@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
package/dist/client/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as IgniterCallerManager, a as IgniterCallerApiResponse, b as IgniterCallerSchemaMap, c as IgniterCallerSchemaMethod, E as EndpointInfo, G as GetPaths, d as InferResponse, T as TypedRequestBuilder, e as IgniterCallerTypedRequestBuilder, P as PostPaths, f as PutPaths, g as PatchPaths, D as DeletePaths, H as HeadPaths } from '../manager-
|
|
1
|
+
import { I as IgniterCallerManager, a as IgniterCallerApiResponse, b as IgniterCallerSchemaMap, c as IgniterCallerSchemaMethod, E as EndpointInfo, G as GetPaths, d as InferResponse, T as TypedRequestBuilder, e as IgniterCallerTypedRequestBuilder, P as PostPaths, f as PutPaths, g as PatchPaths, D as DeletePaths, H as HeadPaths } from '../manager-DXmJbnQY.mjs';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { PropsWithChildren } from 'react';
|
|
4
4
|
import { IgniterError } from '@igniter-js/common';
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as IgniterCallerManager, a as IgniterCallerApiResponse, b as IgniterCallerSchemaMap, c as IgniterCallerSchemaMethod, E as EndpointInfo, G as GetPaths, d as InferResponse, T as TypedRequestBuilder, e as IgniterCallerTypedRequestBuilder, P as PostPaths, f as PutPaths, g as PatchPaths, D as DeletePaths, H as HeadPaths } from '../manager-
|
|
1
|
+
import { I as IgniterCallerManager, a as IgniterCallerApiResponse, b as IgniterCallerSchemaMap, c as IgniterCallerSchemaMethod, E as EndpointInfo, G as GetPaths, d as InferResponse, T as TypedRequestBuilder, e as IgniterCallerTypedRequestBuilder, P as PostPaths, f as PutPaths, g as PatchPaths, D as DeletePaths, H as HeadPaths } from '../manager-DQcuAp3y.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { PropsWithChildren } from 'react';
|
|
4
4
|
import { IgniterError } from '@igniter-js/common';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as IgniterCallerUrlPattern, i as IgniterCallerEventCallback, b as IgniterCallerSchemaMap, j as IIgniterCallerMockManager, k as IgniterCallerMockRegistry, c as IgniterCallerSchemaMethod, l as IgniterCallerMockResolvedHandler, m as IgniterCallerRequestInterceptor, n as IgniterCallerResponseInterceptor, o as
|
|
2
|
-
export { D as DeletePaths, E as EndpointInfo,
|
|
1
|
+
import { h as IgniterCallerUrlPattern, i as IgniterCallerEventCallback, b as IgniterCallerSchemaMap, j as IIgniterCallerMockManager, k as IgniterCallerMockRegistry, c as IgniterCallerSchemaMethod, l as IgniterCallerMockResolvedHandler, m as IgniterCallerRequestInterceptor, n as IgniterCallerResponseInterceptor, o as IgniterCallerSchemaValidationOptions, p as IgniterCallerSchemaRegistry, q as IgniterCallerSchemaBuildResult, r as IgniterCallerMockConfig, I as IgniterCallerManager, s as IgniterCallerEndpointSchema, S as SchemaArray, t as SchemaNullable, u as SchemaOptional, v as SchemaRecord, w as IgniterCallerSchemaEndpointConfig, x as SchemaMapPaths, y as IgniterCallerMockPathDefinition, a as IgniterCallerApiResponse, z as IgniterCallerFileResponse } from './manager-DXmJbnQY.mjs';
|
|
2
|
+
export { D as DeletePaths, E as EndpointInfo, O as ExtractPathParams, ak as GetEndpoint, G as GetPaths, H as HeadPaths, al as IIgniterCallerManager, C as IgniterCallerBaseRequestOptions, ag as IgniterCallerBuilderState, J as IgniterCallerDirectRequestOptions, B as IgniterCallerHttpMethod, ai as IgniterCallerMethodRequestBuilder, a9 as IgniterCallerMockDefaultStatus, ae as IgniterCallerMockHandler, af as IgniterCallerMockHandlerDefinition, aa as IgniterCallerMockRequest, ad as IgniterCallerMockResponse, ac as IgniterCallerMockResponseDefault, ab as IgniterCallerMockResponseForStatus, a8 as IgniterCallerMockStatus, A as IgniterCallerRequestBuilder, ah as IgniterCallerRequestBuilderParams, F as IgniterCallerRequestOptions, K as IgniterCallerResponseContentType, M as IgniterCallerResponseMarker, N as IgniterCallerRetryOptions, a5 as IgniterCallerSchemaGetters, a4 as IgniterCallerSchemaInfer, a6 as IgniterCallerSchemaInput, a7 as IgniterCallerSchemaMapFrom, e as IgniterCallerTypedRequestBuilder, L as IgniterCallerValidatableContentType, W as InferAllResponseTypes, Q as InferRequestType, d as InferResponse, U as InferResponseType, aj as InferSuccessResponse, V as InferSuccessResponseType, g as PatchPaths, Y as PathsForMethod, P as PostPaths, f as PutPaths, R as ResolveStatusKey, Z as SchemaMapEndpoint, X as SchemaMapMethods, a2 as SchemaMapRequestSchema, $ as SchemaMapRequestType, a3 as SchemaMapResponseSchema, _ as SchemaMapResponseType, a0 as SchemaMapResponses, a1 as SchemaMapResponsesType, T as TypedRequestBuilder } from './manager-DXmJbnQY.mjs';
|
|
3
3
|
import { IgniterLogger, StandardSchemaV1, IgniterError } from '@igniter-js/common';
|
|
4
4
|
import { IgniterTelemetryManager } from '@igniter-js/telemetry';
|
|
5
5
|
import { I as IgniterCallerStoreAdapter, a as IgniterCallerStoreOptions } from './store-D2p2dqGN.mjs';
|
|
@@ -176,7 +176,8 @@ declare class IgniterCallerBuilder<TSchemas extends IgniterCallerSchemaMap = Ign
|
|
|
176
176
|
* .build()
|
|
177
177
|
* ```
|
|
178
178
|
*/
|
|
179
|
-
withSchemas<TNewSchemas extends
|
|
179
|
+
withSchemas<TNewSchemas extends IgniterCallerSchemaMap>(schemas: TNewSchemas, validation?: IgniterCallerSchemaValidationOptions): IgniterCallerBuilder<TNewSchemas>;
|
|
180
|
+
withSchemas<TNewSchemas extends IgniterCallerSchemaMap, TRegistry extends IgniterCallerSchemaRegistry>(schemas: IgniterCallerSchemaBuildResult<TNewSchemas, TRegistry>, validation?: IgniterCallerSchemaValidationOptions): IgniterCallerBuilder<TNewSchemas>;
|
|
180
181
|
/**
|
|
181
182
|
* Attaches telemetry for request monitoring and observability.
|
|
182
183
|
*
|
|
@@ -359,7 +360,8 @@ declare class IgniterCallerMockBuilder<TSchemas extends IgniterCallerSchemaMap =
|
|
|
359
360
|
*
|
|
360
361
|
* @param _schemas - Schema map or build result.
|
|
361
362
|
*/
|
|
362
|
-
withSchemas<TNewSchemas extends
|
|
363
|
+
withSchemas<TNewSchemas extends IgniterCallerSchemaMap>(_schemas: TNewSchemas): IgniterCallerMockBuilder<TNewSchemas>;
|
|
364
|
+
withSchemas<TNewSchemas extends IgniterCallerSchemaMap, TRegistry extends IgniterCallerSchemaRegistry>(_schemas: IgniterCallerSchemaBuildResult<TNewSchemas, TRegistry>): IgniterCallerMockBuilder<TNewSchemas>;
|
|
363
365
|
/**
|
|
364
366
|
* Registers mock handlers for a path.
|
|
365
367
|
*
|
|
@@ -656,4 +658,4 @@ declare class IgniterCallerHttpMock {
|
|
|
656
658
|
static mockFileError(message?: string): IgniterCallerFileResponse;
|
|
657
659
|
}
|
|
658
660
|
|
|
659
|
-
export { IIgniterCallerMockManager, IgniterCaller, IgniterCallerApiResponse, IgniterCallerBodyUtils, IgniterCallerBuilder, IgniterCallerCacheUtils, IgniterCallerEndpointSchema, IgniterCallerError, type IgniterCallerErrorCode, type IgniterCallerErrorPayload, IgniterCallerEventCallback, IgniterCallerEvents, IgniterCallerFileResponse, IgniterCallerHttpMock, IgniterCallerManager, IgniterCallerMock, IgniterCallerMockBuilder, IgniterCallerMockConfig, IgniterCallerMockManager, IgniterCallerMockPathDefinition, IgniterCallerMockRegistry, IgniterCallerMockResolvedHandler, type IgniterCallerOperation, IgniterCallerRequestInterceptor, IgniterCallerResponseInterceptor, IgniterCallerSchema, IgniterCallerSchemaBuildResult, IgniterCallerSchemaEndpointConfig,
|
|
661
|
+
export { IIgniterCallerMockManager, IgniterCaller, IgniterCallerApiResponse, IgniterCallerBodyUtils, IgniterCallerBuilder, IgniterCallerCacheUtils, IgniterCallerEndpointSchema, IgniterCallerError, type IgniterCallerErrorCode, type IgniterCallerErrorPayload, IgniterCallerEventCallback, IgniterCallerEvents, IgniterCallerFileResponse, IgniterCallerHttpMock, IgniterCallerManager, IgniterCallerMock, IgniterCallerMockBuilder, IgniterCallerMockConfig, IgniterCallerMockManager, IgniterCallerMockPathDefinition, IgniterCallerMockRegistry, IgniterCallerMockResolvedHandler, type IgniterCallerOperation, IgniterCallerRequestInterceptor, IgniterCallerResponseInterceptor, IgniterCallerSchema, IgniterCallerSchemaBuildResult, IgniterCallerSchemaEndpointConfig, IgniterCallerSchemaMap, IgniterCallerSchemaMethod, IgniterCallerSchemaPathBuilder, IgniterCallerSchemaRegistry, IgniterCallerSchemaUtils, IgniterCallerSchemaValidationOptions, IgniterCallerStoreAdapter, IgniterCallerStoreOptions, IgniterCallerUrlPattern, IgniterCallerUrlUtils, SchemaArray, SchemaMapPaths, SchemaNullable, SchemaOptional, SchemaRecord };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as IgniterCallerUrlPattern, i as IgniterCallerEventCallback, b as IgniterCallerSchemaMap, j as IIgniterCallerMockManager, k as IgniterCallerMockRegistry, c as IgniterCallerSchemaMethod, l as IgniterCallerMockResolvedHandler, m as IgniterCallerRequestInterceptor, n as IgniterCallerResponseInterceptor, o as
|
|
2
|
-
export { D as DeletePaths, E as EndpointInfo,
|
|
1
|
+
import { h as IgniterCallerUrlPattern, i as IgniterCallerEventCallback, b as IgniterCallerSchemaMap, j as IIgniterCallerMockManager, k as IgniterCallerMockRegistry, c as IgniterCallerSchemaMethod, l as IgniterCallerMockResolvedHandler, m as IgniterCallerRequestInterceptor, n as IgniterCallerResponseInterceptor, o as IgniterCallerSchemaValidationOptions, p as IgniterCallerSchemaRegistry, q as IgniterCallerSchemaBuildResult, r as IgniterCallerMockConfig, I as IgniterCallerManager, s as IgniterCallerEndpointSchema, S as SchemaArray, t as SchemaNullable, u as SchemaOptional, v as SchemaRecord, w as IgniterCallerSchemaEndpointConfig, x as SchemaMapPaths, y as IgniterCallerMockPathDefinition, a as IgniterCallerApiResponse, z as IgniterCallerFileResponse } from './manager-DQcuAp3y.js';
|
|
2
|
+
export { D as DeletePaths, E as EndpointInfo, O as ExtractPathParams, ak as GetEndpoint, G as GetPaths, H as HeadPaths, al as IIgniterCallerManager, C as IgniterCallerBaseRequestOptions, ag as IgniterCallerBuilderState, J as IgniterCallerDirectRequestOptions, B as IgniterCallerHttpMethod, ai as IgniterCallerMethodRequestBuilder, a9 as IgniterCallerMockDefaultStatus, ae as IgniterCallerMockHandler, af as IgniterCallerMockHandlerDefinition, aa as IgniterCallerMockRequest, ad as IgniterCallerMockResponse, ac as IgniterCallerMockResponseDefault, ab as IgniterCallerMockResponseForStatus, a8 as IgniterCallerMockStatus, A as IgniterCallerRequestBuilder, ah as IgniterCallerRequestBuilderParams, F as IgniterCallerRequestOptions, K as IgniterCallerResponseContentType, M as IgniterCallerResponseMarker, N as IgniterCallerRetryOptions, a5 as IgniterCallerSchemaGetters, a4 as IgniterCallerSchemaInfer, a6 as IgniterCallerSchemaInput, a7 as IgniterCallerSchemaMapFrom, e as IgniterCallerTypedRequestBuilder, L as IgniterCallerValidatableContentType, W as InferAllResponseTypes, Q as InferRequestType, d as InferResponse, U as InferResponseType, aj as InferSuccessResponse, V as InferSuccessResponseType, g as PatchPaths, Y as PathsForMethod, P as PostPaths, f as PutPaths, R as ResolveStatusKey, Z as SchemaMapEndpoint, X as SchemaMapMethods, a2 as SchemaMapRequestSchema, $ as SchemaMapRequestType, a3 as SchemaMapResponseSchema, _ as SchemaMapResponseType, a0 as SchemaMapResponses, a1 as SchemaMapResponsesType, T as TypedRequestBuilder } from './manager-DQcuAp3y.js';
|
|
3
3
|
import { IgniterLogger, StandardSchemaV1, IgniterError } from '@igniter-js/common';
|
|
4
4
|
import { IgniterTelemetryManager } from '@igniter-js/telemetry';
|
|
5
5
|
import { I as IgniterCallerStoreAdapter, a as IgniterCallerStoreOptions } from './store-D2p2dqGN.js';
|
|
@@ -176,7 +176,8 @@ declare class IgniterCallerBuilder<TSchemas extends IgniterCallerSchemaMap = Ign
|
|
|
176
176
|
* .build()
|
|
177
177
|
* ```
|
|
178
178
|
*/
|
|
179
|
-
withSchemas<TNewSchemas extends
|
|
179
|
+
withSchemas<TNewSchemas extends IgniterCallerSchemaMap>(schemas: TNewSchemas, validation?: IgniterCallerSchemaValidationOptions): IgniterCallerBuilder<TNewSchemas>;
|
|
180
|
+
withSchemas<TNewSchemas extends IgniterCallerSchemaMap, TRegistry extends IgniterCallerSchemaRegistry>(schemas: IgniterCallerSchemaBuildResult<TNewSchemas, TRegistry>, validation?: IgniterCallerSchemaValidationOptions): IgniterCallerBuilder<TNewSchemas>;
|
|
180
181
|
/**
|
|
181
182
|
* Attaches telemetry for request monitoring and observability.
|
|
182
183
|
*
|
|
@@ -359,7 +360,8 @@ declare class IgniterCallerMockBuilder<TSchemas extends IgniterCallerSchemaMap =
|
|
|
359
360
|
*
|
|
360
361
|
* @param _schemas - Schema map or build result.
|
|
361
362
|
*/
|
|
362
|
-
withSchemas<TNewSchemas extends
|
|
363
|
+
withSchemas<TNewSchemas extends IgniterCallerSchemaMap>(_schemas: TNewSchemas): IgniterCallerMockBuilder<TNewSchemas>;
|
|
364
|
+
withSchemas<TNewSchemas extends IgniterCallerSchemaMap, TRegistry extends IgniterCallerSchemaRegistry>(_schemas: IgniterCallerSchemaBuildResult<TNewSchemas, TRegistry>): IgniterCallerMockBuilder<TNewSchemas>;
|
|
363
365
|
/**
|
|
364
366
|
* Registers mock handlers for a path.
|
|
365
367
|
*
|
|
@@ -656,4 +658,4 @@ declare class IgniterCallerHttpMock {
|
|
|
656
658
|
static mockFileError(message?: string): IgniterCallerFileResponse;
|
|
657
659
|
}
|
|
658
660
|
|
|
659
|
-
export { IIgniterCallerMockManager, IgniterCaller, IgniterCallerApiResponse, IgniterCallerBodyUtils, IgniterCallerBuilder, IgniterCallerCacheUtils, IgniterCallerEndpointSchema, IgniterCallerError, type IgniterCallerErrorCode, type IgniterCallerErrorPayload, IgniterCallerEventCallback, IgniterCallerEvents, IgniterCallerFileResponse, IgniterCallerHttpMock, IgniterCallerManager, IgniterCallerMock, IgniterCallerMockBuilder, IgniterCallerMockConfig, IgniterCallerMockManager, IgniterCallerMockPathDefinition, IgniterCallerMockRegistry, IgniterCallerMockResolvedHandler, type IgniterCallerOperation, IgniterCallerRequestInterceptor, IgniterCallerResponseInterceptor, IgniterCallerSchema, IgniterCallerSchemaBuildResult, IgniterCallerSchemaEndpointConfig,
|
|
661
|
+
export { IIgniterCallerMockManager, IgniterCaller, IgniterCallerApiResponse, IgniterCallerBodyUtils, IgniterCallerBuilder, IgniterCallerCacheUtils, IgniterCallerEndpointSchema, IgniterCallerError, type IgniterCallerErrorCode, type IgniterCallerErrorPayload, IgniterCallerEventCallback, IgniterCallerEvents, IgniterCallerFileResponse, IgniterCallerHttpMock, IgniterCallerManager, IgniterCallerMock, IgniterCallerMockBuilder, IgniterCallerMockConfig, IgniterCallerMockManager, IgniterCallerMockPathDefinition, IgniterCallerMockRegistry, IgniterCallerMockResolvedHandler, type IgniterCallerOperation, IgniterCallerRequestInterceptor, IgniterCallerResponseInterceptor, IgniterCallerSchema, IgniterCallerSchemaBuildResult, IgniterCallerSchemaEndpointConfig, IgniterCallerSchemaMap, IgniterCallerSchemaMethod, IgniterCallerSchemaPathBuilder, IgniterCallerSchemaRegistry, IgniterCallerSchemaUtils, IgniterCallerSchemaValidationOptions, IgniterCallerStoreAdapter, IgniterCallerStoreOptions, IgniterCallerUrlPattern, IgniterCallerUrlUtils, SchemaArray, SchemaMapPaths, SchemaNullable, SchemaOptional, SchemaRecord };
|
package/dist/index.js
CHANGED
|
@@ -1419,8 +1419,9 @@ var IgniterCallerRequestBuilder = class {
|
|
|
1419
1419
|
resolved.handler,
|
|
1420
1420
|
mockRequest
|
|
1421
1421
|
);
|
|
1422
|
-
|
|
1423
|
-
|
|
1422
|
+
const delayMs = response.delayMs ?? this.mock?.delay;
|
|
1423
|
+
if (delayMs && delayMs > 0) {
|
|
1424
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
1424
1425
|
}
|
|
1425
1426
|
const status = response.status;
|
|
1426
1427
|
const headers = new Headers(response.headers);
|
|
@@ -2157,46 +2158,15 @@ var IgniterCallerBuilder = class _IgniterCallerBuilder {
|
|
|
2157
2158
|
storeOptions: options
|
|
2158
2159
|
});
|
|
2159
2160
|
}
|
|
2160
|
-
/**
|
|
2161
|
-
* Configures schema-based type safety and validation.
|
|
2162
|
-
*
|
|
2163
|
-
* Enables automatic type inference for requests/responses based on
|
|
2164
|
-
* route and method, with optional runtime validation via StandardSchemaV1
|
|
2165
|
-
* (Zod is supported).
|
|
2166
|
-
*
|
|
2167
|
-
* @param schemas - Schema map keyed by URL path and method.
|
|
2168
|
-
* @param validation - Validation options for request/response checks.
|
|
2169
|
-
*
|
|
2170
|
-
* @example
|
|
2171
|
-
* ```ts
|
|
2172
|
-
* const api = IgniterCaller.create()
|
|
2173
|
-
* .withSchemas({
|
|
2174
|
-
* '/users': {
|
|
2175
|
-
* GET: {
|
|
2176
|
-
* responses: {
|
|
2177
|
-
* 200: z.array(UserSchema),
|
|
2178
|
-
* 401: ErrorSchema,
|
|
2179
|
-
* },
|
|
2180
|
-
* },
|
|
2181
|
-
* POST: {
|
|
2182
|
-
* request: CreateUserSchema,
|
|
2183
|
-
* responses: {
|
|
2184
|
-
* 201: UserSchema,
|
|
2185
|
-
* 400: ValidationErrorSchema,
|
|
2186
|
-
* },
|
|
2187
|
-
* },
|
|
2188
|
-
* },
|
|
2189
|
-
* })
|
|
2190
|
-
* .build()
|
|
2191
|
-
* ```
|
|
2192
|
-
*/
|
|
2193
2161
|
withSchemas(schemas, validation) {
|
|
2194
2162
|
const nextState = {
|
|
2195
2163
|
...this.state,
|
|
2196
2164
|
schemas,
|
|
2197
2165
|
schemaValidation: validation
|
|
2198
2166
|
};
|
|
2199
|
-
return new _IgniterCallerBuilder(
|
|
2167
|
+
return new _IgniterCallerBuilder(
|
|
2168
|
+
nextState
|
|
2169
|
+
);
|
|
2200
2170
|
}
|
|
2201
2171
|
/**
|
|
2202
2172
|
* Attaches telemetry for request monitoring and observability.
|
|
@@ -2513,11 +2483,6 @@ var IgniterCallerMockBuilder = class _IgniterCallerMockBuilder {
|
|
|
2513
2483
|
static create() {
|
|
2514
2484
|
return new _IgniterCallerMockBuilder({ registry: {} });
|
|
2515
2485
|
}
|
|
2516
|
-
/**
|
|
2517
|
-
* Sets schemas to enable typed mock definitions.
|
|
2518
|
-
*
|
|
2519
|
-
* @param _schemas - Schema map or build result.
|
|
2520
|
-
*/
|
|
2521
2486
|
withSchemas(_schemas) {
|
|
2522
2487
|
return new _IgniterCallerMockBuilder({
|
|
2523
2488
|
registry: this.state.registry
|