@plyaz/types 1.7.20 → 1.7.22

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.
@@ -2,8 +2,11 @@
2
2
  * API Client Types
3
3
  * Defines the client interface and options
4
4
  */
5
+ import type { ApiHandlerMethods } from 'fetchff';
5
6
  import type { ApiConfig } from '../config';
6
7
  import type { ConfigUpdateStrategy, HandlerStrategy } from '../events';
8
+ import type { EndpointTypes } from '../endpoints';
9
+ import type { UnknownRecord } from 'type-fest';
7
10
  /**
8
11
  * Options for creating an API client
9
12
  * Endpoints are automatically included from src/api/endpoints
@@ -23,14 +26,14 @@ import type { ConfigUpdateStrategy, HandlerStrategy } from '../events';
23
26
  *
24
27
  * Note: ApiConfig is imported from config/types, not defined here to avoid circular dependencies
25
28
  */
26
- export type ApiClientOptions = Record<string, unknown>;
29
+ export type ApiClientOptions = ApiConfig;
27
30
  /**
28
31
  * API client instance with full TypeScript support
29
32
  * The client IS the fetchff instance with all endpoint methods
30
33
  *
31
34
  * Note: Full type definition requires EndpointTypes and endpoints from api package
32
35
  */
33
- export type ApiClientInstance = Record<string, unknown>;
36
+ export type ApiClientInstance<EndpointsList = UnknownRecord> = ApiHandlerMethods<EndpointTypes, EndpointsList>;
34
37
  /**
35
38
  * Event handler registration options
36
39
  */
@@ -1,5 +1,12 @@
1
+ import type { CampaignEndpointTypes } from './campaigns';
2
+ import type { PollingEndpointTypes } from './health';
1
3
  /**
2
4
  * Query parameters type - matches fetchff's flexible param handling
3
5
  * Supports objects, URLSearchParams, and arrays of name-value pairs
4
6
  */
5
7
  export type QueryParams = Record<string, string | number | boolean | string[] | number[]> | URLSearchParams | Array<[string, string]>;
8
+ /**
9
+ * All endpoint types combined
10
+ */
11
+ export interface EndpointTypes extends CampaignEndpointTypes, PollingEndpointTypes {
12
+ }
@@ -157,7 +157,7 @@ export interface HeaderValidationResult {
157
157
  /**
158
158
  * Build enriched context headers from request context
159
159
  */
160
- export interface RequestContext {
160
+ export interface RequestContext<EndpointsList> {
161
161
  request?: {
162
162
  headers?: Record<string, string | string[] | undefined>;
163
163
  ip?: string;
@@ -165,7 +165,7 @@ export interface RequestContext {
165
165
  url?: string;
166
166
  [key: string]: unknown;
167
167
  };
168
- clientContext?: ApiClientInstance;
168
+ clientContext?: ApiClientInstance<EndpointsList>;
169
169
  [key: string]: unknown;
170
170
  }
171
171
  /**
@@ -1,10 +1,4 @@
1
- import type { WithUuid, WithExpiration, WithAuthTokens } from '../common/types';
2
- /**
3
- * Represents a simplified user model.
4
- * @description Typically used for identification purposes within auth or session logic.
5
- */
6
- export interface User extends WithUuid {
7
- }
1
+ import type { WithExpiration, WithAuthTokens } from '../common/types';
8
2
  /**
9
3
  * AuthToken Interface.
10
4
  * @description Represents an authentication token set returned after a successful login or refresh.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plyaz/types",
3
- "version": "1.7.20",
3
+ "version": "1.7.22",
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.",