@plyaz/types 1.1.4 → 1.2.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.
|
@@ -300,3 +300,191 @@ export interface FetchFeatureFlagDataResponse<FeatureFlagKey> {
|
|
|
300
300
|
flags: FeatureFlag<FeatureFlagKey>[];
|
|
301
301
|
rules: FeatureFlagRule<FeatureFlagKey>[];
|
|
302
302
|
}
|
|
303
|
+
/**
|
|
304
|
+
* Input for error handling test cases
|
|
305
|
+
*/
|
|
306
|
+
export interface ErrorHandlingTestInput {
|
|
307
|
+
/** The error to test */
|
|
308
|
+
error: unknown;
|
|
309
|
+
/** Expected error message */
|
|
310
|
+
expectedMessage: string;
|
|
311
|
+
/** Expected HTTP status code */
|
|
312
|
+
expectedStatus: number;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Input for flag evaluation test cases
|
|
316
|
+
*/
|
|
317
|
+
export interface FlagEvaluationTestInput<FeatureFlagKey> {
|
|
318
|
+
/** The flag key to evaluate */
|
|
319
|
+
flagKey: FeatureFlagKey;
|
|
320
|
+
/** Optional evaluation context */
|
|
321
|
+
context?: FeatureFlagContext;
|
|
322
|
+
/** Mock value to return */
|
|
323
|
+
mockValue: boolean;
|
|
324
|
+
/** Whether the flag is enabled */
|
|
325
|
+
isEnabled: boolean;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Input for flag creation test cases
|
|
329
|
+
*/
|
|
330
|
+
export interface FlagCreationTestInput<FeatureFlagKey> {
|
|
331
|
+
/** Unique key for the flag */
|
|
332
|
+
key: FeatureFlagKey;
|
|
333
|
+
/** Human-readable name */
|
|
334
|
+
name: string;
|
|
335
|
+
/** Optional description */
|
|
336
|
+
description?: string;
|
|
337
|
+
/** Flag value */
|
|
338
|
+
value: FeatureFlagValue;
|
|
339
|
+
/** Whether the flag is enabled */
|
|
340
|
+
isEnabled?: boolean;
|
|
341
|
+
/** Target environment */
|
|
342
|
+
environment?: 'all' | 'development' | 'production' | 'staging';
|
|
343
|
+
/** Rollout percentage (0-100) */
|
|
344
|
+
rolloutPercentage?: number;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Input for flag update test cases
|
|
348
|
+
*/
|
|
349
|
+
export interface FlagUpdateTestInput<FeatureFlagKey> {
|
|
350
|
+
/** Key of the flag to update */
|
|
351
|
+
flagKey: FeatureFlagKey;
|
|
352
|
+
/** Update data object */
|
|
353
|
+
updateData: Record<string, unknown>;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Input for override test cases
|
|
357
|
+
*/
|
|
358
|
+
export interface OverrideTestInput<FeatureFlagKey> {
|
|
359
|
+
/** Flag key to override */
|
|
360
|
+
flagKey: FeatureFlagKey;
|
|
361
|
+
/** Override value */
|
|
362
|
+
value: FeatureFlagValue;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Input for service initialization test cases
|
|
366
|
+
*/
|
|
367
|
+
export interface ServiceInitializationTestInput {
|
|
368
|
+
/** Environment variables to set */
|
|
369
|
+
envVars: Record<string, string>;
|
|
370
|
+
/** Expected configuration after initialization */
|
|
371
|
+
expectedConfig: {
|
|
372
|
+
/** Provider type */
|
|
373
|
+
provider: string;
|
|
374
|
+
/** Whether caching is enabled */
|
|
375
|
+
isCacheEnabled: boolean;
|
|
376
|
+
/** Cache TTL in seconds */
|
|
377
|
+
cacheTtl: number;
|
|
378
|
+
/** Refresh interval in seconds */
|
|
379
|
+
refreshInterval: number;
|
|
380
|
+
/** Whether to fallback to defaults on error */
|
|
381
|
+
shouldFallbackToDefaults: boolean;
|
|
382
|
+
/** Whether logging is enabled */
|
|
383
|
+
isLoggingEnabled: boolean;
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Input for flag operation error test cases
|
|
388
|
+
*/
|
|
389
|
+
export interface FlagOperationErrorTestInput<FeatureFlagKey> {
|
|
390
|
+
/** Flag key involved in the operation */
|
|
391
|
+
flagKey: FeatureFlagKey;
|
|
392
|
+
/** Error that occurred */
|
|
393
|
+
error: Error;
|
|
394
|
+
/** Expected log message */
|
|
395
|
+
expectedLogMessage: string;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Input for type inference test cases
|
|
399
|
+
*/
|
|
400
|
+
export interface TypeInferenceTestInput {
|
|
401
|
+
/** Value to infer type from */
|
|
402
|
+
value: unknown;
|
|
403
|
+
/** Expected type string */
|
|
404
|
+
expectedType: string;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Input for environment filter test cases
|
|
408
|
+
*/
|
|
409
|
+
export interface EnvironmentFilterTestInput {
|
|
410
|
+
/** Environment to filter by */
|
|
411
|
+
environment: string;
|
|
412
|
+
/** List of allowed environments */
|
|
413
|
+
allowedEnvironments: string[];
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Input for timestamp behavior test cases
|
|
417
|
+
*/
|
|
418
|
+
export interface TimestampTestInput {
|
|
419
|
+
/** Operation type */
|
|
420
|
+
operation: 'create' | 'update';
|
|
421
|
+
/** Description of expected timestamp behavior */
|
|
422
|
+
expectedTimestampBehavior: string;
|
|
423
|
+
}
|
|
424
|
+
export interface ModuleConfigurationTestInput {
|
|
425
|
+
config: Record<string, unknown>;
|
|
426
|
+
expectedConfig: Record<string, unknown>;
|
|
427
|
+
}
|
|
428
|
+
export interface ProviderTypeTestInput {
|
|
429
|
+
provider: string;
|
|
430
|
+
}
|
|
431
|
+
export interface FlagOperationTestInput<FeatureFlagKey> {
|
|
432
|
+
operation: 'create' | 'update' | 'delete' | 'evaluate';
|
|
433
|
+
flagKey: FeatureFlagKey;
|
|
434
|
+
data?: unknown;
|
|
435
|
+
context?: FeatureFlagContext;
|
|
436
|
+
expectedResult?: unknown;
|
|
437
|
+
}
|
|
438
|
+
export interface PermissionTestInput {
|
|
439
|
+
role: string;
|
|
440
|
+
operation: string;
|
|
441
|
+
resource: string;
|
|
442
|
+
expected: boolean;
|
|
443
|
+
}
|
|
444
|
+
export interface CacheOperationTestInput<FeatureFlagKey> {
|
|
445
|
+
operation: 'set' | 'get' | 'refresh' | 'clear';
|
|
446
|
+
flagKey?: FeatureFlagKey;
|
|
447
|
+
expectedBehavior: string;
|
|
448
|
+
}
|
|
449
|
+
export interface RuleEvaluationTestInput<FeatureFlagKey> {
|
|
450
|
+
flagKey: FeatureFlagKey;
|
|
451
|
+
rules: Array<{
|
|
452
|
+
conditions: Record<string, unknown>;
|
|
453
|
+
value: FeatureFlagValue;
|
|
454
|
+
}>;
|
|
455
|
+
context: FeatureFlagContext;
|
|
456
|
+
expectedValue: FeatureFlagValue;
|
|
457
|
+
}
|
|
458
|
+
export interface BatchOperationTestInput<FeatureFlagKey> {
|
|
459
|
+
operations: Array<{
|
|
460
|
+
type: 'create' | 'update' | 'delete';
|
|
461
|
+
flagKey: FeatureFlagKey;
|
|
462
|
+
data?: unknown;
|
|
463
|
+
}>;
|
|
464
|
+
expectedResults: unknown[];
|
|
465
|
+
}
|
|
466
|
+
export interface ValidationTestInput {
|
|
467
|
+
input: unknown;
|
|
468
|
+
field: string;
|
|
469
|
+
expectedError?: string;
|
|
470
|
+
isValid: boolean;
|
|
471
|
+
}
|
|
472
|
+
export interface DynamicModuleTestInput {
|
|
473
|
+
config: Record<string, unknown>;
|
|
474
|
+
expectedProviders?: string[];
|
|
475
|
+
expectedImports?: string[];
|
|
476
|
+
expectedExports?: string[];
|
|
477
|
+
}
|
|
478
|
+
export interface AsyncModuleConfigTestInput {
|
|
479
|
+
imports?: string[];
|
|
480
|
+
inject?: string[];
|
|
481
|
+
useFactory?: (...args: unknown[]) => Record<string, unknown>;
|
|
482
|
+
expectedImports?: string[];
|
|
483
|
+
expectedProviders?: string[];
|
|
484
|
+
}
|
|
485
|
+
export interface RepositoryOperationTestInput {
|
|
486
|
+
operation: 'create' | 'update' | 'delete' | 'find';
|
|
487
|
+
data?: unknown;
|
|
488
|
+
expectedResult?: unknown;
|
|
489
|
+
shouldThrow?: boolean;
|
|
490
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plyaz/types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"author": "Redeemer Pace",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"description": "Provides shared TypeScript types and schema utilities for validation and parsing in the @playz ecosystem.",
|
|
@@ -37,9 +37,10 @@
|
|
|
37
37
|
"@eslint/markdown": "^6.5.0",
|
|
38
38
|
"@nestjs/common": "^11.1.3",
|
|
39
39
|
"@next/eslint-plugin-next": "^15.0.3",
|
|
40
|
-
"@plyaz/devtools": "^1.
|
|
41
|
-
"@types/node": "^
|
|
40
|
+
"@plyaz/devtools": "^1.6.11",
|
|
41
|
+
"@types/node": "^22.14.0",
|
|
42
42
|
"@types/react": "^19.1.8",
|
|
43
|
+
"@types/react-dom": "^19.1.6",
|
|
43
44
|
"@typescript-eslint/eslint-plugin": "^8.15.0",
|
|
44
45
|
"@typescript-eslint/parser": "^8.15.0",
|
|
45
46
|
"@vitest/coverage-v8": "^3.1.3",
|