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.
Files changed (259) hide show
  1. package/CHANGELOG.md +678 -0
  2. package/README.md +583 -0
  3. package/dist/a11y.service-C-DQQfgO.d.mts +143 -0
  4. package/dist/a11y.service-CauEJrJe.d.ts +143 -0
  5. package/dist/adapters-B6slG6hQ.d.mts +84 -0
  6. package/dist/adapters-B6slG6hQ.d.ts +84 -0
  7. package/dist/aes.service-CkoupAww.d.mts +95 -0
  8. package/dist/aes.service-CkoupAww.d.ts +95 -0
  9. package/dist/ai/index.d.mts +99 -0
  10. package/dist/ai/index.d.ts +99 -0
  11. package/dist/ai/index.js +307 -0
  12. package/dist/ai/index.js.map +1 -0
  13. package/dist/ai/index.mjs +304 -0
  14. package/dist/ai/index.mjs.map +1 -0
  15. package/dist/analytics/index.d.mts +42 -0
  16. package/dist/analytics/index.d.ts +42 -0
  17. package/dist/analytics/index.js +139 -0
  18. package/dist/analytics/index.js.map +1 -0
  19. package/dist/analytics/index.mjs +136 -0
  20. package/dist/analytics/index.mjs.map +1 -0
  21. package/dist/angular/index.d.mts +148 -0
  22. package/dist/angular/index.d.ts +148 -0
  23. package/dist/angular/index.js +122 -0
  24. package/dist/angular/index.js.map +1 -0
  25. package/dist/angular/index.mjs +101 -0
  26. package/dist/angular/index.mjs.map +1 -0
  27. package/dist/api/index.d.mts +128 -0
  28. package/dist/api/index.d.ts +128 -0
  29. package/dist/api/index.js +1358 -0
  30. package/dist/api/index.js.map +1 -0
  31. package/dist/api/index.mjs +1332 -0
  32. package/dist/api/index.mjs.map +1 -0
  33. package/dist/auth/index.d.mts +105 -0
  34. package/dist/auth/index.d.ts +105 -0
  35. package/dist/auth/index.js +989 -0
  36. package/dist/auth/index.js.map +1 -0
  37. package/dist/auth/index.mjs +979 -0
  38. package/dist/auth/index.mjs.map +1 -0
  39. package/dist/auth.service-DNVB-L4U.d.mts +16 -0
  40. package/dist/auth.service-PjUUSUIt.d.ts +16 -0
  41. package/dist/banking/index.d.mts +1530 -0
  42. package/dist/banking/index.d.ts +1530 -0
  43. package/dist/banking/index.js +4739 -0
  44. package/dist/banking/index.js.map +1 -0
  45. package/dist/banking/index.mjs +4661 -0
  46. package/dist/banking/index.mjs.map +1 -0
  47. package/dist/cache/index.d.mts +40 -0
  48. package/dist/cache/index.d.ts +40 -0
  49. package/dist/cache/index.js +174 -0
  50. package/dist/cache/index.js.map +1 -0
  51. package/dist/cache/index.mjs +172 -0
  52. package/dist/cache/index.mjs.map +1 -0
  53. package/dist/client-profile.service-BuPeXVp5.d.mts +28 -0
  54. package/dist/client-profile.service-D5bRRYQp.d.ts +28 -0
  55. package/dist/config.models-Cqg04fAQ.d.mts +84 -0
  56. package/dist/config.models-Cqg04fAQ.d.ts +84 -0
  57. package/dist/config.service-CrCvI-JS.d.ts +31 -0
  58. package/dist/config.service-Cz4QQLlf.d.mts +31 -0
  59. package/dist/core/index.d.mts +4 -0
  60. package/dist/core/index.d.ts +4 -0
  61. package/dist/core/index.js +631 -0
  62. package/dist/core/index.js.map +1 -0
  63. package/dist/core/index.mjs +619 -0
  64. package/dist/core/index.mjs.map +1 -0
  65. package/dist/crypto-utils-DriNhLdx.d.mts +30 -0
  66. package/dist/crypto-utils-DriNhLdx.d.ts +30 -0
  67. package/dist/data-storage.service-DT6xaTxE.d.ts +51 -0
  68. package/dist/data-storage.service-LvhGRCmw.d.mts +51 -0
  69. package/dist/deeplink/index.d.mts +39 -0
  70. package/dist/deeplink/index.d.ts +39 -0
  71. package/dist/deeplink/index.js +268 -0
  72. package/dist/deeplink/index.js.map +1 -0
  73. package/dist/deeplink/index.mjs +265 -0
  74. package/dist/deeplink/index.mjs.map +1 -0
  75. package/dist/deeplink.service-Ctd5u243.d.mts +35 -0
  76. package/dist/deeplink.service-uUuTnY9_.d.ts +35 -0
  77. package/dist/dev/index.d.mts +20 -0
  78. package/dist/dev/index.d.ts +20 -0
  79. package/dist/dev/index.js +51 -0
  80. package/dist/dev/index.js.map +1 -0
  81. package/dist/dev/index.mjs +49 -0
  82. package/dist/dev/index.mjs.map +1 -0
  83. package/dist/device/index.d.mts +108 -0
  84. package/dist/device/index.d.ts +108 -0
  85. package/dist/device/index.js +960 -0
  86. package/dist/device/index.js.map +1 -0
  87. package/dist/device/index.mjs +951 -0
  88. package/dist/device/index.mjs.map +1 -0
  89. package/dist/differential-privacy-BcAv1G80.d.mts +210 -0
  90. package/dist/differential-privacy-C8mAUjZr.d.ts +210 -0
  91. package/dist/encryption/index.d.mts +75 -0
  92. package/dist/encryption/index.d.ts +75 -0
  93. package/dist/encryption/index.js +605 -0
  94. package/dist/encryption/index.js.map +1 -0
  95. package/dist/encryption/index.mjs +598 -0
  96. package/dist/encryption/index.mjs.map +1 -0
  97. package/dist/form-validator-3tkmzr_o.d.mts +72 -0
  98. package/dist/form-validator-3tkmzr_o.d.ts +72 -0
  99. package/dist/forms/index.d.mts +59 -0
  100. package/dist/forms/index.d.ts +59 -0
  101. package/dist/forms/index.js +446 -0
  102. package/dist/forms/index.js.map +1 -0
  103. package/dist/forms/index.mjs +442 -0
  104. package/dist/forms/index.mjs.map +1 -0
  105. package/dist/i18n/index.d.mts +37 -0
  106. package/dist/i18n/index.d.ts +37 -0
  107. package/dist/i18n/index.js +147 -0
  108. package/dist/i18n/index.js.map +1 -0
  109. package/dist/i18n/index.mjs +145 -0
  110. package/dist/i18n/index.mjs.map +1 -0
  111. package/dist/idempotency.service-_6LqhivP.d.mts +372 -0
  112. package/dist/idempotency.service-eOKoISRD.d.ts +372 -0
  113. package/dist/index-B_ksKpS1.d.mts +202 -0
  114. package/dist/index-CqDKWTUP.d.mts +28 -0
  115. package/dist/index-CqDKWTUP.d.ts +28 -0
  116. package/dist/index-DFqEoX_l.d.ts +202 -0
  117. package/dist/index-Dz0gOur2.d.mts +36 -0
  118. package/dist/index-Dz0gOur2.d.ts +36 -0
  119. package/dist/index.d.mts +1336 -0
  120. package/dist/index.d.ts +1336 -0
  121. package/dist/index.js +19464 -0
  122. package/dist/index.js.map +1 -0
  123. package/dist/index.mjs +19155 -0
  124. package/dist/index.mjs.map +1 -0
  125. package/dist/india/index.d.mts +75 -0
  126. package/dist/india/index.d.ts +75 -0
  127. package/dist/india/index.js +325 -0
  128. package/dist/india/index.js.map +1 -0
  129. package/dist/india/index.mjs +303 -0
  130. package/dist/india/index.mjs.map +1 -0
  131. package/dist/joop-Bx7Iwj5p.d.mts +155 -0
  132. package/dist/joop-CA3DMeOO.d.ts +155 -0
  133. package/dist/native-bridge/index.d.mts +27 -0
  134. package/dist/native-bridge/index.d.ts +27 -0
  135. package/dist/native-bridge/index.js +98 -0
  136. package/dist/native-bridge/index.js.map +1 -0
  137. package/dist/native-bridge/index.mjs +96 -0
  138. package/dist/native-bridge/index.mjs.map +1 -0
  139. package/dist/network/index.d.mts +85 -0
  140. package/dist/network/index.d.ts +85 -0
  141. package/dist/network/index.js +454 -0
  142. package/dist/network/index.js.map +1 -0
  143. package/dist/network/index.mjs +451 -0
  144. package/dist/network/index.mjs.map +1 -0
  145. package/dist/network-monitor-BIwPSXme.d.mts +179 -0
  146. package/dist/network-monitor-Bqp2hvZr.d.ts +179 -0
  147. package/dist/notification.service-Dm4fvfZf.d.mts +25 -0
  148. package/dist/notification.service-tEMKatWJ.d.ts +25 -0
  149. package/dist/observability/index.d.mts +179 -0
  150. package/dist/observability/index.d.ts +179 -0
  151. package/dist/observability/index.js +559 -0
  152. package/dist/observability/index.js.map +1 -0
  153. package/dist/observability/index.mjs +552 -0
  154. package/dist/observability/index.mjs.map +1 -0
  155. package/dist/oidc-client-DIJcClmB.d.mts +190 -0
  156. package/dist/oidc-client-DxhyE59t.d.ts +190 -0
  157. package/dist/platform/index.d.mts +73 -0
  158. package/dist/platform/index.d.ts +73 -0
  159. package/dist/platform/index.js +127 -0
  160. package/dist/platform/index.js.map +1 -0
  161. package/dist/platform/index.mjs +125 -0
  162. package/dist/platform/index.mjs.map +1 -0
  163. package/dist/pwa/index.d.mts +31 -0
  164. package/dist/pwa/index.d.ts +31 -0
  165. package/dist/pwa/index.js +247 -0
  166. package/dist/pwa/index.js.map +1 -0
  167. package/dist/pwa/index.mjs +244 -0
  168. package/dist/pwa/index.mjs.map +1 -0
  169. package/dist/react/index.d.mts +133 -0
  170. package/dist/react/index.d.ts +133 -0
  171. package/dist/react/index.js +632 -0
  172. package/dist/react/index.js.map +1 -0
  173. package/dist/react/index.mjs +630 -0
  174. package/dist/react/index.mjs.map +1 -0
  175. package/dist/router/index.d.mts +39 -0
  176. package/dist/router/index.d.ts +39 -0
  177. package/dist/router/index.js +168 -0
  178. package/dist/router/index.js.map +1 -0
  179. package/dist/router/index.mjs +166 -0
  180. package/dist/router/index.mjs.map +1 -0
  181. package/dist/security/index.d.mts +206 -0
  182. package/dist/security/index.d.ts +206 -0
  183. package/dist/security/index.js +1297 -0
  184. package/dist/security/index.js.map +1 -0
  185. package/dist/security/index.mjs +1285 -0
  186. package/dist/security/index.mjs.map +1 -0
  187. package/dist/session/index.d.mts +115 -0
  188. package/dist/session/index.d.ts +115 -0
  189. package/dist/session/index.js +297 -0
  190. package/dist/session/index.js.map +1 -0
  191. package/dist/session/index.mjs +292 -0
  192. package/dist/session/index.mjs.map +1 -0
  193. package/dist/state/index.d.mts +43 -0
  194. package/dist/state/index.d.ts +43 -0
  195. package/dist/state/index.js +156 -0
  196. package/dist/state/index.js.map +1 -0
  197. package/dist/state/index.mjs +152 -0
  198. package/dist/state/index.mjs.map +1 -0
  199. package/dist/statement-parser-BHQtXwCM.d.ts +260 -0
  200. package/dist/statement-parser-C2qNmb49.d.mts +260 -0
  201. package/dist/storage/index.d.mts +40 -0
  202. package/dist/storage/index.d.ts +40 -0
  203. package/dist/storage/index.js +256 -0
  204. package/dist/storage/index.js.map +1 -0
  205. package/dist/storage/index.mjs +252 -0
  206. package/dist/storage/index.mjs.map +1 -0
  207. package/dist/sync/index.d.mts +69 -0
  208. package/dist/sync/index.d.ts +69 -0
  209. package/dist/sync/index.js +330 -0
  210. package/dist/sync/index.js.map +1 -0
  211. package/dist/sync/index.mjs +323 -0
  212. package/dist/sync/index.mjs.map +1 -0
  213. package/dist/sync-engine-DCIMRG5s.d.ts +61 -0
  214. package/dist/sync-engine-DZqyKHkK.d.mts +61 -0
  215. package/dist/theme/index.d.mts +53 -0
  216. package/dist/theme/index.d.ts +53 -0
  217. package/dist/theme/index.js +169 -0
  218. package/dist/theme/index.js.map +1 -0
  219. package/dist/theme/index.mjs +167 -0
  220. package/dist/theme/index.mjs.map +1 -0
  221. package/dist/ui/index.d.mts +66 -0
  222. package/dist/ui/index.d.ts +66 -0
  223. package/dist/ui/index.js +811 -0
  224. package/dist/ui/index.js.map +1 -0
  225. package/dist/ui/index.mjs +803 -0
  226. package/dist/ui/index.mjs.map +1 -0
  227. package/dist/utilities/index.d.mts +199 -0
  228. package/dist/utilities/index.d.ts +199 -0
  229. package/dist/utilities/index.js +1991 -0
  230. package/dist/utilities/index.js.map +1 -0
  231. package/dist/utilities/index.mjs +1923 -0
  232. package/dist/utilities/index.mjs.map +1 -0
  233. package/dist/validation/index.d.mts +60 -0
  234. package/dist/validation/index.d.ts +60 -0
  235. package/dist/validation/index.js +460 -0
  236. package/dist/validation/index.js.map +1 -0
  237. package/dist/validation/index.mjs +455 -0
  238. package/dist/validation/index.mjs.map +1 -0
  239. package/dist/vue/index.d.mts +135 -0
  240. package/dist/vue/index.d.ts +135 -0
  241. package/dist/vue/index.js +621 -0
  242. package/dist/vue/index.js.map +1 -0
  243. package/dist/vue/index.mjs +619 -0
  244. package/dist/vue/index.mjs.map +1 -0
  245. package/dist/watermark.service-Detur5tq.d.ts +235 -0
  246. package/dist/watermark.service-QNegMeQZ.d.mts +235 -0
  247. package/dist/workers/index.d.mts +42 -0
  248. package/dist/workers/index.d.ts +42 -0
  249. package/dist/workers/index.js +359 -0
  250. package/dist/workers/index.js.map +1 -0
  251. package/dist/workers/index.mjs +356 -0
  252. package/dist/workers/index.mjs.map +1 -0
  253. package/dist/workflow/index.d.mts +99 -0
  254. package/dist/workflow/index.d.ts +99 -0
  255. package/dist/workflow/index.js +282 -0
  256. package/dist/workflow/index.js.map +1 -0
  257. package/dist/workflow/index.mjs +279 -0
  258. package/dist/workflow/index.mjs.map +1 -0
  259. package/package.json +226 -0
