@plyaz/types 1.7.2 → 1.7.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/common/types.d.ts +1 -1
- package/dist/features/feature-flag/types.d.ts +4 -2
- package/dist/testing/common/assertions/types.d.ts +4 -4
- package/dist/testing/common/factories/types.d.ts +1 -1
- package/dist/testing/common/patterns/types.d.ts +2 -2
- package/dist/testing/common/utils/types.d.ts +8 -6
- package/package.json +1 -1
package/dist/common/types.d.ts
CHANGED
|
@@ -253,7 +253,7 @@ export interface Describable extends Named {
|
|
|
253
253
|
* }
|
|
254
254
|
* ```
|
|
255
255
|
*/
|
|
256
|
-
export interface WithMetadata<T = UnknownRecord
|
|
256
|
+
export interface WithMetadata<T = UnknownRecord> {
|
|
257
257
|
/** Metadata for additional information */
|
|
258
258
|
metadata: T;
|
|
259
259
|
}
|
|
@@ -172,7 +172,7 @@ export interface FeatureFlagProviderProps<FeatureFlagKey extends string, Feature
|
|
|
172
172
|
/**
|
|
173
173
|
* Backend Request DTO for flag creation.
|
|
174
174
|
*/
|
|
175
|
-
export interface CreateFlagRequest<FeatureFlagKey extends string> extends WithEnvironment
|
|
175
|
+
export interface CreateFlagRequest<FeatureFlagKey extends string> extends Partial<WithEnvironment>, SetOptional<Enabled, 'isEnabled'>, SetOptional<Describable, 'description'>, Named, KeyValuePair<FeatureFlagKey, FeatureFlagValue> {
|
|
176
176
|
rolloutPercentage?: number;
|
|
177
177
|
}
|
|
178
178
|
/**
|
|
@@ -227,6 +227,8 @@ export interface ProviderStats {
|
|
|
227
227
|
avgEvaluationTime: number;
|
|
228
228
|
/** Last refresh timestamp */
|
|
229
229
|
lastRefresh?: Date;
|
|
230
|
+
/** Last updated timestamp */
|
|
231
|
+
lastUpdated?: Date;
|
|
230
232
|
/** Provider uptime in ms */
|
|
231
233
|
uptime: number;
|
|
232
234
|
}
|
|
@@ -303,7 +305,7 @@ export interface FlagEvaluationTestInput<FeatureFlagKey extends string> extends
|
|
|
303
305
|
/**
|
|
304
306
|
* Input for flag creation test cases
|
|
305
307
|
*/
|
|
306
|
-
export interface FlagCreationTestInput<FeatureFlagKey extends string> extends WithEnvironment
|
|
308
|
+
export interface FlagCreationTestInput<FeatureFlagKey extends string> extends Partial<WithEnvironment>, Enabled, Describable, Named, KeyValuePair<FeatureFlagKey, FeatureFlagValue> {
|
|
307
309
|
/** Rollout percentage (0-100) */
|
|
308
310
|
rolloutPercentage?: number;
|
|
309
311
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Type definitions for assertion utilities.
|
|
5
5
|
*/
|
|
6
|
-
import type { UnknownRecord, UnknownArray,
|
|
6
|
+
import type { UnknownRecord, UnknownArray, SetOptional } from 'type-fest';
|
|
7
7
|
import type { WithStatusCode, WithMessage, WithTimestamp, WithCorrelationId, WithMetadata, Named, WithRequestId, WithStatus } from '../../../common/types';
|
|
8
8
|
/**
|
|
9
9
|
* Pattern for matching HTTP errors with status code and message.
|
|
@@ -17,7 +17,7 @@ import type { WithStatusCode, WithMessage, WithTimestamp, WithCorrelationId, Wit
|
|
|
17
17
|
* };
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
export interface ErrorPattern extends WithStatusCode, WithStatus<string | number> {
|
|
20
|
+
export interface ErrorPattern extends SetOptional<WithStatusCode, 'statusCode'>, WithStatus<string | number> {
|
|
21
21
|
/** Regular expression to match against error message */
|
|
22
22
|
message: RegExp;
|
|
23
23
|
}
|
|
@@ -33,7 +33,7 @@ export interface ErrorPattern extends WithStatusCode, WithStatus<string | number
|
|
|
33
33
|
* };
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
export interface ValidationErrorPattern extends WithStatusCode, WithStatus<string | number> {
|
|
36
|
+
export interface ValidationErrorPattern extends SetOptional<WithStatusCode, 'statusCode'>, WithStatus<string | number> {
|
|
37
37
|
/** Array of field names that failed validation */
|
|
38
38
|
validation: string[];
|
|
39
39
|
}
|
|
@@ -203,7 +203,7 @@ export interface ErrorPropagationTestResult<T> {
|
|
|
203
203
|
*/
|
|
204
204
|
export interface ErrorCircuitBreaker<T> {
|
|
205
205
|
/** Execute function with circuit breaker protection */
|
|
206
|
-
execute: (fn: () =>
|
|
206
|
+
execute: (fn: () => T | Promise<T>) => T | Promise<T>;
|
|
207
207
|
/** Get current circuit state */
|
|
208
208
|
getState: () => 'closed' | 'open' | 'half-open';
|
|
209
209
|
/** Get error statistics */
|
|
@@ -623,7 +623,7 @@ export interface ScenarioResult<T> {
|
|
|
623
623
|
* };
|
|
624
624
|
* ```
|
|
625
625
|
*/
|
|
626
|
-
export interface TrackedCallRecord<TArgs extends unknown[], TReturn, TTimestamp = Date> extends Omit<Tracked<TReturn>, 'timestamp'>, WithDuration, WithTimestamp<TTimestamp> {
|
|
626
|
+
export interface TrackedCallRecord<TArgs extends unknown[], TReturn, TTimestamp = Date> extends Omit<Tracked<TReturn | undefined>, 'timestamp'>, WithDuration, WithTimestamp<TTimestamp> {
|
|
627
627
|
/** Function arguments */
|
|
628
628
|
args: TArgs;
|
|
629
629
|
}
|
|
@@ -400,10 +400,10 @@ export interface CreateTableDrivenTestOptions<TInput, TExpected> extends Named {
|
|
|
400
400
|
}>;
|
|
401
401
|
test?: (testCase: TInput & {
|
|
402
402
|
expected?: TExpected;
|
|
403
|
-
}) =>
|
|
403
|
+
}) => void | Promise<void>;
|
|
404
404
|
fn?: (testCase: TInput & {
|
|
405
405
|
expected?: TExpected;
|
|
406
|
-
}) =>
|
|
406
|
+
}) => void | Promise<void>;
|
|
407
407
|
}
|
|
408
408
|
/**
|
|
409
409
|
* Statistics collected for operation performance tracking.
|
|
@@ -2135,7 +2135,7 @@ export interface ModuleLifecycleTest extends Named {
|
|
|
2135
2135
|
*/
|
|
2136
2136
|
export interface ApplicationLifecycleTest extends Named {
|
|
2137
2137
|
app: UnknownRecord;
|
|
2138
|
-
modules:
|
|
2138
|
+
modules: unknown[];
|
|
2139
2139
|
expectedStartupSequence: string[];
|
|
2140
2140
|
expectedShutdownSequence: string[];
|
|
2141
2141
|
}
|
|
@@ -2855,6 +2855,8 @@ export interface ApiRouteHandlerMethods {
|
|
|
2855
2855
|
PUT?: Function;
|
|
2856
2856
|
DELETE?: Function;
|
|
2857
2857
|
PATCH?: Function;
|
|
2858
|
+
HEAD?: Function;
|
|
2859
|
+
OPTIONS?: Function;
|
|
2858
2860
|
}
|
|
2859
2861
|
/**
|
|
2860
2862
|
* Test scenario for route handlers.
|
|
@@ -3653,7 +3655,7 @@ export interface SecretsManagementTest extends Named {
|
|
|
3653
3655
|
}
|
|
3654
3656
|
export interface SecretsManager extends KeyValueStore<string, string> {
|
|
3655
3657
|
}
|
|
3656
|
-
export interface MockEnvironment extends
|
|
3658
|
+
export interface MockEnvironment extends Omit<KeyValueStore<string, string>, 'delete' | 'has'> {
|
|
3657
3659
|
update: (updates: EnvironmentConfig) => void;
|
|
3658
3660
|
unset: (key: string) => void;
|
|
3659
3661
|
restore: () => void;
|
|
@@ -4418,9 +4420,9 @@ export interface DynamicModuleClass {
|
|
|
4418
4420
|
* ```
|
|
4419
4421
|
*/
|
|
4420
4422
|
export interface DynamicModuleExpectations {
|
|
4421
|
-
providers?:
|
|
4422
|
-
imports?:
|
|
4423
|
-
exports?:
|
|
4423
|
+
providers?: unknown[];
|
|
4424
|
+
imports?: unknown[];
|
|
4425
|
+
exports?: unknown[];
|
|
4424
4426
|
}
|
|
4425
4427
|
/**
|
|
4426
4428
|
* Return value from NestJS test suite setup.
|
|
@@ -4584,7 +4586,7 @@ export interface UserFlowStep extends Named {
|
|
|
4584
4586
|
export interface MockNextRequestCreatorParams {
|
|
4585
4587
|
url: string;
|
|
4586
4588
|
options?: {
|
|
4587
|
-
method?:
|
|
4589
|
+
method?: HttpMethod;
|
|
4588
4590
|
headers?: Record<string, string>;
|
|
4589
4591
|
body?: unknown;
|
|
4590
4592
|
searchParams?: Record<string, string>;
|
package/package.json
CHANGED