@plyaz/types 1.7.29 → 1.7.30
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.
|
@@ -34,13 +34,15 @@ export type ErrorCategoryValue = (typeof ERROR_CATEGORY)[keyof typeof ERROR_CATE
|
|
|
34
34
|
/**
|
|
35
35
|
* Type alias for API error code values
|
|
36
36
|
* Use this instead of repeating the verbose (typeof API_ERROR_CODES)[keyof typeof API_ERROR_CODES]
|
|
37
|
+
* Also allows dynamic HTTP error codes in the form HTTP_${number}
|
|
37
38
|
*
|
|
38
39
|
* @example
|
|
39
40
|
* ```typescript
|
|
40
41
|
* const code: ApiErrorCodeValue = API_ERROR_CODES.NETWORK_ERROR;
|
|
42
|
+
* const dynamicCode: ApiErrorCodeValue = `HTTP_${404}`; // Also valid
|
|
41
43
|
* ```
|
|
42
44
|
*/
|
|
43
|
-
export type ApiErrorCodeValue = (typeof API_ERROR_CODES)[keyof typeof API_ERROR_CODES]
|
|
45
|
+
export type ApiErrorCodeValue = (typeof API_ERROR_CODES)[keyof typeof API_ERROR_CODES] | `HTTP_${number}`;
|
|
44
46
|
/**
|
|
45
47
|
* Type alias for package-specific status code values
|
|
46
48
|
* Custom status codes specific to @plyaz/api package (1xxx range)
|
|
@@ -490,6 +490,7 @@ export type HeaderPresetName = {
|
|
|
490
490
|
* ```
|
|
491
491
|
*/
|
|
492
492
|
export interface HeaderBuilderLike {
|
|
493
|
+
readonly headers: ApiHeaders;
|
|
493
494
|
auth(token: string, type?: AuthType): HeaderBuilderLike;
|
|
494
495
|
contentType(type: ContentType): HeaderBuilderLike;
|
|
495
496
|
accept(type: AcceptType): HeaderBuilderLike;
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { PRIORITY_LEVEL } from './enums';
|
|
5
5
|
import type { ConfigUpdateStrategy, DebuggerConfigSource } from '..';
|
|
6
|
+
/**
|
|
7
|
+
* Type alias for priority level values
|
|
8
|
+
*/
|
|
9
|
+
export type PriorityLevelValue = (typeof PRIORITY_LEVEL)[keyof typeof PRIORITY_LEVEL];
|
|
6
10
|
/**
|
|
7
11
|
* Processing strategy for queue operations
|
|
8
12
|
*/
|
|
@@ -13,7 +17,7 @@ export type ProcessingStrategy = 'immediate' | 'batch' | 'throttle' | 'debounce'
|
|
|
13
17
|
export interface QueueOperation<T = unknown> {
|
|
14
18
|
id: string;
|
|
15
19
|
timestamp: number;
|
|
16
|
-
priority?:
|
|
20
|
+
priority?: PriorityLevelValue;
|
|
17
21
|
data: T;
|
|
18
22
|
metadata?: Record<string, unknown>;
|
|
19
23
|
retryCount?: number;
|
|
@@ -77,7 +81,7 @@ export interface BaseOperation {
|
|
|
77
81
|
/**
|
|
78
82
|
* Operation priority detection function type
|
|
79
83
|
*/
|
|
80
|
-
export type PriorityDetector<T extends BaseOperation> = (operation: T) =>
|
|
84
|
+
export type PriorityDetector<T extends BaseOperation> = (operation: T) => PriorityLevelValue;
|
|
81
85
|
/**
|
|
82
86
|
* Source detection function type
|
|
83
87
|
*/
|
package/package.json
CHANGED