@igniter-js/caller 0.1.51 → 0.1.53
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 +2 -39
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -39
- package/dist/index.mjs.map +1 -1
- package/dist/{manager-DCFeR1Pd.d.ts → manager-DQcuAp3y.d.ts} +2 -2
- package/dist/{manager-Dl9t7GDO.d.mts → manager-DXmJbnQY.d.mts} +2 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2156,42 +2156,10 @@ var IgniterCallerBuilder = class _IgniterCallerBuilder {
|
|
|
2156
2156
|
storeOptions: options
|
|
2157
2157
|
});
|
|
2158
2158
|
}
|
|
2159
|
-
/**
|
|
2160
|
-
* Configures schema-based type safety and validation.
|
|
2161
|
-
*
|
|
2162
|
-
* Enables automatic type inference for requests/responses based on
|
|
2163
|
-
* route and method, with optional runtime validation via StandardSchemaV1
|
|
2164
|
-
* (Zod is supported).
|
|
2165
|
-
*
|
|
2166
|
-
* @param schemas - Schema map keyed by URL path and method.
|
|
2167
|
-
* @param validation - Validation options for request/response checks.
|
|
2168
|
-
*
|
|
2169
|
-
* @example
|
|
2170
|
-
* ```ts
|
|
2171
|
-
* const api = IgniterCaller.create()
|
|
2172
|
-
* .withSchemas({
|
|
2173
|
-
* '/users': {
|
|
2174
|
-
* GET: {
|
|
2175
|
-
* responses: {
|
|
2176
|
-
* 200: z.array(UserSchema),
|
|
2177
|
-
* 401: ErrorSchema,
|
|
2178
|
-
* },
|
|
2179
|
-
* },
|
|
2180
|
-
* POST: {
|
|
2181
|
-
* request: CreateUserSchema,
|
|
2182
|
-
* responses: {
|
|
2183
|
-
* 201: UserSchema,
|
|
2184
|
-
* 400: ValidationErrorSchema,
|
|
2185
|
-
* },
|
|
2186
|
-
* },
|
|
2187
|
-
* },
|
|
2188
|
-
* })
|
|
2189
|
-
* .build()
|
|
2190
|
-
* ```
|
|
2191
|
-
*/
|
|
2192
2159
|
withSchemas(schemas, validation) {
|
|
2160
|
+
const { mock: _removedMock, ...stateWithoutMock } = this.state;
|
|
2193
2161
|
const nextState = {
|
|
2194
|
-
...
|
|
2162
|
+
...stateWithoutMock,
|
|
2195
2163
|
schemas,
|
|
2196
2164
|
schemaValidation: validation
|
|
2197
2165
|
};
|
|
@@ -2512,11 +2480,6 @@ var IgniterCallerMockBuilder = class _IgniterCallerMockBuilder {
|
|
|
2512
2480
|
static create() {
|
|
2513
2481
|
return new _IgniterCallerMockBuilder({ registry: {} });
|
|
2514
2482
|
}
|
|
2515
|
-
/**
|
|
2516
|
-
* Sets schemas to enable typed mock definitions.
|
|
2517
|
-
*
|
|
2518
|
-
* @param _schemas - Schema map or build result.
|
|
2519
|
-
*/
|
|
2520
2483
|
withSchemas(_schemas) {
|
|
2521
2484
|
return new _IgniterCallerMockBuilder({
|
|
2522
2485
|
registry: this.state.registry
|