@finema/finework-layer 0.2.64 → 0.2.66
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/.husky/pre-commit +1 -1
- package/.playground/app/pages/layout-admin/[id]/index.vue +145 -145
- package/.playground/app/pages/layout-admin/test/[id]/index.vue +286 -286
- package/.playground/app/pages/layout-admin.vue +275 -275
- package/.playground/app/pages/submenu/layout-admin.vue +210 -210
- package/.vscode/extensions.json +0 -1
- package/CHANGELOG.md +336 -328
- package/app/app.config.ts +136 -136
- package/app/app.vue +10 -10
- package/app/assets/css/main.css +75 -75
- package/app/components/Button/ActionIcon.vue +29 -29
- package/app/components/Button/Back.vue +22 -22
- package/app/components/InfoItemList.vue +196 -196
- package/app/components/Layout/Admin/Sidebar.vue +329 -329
- package/app/components/Layout/Admin/index.vue +224 -224
- package/app/components/Layout/Apps.vue +45 -45
- package/app/components/Layout/User/index.vue +99 -99
- package/app/components/StatusBox.vue +56 -56
- package/app/composables/useRequestOptions.ts +50 -50
- package/app/constants/routes.ts +86 -86
- package/app/error.vue +218 -218
- package/app/middleware/auth.ts +45 -45
- package/app/middleware/common.ts +12 -12
- package/app/middleware/guest.ts +7 -7
- package/app/middleware/permissions.ts +29 -29
- package/bun.lock +2 -2
- package/index.d.ts +16 -16
- package/nuxt.config.ts +41 -41
- package/package.json +2 -2
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { defineNuxtRouteMiddleware, useAuth, navigateTo, abortNavigation } from '#imports'
|
|
2
|
-
|
|
3
|
-
export interface AccessGuardOptions {
|
|
4
|
-
permissions?: `${UserModule}:${Permission}`[]
|
|
5
|
-
redirectTo?: string
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export default defineNuxtRouteMiddleware(async (to, from) => {
|
|
9
|
-
const options: AccessGuardOptions = to.meta.accessGuard || {}
|
|
10
|
-
const auth = useAuth()
|
|
11
|
-
|
|
12
|
-
if (
|
|
13
|
-
options.permissions?.some((perm) => {
|
|
14
|
-
const [module, permission] = perm.split(':') as [UserModule, Permission]
|
|
15
|
-
|
|
16
|
-
return auth.hasPermission(module, permission)
|
|
17
|
-
})
|
|
18
|
-
) {
|
|
19
|
-
return
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (options.redirectTo) {
|
|
23
|
-
return navigateTo(options.redirectTo)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return abortNavigation({
|
|
27
|
-
statusCode: 403,
|
|
28
|
-
})
|
|
29
|
-
})
|
|
1
|
+
import { defineNuxtRouteMiddleware, useAuth, navigateTo, abortNavigation } from '#imports'
|
|
2
|
+
|
|
3
|
+
export interface AccessGuardOptions {
|
|
4
|
+
permissions?: `${UserModule}:${Permission}`[]
|
|
5
|
+
redirectTo?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default defineNuxtRouteMiddleware(async (to, from) => {
|
|
9
|
+
const options: AccessGuardOptions = to.meta.accessGuard || {}
|
|
10
|
+
const auth = useAuth()
|
|
11
|
+
|
|
12
|
+
if (
|
|
13
|
+
options.permissions?.some((perm) => {
|
|
14
|
+
const [module, permission] = perm.split(':') as [UserModule, Permission]
|
|
15
|
+
|
|
16
|
+
return auth.hasPermission(module, permission)
|
|
17
|
+
})
|
|
18
|
+
) {
|
|
19
|
+
return
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (options.redirectTo) {
|
|
23
|
+
return navigateTo(options.redirectTo)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return abortNavigation({
|
|
27
|
+
statusCode: 403,
|
|
28
|
+
})
|
|
29
|
+
})
|
package/bun.lock
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"": {
|
|
5
5
|
"name": "@finema/finework-layer",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@finema/core": "^2.
|
|
7
|
+
"@finema/core": "^2.60.2",
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
10
|
"@finema/eslint-config": "^2.0.3",
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
|
|
188
188
|
"@eslint/plugin-kit": ["@eslint/plugin-kit@0.4.0", "", { "dependencies": { "@eslint/core": "^0.16.0", "levn": "^0.4.1" } }, "sha512-sB5uyeq+dwCWyPi31B2gQlVlo+j5brPlWx4yZBrEaRo/nhdDE8Xke1gsGgtiBdaBTxuTkceLVuVt/pclrasb0A=="],
|
|
189
189
|
|
|
190
|
-
"@finema/core": ["@finema/core@2.
|
|
190
|
+
"@finema/core": ["@finema/core@2.60.2", "", { "dependencies": { "@iconify-json/heroicons": "^1.2.2", "@iconify-json/ph": "^1.2.2", "@iconify-json/svg-spinners": "^1.2.2", "@nuxt/kit": "^4.1.3", "@nuxt/ui": "^4.1.0", "@pinia/nuxt": "^0.11.0", "@tailwindcss/typography": "^0.5.0-alpha.3", "@tiptap/extension-image": "^3.0.7", "@tiptap/extension-link": "^3.0.7", "@tiptap/extension-text-align": "^3.0.7", "@tiptap/extension-text-style": "^3.0.7", "@tiptap/extension-underline": "^3.0.7", "@tiptap/extension-youtube": "^3.0.7", "@tiptap/pm": "^3.0.7", "@tiptap/starter-kit": "^3.0.7", "@tiptap/vue-3": "^3.0.7", "@vee-validate/nuxt": "^4.15.1", "@vee-validate/valibot": "^4.15.1", "@vuepic/vue-datepicker": "^11.0.2", "@vueuse/components": "^13.9.0", "@vueuse/core": "^13.9.0", "@wdns/vue-code-block": "^2.3.5", "axios": "^1.10.0", "date-fns": "^4.1.0", "date-fns-tz": "^3.2.0", "defu": "^6.1.4", "lodash-es": "^4.17.21", "maska": "^3.1.1", "url-join": "^5.0.0" } }, "sha512-zy0MD3IalpJcqplM0MmcZEzRKk5fL0wA/qjN1aU5EuIHvDY2Se3jZxjQGkrXZsj3bQ6//h9xP9Mx++OEOy+vgA=="],
|
|
191
191
|
|
|
192
192
|
"@finema/eslint-config": ["@finema/eslint-config@2.0.3", "", { "dependencies": { "eslint-plugin-better-tailwindcss": "^3.7.10", "eslint-plugin-tailwindcss": "^3.18.2", "eslint-plugin-unused-imports": "^4.2.0" }, "peerDependencies": { "eslint": "^9.37.0" } }, "sha512-cKayHHZLTp/cA1q9ohowBcNWqpMZcA3zYcw8W7JkB89B+cyT1hYUOIi046cUEW23mFTfsSKUVIeW/C+BKpXuXQ=="],
|
|
193
193
|
|
package/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { IStatus } from '#core/types/lib'
|
|
2
|
-
import { ArrayHelper } from '#core/utils/ArrayHelper'
|
|
3
|
-
import { NumberHelper } from '#core/utils/NumberHelper'
|
|
4
|
-
import { StringHelper } from '#core/utils/StringHelper'
|
|
5
|
-
|
|
6
|
-
export {}
|
|
7
|
-
|
|
8
|
-
declare global {
|
|
9
|
-
export type { IStatus }
|
|
10
|
-
|
|
11
|
-
export { NumberHelper }
|
|
12
|
-
|
|
13
|
-
export { StringHelper }
|
|
14
|
-
|
|
15
|
-
export { ArrayHelper }
|
|
16
|
-
}
|
|
1
|
+
import type { IStatus } from '#core/types/lib'
|
|
2
|
+
import { ArrayHelper } from '#core/utils/ArrayHelper'
|
|
3
|
+
import { NumberHelper } from '#core/utils/NumberHelper'
|
|
4
|
+
import { StringHelper } from '#core/utils/StringHelper'
|
|
5
|
+
|
|
6
|
+
export {}
|
|
7
|
+
|
|
8
|
+
declare global {
|
|
9
|
+
export type { IStatus }
|
|
10
|
+
|
|
11
|
+
export { NumberHelper }
|
|
12
|
+
|
|
13
|
+
export { StringHelper }
|
|
14
|
+
|
|
15
|
+
export { ArrayHelper }
|
|
16
|
+
}
|
package/nuxt.config.ts
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { createResolver } from '@nuxt/kit'
|
|
2
|
-
import { fileURLToPath } from 'node:url'
|
|
3
|
-
import { dirname, join } from 'node:path'
|
|
4
|
-
|
|
5
|
-
const currentDir = dirname(fileURLToPath(import.meta.url))
|
|
6
|
-
|
|
7
|
-
const {
|
|
8
|
-
resolve,
|
|
9
|
-
} = createResolver(import.meta.url)
|
|
10
|
-
|
|
11
|
-
export default defineNuxtConfig({
|
|
12
|
-
modules: ['@nuxt/eslint', '@nuxt/test-utils', '@finema/core'],
|
|
13
|
-
imports: {
|
|
14
|
-
dirs: ['./constants', './loaders', './loaders/pmo', './helpers', './types'],
|
|
15
|
-
},
|
|
16
|
-
devtools: {
|
|
17
|
-
enabled: true,
|
|
18
|
-
},
|
|
19
|
-
css: [join(currentDir, './app/assets/css/main.css'), '@vuepic/vue-datepicker/dist/main.css'],
|
|
20
|
-
alias: {
|
|
21
|
-
'#layer': resolve('./'),
|
|
22
|
-
},
|
|
23
|
-
build: {
|
|
24
|
-
transpile: ['@vuepic/vue-datepicker'],
|
|
25
|
-
},
|
|
26
|
-
compatibilityDate: '2025-07-15',
|
|
27
|
-
vite: {
|
|
28
|
-
optimizeDeps: {
|
|
29
|
-
include: [
|
|
30
|
-
'@vue/devtools-kit',
|
|
31
|
-
'@vue/devtools-core',
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
eslint: {
|
|
36
|
-
config: {
|
|
37
|
-
stylistic: true,
|
|
38
|
-
tooling: true,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
})
|
|
1
|
+
import { createResolver } from '@nuxt/kit'
|
|
2
|
+
import { fileURLToPath } from 'node:url'
|
|
3
|
+
import { dirname, join } from 'node:path'
|
|
4
|
+
|
|
5
|
+
const currentDir = dirname(fileURLToPath(import.meta.url))
|
|
6
|
+
|
|
7
|
+
const {
|
|
8
|
+
resolve,
|
|
9
|
+
} = createResolver(import.meta.url)
|
|
10
|
+
|
|
11
|
+
export default defineNuxtConfig({
|
|
12
|
+
modules: ['@nuxt/eslint', '@nuxt/test-utils', '@finema/core'],
|
|
13
|
+
imports: {
|
|
14
|
+
dirs: ['./constants', './loaders', './loaders/pmo', './helpers', './types'],
|
|
15
|
+
},
|
|
16
|
+
devtools: {
|
|
17
|
+
enabled: true,
|
|
18
|
+
},
|
|
19
|
+
css: [join(currentDir, './app/assets/css/main.css'), '@vuepic/vue-datepicker/dist/main.css'],
|
|
20
|
+
alias: {
|
|
21
|
+
'#layer': resolve('./'),
|
|
22
|
+
},
|
|
23
|
+
build: {
|
|
24
|
+
transpile: ['@vuepic/vue-datepicker'],
|
|
25
|
+
},
|
|
26
|
+
compatibilityDate: '2025-07-15',
|
|
27
|
+
vite: {
|
|
28
|
+
optimizeDeps: {
|
|
29
|
+
include: [
|
|
30
|
+
'@vue/devtools-kit',
|
|
31
|
+
'@vue/devtools-core',
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
eslint: {
|
|
36
|
+
config: {
|
|
37
|
+
stylistic: true,
|
|
38
|
+
tooling: true,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
})
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finema/finework-layer",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.66",
|
|
5
5
|
"main": "./nuxt.config.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "nuxi dev .playground -o",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"vue": "latest"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@finema/core": "^2.
|
|
33
|
+
"@finema/core": "^2.60.2"
|
|
34
34
|
},
|
|
35
35
|
"lint-staged": {
|
|
36
36
|
"*": "eslint"
|