joopjs 2.0.0
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/CHANGELOG.md +678 -0
- package/README.md +583 -0
- package/dist/a11y.service-C-DQQfgO.d.mts +143 -0
- package/dist/a11y.service-CauEJrJe.d.ts +143 -0
- package/dist/adapters-B6slG6hQ.d.mts +84 -0
- package/dist/adapters-B6slG6hQ.d.ts +84 -0
- package/dist/aes.service-CkoupAww.d.mts +95 -0
- package/dist/aes.service-CkoupAww.d.ts +95 -0
- package/dist/ai/index.d.mts +99 -0
- package/dist/ai/index.d.ts +99 -0
- package/dist/ai/index.js +307 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/index.mjs +304 -0
- package/dist/ai/index.mjs.map +1 -0
- package/dist/analytics/index.d.mts +42 -0
- package/dist/analytics/index.d.ts +42 -0
- package/dist/analytics/index.js +139 -0
- package/dist/analytics/index.js.map +1 -0
- package/dist/analytics/index.mjs +136 -0
- package/dist/analytics/index.mjs.map +1 -0
- package/dist/angular/index.d.mts +148 -0
- package/dist/angular/index.d.ts +148 -0
- package/dist/angular/index.js +122 -0
- package/dist/angular/index.js.map +1 -0
- package/dist/angular/index.mjs +101 -0
- package/dist/angular/index.mjs.map +1 -0
- package/dist/api/index.d.mts +128 -0
- package/dist/api/index.d.ts +128 -0
- package/dist/api/index.js +1358 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/index.mjs +1332 -0
- package/dist/api/index.mjs.map +1 -0
- package/dist/auth/index.d.mts +105 -0
- package/dist/auth/index.d.ts +105 -0
- package/dist/auth/index.js +989 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/index.mjs +979 -0
- package/dist/auth/index.mjs.map +1 -0
- package/dist/auth.service-DNVB-L4U.d.mts +16 -0
- package/dist/auth.service-PjUUSUIt.d.ts +16 -0
- package/dist/banking/index.d.mts +1530 -0
- package/dist/banking/index.d.ts +1530 -0
- package/dist/banking/index.js +4739 -0
- package/dist/banking/index.js.map +1 -0
- package/dist/banking/index.mjs +4661 -0
- package/dist/banking/index.mjs.map +1 -0
- package/dist/cache/index.d.mts +40 -0
- package/dist/cache/index.d.ts +40 -0
- package/dist/cache/index.js +174 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/index.mjs +172 -0
- package/dist/cache/index.mjs.map +1 -0
- package/dist/client-profile.service-BuPeXVp5.d.mts +28 -0
- package/dist/client-profile.service-D5bRRYQp.d.ts +28 -0
- package/dist/config.models-Cqg04fAQ.d.mts +84 -0
- package/dist/config.models-Cqg04fAQ.d.ts +84 -0
- package/dist/config.service-CrCvI-JS.d.ts +31 -0
- package/dist/config.service-Cz4QQLlf.d.mts +31 -0
- package/dist/core/index.d.mts +4 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.js +631 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/index.mjs +619 -0
- package/dist/core/index.mjs.map +1 -0
- package/dist/crypto-utils-DriNhLdx.d.mts +30 -0
- package/dist/crypto-utils-DriNhLdx.d.ts +30 -0
- package/dist/data-storage.service-DT6xaTxE.d.ts +51 -0
- package/dist/data-storage.service-LvhGRCmw.d.mts +51 -0
- package/dist/deeplink/index.d.mts +39 -0
- package/dist/deeplink/index.d.ts +39 -0
- package/dist/deeplink/index.js +268 -0
- package/dist/deeplink/index.js.map +1 -0
- package/dist/deeplink/index.mjs +265 -0
- package/dist/deeplink/index.mjs.map +1 -0
- package/dist/deeplink.service-Ctd5u243.d.mts +35 -0
- package/dist/deeplink.service-uUuTnY9_.d.ts +35 -0
- package/dist/dev/index.d.mts +20 -0
- package/dist/dev/index.d.ts +20 -0
- package/dist/dev/index.js +51 -0
- package/dist/dev/index.js.map +1 -0
- package/dist/dev/index.mjs +49 -0
- package/dist/dev/index.mjs.map +1 -0
- package/dist/device/index.d.mts +108 -0
- package/dist/device/index.d.ts +108 -0
- package/dist/device/index.js +960 -0
- package/dist/device/index.js.map +1 -0
- package/dist/device/index.mjs +951 -0
- package/dist/device/index.mjs.map +1 -0
- package/dist/differential-privacy-BcAv1G80.d.mts +210 -0
- package/dist/differential-privacy-C8mAUjZr.d.ts +210 -0
- package/dist/encryption/index.d.mts +75 -0
- package/dist/encryption/index.d.ts +75 -0
- package/dist/encryption/index.js +605 -0
- package/dist/encryption/index.js.map +1 -0
- package/dist/encryption/index.mjs +598 -0
- package/dist/encryption/index.mjs.map +1 -0
- package/dist/form-validator-3tkmzr_o.d.mts +72 -0
- package/dist/form-validator-3tkmzr_o.d.ts +72 -0
- package/dist/forms/index.d.mts +59 -0
- package/dist/forms/index.d.ts +59 -0
- package/dist/forms/index.js +446 -0
- package/dist/forms/index.js.map +1 -0
- package/dist/forms/index.mjs +442 -0
- package/dist/forms/index.mjs.map +1 -0
- package/dist/i18n/index.d.mts +37 -0
- package/dist/i18n/index.d.ts +37 -0
- package/dist/i18n/index.js +147 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/index.mjs +145 -0
- package/dist/i18n/index.mjs.map +1 -0
- package/dist/idempotency.service-_6LqhivP.d.mts +372 -0
- package/dist/idempotency.service-eOKoISRD.d.ts +372 -0
- package/dist/index-B_ksKpS1.d.mts +202 -0
- package/dist/index-CqDKWTUP.d.mts +28 -0
- package/dist/index-CqDKWTUP.d.ts +28 -0
- package/dist/index-DFqEoX_l.d.ts +202 -0
- package/dist/index-Dz0gOur2.d.mts +36 -0
- package/dist/index-Dz0gOur2.d.ts +36 -0
- package/dist/index.d.mts +1336 -0
- package/dist/index.d.ts +1336 -0
- package/dist/index.js +19464 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +19155 -0
- package/dist/index.mjs.map +1 -0
- package/dist/india/index.d.mts +75 -0
- package/dist/india/index.d.ts +75 -0
- package/dist/india/index.js +325 -0
- package/dist/india/index.js.map +1 -0
- package/dist/india/index.mjs +303 -0
- package/dist/india/index.mjs.map +1 -0
- package/dist/joop-Bx7Iwj5p.d.mts +155 -0
- package/dist/joop-CA3DMeOO.d.ts +155 -0
- package/dist/native-bridge/index.d.mts +27 -0
- package/dist/native-bridge/index.d.ts +27 -0
- package/dist/native-bridge/index.js +98 -0
- package/dist/native-bridge/index.js.map +1 -0
- package/dist/native-bridge/index.mjs +96 -0
- package/dist/native-bridge/index.mjs.map +1 -0
- package/dist/network/index.d.mts +85 -0
- package/dist/network/index.d.ts +85 -0
- package/dist/network/index.js +454 -0
- package/dist/network/index.js.map +1 -0
- package/dist/network/index.mjs +451 -0
- package/dist/network/index.mjs.map +1 -0
- package/dist/network-monitor-BIwPSXme.d.mts +179 -0
- package/dist/network-monitor-Bqp2hvZr.d.ts +179 -0
- package/dist/notification.service-Dm4fvfZf.d.mts +25 -0
- package/dist/notification.service-tEMKatWJ.d.ts +25 -0
- package/dist/observability/index.d.mts +179 -0
- package/dist/observability/index.d.ts +179 -0
- package/dist/observability/index.js +559 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability/index.mjs +552 -0
- package/dist/observability/index.mjs.map +1 -0
- package/dist/oidc-client-DIJcClmB.d.mts +190 -0
- package/dist/oidc-client-DxhyE59t.d.ts +190 -0
- package/dist/platform/index.d.mts +73 -0
- package/dist/platform/index.d.ts +73 -0
- package/dist/platform/index.js +127 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/platform/index.mjs +125 -0
- package/dist/platform/index.mjs.map +1 -0
- package/dist/pwa/index.d.mts +31 -0
- package/dist/pwa/index.d.ts +31 -0
- package/dist/pwa/index.js +247 -0
- package/dist/pwa/index.js.map +1 -0
- package/dist/pwa/index.mjs +244 -0
- package/dist/pwa/index.mjs.map +1 -0
- package/dist/react/index.d.mts +133 -0
- package/dist/react/index.d.ts +133 -0
- package/dist/react/index.js +632 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/index.mjs +630 -0
- package/dist/react/index.mjs.map +1 -0
- package/dist/router/index.d.mts +39 -0
- package/dist/router/index.d.ts +39 -0
- package/dist/router/index.js +168 -0
- package/dist/router/index.js.map +1 -0
- package/dist/router/index.mjs +166 -0
- package/dist/router/index.mjs.map +1 -0
- package/dist/security/index.d.mts +206 -0
- package/dist/security/index.d.ts +206 -0
- package/dist/security/index.js +1297 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/index.mjs +1285 -0
- package/dist/security/index.mjs.map +1 -0
- package/dist/session/index.d.mts +115 -0
- package/dist/session/index.d.ts +115 -0
- package/dist/session/index.js +297 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session/index.mjs +292 -0
- package/dist/session/index.mjs.map +1 -0
- package/dist/state/index.d.mts +43 -0
- package/dist/state/index.d.ts +43 -0
- package/dist/state/index.js +156 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/index.mjs +152 -0
- package/dist/state/index.mjs.map +1 -0
- package/dist/statement-parser-BHQtXwCM.d.ts +260 -0
- package/dist/statement-parser-C2qNmb49.d.mts +260 -0
- package/dist/storage/index.d.mts +40 -0
- package/dist/storage/index.d.ts +40 -0
- package/dist/storage/index.js +256 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/index.mjs +252 -0
- package/dist/storage/index.mjs.map +1 -0
- package/dist/sync/index.d.mts +69 -0
- package/dist/sync/index.d.ts +69 -0
- package/dist/sync/index.js +330 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/index.mjs +323 -0
- package/dist/sync/index.mjs.map +1 -0
- package/dist/sync-engine-DCIMRG5s.d.ts +61 -0
- package/dist/sync-engine-DZqyKHkK.d.mts +61 -0
- package/dist/theme/index.d.mts +53 -0
- package/dist/theme/index.d.ts +53 -0
- package/dist/theme/index.js +169 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/index.mjs +167 -0
- package/dist/theme/index.mjs.map +1 -0
- package/dist/ui/index.d.mts +66 -0
- package/dist/ui/index.d.ts +66 -0
- package/dist/ui/index.js +811 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/index.mjs +803 -0
- package/dist/ui/index.mjs.map +1 -0
- package/dist/utilities/index.d.mts +199 -0
- package/dist/utilities/index.d.ts +199 -0
- package/dist/utilities/index.js +1991 -0
- package/dist/utilities/index.js.map +1 -0
- package/dist/utilities/index.mjs +1923 -0
- package/dist/utilities/index.mjs.map +1 -0
- package/dist/validation/index.d.mts +60 -0
- package/dist/validation/index.d.ts +60 -0
- package/dist/validation/index.js +460 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/index.mjs +455 -0
- package/dist/validation/index.mjs.map +1 -0
- package/dist/vue/index.d.mts +135 -0
- package/dist/vue/index.d.ts +135 -0
- package/dist/vue/index.js +621 -0
- package/dist/vue/index.js.map +1 -0
- package/dist/vue/index.mjs +619 -0
- package/dist/vue/index.mjs.map +1 -0
- package/dist/watermark.service-Detur5tq.d.ts +235 -0
- package/dist/watermark.service-QNegMeQZ.d.mts +235 -0
- package/dist/workers/index.d.mts +42 -0
- package/dist/workers/index.d.ts +42 -0
- package/dist/workers/index.js +359 -0
- package/dist/workers/index.js.map +1 -0
- package/dist/workers/index.mjs +356 -0
- package/dist/workers/index.mjs.map +1 -0
- package/dist/workflow/index.d.mts +99 -0
- package/dist/workflow/index.d.ts +99 -0
- package/dist/workflow/index.js +282 -0
- package/dist/workflow/index.js.map +1 -0
- package/dist/workflow/index.mjs +279 -0
- package/dist/workflow/index.mjs.map +1 -0
- package/package.json +226 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import { b as JoopSubject, J as JoopObservable } from './index-Dz0gOur2.mjs';
|
|
2
|
+
import { a as JoopHttpMethod } from './index-CqDKWTUP.mjs';
|
|
3
|
+
import { J as JoopClientProfile } from './client-profile.service-BuPeXVp5.mjs';
|
|
4
|
+
import { b as JoopAesService, c as JoopRequestOptions } from './aes.service-CkoupAww.mjs';
|
|
5
|
+
import { J as JoopConfigService } from './config.service-Cz4QQLlf.mjs';
|
|
6
|
+
import { d as JoopStorageAdapter } from './adapters-B6slG6hQ.mjs';
|
|
7
|
+
|
|
8
|
+
interface JoopFetchOptions {
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
body?: any;
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
timeout?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Thin fetch wrapper — no Angular, no RxJS.
|
|
16
|
+
* Use directly or extend for request/response interceptors.
|
|
17
|
+
*/
|
|
18
|
+
declare class JoopHttpClient {
|
|
19
|
+
request<T = any>(method: JoopHttpMethod, url: string, options?: JoopFetchOptions): Promise<T>;
|
|
20
|
+
get<T = any>(url: string, options?: JoopFetchOptions): Promise<T>;
|
|
21
|
+
post<T = any>(url: string, body?: any, options?: JoopFetchOptions): Promise<T>;
|
|
22
|
+
put<T = any>(url: string, body?: any, options?: JoopFetchOptions): Promise<T>;
|
|
23
|
+
patch<T = any>(url: string, body?: any, options?: JoopFetchOptions): Promise<T>;
|
|
24
|
+
delete<T = any>(url: string, options?: JoopFetchOptions): Promise<T>;
|
|
25
|
+
/** Upload files with progress via XMLHttpRequest (fetch does not expose upload progress). */
|
|
26
|
+
uploadWithProgress<T = any>(url: string, formData: FormData, onProgress: (percent: number) => void, headers?: Record<string, string>): Promise<T>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface JoopRequest {
|
|
30
|
+
url: string;
|
|
31
|
+
method: string;
|
|
32
|
+
headers: Record<string, string>;
|
|
33
|
+
body?: unknown;
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
}
|
|
36
|
+
interface JoopResponse<T = unknown> {
|
|
37
|
+
status: number;
|
|
38
|
+
headers: Record<string, string>;
|
|
39
|
+
data: T;
|
|
40
|
+
url: string;
|
|
41
|
+
}
|
|
42
|
+
type JoopRequestInterceptor = (req: JoopRequest) => JoopRequest | Promise<JoopRequest>;
|
|
43
|
+
type JoopResponseInterceptor = (res: JoopResponse) => JoopResponse | Promise<JoopResponse>;
|
|
44
|
+
type JoopErrorInterceptor = (err: unknown) => unknown | Promise<unknown>;
|
|
45
|
+
declare class JoopInterceptorPipeline {
|
|
46
|
+
private _req;
|
|
47
|
+
private _res;
|
|
48
|
+
private _err;
|
|
49
|
+
addRequestInterceptor(fn: JoopRequestInterceptor): () => void;
|
|
50
|
+
addResponseInterceptor(fn: JoopResponseInterceptor): () => void;
|
|
51
|
+
addErrorInterceptor(fn: JoopErrorInterceptor): () => void;
|
|
52
|
+
processRequest(req: JoopRequest): Promise<JoopRequest>;
|
|
53
|
+
processResponse(res: JoopResponse): Promise<JoopResponse>;
|
|
54
|
+
processError(err: unknown): Promise<unknown>;
|
|
55
|
+
clear(): void;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
type JoopCircuitState = 'closed' | 'open' | 'half-open';
|
|
59
|
+
type JoopCircuitBreakerState = JoopCircuitState;
|
|
60
|
+
interface JoopCircuitBreakerConfig {
|
|
61
|
+
name?: string;
|
|
62
|
+
failureThreshold?: number;
|
|
63
|
+
successThreshold?: number;
|
|
64
|
+
timeoutMs?: number;
|
|
65
|
+
volumeThreshold?: number;
|
|
66
|
+
onStateChange?: (from: JoopCircuitState, to: JoopCircuitState, name: string) => void;
|
|
67
|
+
}
|
|
68
|
+
interface JoopCircuitBreakerStats {
|
|
69
|
+
state: JoopCircuitState;
|
|
70
|
+
failures: number;
|
|
71
|
+
successes: number;
|
|
72
|
+
totalCalls: number;
|
|
73
|
+
lastFailureAt?: number;
|
|
74
|
+
openedAt?: number;
|
|
75
|
+
nextAttemptAt?: number;
|
|
76
|
+
}
|
|
77
|
+
declare class JoopCircuitBreakerOpenError extends Error {
|
|
78
|
+
readonly nextAttemptAt: number;
|
|
79
|
+
constructor(name: string, nextAttemptAt: number);
|
|
80
|
+
}
|
|
81
|
+
declare class JoopCircuitBreaker {
|
|
82
|
+
private readonly _name;
|
|
83
|
+
private readonly failureThreshold;
|
|
84
|
+
private readonly successThreshold;
|
|
85
|
+
private readonly timeoutMs;
|
|
86
|
+
private readonly volumeThreshold;
|
|
87
|
+
private readonly onStateChangeFn?;
|
|
88
|
+
private _state;
|
|
89
|
+
private _failures;
|
|
90
|
+
private _successes;
|
|
91
|
+
private _totalCalls;
|
|
92
|
+
private _lastFailureAt?;
|
|
93
|
+
private _openedAt?;
|
|
94
|
+
constructor(nameOrConfig: string | (JoopCircuitBreakerConfig & {
|
|
95
|
+
name: string;
|
|
96
|
+
}), config?: JoopCircuitBreakerConfig);
|
|
97
|
+
get state(): JoopCircuitState;
|
|
98
|
+
get name(): string;
|
|
99
|
+
private setState;
|
|
100
|
+
private recordSuccess;
|
|
101
|
+
private recordFailure;
|
|
102
|
+
private canAttempt;
|
|
103
|
+
/** Primary execution method — throws JoopCircuitBreakerOpenError when open. */
|
|
104
|
+
execute<T>(fn: () => Promise<T>): Promise<T>;
|
|
105
|
+
/** Alias kept for back-compat with original `call()` interface. */
|
|
106
|
+
call<T>(fn: () => Promise<T>): Promise<T>;
|
|
107
|
+
executeWithFallback<T>(fn: () => Promise<T>, fallback: () => Promise<T> | T): Promise<T>;
|
|
108
|
+
getState(): JoopCircuitState;
|
|
109
|
+
getStats(): JoopCircuitBreakerStats;
|
|
110
|
+
reset(): void;
|
|
111
|
+
forceOpen(): void;
|
|
112
|
+
forceClose(): void;
|
|
113
|
+
}
|
|
114
|
+
declare class JoopCircuitBreakerRegistry {
|
|
115
|
+
private static readonly store;
|
|
116
|
+
static get(name: string, config?: JoopCircuitBreakerConfig): JoopCircuitBreaker;
|
|
117
|
+
static getAll(): Map<string, JoopCircuitBreaker>;
|
|
118
|
+
static reset(name?: string): void;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
declare class JoopOfflineQueue {
|
|
122
|
+
private _queue;
|
|
123
|
+
private _online;
|
|
124
|
+
private _draining;
|
|
125
|
+
constructor();
|
|
126
|
+
isOnline(): boolean;
|
|
127
|
+
queueLength(): number;
|
|
128
|
+
enqueue<T>(fn: () => Promise<T>): Promise<T>;
|
|
129
|
+
drainNow(): Promise<void>;
|
|
130
|
+
clear(): void;
|
|
131
|
+
private _onOnline;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
interface JoopPollConfig<T> {
|
|
135
|
+
fn: () => Promise<T>;
|
|
136
|
+
intervalMs: number;
|
|
137
|
+
immediate?: boolean;
|
|
138
|
+
stopWhen?: (result: T) => boolean;
|
|
139
|
+
onError?: (err: unknown) => void;
|
|
140
|
+
}
|
|
141
|
+
declare class JoopPollingService {
|
|
142
|
+
private _timers;
|
|
143
|
+
private _subjects;
|
|
144
|
+
start<T>(id: string, config: JoopPollConfig<T>): JoopSubject<T>;
|
|
145
|
+
stop(id: string): void;
|
|
146
|
+
stopAll(): void;
|
|
147
|
+
isPolling(id: string): boolean;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
type JoopErrorType = 'screen' | 'popup' | 'quiet' | 'inline';
|
|
151
|
+
interface JoopError {
|
|
152
|
+
status?: number;
|
|
153
|
+
title?: string;
|
|
154
|
+
message?: string;
|
|
155
|
+
description?: string;
|
|
156
|
+
icon?: string;
|
|
157
|
+
style?: string;
|
|
158
|
+
isTimeout?: boolean;
|
|
159
|
+
type?: JoopErrorType;
|
|
160
|
+
customData?: any;
|
|
161
|
+
buttons?: JoopErrorButton[];
|
|
162
|
+
}
|
|
163
|
+
interface JoopErrorButton {
|
|
164
|
+
label: string;
|
|
165
|
+
action?: string;
|
|
166
|
+
style?: string;
|
|
167
|
+
actionData?: any;
|
|
168
|
+
}
|
|
169
|
+
declare class JoopHttpError extends Error {
|
|
170
|
+
readonly statusCode: number;
|
|
171
|
+
readonly statusText: string;
|
|
172
|
+
readonly body?: any | undefined;
|
|
173
|
+
constructor(statusCode: number, statusText: string, body?: any | undefined);
|
|
174
|
+
}
|
|
175
|
+
declare class JoopEncryptionError extends Error {
|
|
176
|
+
constructor(message: string);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
type JoopLoadingState = {
|
|
180
|
+
active: boolean;
|
|
181
|
+
count: number;
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* High-level service request dispatcher.
|
|
185
|
+
*
|
|
186
|
+
* - Serialises request data
|
|
187
|
+
* - Optionally encrypts (AES E2E)
|
|
188
|
+
* - Tracks concurrent requests for loader visibility
|
|
189
|
+
* - Decrypts encrypted responses
|
|
190
|
+
*/
|
|
191
|
+
declare class JoopRequestService {
|
|
192
|
+
private readonly _http;
|
|
193
|
+
private readonly _config;
|
|
194
|
+
private readonly _profile;
|
|
195
|
+
private readonly _aes;
|
|
196
|
+
private readonly _loading$;
|
|
197
|
+
private _requestCount;
|
|
198
|
+
constructor(_http: JoopHttpClient, _config: JoopConfigService, _profile: JoopClientProfile, _aes: JoopAesService);
|
|
199
|
+
/** Observable loading state — subscribe in any framework to drive a spinner. */
|
|
200
|
+
loading$(): JoopObservable<JoopLoadingState>;
|
|
201
|
+
isLoading(): boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Send a service request to the configured base URL.
|
|
204
|
+
* @param serviceId Service/endpoint identifier appended to the base URL
|
|
205
|
+
* @param data Request payload
|
|
206
|
+
* @param options Loader, error, method overrides
|
|
207
|
+
*/
|
|
208
|
+
send<T = any>(serviceId: string, data?: Record<string, any>, options?: JoopRequestOptions): Promise<T>;
|
|
209
|
+
/** Upload a file with progress. */
|
|
210
|
+
upload<T = any>(serviceId: string, formData: FormData, onProgress: (pct: number) => void): Promise<T>;
|
|
211
|
+
private _buildUrl;
|
|
212
|
+
private _prepareBody;
|
|
213
|
+
private _handleResponse;
|
|
214
|
+
private _incrementLoader;
|
|
215
|
+
private _decrementLoader;
|
|
216
|
+
}
|
|
217
|
+
/** Convenience: catch JoopHttpError by status code. */
|
|
218
|
+
declare function isHttpError(err: unknown, status?: number): err is JoopHttpError;
|
|
219
|
+
|
|
220
|
+
interface JoopDownloadOptions {
|
|
221
|
+
method?: 'GET' | 'POST';
|
|
222
|
+
headers?: Record<string, string>;
|
|
223
|
+
body?: string | FormData;
|
|
224
|
+
iosHandlerName?: string;
|
|
225
|
+
}
|
|
226
|
+
declare class JoopFileSaverService {
|
|
227
|
+
isIosWebView(handlerName?: string): boolean;
|
|
228
|
+
download(url: string, options?: JoopDownloadOptions): Promise<void>;
|
|
229
|
+
saveBlob(blob: Blob, fileName: string): void;
|
|
230
|
+
blobToBase64(blob: Blob): Promise<string>;
|
|
231
|
+
getMimeType(fileName: string): string;
|
|
232
|
+
typedBlob(blob: Blob, fileName: string): Blob;
|
|
233
|
+
private _sendToIos;
|
|
234
|
+
private _fileNameFromHeaders;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
interface JoopRawComponent6 {
|
|
238
|
+
compKey: string;
|
|
239
|
+
compValue: string;
|
|
240
|
+
}
|
|
241
|
+
interface JoopRawResponse6 {
|
|
242
|
+
scrId?: string;
|
|
243
|
+
scrid?: string;
|
|
244
|
+
compDet?: JoopRawComponent6[];
|
|
245
|
+
segments?: string;
|
|
246
|
+
mxenc?: string;
|
|
247
|
+
mxencres?: string;
|
|
248
|
+
errorCode?: string;
|
|
249
|
+
errorDesc?: string;
|
|
250
|
+
}
|
|
251
|
+
interface JoopRawResponse {
|
|
252
|
+
scrid?: string;
|
|
253
|
+
segments?: string;
|
|
254
|
+
mxenc?: string;
|
|
255
|
+
mxencres?: string;
|
|
256
|
+
components?: Record<string, string>;
|
|
257
|
+
errorCode?: string;
|
|
258
|
+
errorDesc?: string;
|
|
259
|
+
}
|
|
260
|
+
interface JoopMappedComponent {
|
|
261
|
+
key: string;
|
|
262
|
+
value: string;
|
|
263
|
+
scope: string;
|
|
264
|
+
dataKey: string;
|
|
265
|
+
}
|
|
266
|
+
interface JoopMappedResponse {
|
|
267
|
+
scrid: string;
|
|
268
|
+
segments: string;
|
|
269
|
+
mxenc: string;
|
|
270
|
+
mxencres: string;
|
|
271
|
+
components: Record<string, string>;
|
|
272
|
+
componentList: JoopMappedComponent[];
|
|
273
|
+
errorCode?: string;
|
|
274
|
+
errorDesc?: string;
|
|
275
|
+
hasError: boolean;
|
|
276
|
+
}
|
|
277
|
+
declare class JoopResponseMapper {
|
|
278
|
+
/** Normalize a v6 or v7+ raw API response into a typed mapped response */
|
|
279
|
+
map(raw: JoopRawResponse | JoopRawResponse6): JoopMappedResponse;
|
|
280
|
+
/** Extract scope prefix from a component key (first char: M/O/N/S) */
|
|
281
|
+
extractScope(key: string): string;
|
|
282
|
+
/** Extract data key portion (everything after the first character) */
|
|
283
|
+
extractDataKey(key: string): string;
|
|
284
|
+
/**
|
|
285
|
+
* Build a property map from component list — groups by scope prefix.
|
|
286
|
+
* e.g. "MUserName" → { scope: 'M', dataKey: 'UserName', value: '...' }
|
|
287
|
+
*/
|
|
288
|
+
buildScopedMap(response: JoopMappedResponse): Record<string, Record<string, string>>;
|
|
289
|
+
/** Get a single component value from a mapped response */
|
|
290
|
+
getComponent(response: JoopMappedResponse, key: string): string | null;
|
|
291
|
+
/** Check if the raw payload looks like a v7+ response (has 'components' key) */
|
|
292
|
+
private _isV7;
|
|
293
|
+
private _convertV6ToV7;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
interface JoopCsvOptions {
|
|
297
|
+
delimiter?: string;
|
|
298
|
+
headers?: string[];
|
|
299
|
+
includeHeaders?: boolean;
|
|
300
|
+
bom?: boolean;
|
|
301
|
+
nullValue?: string;
|
|
302
|
+
}
|
|
303
|
+
declare class JoopExportService {
|
|
304
|
+
/** Convert an array of objects to a CSV string */
|
|
305
|
+
toCsv(data: Record<string, unknown>[], options?: JoopCsvOptions): string;
|
|
306
|
+
/** Trigger browser download of a CSV string */
|
|
307
|
+
downloadCsv(data: Record<string, unknown>[], filename: string, options?: JoopCsvOptions): void;
|
|
308
|
+
/** Download Excel-compatible CSV (with BOM so Excel reads UTF-8 correctly) */
|
|
309
|
+
downloadExcel(data: Record<string, unknown>[], filename: string, options?: JoopCsvOptions): void;
|
|
310
|
+
/** Convert data to a JSON string and download */
|
|
311
|
+
downloadJson(data: unknown, filename: string, indent?: number): void;
|
|
312
|
+
/** Download a plain-text file */
|
|
313
|
+
downloadText(content: string, filename: string): void;
|
|
314
|
+
/** Convert a 2D array (table) to CSV */
|
|
315
|
+
tableToCsv(rows: unknown[][], headers?: string[], delimiter?: string): string;
|
|
316
|
+
private _download;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
type JoopWebhookProvider = 'stripe' | 'github' | 'generic';
|
|
320
|
+
interface JoopWebhookOptions {
|
|
321
|
+
toleranceSeconds?: number;
|
|
322
|
+
algorithm?: 'SHA-256' | 'SHA-1' | 'SHA-512';
|
|
323
|
+
}
|
|
324
|
+
declare class JoopWebhookVerifier {
|
|
325
|
+
private _provider;
|
|
326
|
+
for(provider: JoopWebhookProvider): JoopWebhookVerifier;
|
|
327
|
+
verify(payload: string, signature: string, secret: string, opts?: JoopWebhookOptions): Promise<boolean>;
|
|
328
|
+
/** Stripe: `Stripe-Signature: t=...,v1=...` */
|
|
329
|
+
verifyStripe(payload: string, header: string, secret: string, opts?: JoopWebhookOptions): Promise<boolean>;
|
|
330
|
+
/** GitHub: `X-Hub-Signature-256: sha256=...` */
|
|
331
|
+
verifyGitHub(payload: string, header: string, secret: string, opts?: JoopWebhookOptions): Promise<boolean>;
|
|
332
|
+
/** Generic HMAC verification. signature is a hex string. */
|
|
333
|
+
verifyGeneric(payload: string, signature: string, secret: string, opts?: JoopWebhookOptions): Promise<boolean>;
|
|
334
|
+
/** Returns true if the timestamp is within tolerance of now */
|
|
335
|
+
verifyTimestamp(timestamp: number, toleranceSeconds?: number): boolean;
|
|
336
|
+
/** Compute the expected HMAC for a payload (for testing) */
|
|
337
|
+
sign(payload: string, secret: string, algo?: AlgorithmIdentifier): Promise<string>;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
interface JoopIdempotencyConfig {
|
|
341
|
+
storage?: JoopStorageAdapter;
|
|
342
|
+
ttlMs?: number;
|
|
343
|
+
prefix?: string;
|
|
344
|
+
}
|
|
345
|
+
declare class JoopIdempotencyService {
|
|
346
|
+
private _storage;
|
|
347
|
+
private _ttlMs;
|
|
348
|
+
private _prefix;
|
|
349
|
+
/** Internal key registry used for clearAll() and gc() (avoids requiring Storage.length/key()) */
|
|
350
|
+
private _keys;
|
|
351
|
+
constructor(config?: JoopIdempotencyConfig);
|
|
352
|
+
/**
|
|
353
|
+
* Generate and store an idempotency key for the given operation.
|
|
354
|
+
* Returns an existing (non-expired) key if one already exists.
|
|
355
|
+
*/
|
|
356
|
+
generate(operationKey: string): string;
|
|
357
|
+
/** Get the stored key for an operation, or null if expired/not found */
|
|
358
|
+
get(operationKey: string): string | null;
|
|
359
|
+
/** Remove the key for an operation (e.g. after successful completion) */
|
|
360
|
+
clear(operationKey: string): void;
|
|
361
|
+
/** Clear all idempotency keys managed by this instance */
|
|
362
|
+
clearAll(): void;
|
|
363
|
+
/**
|
|
364
|
+
* Wrap a fetch-based function with automatic idempotency key injection.
|
|
365
|
+
* Clears the key on success; keeps it on failure so retries reuse the same key.
|
|
366
|
+
*/
|
|
367
|
+
wrap<T>(operationKey: string, fn: (idempotencyKey: string) => Promise<T>): Promise<T>;
|
|
368
|
+
/** Remove all expired entries */
|
|
369
|
+
gc(): void;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export { type JoopLoadingState as A, type JoopMappedComponent as B, type JoopMappedResponse as C, type JoopPollConfig as D, type JoopRawResponse as E, type JoopRawResponse6 as F, type JoopRequest as G, type JoopRequestInterceptor as H, type JoopResponse as I, JoopHttpClient as J, type JoopResponseInterceptor as K, type JoopWebhookOptions as L, type JoopWebhookProvider as M, isHttpError as N, type JoopRawComponent6 as O, JoopInterceptorPipeline as a, JoopCircuitBreaker as b, JoopOfflineQueue as c, JoopPollingService as d, JoopRequestService as e, JoopFileSaverService as f, JoopResponseMapper as g, JoopExportService as h, JoopWebhookVerifier as i, JoopIdempotencyService as j, type JoopCircuitBreakerConfig as k, JoopCircuitBreakerOpenError as l, JoopCircuitBreakerRegistry as m, type JoopCircuitBreakerState as n, type JoopCircuitBreakerStats as o, type JoopCircuitState as p, type JoopCsvOptions as q, type JoopDownloadOptions as r, JoopEncryptionError as s, type JoopError as t, type JoopErrorButton as u, type JoopErrorInterceptor as v, type JoopErrorType as w, type JoopFetchOptions as x, JoopHttpError as y, type JoopIdempotencyConfig as z };
|