@plyaz/types 1.3.1 → 1.3.3
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/index.d.ts +1 -0
- package/dist/testing/common/assertions/index.d.ts +1 -0
- package/dist/testing/common/assertions/types.d.ts +137 -0
- package/dist/testing/common/factories/index.d.ts +1 -0
- package/dist/testing/common/factories/types.d.ts +701 -0
- package/dist/testing/common/index.d.ts +6 -0
- package/dist/testing/common/mocks/index.d.ts +1 -0
- package/dist/testing/common/mocks/types.d.ts +1662 -0
- package/dist/testing/common/patterns/index.d.ts +1 -0
- package/dist/testing/common/patterns/types.d.ts +397 -0
- package/dist/testing/common/utils/index.d.ts +1 -0
- package/dist/testing/common/utils/types.d.ts +1970 -0
- package/dist/testing/common/wrappers/index.d.ts +1 -0
- package/dist/testing/common/wrappers/types.d.ts +373 -0
- package/dist/testing/features/cache/index.d.ts +1 -0
- package/dist/testing/features/cache/types.d.ts +43 -0
- package/dist/testing/features/feature-flags/index.d.ts +1 -0
- package/dist/testing/features/feature-flags/types.d.ts +1133 -0
- package/dist/testing/features/index.d.ts +2 -0
- package/dist/testing/index.d.ts +2 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './types';
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assertion Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for assertion utilities.
|
|
5
|
+
*/
|
|
6
|
+
export interface ErrorPattern {
|
|
7
|
+
status: number;
|
|
8
|
+
message: RegExp;
|
|
9
|
+
}
|
|
10
|
+
export interface ValidationErrorPattern {
|
|
11
|
+
status: number;
|
|
12
|
+
validation: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface ErrorMessagePattern {
|
|
15
|
+
message: RegExp;
|
|
16
|
+
}
|
|
17
|
+
export interface ErrorStats {
|
|
18
|
+
failures: number;
|
|
19
|
+
successes: number;
|
|
20
|
+
lastFailure?: Error;
|
|
21
|
+
}
|
|
22
|
+
export interface ErrorTimelineEntry {
|
|
23
|
+
timestamp: number;
|
|
24
|
+
error: Error;
|
|
25
|
+
context?: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
export interface ExpectedError {
|
|
28
|
+
message?: string | RegExp;
|
|
29
|
+
type?: new (...args: unknown[]) => unknown;
|
|
30
|
+
}
|
|
31
|
+
export interface ValidationResponse {
|
|
32
|
+
message?: unknown[];
|
|
33
|
+
}
|
|
34
|
+
export interface HookResultValue<T> {
|
|
35
|
+
current: {
|
|
36
|
+
value: T;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export interface HookResultLoading {
|
|
40
|
+
current: {
|
|
41
|
+
isLoading: boolean;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface HookResultError {
|
|
45
|
+
current: {
|
|
46
|
+
error: Error | null;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export interface ErrorRecoveryResult {
|
|
50
|
+
error: Error;
|
|
51
|
+
recoveryResult: unknown;
|
|
52
|
+
}
|
|
53
|
+
export interface ErrorCorrelationEntry {
|
|
54
|
+
error: Error;
|
|
55
|
+
metadata?: Record<string, unknown>;
|
|
56
|
+
}
|
|
57
|
+
export interface ErrorTestScenario {
|
|
58
|
+
name: string;
|
|
59
|
+
fn: () => unknown | Promise<unknown>;
|
|
60
|
+
expectedError: unknown;
|
|
61
|
+
skip?: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface CircuitBreakerOptions {
|
|
64
|
+
failureThreshold: number;
|
|
65
|
+
resetTimeout: number;
|
|
66
|
+
onOpen?: () => void;
|
|
67
|
+
onClose?: () => void;
|
|
68
|
+
onHalfOpen?: () => void;
|
|
69
|
+
}
|
|
70
|
+
export interface ErrorPropagationTestResult<T> {
|
|
71
|
+
propagatedTo: number;
|
|
72
|
+
finalError: Error;
|
|
73
|
+
intermediateResults: Array<T | Error>;
|
|
74
|
+
}
|
|
75
|
+
export interface ErrorCircuitBreaker<T> {
|
|
76
|
+
execute: (fn: () => T | Promise<T>) => Promise<T>;
|
|
77
|
+
getState: () => 'closed' | 'open' | 'half-open';
|
|
78
|
+
getStats: () => ErrorStats;
|
|
79
|
+
reset: () => void;
|
|
80
|
+
}
|
|
81
|
+
export interface ErrorCorrelator {
|
|
82
|
+
correlate: (error: Error, metadata?: Record<string, unknown>) => string;
|
|
83
|
+
getRelated: (correlationId: string) => Array<ErrorCorrelationEntry>;
|
|
84
|
+
getChain: (error: Error) => Array<ErrorCorrelationEntry>;
|
|
85
|
+
}
|
|
86
|
+
export interface ErrorMetrics {
|
|
87
|
+
record: (error: Error, context?: Record<string, unknown>) => void;
|
|
88
|
+
getMetrics: () => {
|
|
89
|
+
total: number;
|
|
90
|
+
byType: Record<string, number>;
|
|
91
|
+
byMessage: Record<string, number>;
|
|
92
|
+
timeline: Array<ErrorTimelineEntry>;
|
|
93
|
+
errorRate: (windowMs: number) => number;
|
|
94
|
+
};
|
|
95
|
+
reset: () => void;
|
|
96
|
+
}
|
|
97
|
+
export interface ErrorDeduplicator {
|
|
98
|
+
isDuplicate: (error: Error) => boolean;
|
|
99
|
+
record: (error: Error) => void;
|
|
100
|
+
getUniqueErrors: () => Error[];
|
|
101
|
+
reset: () => void;
|
|
102
|
+
}
|
|
103
|
+
export interface ErrorWithMessage {
|
|
104
|
+
message: string;
|
|
105
|
+
}
|
|
106
|
+
export interface ErrorWithResponse {
|
|
107
|
+
getResponse?: () => unknown;
|
|
108
|
+
response?: unknown;
|
|
109
|
+
}
|
|
110
|
+
export interface ValidationMessage {
|
|
111
|
+
property?: string;
|
|
112
|
+
constraints?: Record<string, string>;
|
|
113
|
+
}
|
|
114
|
+
export interface ExpectedHttpException {
|
|
115
|
+
status?: number;
|
|
116
|
+
message?: string | RegExp;
|
|
117
|
+
response?: unknown;
|
|
118
|
+
}
|
|
119
|
+
export interface ExpectedServiceError {
|
|
120
|
+
message?: string | RegExp;
|
|
121
|
+
type?: new (...args: unknown[]) => unknown;
|
|
122
|
+
}
|
|
123
|
+
export interface ErrorPropagationInjection {
|
|
124
|
+
atStep: number;
|
|
125
|
+
error: Error;
|
|
126
|
+
}
|
|
127
|
+
export interface ErrorEnrichmentContext {
|
|
128
|
+
operation?: string;
|
|
129
|
+
user?: string;
|
|
130
|
+
timestamp?: number;
|
|
131
|
+
requestId?: string;
|
|
132
|
+
metadata?: Record<string, unknown>;
|
|
133
|
+
}
|
|
134
|
+
export interface ErrorDeduplicatorOptions {
|
|
135
|
+
keyFn?: (error: Error) => string;
|
|
136
|
+
windowMs?: number;
|
|
137
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './types';
|