@vesperjs/nuxt 0.3.0 → 0.3.2
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.
|
@@ -2,7 +2,7 @@ export type { QueryAPIOptions } from './api'
|
|
|
2
2
|
|
|
3
3
|
export { createFetch, createRequestFetch, useOFetch, useMutationApi, useQueryApi } from './api'
|
|
4
4
|
|
|
5
|
-
export { useAlert } from './use-
|
|
5
|
+
export { useApiError, useAlert } from './use-api-error'
|
|
6
6
|
export { useExternalErrors } from './error'
|
|
7
7
|
|
|
8
|
-
export type { UseAlertType } from './use-
|
|
8
|
+
export type { UseApiErrorType, UseAlertType } from './use-api-error'
|
|
@@ -15,20 +15,20 @@ import type {
|
|
|
15
15
|
|
|
16
16
|
import { useBackendErrorInfo } from './error'
|
|
17
17
|
|
|
18
|
-
interface
|
|
18
|
+
interface UseApiErrorOptions {
|
|
19
19
|
flash: Ref<Flash>
|
|
20
|
-
caller?:
|
|
20
|
+
caller?: UseApiErrorCallerType
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
interface
|
|
23
|
+
interface UseApiErrorCallerType {
|
|
24
24
|
externalErrors?: Ref<ErrorMessages<string>>
|
|
25
25
|
clearAccount?: () => void
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export const
|
|
28
|
+
export const useApiError = function <BER extends object = BackendErrorResource>({
|
|
29
29
|
flash,
|
|
30
30
|
caller,
|
|
31
|
-
}:
|
|
31
|
+
}: UseApiErrorOptions): {
|
|
32
32
|
backendErrorInfo: Ref<BackendErrorInfo<BER>, BER>
|
|
33
33
|
setError: (
|
|
34
34
|
error:
|
|
@@ -91,4 +91,7 @@ export const useAlert = function <BER extends object = BackendErrorResource>({
|
|
|
91
91
|
return { backendErrorInfo, setError }
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
export
|
|
94
|
+
export const useAlert = useApiError
|
|
95
|
+
|
|
96
|
+
export type UseApiErrorType = ReturnType<typeof useApiError>
|
|
97
|
+
export type UseAlertType = UseApiErrorType
|
package/app/composables/index.ts
CHANGED
|
@@ -3,8 +3,8 @@ export { useEntity, useFlash } from '@vesperjs/shared'
|
|
|
3
3
|
export type { QueryAPIOptions } from './backend'
|
|
4
4
|
|
|
5
5
|
export { createFetch, createRequestFetch, useOFetch, useMutationApi, useQueryApi } from './backend'
|
|
6
|
-
export { useExternalErrors, useAlert } from './backend'
|
|
6
|
+
export { useExternalErrors, useApiError, useAlert } from './backend'
|
|
7
7
|
|
|
8
8
|
export { useDate } from './util'
|
|
9
9
|
|
|
10
|
-
export type { UseAlertType } from './backend'
|
|
10
|
+
export type { UseApiErrorType, UseAlertType } from './backend'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vesperjs/nuxt",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"nuxt",
|
|
6
6
|
"vue.js"
|
|
@@ -21,19 +21,19 @@
|
|
|
21
21
|
"main": "./nuxt.config.ts",
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@formkit/tempo": "^1.0.0",
|
|
24
|
-
"@nuxt/eslint": "
|
|
24
|
+
"@nuxt/eslint": "1.15.2",
|
|
25
25
|
"@nuxtjs/i18n": "^10.2.4",
|
|
26
26
|
"@types/node": "^24.12.2",
|
|
27
|
-
"@vesperjs/shared": "0.3.
|
|
28
|
-
"eslint": "^10.2.
|
|
27
|
+
"@vesperjs/shared": "0.3.2",
|
|
28
|
+
"eslint": "^10.2.1",
|
|
29
29
|
"eslint-typegen": "2.3.1",
|
|
30
30
|
"nuxt": "^4.3.1",
|
|
31
31
|
"ofetch": "^1.5.1",
|
|
32
|
-
"oxfmt": "^0.
|
|
33
|
-
"typescript": "^6.0.
|
|
32
|
+
"oxfmt": "^0.46.0",
|
|
33
|
+
"typescript": "^6.0.3"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"vue": "^3.5.
|
|
36
|
+
"vue": "^3.5.33 || ^3.6.0-beta.10"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"dev": "nuxi dev .playground",
|