@shiva004/surveys 0.11.1 → 0.11.2
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/dist/App.d.ts +1 -1
- package/dist/elements.js +15024 -13527
- package/dist/index.d.ts +0 -8
- package/dist/index.js +12572 -11075
- package/dist/recorder/RouteRecorderWatcher.d.ts +58 -0
- package/dist/recorder/sessionStore.d.ts +22 -0
- package/dist/recording/RecordingApp.d.ts +3 -0
- package/dist/recording/fields.d.ts +18 -0
- package/dist/recording/session.d.ts +54 -0
- package/dist/sessions/data.d.ts +7 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/experiments/ExperimentsApp.d.ts +0 -8
- package/dist/experiments/data.d.ts +0 -129
- package/dist/monitoring/MonitoringApp.d.ts +0 -8
- package/dist/monitoring/data.d.ts +0 -108
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
export type CheckMethod = 'GET' | 'HEAD';
|
|
2
|
-
export type CheckMode = 'cors' | 'no-cors';
|
|
3
|
-
export type CheckStatus = 'unknown' | 'up' | 'degraded' | 'down' | 'paused';
|
|
4
|
-
export interface CheckResult {
|
|
5
|
-
ts: number;
|
|
6
|
-
ok: boolean;
|
|
7
|
-
/** HTTP status. null for a "no-cors" check (opaque answer) or when nothing came back. */
|
|
8
|
-
status: number | null;
|
|
9
|
-
/** Time until the response headers arrived. */
|
|
10
|
-
latencyMs: number;
|
|
11
|
-
/** Answered, but slower than the check's maxLatencyMs. */
|
|
12
|
-
slow?: boolean;
|
|
13
|
-
error?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface Check {
|
|
16
|
-
id: string;
|
|
17
|
-
name: string;
|
|
18
|
-
url: string;
|
|
19
|
-
method: CheckMethod;
|
|
20
|
-
mode: CheckMode;
|
|
21
|
-
intervalSec: number;
|
|
22
|
-
timeoutMs: number;
|
|
23
|
-
/** Exact status that counts as healthy. null: any 2xx. */
|
|
24
|
-
expectStatus: number | null;
|
|
25
|
-
/** Slower than this is "degraded". null: no limit. */
|
|
26
|
-
maxLatencyMs: number | null;
|
|
27
|
-
/** The body must contain this text (GET and "cors" only). */
|
|
28
|
-
contains?: string;
|
|
29
|
-
enabled: boolean;
|
|
30
|
-
createdAt: number;
|
|
31
|
-
/** Newest first. */
|
|
32
|
-
results: CheckResult[];
|
|
33
|
-
/** Failures in a row. */
|
|
34
|
-
failures: number;
|
|
35
|
-
}
|
|
36
|
-
export interface Incident {
|
|
37
|
-
id: string;
|
|
38
|
-
checkId: string;
|
|
39
|
-
checkName: string;
|
|
40
|
-
url: string;
|
|
41
|
-
startedAt: number;
|
|
42
|
-
resolvedAt?: number;
|
|
43
|
-
reason: string;
|
|
44
|
-
}
|
|
45
|
-
export interface CheckInput {
|
|
46
|
-
name: string;
|
|
47
|
-
url: string;
|
|
48
|
-
method?: CheckMethod;
|
|
49
|
-
mode?: CheckMode;
|
|
50
|
-
intervalSec?: number;
|
|
51
|
-
timeoutMs?: number;
|
|
52
|
-
expectStatus?: number | null;
|
|
53
|
-
maxLatencyMs?: number | null;
|
|
54
|
-
contains?: string;
|
|
55
|
-
enabled?: boolean;
|
|
56
|
-
}
|
|
57
|
-
export interface MonitoringConfig {
|
|
58
|
-
/** localStorage key. Default "mon_checks_v1". */
|
|
59
|
-
storageKey?: string;
|
|
60
|
-
/** Results kept per check. Default 100. */
|
|
61
|
-
maxResults?: number;
|
|
62
|
-
/** Failures in a row before an incident opens. Default 2. */
|
|
63
|
-
failAfter?: number;
|
|
64
|
-
onResult?: (c: Check, r: CheckResult) => void;
|
|
65
|
-
onDown?: (c: Check, i: Incident) => void;
|
|
66
|
-
onRecover?: (c: Check, i: Incident) => void;
|
|
67
|
-
}
|
|
68
|
-
export type Outcome<T> = {
|
|
69
|
-
ok: true;
|
|
70
|
-
value: T;
|
|
71
|
-
} | {
|
|
72
|
-
ok: false;
|
|
73
|
-
error: string;
|
|
74
|
-
};
|
|
75
|
-
export declare const useMonitoring: () => {
|
|
76
|
-
checks: Check[];
|
|
77
|
-
incidents: Incident[];
|
|
78
|
-
online: boolean;
|
|
79
|
-
};
|
|
80
|
-
export declare const getChecks: () => Check[];
|
|
81
|
-
export declare const getCheck: (id: string) => Check | undefined;
|
|
82
|
-
export declare const getIncidents: () => Incident[];
|
|
83
|
-
export declare const configureMonitoring: (c: MonitoringConfig) => void;
|
|
84
|
-
export declare const statusOf: (c: Check) => CheckStatus;
|
|
85
|
-
export interface CheckStats {
|
|
86
|
-
total: number;
|
|
87
|
-
uptime: number | null;
|
|
88
|
-
avgMs: number | null;
|
|
89
|
-
p95Ms: number | null;
|
|
90
|
-
last?: CheckResult;
|
|
91
|
-
}
|
|
92
|
-
/** Uptime and latency over the results kept for this check. Latency counts only answered requests. */
|
|
93
|
-
export declare const statsOf: (c: Check) => CheckStats;
|
|
94
|
-
export declare const openIncident: (checkId: string) => Incident | undefined;
|
|
95
|
-
export type ProbeOptions = Pick<Check, 'url'> & Partial<Pick<Check, 'method' | 'mode' | 'timeoutMs' | 'expectStatus' | 'maxLatencyMs' | 'contains'>>;
|
|
96
|
-
/** One request, no store involved. Uses the browser's own fetch, so it is not counted as app traffic by Live Events, Rate Limit or Mock API. */
|
|
97
|
-
export declare const probe: (o: ProbeOptions) => Promise<CheckResult>;
|
|
98
|
-
/** Run one check now and record the result. Returns null when the check does not exist or is already running. */
|
|
99
|
-
export declare const runCheck: (id: string) => Promise<CheckResult | null>;
|
|
100
|
-
export declare const runAllChecks: () => Promise<(CheckResult | null)[]>;
|
|
101
|
-
export declare const addCheck: (input: CheckInput) => Outcome<Check>;
|
|
102
|
-
export declare const updateCheck: (id: string, input: CheckInput) => Outcome<Check>;
|
|
103
|
-
export declare const toggleCheck: (id: string) => void;
|
|
104
|
-
export declare const removeCheck: (id: string) => void;
|
|
105
|
-
export declare const clearCheckHistory: (id: string) => void;
|
|
106
|
-
export declare const clearChecks: () => void;
|
|
107
|
-
/** Runs every enabled check at its interval while the page is open, and tracks the browser's online state. Call once at start-up. Returns a stop function. */
|
|
108
|
-
export declare const startLocalMonitoring: () => (() => void);
|