@povio/openapi-codegen-cli 3.2.0-rc.13 → 3.2.0-rc.14

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/index.d.mts CHANGED
@@ -7,6 +7,6 @@ import { i as QueryModule, n as InvalidationMapFunc, r as OpenApiQueryConfig, t
7
7
  import { t as RestUtils } from "./rest.utils-rezWAIYL.mjs";
8
8
  import { t as OpenAPICodegenConfig } from "./config-DgrOddSC.mjs";
9
9
  import { d as TransportResponse, l as TransportRequest, n as HttpError, p as UploadProgress, u as TransportRequestConfig } from "./rest-transport.types-DM5-qyOJ.mjs";
10
- import { n as NativeRestInterceptor, r as NativeRestClient, t as NativeInterceptor } from "./native-rest-interceptor-Cz6saoq5.mjs";
10
+ import { n as NativeRestInterceptor, r as NativeRestClient, t as NativeInterceptor } from "./native-rest-interceptor-PgziZt1f.mjs";
11
11
  import { a as AppQueryOptions, i as AppMutationOptions, n as useMutationEffects, r as AppInfiniteQueryOptions, t as MutationEffectsOptions } from "./useMutationEffects-DIdL8tlx.mjs";
12
12
  export { type AppInfiniteQueryOptions, type AppMutationOptions, type AppQueryOptions, ApplicationException, AuthContext, AuthGuard, type AuthGuardProps, type DomainErrorEntry, DomainErrorRegistry, type ErrorEntry, ErrorHandler, type ErrorHandlerOptions, type GeneralErrorCodes, type RestClient as IRestClient, type InvalidationMap, type InvalidationMapFunc, type MutationEffectsOptions, HttpError as NativeHttpError, type NativeInterceptor, type TransportRequest as NativeRequest, type TransportRequestConfig as NativeRequestConfig, type TransportResponse as NativeResponse, NativeRestClient, NativeRestInterceptor, type UploadProgress as NativeUploadProgress, OpenAPICodegenConfig, OpenApiQueryConfig, OpenApiRouter, OpenApiWorkspaceContext, type QueryModule, type RequestConfig, type RequestInfo, type Response, RestClient$1 as RestClient, RestInterceptor, RestUtils, SharedErrorHandler, type TranslateFunction, configureTranslations, ns, resources, useMutationEffects, useWorkspaceContext };
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import { i as resources, n as ns, t as configureTranslations } from "./i18n-D-Fe
2
2
  import { a as RestUtils, i as SharedErrorHandler, n as DomainErrorRegistry, r as ErrorHandler, t as ApplicationException } from "./error-handling-BeydPL7s.mjs";
3
3
  import { t as HttpError } from "./rest-transport.types-DxitRtsB.mjs";
4
4
  import { n as RestClient, t as RestInterceptor } from "./rest-interceptor-D5NCNTm1.mjs";
5
- import { n as NativeRestClient, t as NativeRestInterceptor } from "./native-rest-interceptor-CAWR8H5Y.mjs";
5
+ import { n as NativeRestClient, t as NativeRestInterceptor } from "./native-rest-interceptor-Bn_XbZ1y.mjs";
6
6
  import { t as OpenApiQueryConfig } from "./queryConfig.context-CldQ5YL9.mjs";
7
7
  import { t as useMutationEffects } from "./useMutationEffects-PB1fvKWM.mjs";
8
8
  import { t as OpenApiRouter } from "./router.context-EPlMBk3G.mjs";
@@ -3,12 +3,14 @@ import { z } from "zod";
3
3
  //#region src/lib/rest/native-rest-client.ts
4
4
  var NativeRestClient = class {
5
5
  interceptors;
6
- constructor({ config, interceptors = [] } = {}) {
6
+ errorHandler;
7
+ constructor({ config, interceptors = [], errorHandler } = {}) {
7
8
  this.baseURL = config?.baseURL ?? "";
8
9
  this.headers = config?.headers;
9
10
  this.credentials = config?.credentials;
10
11
  this.fetch = config?.fetch ?? globalThis.fetch.bind(globalThis);
11
12
  this.interceptors = [...interceptors];
13
+ this.errorHandler = errorHandler;
12
14
  }
13
15
  baseURL;
14
16
  headers;
@@ -84,7 +86,8 @@ var NativeRestClient = class {
84
86
  } : dataResult;
85
87
  } catch (error) {
86
88
  if (error instanceof z.ZodError) error.name = "BE Response schema mismatch - ZodError";
87
- throw await this.runErrorInterceptors(error);
89
+ const transformed = await this.runErrorInterceptors(error);
90
+ throw this.errorHandler ? this.errorHandler.rethrowError(transformed) : transformed;
88
91
  }
89
92
  }
90
93
  async execute(request, config = {}, applyInterceptors = true) {
@@ -1,9 +1,11 @@
1
+ import { a as ErrorHandler } from "./error-handling-LPEPQV1V.mjs";
1
2
  import { a as RestTransport, c as TransportFetch, d as TransportResponse, l as TransportRequest, o as RestTransportInterceptor, r as RestRequestInfo, s as TransportErrorContext, t as GeneralTransportErrorCode, u as TransportRequestConfig } from "./rest-transport.types-DM5-qyOJ.mjs";
2
3
  //#region src/lib/rest/native-rest-client.d.ts
3
4
  type NativeResult<T, IsRawRes extends boolean> = IsRawRes extends true ? TransportResponse<T> : T;
4
5
  declare class NativeRestClient implements RestTransport {
5
6
  private readonly interceptors;
6
- constructor({ config, interceptors }?: {
7
+ private readonly errorHandler?;
8
+ constructor({ config, interceptors, errorHandler }?: {
7
9
  config?: {
8
10
  baseURL?: string;
9
11
  headers?: HeadersInit;
@@ -11,6 +13,7 @@ declare class NativeRestClient implements RestTransport {
11
13
  fetch?: TransportFetch;
12
14
  };
13
15
  interceptors?: RestTransportInterceptor[];
16
+ errorHandler?: ErrorHandler<any>;
14
17
  });
15
18
  private readonly baseURL;
16
19
  private readonly headers?;
package/dist/native.d.mts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { a as RestTransport, d as TransportResponse, f as TransportResult, i as RestResponseType, l as TransportRequest, n as HttpError, o as RestTransportInterceptor, p as UploadProgress, r as RestRequestInfo, t as GeneralTransportErrorCode, u as TransportRequestConfig } from "./rest-transport.types-DM5-qyOJ.mjs";
2
- import { n as NativeRestInterceptor, r as NativeRestClient, t as NativeInterceptor } from "./native-rest-interceptor-Cz6saoq5.mjs";
2
+ import { n as NativeRestInterceptor, r as NativeRestClient, t as NativeInterceptor } from "./native-rest-interceptor-PgziZt1f.mjs";
3
3
  export { type GeneralTransportErrorCode, HttpError, HttpError as NativeHttpError, type NativeInterceptor, type TransportRequest as NativeRequest, type TransportRequest, type TransportRequestConfig as NativeRequestConfig, type TransportRequestConfig, type TransportResponse as NativeResponse, type TransportResponse, NativeRestClient, NativeRestInterceptor, type UploadProgress as NativeUploadProgress, type UploadProgress, type RestRequestInfo, type RestResponseType, type RestTransport, type RestTransportInterceptor, type TransportResult };
package/dist/native.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  import { t as HttpError } from "./rest-transport.types-DxitRtsB.mjs";
2
- import { n as NativeRestClient, t as NativeRestInterceptor } from "./native-rest-interceptor-CAWR8H5Y.mjs";
2
+ import { n as NativeRestClient, t as NativeRestInterceptor } from "./native-rest-interceptor-Bn_XbZ1y.mjs";
3
3
  export { HttpError, HttpError as NativeHttpError, NativeRestClient, NativeRestInterceptor };
package/dist/sh.mjs CHANGED
@@ -32,7 +32,7 @@ function logBanner(message) {
32
32
  * Fetch the version from package.json
33
33
  */
34
34
  function getVersion() {
35
- return "3.2.0-rc.13";
35
+ return "3.2.0-rc.14";
36
36
  }
37
37
  //#endregion
38
38
  //#region src/helpers/yargs.helper.ts
package/package.json CHANGED
@@ -186,5 +186,5 @@
186
186
  "node": ">= 18"
187
187
  },
188
188
  "packageManager": "bun@1.3.14",
189
- "version": "3.2.0-rc.13"
189
+ "version": "3.2.0-rc.14"
190
190
  }