@tonder.io/ionic-lite-sdk 0.0.68-beta.DEV-2106.10 → 0.0.68-beta.DEV-2106.48d18dd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/index.js +1 -1
- package/dist/shared/utils/appError.d.ts +2 -0
- package/package.json +1 -1
- package/src/classes/liteCheckout.ts +4 -5
- package/src/helpers/card_on_file.ts +11 -1
- package/src/shared/utils/appError.ts +48 -4
- package/dist/classes/SdkTelemetryClient.d.ts +0 -86
- package/dist/index.js.map +0 -1
- package/dist/types/jsx-web-components.d.ts +0 -17
- package/dist/ui/components/input/CardCVVInput.d.ts +0 -19
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { ITelemetryConfig, ITelemetryContext } from "../types/telemetry";
|
|
2
|
-
/**
|
|
3
|
-
* SdkTelemetryClient - Internal SDK error reporting
|
|
4
|
-
*
|
|
5
|
-
* Features:
|
|
6
|
-
* - Ring buffer (max 100 events)
|
|
7
|
-
* - Batching (flush every 5s or 10 events)
|
|
8
|
-
* - Circuit breaker (3 consecutive failures = 10 min pause)
|
|
9
|
-
* - Non-blocking (never throws)
|
|
10
|
-
* - Sanitization (truncate message/stack, allowlist context)
|
|
11
|
-
* - Retry with backoff (max 1 retry)
|
|
12
|
-
*/
|
|
13
|
-
export declare class SdkTelemetryClient {
|
|
14
|
-
private config;
|
|
15
|
-
private buffer;
|
|
16
|
-
private readonly MAX_BUFFER_SIZE;
|
|
17
|
-
private readonly BATCH_SIZE;
|
|
18
|
-
private readonly FLUSH_INTERVAL_MS;
|
|
19
|
-
private readonly REQUEST_TIMEOUT_MS;
|
|
20
|
-
private readonly MAX_MESSAGE_LENGTH;
|
|
21
|
-
private readonly MAX_STACK_LENGTH;
|
|
22
|
-
private readonly MAX_RETRIES;
|
|
23
|
-
private readonly CIRCUIT_BREAKER_THRESHOLD;
|
|
24
|
-
private readonly CIRCUIT_BREAKER_TIMEOUT_MS;
|
|
25
|
-
private flushTimer;
|
|
26
|
-
private circuitBreaker;
|
|
27
|
-
constructor(config: ITelemetryConfig);
|
|
28
|
-
/**
|
|
29
|
-
* Capture an exception and queue it for sending
|
|
30
|
-
* @param error - Error object or any thrown value
|
|
31
|
-
* @param context - Additional context (tenant_id, feature, process_id, user_id, metadata, etc.)
|
|
32
|
-
*/
|
|
33
|
-
captureException(error: unknown, context?: ITelemetryContext): void;
|
|
34
|
-
/**
|
|
35
|
-
* Extract error information from error object
|
|
36
|
-
*/
|
|
37
|
-
private extractErrorInfo;
|
|
38
|
-
/**
|
|
39
|
-
* Safe stringify with circular reference protection
|
|
40
|
-
*/
|
|
41
|
-
private safeStringify;
|
|
42
|
-
/**
|
|
43
|
-
* Build telemetry event with API format
|
|
44
|
-
*/
|
|
45
|
-
private buildEvent;
|
|
46
|
-
/**
|
|
47
|
-
* Truncate string to max length
|
|
48
|
-
*/
|
|
49
|
-
private truncate;
|
|
50
|
-
/**
|
|
51
|
-
* Start automatic flush timer
|
|
52
|
-
*/
|
|
53
|
-
private startFlushTimer;
|
|
54
|
-
/**
|
|
55
|
-
* Flush buffer - send all pending events
|
|
56
|
-
*/
|
|
57
|
-
private flush;
|
|
58
|
-
/**
|
|
59
|
-
* Send a single event with retry logic
|
|
60
|
-
*/
|
|
61
|
-
private sendEvent;
|
|
62
|
-
/**
|
|
63
|
-
* Send HTTP request to telemetry endpoint
|
|
64
|
-
*/
|
|
65
|
-
private sendHttpRequest;
|
|
66
|
-
/**
|
|
67
|
-
* Handle successful send
|
|
68
|
-
*/
|
|
69
|
-
private onSendSuccess;
|
|
70
|
-
/**
|
|
71
|
-
* Handle send failure with retry logic
|
|
72
|
-
*/
|
|
73
|
-
private onSendFailure;
|
|
74
|
-
/**
|
|
75
|
-
* Open circuit breaker
|
|
76
|
-
*/
|
|
77
|
-
private openCircuitBreaker;
|
|
78
|
-
/**
|
|
79
|
-
* Check if circuit breaker is open
|
|
80
|
-
*/
|
|
81
|
-
private isCircuitBreakerOpen;
|
|
82
|
-
/**
|
|
83
|
-
* Cleanup - stop flush timer
|
|
84
|
-
*/
|
|
85
|
-
destroy(): void;
|
|
86
|
-
}
|