@signal24/vue-foundation 4.18.1 → 4.19.0
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/src/helpers/openapi.d.ts +2 -2
- package/dist/vue-foundation.es.js +10 -10
- package/package.json +3 -3
- package/src/helpers/openapi.ts +12 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function
|
|
1
|
+
import { type OpenApiClient, type OpenApiClientOptions } from '@signal24/openapi-client-codegen/browser';
|
|
2
|
+
export declare function configureVfOpenApiClient(client: OpenApiClient, clientOptions: OpenApiClientOptions): void;
|
|
@@ -5,7 +5,7 @@ import { defineComponent as N, ref as T, computed as x, watch as F, onMounted as
|
|
|
5
5
|
import { compact as Ye, debounce as At, isEqual as Ke, startCase as Ft, upperFirst as Dt, cloneDeep as Ot, remove as $t, last as Bt } from "lodash";
|
|
6
6
|
import { escapeHtml as Vt } from "@vue/shared";
|
|
7
7
|
import { escapeHtml as Ro } from "@vue/shared";
|
|
8
|
-
import {
|
|
8
|
+
import { configureOpenApiClient as _t, OpenApiError as Nt } from "@signal24/openapi-client-codegen/browser";
|
|
9
9
|
import { format as fe } from "date-fns";
|
|
10
10
|
const Rt = {
|
|
11
11
|
key: 0,
|
|
@@ -918,14 +918,14 @@ function Do(e, t) {
|
|
|
918
918
|
n[o] === "" && (n[o] = null);
|
|
919
919
|
return n;
|
|
920
920
|
}
|
|
921
|
-
function Oo(e) {
|
|
922
|
-
_t({
|
|
923
|
-
...
|
|
924
|
-
onError(
|
|
925
|
-
var
|
|
926
|
-
Nt
|
|
927
|
-
const
|
|
928
|
-
return
|
|
921
|
+
function Oo(e, t) {
|
|
922
|
+
_t(e, {
|
|
923
|
+
...t,
|
|
924
|
+
onError(n, o) {
|
|
925
|
+
var l;
|
|
926
|
+
n instanceof Nt && n.response.status === 422 && typeof n.body == "object" && n.body && "error" in n.body && typeof n.body.error == "string" && (n = new oe(n.body.error));
|
|
927
|
+
const i = (l = t.onError) == null ? void 0 : l.call(t, n, o);
|
|
928
|
+
return i !== void 0 ? i : n;
|
|
929
929
|
}
|
|
930
930
|
});
|
|
931
931
|
}
|
|
@@ -1231,6 +1231,7 @@ export {
|
|
|
1231
1231
|
wn as VfSmartSelect,
|
|
1232
1232
|
Fo as cloneProp,
|
|
1233
1233
|
go as configureVf,
|
|
1234
|
+
Oo as configureVfOpenApiClient,
|
|
1234
1235
|
xo as createFilters,
|
|
1235
1236
|
ge as createOverlayInjection,
|
|
1236
1237
|
cn as desnakeCase,
|
|
@@ -1245,7 +1246,6 @@ export {
|
|
|
1245
1246
|
fn as formatUSCurrency,
|
|
1246
1247
|
wo as handleError,
|
|
1247
1248
|
Eo as handleErrorAndAlert,
|
|
1248
|
-
Oo as installApiClientInterceptors,
|
|
1249
1249
|
Vo as installVf,
|
|
1250
1250
|
ko as maskComponent,
|
|
1251
1251
|
Xt as maskEl,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signal24/vue-foundation",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.19.0",
|
|
5
5
|
"description": "Common components, directives, and helpers for Vue 3 apps",
|
|
6
6
|
"module": "./dist/vue-foundation.es.js",
|
|
7
7
|
"exports": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"uuid": "^11.0.3"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@signal24/openapi-client-codegen": "^
|
|
40
|
+
"@signal24/openapi-client-codegen": "^2.1.0",
|
|
41
41
|
"date-fns": "^3.0.6",
|
|
42
42
|
"lodash": "^4.17.21",
|
|
43
43
|
"vue": "^3.4.0"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@eslint/js": "9.14.0",
|
|
47
47
|
"@nabla/vite-plugin-eslint": "^2.0.4",
|
|
48
|
-
"@signal24/openapi-client-codegen": "^
|
|
48
|
+
"@signal24/openapi-client-codegen": "^2.1.0",
|
|
49
49
|
"@tsconfig/node22": "^22.0.0",
|
|
50
50
|
"@types/eslint__js": "^8.42.3",
|
|
51
51
|
"@types/jsdom": "^21.1.7",
|
package/src/helpers/openapi.ts
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { configureOpenApiClient, type OpenApiClient, type OpenApiClientOptions, OpenApiError } from '@signal24/openapi-client-codegen/browser';
|
|
2
2
|
|
|
3
3
|
import { UserError } from '.';
|
|
4
4
|
|
|
5
|
-
export function
|
|
6
|
-
|
|
5
|
+
export function configureVfOpenApiClient(client: OpenApiClient, clientOptions: OpenApiClientOptions) {
|
|
6
|
+
configureOpenApiClient(client, {
|
|
7
7
|
...clientOptions,
|
|
8
|
+
|
|
8
9
|
onError(err, options) {
|
|
9
|
-
if (
|
|
10
|
+
if (
|
|
11
|
+
err instanceof OpenApiError &&
|
|
12
|
+
err.response.status === 422 &&
|
|
13
|
+
typeof err.body === 'object' &&
|
|
14
|
+
err.body &&
|
|
15
|
+
'error' in err.body &&
|
|
16
|
+
typeof err.body.error === 'string'
|
|
17
|
+
) {
|
|
10
18
|
err = new UserError(err.body.error);
|
|
11
19
|
}
|
|
12
20
|
|