@@ -0,0 +1,372 @@
1
+ import { b as JoopSubject, J as JoopObservable } from './index-Dz0gOur2.js';
2
+ import { a as JoopHttpMethod } from './index-CqDKWTUP.js';
3
+ import { J as JoopClientProfile } from './client-profile.service-D5bRRYQp.js';
4
+ import { b as JoopAesService, c as JoopRequestOptions } from './aes.service-CkoupAww.js';
5
+ import { J as JoopConfigService } from './config.service-CrCvI-JS.js';
6
+ import { d as JoopStorageAdapter } from './adapters-B6slG6hQ.js';
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 };
@@ -0,0 +1,202 @@
1
+ import './config.service-Cz4QQLlf.mjs';
2
+ import { e as JoopLoggerConfig } from './config.models-Cqg04fAQ.mjs';
3
+ import { J as JoopObservable } from './index-Dz0gOur2.mjs';
4
+
5
+ interface JoopLogEntry {
6
+ level: 'debug' | 'log' | 'info' | 'warn' | 'error' | 'off' | 'all';
7
+ message: any;
8
+ timestamp?: string;
9
+ component?: string;
10
+ }
11
+ interface JoopLoggerOptions {
12
+ color?: string;
13
+ componentName?: string;
14
+ isDateEnabled?: boolean;
15
+ }
16
+
17
+ declare class JoopLogger {
18
+ private readonly _logSubject;
19
+ private _config;
20
+ configure(config: JoopLoggerConfig): void;
21
+ debug(message: any, options?: JoopLoggerOptions): void;
22
+ log(message: any, options?: JoopLoggerOptions): void;
23
+ info(message: any, options?: JoopLoggerOptions): void;
24
+ warn(message: any, options?: JoopLoggerOptions): void;
25
+ error(message: any, options?: JoopLoggerOptions): void;
26
+ /** Subscribe to all log entries (useful for remote logging). */
27
+ onLog(listener: (entry: JoopLogEntry) => void): () => void;
28
+ private _shouldLog;
29
+ private _emit;
30
+ private _serialize;
31
+ }
32
+ /** Singleton logger instance exported for direct use. */
33
+ declare const logger: JoopLogger;
34
+
35
+ interface JoopPlugin {
36
+ name: string;
37
+ version?: string;
38
+ install(context: Record<string, unknown>): void | Promise<void>;
39
+ uninstall?(): void;
40
+ }
41
+ declare class JoopPluginService {
42
+ private _plugins;
43
+ private _context;
44
+ setContext(ctx: Record<string, unknown>): void;
45
+ use(plugin: JoopPlugin): Promise<void>;
46
+ unuse(name: string): void;
47
+ has(name: string): boolean;
48
+ getAll(): JoopPlugin[];
49
+ unuseAll(): void;
50
+ }
51
+
52
+ type JoopEnvironmentName = 'development' | 'staging' | 'production' | string;
53
+ interface JoopEnvironmentProfile {
54
+ name: JoopEnvironmentName;
55
+ apiBaseUrl: string;
56
+ features?: Record<string, boolean>;
57
+ [key: string]: unknown;
58
+ }
59
+ declare class JoopEnvironmentService {
60
+ private _current;
61
+ private _profiles;
62
+ register(profile: JoopEnvironmentProfile): void;
63
+ activate(name: JoopEnvironmentName): void;
64
+ detect(): JoopEnvironmentName;
65
+ get current(): JoopEnvironmentProfile;
66
+ get name(): JoopEnvironmentName;
67
+ get apiBaseUrl(): string;
68
+ isDev(): boolean;
69
+ isStaging(): boolean;
70
+ isProduction(): boolean;
71
+ isFeatureEnabled(feature: string): boolean;
72
+ get<T>(key: string): T | undefined;
73
+ }
74
+
75
+ interface JoopHealthCheckResult {
76
+ name: string;
77
+ healthy: boolean;
78
+ latencyMs: number;
79
+ error?: string;
80
+ timestamp: number;
81
+ }
82
+ interface JoopHealthCheck {
83
+ name: string;
84
+ check: () => Promise<boolean>;
85
+ timeoutMs?: number;
86
+ }
87
+ declare class JoopHealthService {
88
+ private _checks;
89
+ register(check: JoopHealthCheck): void;
90
+ runAll(): Promise<JoopHealthCheckResult[]>;
91
+ run(name: string): Promise<JoopHealthCheckResult | null>;
92
+ pingUrl(url: string, timeoutMs?: number): Promise<JoopHealthCheckResult>;
93
+ private _run;
94
+ }
95
+
96
+ interface JoopFlagDefinition {
97
+ key: string;
98
+ enabled: boolean;
99
+ variant?: string;
100
+ description?: string;
101
+ /** Percentage rollout 0–100 — compared against a stable user hash */
102
+ rolloutPercent?: number;
103
+ /** Only enable for specific user IDs */
104
+ allowedUsers?: string[];
105
+ /** Only enable for specific environments */
106
+ environments?: string[];
107
+ }
108
+ interface JoopFlagContext {
109
+ userId?: string;
110
+ environment?: string;
111
+ attributes?: Record<string, unknown>;
112
+ }
113
+ declare class JoopFeatureFlagService {
114
+ private _flags;
115
+ private _overrides;
116
+ private _context;
117
+ private _flags$;
118
+ /** Register flag definitions */
119
+ define(flags: JoopFlagDefinition[]): void;
120
+ /** Load flags from a remote JSON endpoint */
121
+ loadFromUrl(url: string): Promise<void>;
122
+ /** Set user/environment context for targeting */
123
+ setContext(ctx: JoopFlagContext): void;
124
+ /** Check if a feature flag is enabled for the current context */
125
+ isEnabled(key: string, context?: JoopFlagContext): boolean;
126
+ /** Get the variant string for a flag */
127
+ getVariant(key: string, context?: JoopFlagContext): string | null;
128
+ /** Override a flag locally (for testing) */
129
+ setOverride(key: string, value: boolean): void;
130
+ clearOverrides(): void;
131
+ getAllFlags(): JoopFlagDefinition[];
132
+ getFlag(key: string): JoopFlagDefinition | undefined;
133
+ flags$(): JoopObservable<Map<string, JoopFlagDefinition>>;
134
+ /** Simple deterministic hash for percentage rollouts */
135
+ private _hash;
136
+ }
137
+
138
+ interface JoopTokenBucketConfig {
139
+ capacity: number;
140
+ refillRate: number;
141
+ }
142
+ declare class JoopTokenBucket {
143
+ private _tokens;
144
+ private _lastRefill;
145
+ private readonly _cap;
146
+ private readonly _rate;
147
+ constructor(config: JoopTokenBucketConfig);
148
+ private _refill;
149
+ /** Returns true if tokens were available and consumed */
150
+ consume(tokens?: number): boolean;
151
+ /** Waits until enough tokens are available, then consumes */
152
+ tryConsume(tokens?: number): Promise<void>;
153
+ available(): number;
154
+ reset(): void;
155
+ }
156
+ declare class JoopRateLimiter {
157
+ private _buckets;
158
+ private _timers;
159
+ /** Create or get a token bucket by key */
160
+ bucket(key: string, config?: JoopTokenBucketConfig): JoopTokenBucket;
161
+ deleteBucket(key: string): void;
162
+ /** Returns a throttled version — at most once per delayMs */
163
+ throttle<T extends unknown[]>(fn: (...args: T) => void, delayMs: number): (...args: T) => void;
164
+ /** Returns a debounced version — fires after delayMs of silence */
165
+ debounce<T extends unknown[]>(fn: (...args: T) => void, delayMs: number, immediate?: boolean): (...args: T) => void;
166
+ /** Promise-based debounce — resolves when the debounced call fires */
167
+ debounceAsync<T>(fn: () => Promise<T>, delayMs: number): () => Promise<T>;
168
+ /** Ensure a function is called at most once per key in the given window */
169
+ once(key: string, fn: () => void, windowMs: number): boolean;
170
+ }
171
+
172
+ type JoopConsentCategory = 'necessary' | 'analytics' | 'marketing' | 'functional' | 'personalization';
173
+ interface JoopConsentState {
174
+ decided: boolean;
175
+ categories: Record<JoopConsentCategory, boolean>;
176
+ timestamp: number | null;
177
+ }
178
+ declare class JoopConsentService {
179
+ private _state$;
180
+ constructor(storageKey?: string);
181
+ private _key;
182
+ private _loadFrom;
183
+ /** Grant one or more categories */
184
+ grant(categories: JoopConsentCategory | JoopConsentCategory[]): void;
185
+ /** Revoke one or more categories (cannot revoke 'necessary') */
186
+ revoke(categories: JoopConsentCategory | JoopConsentCategory[]): void;
187
+ /** Grant all categories at once */
188
+ acceptAll(): void;
189
+ /** Reject all non-necessary categories */
190
+ rejectAll(): void;
191
+ isGranted(category: JoopConsentCategory): boolean;
192
+ hasDecided(): boolean;
193
+ getAll(): Record<JoopConsentCategory, boolean>;
194
+ getState(): JoopConsentState;
195
+ state$(): JoopObservable<JoopConsentState>;
196
+ reset(): void;
197
+ onChange(handler: (state: JoopConsentState) => void): () => void;
198
+ onCategoryChange(category: JoopConsentCategory, handler: (granted: boolean) => void): () => void;
199
+ private _persist;
200
+ }
201
+
202
+ export { JoopLogger as J, JoopPluginService as a, JoopEnvironmentService as b, JoopHealthService as c, JoopFeatureFlagService as d, JoopRateLimiter as e, JoopConsentService as f, type JoopConsentCategory as g, type JoopConsentState as h, type JoopEnvironmentName as i, type JoopEnvironmentProfile as j, type JoopFlagContext as k, type JoopFlagDefinition as l, type JoopHealthCheck as m, type JoopHealthCheckResult as n, type JoopLogEntry as o, type JoopLoggerOptions as p, type JoopPlugin as q, JoopTokenBucket as r, type JoopTokenBucketConfig as s, logger as t };
@@ -0,0 +1,28 @@
1
+ declare enum JoopScopeType {
2
+ /** Application scope — lives for the lifetime of the app */
3
+ App = "app",
4
+ /** Page/flow scope — cleared on page navigation */
5
+ Page = "page",
6
+ /** Screen scope — cleared on screen change */
7
+ Screen = "screen",
8
+ /** Session scope — maps to sessionStorage semantics */
9
+ Session = "session"
10
+ }
11
+ declare enum JoopHttpMethod {
12
+ Get = "GET",
13
+ Post = "POST",
14
+ Put = "PUT",
15
+ Patch = "PATCH",
16
+ Delete = "DELETE"
17
+ }
18
+ declare enum JoopLogLevel {
19
+ Debug = "debug",
20
+ Log = "log",
21
+ Info = "info",
22
+ Warn = "warn",
23
+ Error = "error",
24
+ All = "all",
25
+ Off = "off"
26
+ }
27
+
28
+ export { JoopScopeType as J, JoopHttpMethod as a, JoopLogLevel as b };
@@ -0,0 +1,28 @@
1
+ declare enum JoopScopeType {
2
+ /** Application scope — lives for the lifetime of the app */
3
+ App = "app",
4
+ /** Page/flow scope — cleared on page navigation */
5
+ Page = "page",
6
+ /** Screen scope — cleared on screen change */
7
+ Screen = "screen",
8
+ /** Session scope — maps to sessionStorage semantics */
9
+ Session = "session"
10
+ }
11
+ declare enum JoopHttpMethod {
12
+ Get = "GET",
13
+ Post = "POST",
14
+ Put = "PUT",
15
+ Patch = "PATCH",
16
+ Delete = "DELETE"
17
+ }
18
+ declare enum JoopLogLevel {
19
+ Debug = "debug",
20
+ Log = "log",
21
+ Info = "info",
22
+ Warn = "warn",
23
+ Error = "error",
24
+ All = "all",
25
+ Off = "off"
26
+ }
27
+
28
+ export { JoopScopeType as J, JoopHttpMethod as a, JoopLogLevel as b };