@igniter-js/caller 0.1.5 → 0.1.52
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/client/index.d.mts +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/index.d.mts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +6 -41
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -41
- package/dist/index.mjs.map +1 -1
- package/dist/{manager-CVi9utzy.d.ts → manager-DQcuAp3y.d.ts} +9 -4
- package/dist/{manager-DWvX2zsz.d.mts → manager-DXmJbnQY.d.mts} +9 -4
- package/package.json +1 -1
|
@@ -409,10 +409,15 @@ type IgniterCallerMockStatus<TSchemas extends IgniterCallerSchemaMap, TPath exte
|
|
|
409
409
|
* Prefers 200, then 201, then the first available status.
|
|
410
410
|
*/
|
|
411
411
|
type IgniterCallerMockDefaultStatus<TSchemas extends IgniterCallerSchemaMap, TPath extends SchemaMapPaths<TSchemas>, TMethod extends SchemaMapMethods<TSchemas, TPath>> = 200 extends IgniterCallerMockStatus<TSchemas, TPath, TMethod> ? 200 : 201 extends IgniterCallerMockStatus<TSchemas, TPath, TMethod> ? 201 : IgniterCallerMockStatus<TSchemas, TPath, TMethod>;
|
|
412
|
+
type IgniterCallerMockRequestBodyField<TSchemas extends IgniterCallerSchemaMap, TPath extends SchemaMapPaths<TSchemas>, TMethod extends SchemaMapMethods<TSchemas, TPath>> = [SchemaMapRequestType<TSchemas, TPath, TMethod>] extends [never] ? {
|
|
413
|
+
body?: undefined;
|
|
414
|
+
} : {
|
|
415
|
+
body: SchemaMapRequestType<TSchemas, TPath, TMethod>;
|
|
416
|
+
};
|
|
412
417
|
/**
|
|
413
418
|
* Full request context passed to mock handlers.
|
|
414
419
|
*/
|
|
415
|
-
|
|
420
|
+
type IgniterCallerMockRequest<TSchemas extends IgniterCallerSchemaMap, TPath extends SchemaMapPaths<TSchemas>, TMethod extends SchemaMapMethods<TSchemas, TPath>> = {
|
|
416
421
|
method: TMethod;
|
|
417
422
|
path: TPath;
|
|
418
423
|
url: string;
|
|
@@ -421,13 +426,12 @@ interface IgniterCallerMockRequest<TSchemas extends IgniterCallerSchemaMap, TPat
|
|
|
421
426
|
headers: Record<string, string>;
|
|
422
427
|
query: Record<string, string | number | boolean>;
|
|
423
428
|
params: EndpointInfo<TSchemas, TPath, TMethod>['params'];
|
|
424
|
-
body?: SchemaMapRequestType<TSchemas, TPath, TMethod>;
|
|
425
429
|
timeoutMs?: number;
|
|
426
430
|
cache?: RequestCache;
|
|
427
431
|
cacheKey?: string;
|
|
428
432
|
staleTime?: number;
|
|
429
433
|
responseTypeSchema?: StandardSchemaV1 | z.ZodSchema<any>;
|
|
430
|
-
}
|
|
434
|
+
} & IgniterCallerMockRequestBodyField<TSchemas, TPath, TMethod>;
|
|
431
435
|
/**
|
|
432
436
|
* Resolved mock handler for a given request path+method.
|
|
433
437
|
*/
|
|
@@ -494,6 +498,7 @@ type IgniterCallerMockRegistry<TSchemas extends IgniterCallerSchemaMap> = Partia
|
|
|
494
498
|
*/
|
|
495
499
|
interface IgniterCallerMockConfig<TSchemas extends IgniterCallerSchemaMap = IgniterCallerSchemaMap> {
|
|
496
500
|
enabled: boolean;
|
|
501
|
+
delay?: number;
|
|
497
502
|
mock: IIgniterCallerMockManager<TSchemas>;
|
|
498
503
|
}
|
|
499
504
|
|
|
@@ -1118,4 +1123,4 @@ declare class IgniterCallerManager<TSchemas extends IgniterCallerSchemaMap> impl
|
|
|
1118
1123
|
static emitEvent(url: string, method: string, result: IgniterCallerApiResponse<any>): Promise<void>;
|
|
1119
1124
|
}
|
|
1120
1125
|
|
|
1121
|
-
export { type
|
|
1126
|
+
export { type SchemaMapRequestType as $, IgniterCallerRequestBuilder as A, type IgniterCallerHttpMethod as B, type IgniterCallerBaseRequestOptions as C, type DeletePaths as D, type EndpointInfo as E, type IgniterCallerRequestOptions as F, type GetPaths as G, type HeadPaths as H, IgniterCallerManager as I, type IgniterCallerDirectRequestOptions as J, type IgniterCallerResponseContentType as K, type IgniterCallerValidatableContentType as L, type IgniterCallerResponseMarker as M, type IgniterCallerRetryOptions as N, type ExtractPathParams as O, type PostPaths as P, type InferRequestType as Q, type ResolveStatusKey as R, type SchemaArray as S, type TypedRequestBuilder as T, type InferResponseType as U, type InferSuccessResponseType as V, type InferAllResponseTypes as W, type SchemaMapMethods as X, type PathsForMethod as Y, type SchemaMapEndpoint as Z, type SchemaMapResponseType as _, type IgniterCallerApiResponse as a, type SchemaMapResponses as a0, type SchemaMapResponsesType as a1, type SchemaMapRequestSchema as a2, type SchemaMapResponseSchema as a3, type IgniterCallerSchemaInfer as a4, type IgniterCallerSchemaGetters as a5, type IgniterCallerSchemaInput as a6, type IgniterCallerSchemaMapFrom as a7, type IgniterCallerMockStatus as a8, type IgniterCallerMockDefaultStatus as a9, type IgniterCallerMockRequest as aa, type IgniterCallerMockResponseForStatus as ab, type IgniterCallerMockResponseDefault as ac, type IgniterCallerMockResponse as ad, type IgniterCallerMockHandler as ae, type IgniterCallerMockHandlerDefinition as af, type IgniterCallerBuilderState as ag, type IgniterCallerRequestBuilderParams as ah, type IgniterCallerMethodRequestBuilder as ai, type InferSuccessResponse as aj, type GetEndpoint as ak, type IIgniterCallerManager as al, type IgniterCallerSchemaMap as b, type IgniterCallerSchemaMethod as c, type InferResponse as d, type IgniterCallerTypedRequestBuilder as e, type PutPaths as f, type PatchPaths as g, type IgniterCallerUrlPattern as h, type IgniterCallerEventCallback as i, type IIgniterCallerMockManager as j, type IgniterCallerMockRegistry as k, type IgniterCallerMockResolvedHandler as l, type IgniterCallerRequestInterceptor as m, type IgniterCallerResponseInterceptor as n, type IgniterCallerSchemaValidationOptions as o, type IgniterCallerSchemaRegistry as p, type IgniterCallerSchemaBuildResult as q, type IgniterCallerMockConfig as r, type IgniterCallerEndpointSchema as s, type SchemaNullable as t, type SchemaOptional as u, type SchemaRecord as v, type IgniterCallerSchemaEndpointConfig as w, type SchemaMapPaths as x, type IgniterCallerMockPathDefinition as y, type IgniterCallerFileResponse as z };
|
|
@@ -409,10 +409,15 @@ type IgniterCallerMockStatus<TSchemas extends IgniterCallerSchemaMap, TPath exte
|
|
|
409
409
|
* Prefers 200, then 201, then the first available status.
|
|
410
410
|
*/
|
|
411
411
|
type IgniterCallerMockDefaultStatus<TSchemas extends IgniterCallerSchemaMap, TPath extends SchemaMapPaths<TSchemas>, TMethod extends SchemaMapMethods<TSchemas, TPath>> = 200 extends IgniterCallerMockStatus<TSchemas, TPath, TMethod> ? 200 : 201 extends IgniterCallerMockStatus<TSchemas, TPath, TMethod> ? 201 : IgniterCallerMockStatus<TSchemas, TPath, TMethod>;
|
|
412
|
+
type IgniterCallerMockRequestBodyField<TSchemas extends IgniterCallerSchemaMap, TPath extends SchemaMapPaths<TSchemas>, TMethod extends SchemaMapMethods<TSchemas, TPath>> = [SchemaMapRequestType<TSchemas, TPath, TMethod>] extends [never] ? {
|
|
413
|
+
body?: undefined;
|
|
414
|
+
} : {
|
|
415
|
+
body: SchemaMapRequestType<TSchemas, TPath, TMethod>;
|
|
416
|
+
};
|
|
412
417
|
/**
|
|
413
418
|
* Full request context passed to mock handlers.
|
|
414
419
|
*/
|
|
415
|
-
|
|
420
|
+
type IgniterCallerMockRequest<TSchemas extends IgniterCallerSchemaMap, TPath extends SchemaMapPaths<TSchemas>, TMethod extends SchemaMapMethods<TSchemas, TPath>> = {
|
|
416
421
|
method: TMethod;
|
|
417
422
|
path: TPath;
|
|
418
423
|
url: string;
|
|
@@ -421,13 +426,12 @@ interface IgniterCallerMockRequest<TSchemas extends IgniterCallerSchemaMap, TPat
|
|
|
421
426
|
headers: Record<string, string>;
|
|
422
427
|
query: Record<string, string | number | boolean>;
|
|
423
428
|
params: EndpointInfo<TSchemas, TPath, TMethod>['params'];
|
|
424
|
-
body?: SchemaMapRequestType<TSchemas, TPath, TMethod>;
|
|
425
429
|
timeoutMs?: number;
|
|
426
430
|
cache?: RequestCache;
|
|
427
431
|
cacheKey?: string;
|
|
428
432
|
staleTime?: number;
|
|
429
433
|
responseTypeSchema?: StandardSchemaV1 | z.ZodSchema<any>;
|
|
430
|
-
}
|
|
434
|
+
} & IgniterCallerMockRequestBodyField<TSchemas, TPath, TMethod>;
|
|
431
435
|
/**
|
|
432
436
|
* Resolved mock handler for a given request path+method.
|
|
433
437
|
*/
|
|
@@ -494,6 +498,7 @@ type IgniterCallerMockRegistry<TSchemas extends IgniterCallerSchemaMap> = Partia
|
|
|
494
498
|
*/
|
|
495
499
|
interface IgniterCallerMockConfig<TSchemas extends IgniterCallerSchemaMap = IgniterCallerSchemaMap> {
|
|
496
500
|
enabled: boolean;
|
|
501
|
+
delay?: number;
|
|
497
502
|
mock: IIgniterCallerMockManager<TSchemas>;
|
|
498
503
|
}
|
|
499
504
|
|
|
@@ -1118,4 +1123,4 @@ declare class IgniterCallerManager<TSchemas extends IgniterCallerSchemaMap> impl
|
|
|
1118
1123
|
static emitEvent(url: string, method: string, result: IgniterCallerApiResponse<any>): Promise<void>;
|
|
1119
1124
|
}
|
|
1120
1125
|
|
|
1121
|
-
export { type
|
|
1126
|
+
export { type SchemaMapRequestType as $, IgniterCallerRequestBuilder as A, type IgniterCallerHttpMethod as B, type IgniterCallerBaseRequestOptions as C, type DeletePaths as D, type EndpointInfo as E, type IgniterCallerRequestOptions as F, type GetPaths as G, type HeadPaths as H, IgniterCallerManager as I, type IgniterCallerDirectRequestOptions as J, type IgniterCallerResponseContentType as K, type IgniterCallerValidatableContentType as L, type IgniterCallerResponseMarker as M, type IgniterCallerRetryOptions as N, type ExtractPathParams as O, type PostPaths as P, type InferRequestType as Q, type ResolveStatusKey as R, type SchemaArray as S, type TypedRequestBuilder as T, type InferResponseType as U, type InferSuccessResponseType as V, type InferAllResponseTypes as W, type SchemaMapMethods as X, type PathsForMethod as Y, type SchemaMapEndpoint as Z, type SchemaMapResponseType as _, type IgniterCallerApiResponse as a, type SchemaMapResponses as a0, type SchemaMapResponsesType as a1, type SchemaMapRequestSchema as a2, type SchemaMapResponseSchema as a3, type IgniterCallerSchemaInfer as a4, type IgniterCallerSchemaGetters as a5, type IgniterCallerSchemaInput as a6, type IgniterCallerSchemaMapFrom as a7, type IgniterCallerMockStatus as a8, type IgniterCallerMockDefaultStatus as a9, type IgniterCallerMockRequest as aa, type IgniterCallerMockResponseForStatus as ab, type IgniterCallerMockResponseDefault as ac, type IgniterCallerMockResponse as ad, type IgniterCallerMockHandler as ae, type IgniterCallerMockHandlerDefinition as af, type IgniterCallerBuilderState as ag, type IgniterCallerRequestBuilderParams as ah, type IgniterCallerMethodRequestBuilder as ai, type InferSuccessResponse as aj, type GetEndpoint as ak, type IIgniterCallerManager as al, type IgniterCallerSchemaMap as b, type IgniterCallerSchemaMethod as c, type InferResponse as d, type IgniterCallerTypedRequestBuilder as e, type PutPaths as f, type PatchPaths as g, type IgniterCallerUrlPattern as h, type IgniterCallerEventCallback as i, type IIgniterCallerMockManager as j, type IgniterCallerMockRegistry as k, type IgniterCallerMockResolvedHandler as l, type IgniterCallerRequestInterceptor as m, type IgniterCallerResponseInterceptor as n, type IgniterCallerSchemaValidationOptions as o, type IgniterCallerSchemaRegistry as p, type IgniterCallerSchemaBuildResult as q, type IgniterCallerMockConfig as r, type IgniterCallerEndpointSchema as s, type SchemaNullable as t, type SchemaOptional as u, type SchemaRecord as v, type IgniterCallerSchemaEndpointConfig as w, type SchemaMapPaths as x, type IgniterCallerMockPathDefinition as y, type IgniterCallerFileResponse as z };
|
package/package.json
CHANGED