@plyaz/types 1.7.3 → 1.7.4
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
CHANGED
|
@@ -868,7 +868,7 @@ export interface WithLogging {
|
|
|
868
868
|
*/
|
|
869
869
|
export interface Refreshable {
|
|
870
870
|
/** When the entity was last updated/refreshed */
|
|
871
|
-
lastUpdated
|
|
871
|
+
lastUpdated?: Date | string | null;
|
|
872
872
|
/** Function to refresh the entity */
|
|
873
873
|
refresh: () => void | Promise<void>;
|
|
874
874
|
}
|
|
@@ -887,7 +887,7 @@ export interface Initializable {
|
|
|
887
887
|
/** Whether the entity has been initialized */
|
|
888
888
|
isInitialized: boolean;
|
|
889
889
|
/** Callback when entity is ready */
|
|
890
|
-
onReady
|
|
890
|
+
onReady?: () => void;
|
|
891
891
|
}
|
|
892
892
|
/**
|
|
893
893
|
* Base interface for entities with a single timestamp.
|
|
@@ -922,7 +922,7 @@ export interface Tracked<T = null | undefined> extends WithTimestamp {
|
|
|
922
922
|
/** Result of the operation */
|
|
923
923
|
result: T;
|
|
924
924
|
/** Error if the operation failed */
|
|
925
|
-
error: Error | null;
|
|
925
|
+
error: Error | null | undefined;
|
|
926
926
|
}
|
|
927
927
|
/**
|
|
928
928
|
* Base interface for entities with duration tracking.
|
|
@@ -1119,9 +1119,9 @@ export interface WithSessionId {
|
|
|
1119
1119
|
*/
|
|
1120
1120
|
export interface WithRetryTracking {
|
|
1121
1121
|
/** Current retry attempt count */
|
|
1122
|
-
retryCount
|
|
1122
|
+
retryCount?: number;
|
|
1123
1123
|
/** Maximum allowed retries */
|
|
1124
|
-
maxRetries
|
|
1124
|
+
maxRetries?: number;
|
|
1125
1125
|
/** retry delay in milliseconds */
|
|
1126
1126
|
retryDelay?: number;
|
|
1127
1127
|
}
|
|
@@ -1445,7 +1445,7 @@ export interface WithBody<T = unknown> {
|
|
|
1445
1445
|
* }
|
|
1446
1446
|
* ```
|
|
1447
1447
|
*/
|
|
1448
|
-
export interface WithError extends WithMessage {
|
|
1448
|
+
export interface WithError extends Partial<WithMessage> {
|
|
1449
1449
|
/** Error code for programmatic handling */
|
|
1450
1450
|
code?: string;
|
|
1451
1451
|
}
|
package/dist/events/types.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface Event<T> extends Identifiable, WithTimestamp, Partial<WithCorre
|
|
|
20
20
|
* Additional contextual data for an event.
|
|
21
21
|
* @description This is often populated with session/user data and retry tracking.
|
|
22
22
|
*/
|
|
23
|
-
export type EventMetadata = SetOptional<WithUserId & WithSessionId & WithUserAgent & WithRetryTracking & WithIpAddress, 'userId' | 'sessionId' | 'userAgent' | '
|
|
23
|
+
export type EventMetadata = SetOptional<WithUserId & WithSessionId & WithUserAgent & WithRetryTracking & WithIpAddress, 'userId' | 'sessionId' | 'userAgent' | 'ip'> & {
|
|
24
24
|
/**
|
|
25
25
|
* Additional metadata as key-value pairs.
|
|
26
26
|
*/
|
|
@@ -94,9 +94,9 @@ export interface CacheStrategy {
|
|
|
94
94
|
* Retrieves a cache entry.
|
|
95
95
|
*
|
|
96
96
|
* @param key - Cache key
|
|
97
|
-
* @returns Promise that resolves to cache entry or null if not found
|
|
97
|
+
* @returns Promise that resolves to cache entry or null/undefined if not found
|
|
98
98
|
*/
|
|
99
|
-
get<T>(key: string): Promise<CacheEntry<T> | null>;
|
|
99
|
+
get<T>(key: string): Promise<CacheEntry<T> | null | undefined>;
|
|
100
100
|
/**
|
|
101
101
|
* Removes a cache entry.
|
|
102
102
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @fileoverview Feature flags domain type definitions
|
|
7
7
|
* @version 1.0.0
|
|
8
8
|
*/
|
|
9
|
-
import type { UnknownRecord, UnknownArray, Arrayable,
|
|
9
|
+
import type { UnknownRecord, UnknownArray, Arrayable, SetOptional } from 'type-fest';
|
|
10
10
|
import type * as React from 'react';
|
|
11
11
|
import type { Describable, Timestamped, WithMetadata, Loadable, Authored, WithTags, WithEnvironment, Identifiable, Named, WithLogging, WithApiKey, Initializable, Refreshable, WithOperation, Enabled, WithError, KeyValuePair, WithUserId, WithCountry, Versioned, WithPlatform, WithPriority, ValidationResult } from '../../common/types';
|
|
12
12
|
/**
|
|
@@ -256,7 +256,7 @@ export interface FeatureFlagHelpers<FeatureFlagKey extends string = string> {
|
|
|
256
256
|
getMultipleFlags: (keys: FeatureFlagKey[], context?: FeatureFlagContext) => Promise<Record<FeatureFlagKey, FeatureFlagValue>>;
|
|
257
257
|
isAnyEnabled: (keys: FeatureFlagKey[], context?: FeatureFlagContext) => Promise<boolean>;
|
|
258
258
|
isAllEnabled: (keys: FeatureFlagKey[], context?: FeatureFlagContext) => Promise<boolean>;
|
|
259
|
-
whenEnabled: <T>(key: FeatureFlagKey, callback: () =>
|
|
259
|
+
whenEnabled: <T>(key: FeatureFlagKey, callback: () => T | Promise<T>, fallback?: () => T | Promise<T>, context?: FeatureFlagContext) => Promise<T | undefined>;
|
|
260
260
|
}
|
|
261
261
|
/**
|
|
262
262
|
* Response structure for fetching feature flag data.
|
|
@@ -2061,11 +2061,11 @@ export interface ConsoleMockParams {
|
|
|
2061
2061
|
storage: string[];
|
|
2062
2062
|
all: Array<{
|
|
2063
2063
|
type: string;
|
|
2064
|
-
args:
|
|
2064
|
+
args: unknown[];
|
|
2065
2065
|
}>;
|
|
2066
2066
|
originalFn: Function;
|
|
2067
2067
|
suppressTypes: string[];
|
|
2068
|
-
formatArguments: (args:
|
|
2068
|
+
formatArguments: (args: unknown[]) => string;
|
|
2069
2069
|
captureStackTrace?: boolean;
|
|
2070
2070
|
}
|
|
2071
2071
|
/**
|
|
@@ -540,7 +540,7 @@ export interface MockConsole {
|
|
|
540
540
|
* };
|
|
541
541
|
* ```
|
|
542
542
|
*/
|
|
543
|
-
export interface MockEnv extends KeyValueStore<string, string> {
|
|
543
|
+
export interface MockEnv extends Omit<KeyValueStore<string, string>, 'has'> {
|
|
544
544
|
restore: () => void;
|
|
545
545
|
}
|
|
546
546
|
/**
|
|
@@ -2611,7 +2611,8 @@ export interface MockNextRouterReturn {
|
|
|
2611
2611
|
* };
|
|
2612
2612
|
* ```
|
|
2613
2613
|
*/
|
|
2614
|
-
export interface MockNextRequest extends WithUrl, WithHttpMethod,
|
|
2614
|
+
export interface MockNextRequest extends WithUrl, WithHttpMethod, WithIpAddress, WithBody {
|
|
2615
|
+
headers: Headers;
|
|
2615
2616
|
searchParams?: Record<string, string>;
|
|
2616
2617
|
nextUrl: {
|
|
2617
2618
|
pathname: string;
|
|
@@ -3727,7 +3728,7 @@ export interface ApiAuthScenario {
|
|
|
3727
3728
|
export interface ApiRouteOptions extends Partial<WithUrl> {
|
|
3728
3729
|
method?: HttpMethod;
|
|
3729
3730
|
headers?: Record<string, Arrayable<string>>;
|
|
3730
|
-
query?: Record<string, Arrayable<string
|
|
3731
|
+
query?: Record<string, Arrayable<string> | undefined>;
|
|
3731
3732
|
body?: unknown;
|
|
3732
3733
|
cookies?: Record<string, string>;
|
|
3733
3734
|
}
|
package/package.json
CHANGED