@enfyra/sdk-nuxt 0.3.17 → 0.3.19
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/composables/useEnfyraApi.d.ts +8 -0
- package/dist/composables/useEnfyraApi.d.ts.map +1 -0
- package/dist/composables/useEnfyraApi.js +363 -0
- package/dist/composables/useEnfyraApi.mjs +345 -0
- package/dist/composables/useEnfyraAuth.d.ts +89 -0
- package/dist/composables/useEnfyraAuth.d.ts.map +1 -0
- package/dist/composables/useEnfyraAuth.js +77 -0
- package/dist/composables/useEnfyraAuth.mjs +81 -0
- package/dist/constants/auth.d.ts +0 -0
- package/dist/constants/auth.mjs +3 -0
- package/dist/constants/config.d.ts +2 -0
- package/dist/constants/config.d.ts.map +1 -0
- package/dist/constants/config.js +1 -0
- package/dist/constants/config.mjs +1 -0
- package/dist/module.cjs +82 -0
- package/dist/module.d.cts +10 -0
- package/dist/module.d.mts +10 -0
- package/dist/module.d.ts +10 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +79 -0
- package/dist/runtime/plugin/config-error.client.d.ts +0 -0
- package/dist/runtime/plugin/config-error.client.js +107 -0
- package/dist/runtime/plugin/config-error.client.mjs +107 -0
- package/dist/runtime/server/api/all.d.ts +0 -0
- package/dist/runtime/server/api/all.js +5 -0
- package/dist/runtime/server/api/all.mjs +5 -0
- package/dist/runtime/server/api/login.post.d.ts +0 -0
- package/dist/runtime/server/api/login.post.js +62 -0
- package/dist/runtime/server/api/login.post.mjs +62 -0
- package/dist/runtime/server/api/logout.post.d.ts +0 -0
- package/dist/runtime/server/api/logout.post.js +35 -0
- package/dist/runtime/server/api/logout.post.mjs +35 -0
- package/dist/runtime/server/middleware/auth.d.ts +0 -0
- package/dist/runtime/server/middleware/auth.js +36 -0
- package/dist/runtime/server/middleware/auth.mjs +36 -0
- package/dist/types/auth.d.ts +43 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +1 -0
- package/dist/types/index.d.ts +141 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types.d.mts +7 -0
- package/dist/types.d.ts +7 -0
- package/dist/utils/config.d.ts +0 -0
- package/dist/utils/config.mjs +16 -0
- package/dist/utils/http.d.ts +8 -0
- package/dist/utils/http.d.ts.map +1 -0
- package/dist/utils/http.js +57 -0
- package/dist/utils/http.mjs +61 -0
- package/dist/utils/server/proxy.d.ts +0 -0
- package/dist/utils/server/proxy.mjs +14 -0
- package/dist/utils/server/refreshToken.d.ts +0 -0
- package/dist/utils/server/refreshToken.mjs +69 -0
- package/dist/utils/url.d.ts +12 -0
- package/dist/utils/url.d.ts.map +1 -0
- package/dist/utils/url.js +77 -0
- package/dist/utils/url.mjs +56 -0
- package/index.ts +1 -1
- package/module.d.ts +2 -2
- package/package.json +25 -22
- package/src/composables/useEnfyraAuth.ts +1 -1
- package/{module.ts → src/module.ts} +9 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enfyra/sdk-nuxt",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.19",
|
|
4
4
|
"description": "Nuxt SDK for Enfyra CMS",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,12 +10,13 @@
|
|
|
10
10
|
"url": "https://github.com/dothinh115/enfyra-sdk-nuxt/issues"
|
|
11
11
|
},
|
|
12
12
|
"homepage": "https://github.com/dothinh115/enfyra-sdk-nuxt#readme",
|
|
13
|
-
"main": "./module.
|
|
14
|
-
"types": "./
|
|
13
|
+
"main": "./dist/module.mjs",
|
|
14
|
+
"types": "./dist/types.d.ts",
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
|
-
"
|
|
18
|
-
"
|
|
17
|
+
"import": "./dist/module.mjs",
|
|
18
|
+
"require": "./dist/module.cjs",
|
|
19
|
+
"types": "./dist/types.d.ts"
|
|
19
20
|
},
|
|
20
21
|
"./src/composables/useEnfyraApi": {
|
|
21
22
|
"types": "./src/composables/useEnfyraApi.ts",
|
|
@@ -25,24 +26,16 @@
|
|
|
25
26
|
"types": "./src/composables/useEnfyraAuth.ts",
|
|
26
27
|
"import": "./src/composables/useEnfyraAuth.ts"
|
|
27
28
|
},
|
|
28
|
-
"./
|
|
29
|
-
"types": "./
|
|
30
|
-
"import": "./
|
|
31
|
-
}
|
|
32
|
-
"./src/runtime/server/api/all": "./src/runtime/server/api/all.ts",
|
|
33
|
-
"./src/runtime/server/api/all.ts": "./src/runtime/server/api/all.ts",
|
|
34
|
-
"./src/runtime/server/api/login.post": "./src/runtime/server/api/login.post.ts",
|
|
35
|
-
"./src/runtime/server/api/login.post.ts": "./src/runtime/server/api/login.post.ts",
|
|
36
|
-
"./src/runtime/server/api/logout.post": "./src/runtime/server/api/logout.post.ts",
|
|
37
|
-
"./src/runtime/server/api/logout.post.ts": "./src/runtime/server/api/logout.post.ts",
|
|
38
|
-
"./src/runtime/server/middleware/auth": "./src/runtime/server/middleware/auth.ts",
|
|
39
|
-
"./src/runtime/server/middleware/auth.ts": "./src/runtime/server/middleware/auth.ts"
|
|
29
|
+
"./types": {
|
|
30
|
+
"types": "./dist/types/index.d.ts",
|
|
31
|
+
"import": "./dist/types/index.js"
|
|
32
|
+
}
|
|
40
33
|
},
|
|
41
34
|
"files": [
|
|
42
|
-
"
|
|
35
|
+
"dist/",
|
|
36
|
+
"src/",
|
|
43
37
|
"module.d.ts",
|
|
44
|
-
"index.ts"
|
|
45
|
-
"src/**/*"
|
|
38
|
+
"index.ts"
|
|
46
39
|
],
|
|
47
40
|
"keywords": [
|
|
48
41
|
"nuxt",
|
|
@@ -56,7 +49,12 @@
|
|
|
56
49
|
"access": "public"
|
|
57
50
|
},
|
|
58
51
|
"scripts": {
|
|
59
|
-
"
|
|
52
|
+
"dev": "nuxi dev playground",
|
|
53
|
+
"build": "nuxt-module-build build && npx tsc -p tsconfig.build.json",
|
|
54
|
+
"prepack": "nuxt-module-build build && npx tsc -p tsconfig.build.json",
|
|
55
|
+
"test": "vitest",
|
|
56
|
+
"test:ui": "vitest --ui",
|
|
57
|
+
"test:run": "vitest run"
|
|
60
58
|
},
|
|
61
59
|
"peerDependencies": {
|
|
62
60
|
"@nuxt/kit": "^3.18.1",
|
|
@@ -67,8 +65,13 @@
|
|
|
67
65
|
"ofetch": "^1.3.3"
|
|
68
66
|
},
|
|
69
67
|
"devDependencies": {
|
|
68
|
+
"@nuxt/module-builder": "^0.8.4",
|
|
70
69
|
"@types/node": "^24.10.1",
|
|
70
|
+
"@vitest/ui": "^3.2.4",
|
|
71
71
|
"nuxt": "^3.18.1",
|
|
72
|
-
"typescript": "^5.0.0"
|
|
72
|
+
"typescript": "^5.0.0",
|
|
73
|
+
"vite": "^6.0.7",
|
|
74
|
+
"vite-plugin-dts": "^4.3.0",
|
|
75
|
+
"vitest": "^3.2.4"
|
|
73
76
|
}
|
|
74
77
|
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
addImportsDir,
|
|
6
6
|
addPlugin,
|
|
7
7
|
} from "@nuxt/kit";
|
|
8
|
-
import { ENFYRA_API_PREFIX } from "./
|
|
8
|
+
import { ENFYRA_API_PREFIX } from "./constants/config";
|
|
9
9
|
|
|
10
10
|
export interface ModuleOptions {
|
|
11
11
|
apiUrl: string;
|
|
@@ -65,46 +65,45 @@ export default defineNuxtModule<ModuleOptions>({
|
|
|
65
65
|
|
|
66
66
|
if (!normalizedOptions.apiUrl) {
|
|
67
67
|
addPlugin({
|
|
68
|
-
src: resolve("./
|
|
68
|
+
src: resolve("./runtime/plugin/config-error.client"),
|
|
69
69
|
mode: 'client'
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
addImportsDir(resolve("./
|
|
73
|
+
addImportsDir(resolve("./composables"));
|
|
74
74
|
|
|
75
75
|
nuxt.hook('prepare:types', ({ declarations, references }: any) => {
|
|
76
76
|
references.push({
|
|
77
|
-
path: resolve('./
|
|
77
|
+
path: resolve('./types/nuxt-imports.d.ts'),
|
|
78
78
|
})
|
|
79
79
|
})
|
|
80
80
|
|
|
81
81
|
addServerHandler({
|
|
82
|
-
handler:
|
|
82
|
+
handler: resolve("./runtime/server/middleware/auth"),
|
|
83
83
|
middleware: true,
|
|
84
84
|
});
|
|
85
85
|
|
|
86
86
|
addServerHandler({
|
|
87
87
|
route: `${apiPrefix}/login`,
|
|
88
|
-
handler:
|
|
88
|
+
handler: resolve("./runtime/server/api/login.post"),
|
|
89
89
|
method: "post",
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
addServerHandler({
|
|
93
93
|
route: `${apiPrefix}/logout`,
|
|
94
|
-
handler:
|
|
94
|
+
handler: resolve("./runtime/server/api/logout.post"),
|
|
95
95
|
method: "post",
|
|
96
96
|
});
|
|
97
97
|
|
|
98
98
|
|
|
99
99
|
addServerHandler({
|
|
100
100
|
route: "/assets/**",
|
|
101
|
-
handler:
|
|
101
|
+
handler: resolve("./runtime/server/api/all"),
|
|
102
102
|
});
|
|
103
103
|
|
|
104
104
|
addServerHandler({
|
|
105
105
|
route: `${apiPrefix}/**`,
|
|
106
|
-
handler:
|
|
106
|
+
handler: resolve("./runtime/server/api/all"),
|
|
107
107
|
});
|
|
108
108
|
},
|
|
109
109
|
});
|
|
110
|
-
|