create-nexwire 4.0.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/README.md +233 -0
- package/express/.dockerignore +14 -0
- package/express/.env +44 -0
- package/express/.env.example +42 -0
- package/express/.vscode/settings.json +26 -0
- package/express/LICENSE +21 -0
- package/express/README.md +211 -0
- package/express/biome.json +66 -0
- package/express/drizzle.config.ts +25 -0
- package/express/gitignore-stub +24 -0
- package/express/package.json +108 -0
- package/express/public/.gitkeep +0 -0
- package/express/src/config/app.ts +41 -0
- package/express/src/config/auth.ts +12 -0
- package/express/src/config/cache.ts +16 -0
- package/express/src/config/cookie.ts +15 -0
- package/express/src/config/cors.ts +12 -0
- package/express/src/config/database.ts +29 -0
- package/express/src/config/index.ts +83 -0
- package/express/src/config/jwt.ts +19 -0
- package/express/src/config/logging.ts +13 -0
- package/express/src/config/mail.ts +24 -0
- package/express/src/config/openapi.ts +54 -0
- package/express/src/config/queue.ts +30 -0
- package/express/src/config/rateLimit.ts +17 -0
- package/express/src/config/realtime.ts +15 -0
- package/express/src/config/redis.ts +18 -0
- package/express/src/config/security.ts +44 -0
- package/express/src/config/session.ts +17 -0
- package/express/src/config/storage.ts +22 -0
- package/express/src/config/validate.ts +40 -0
- package/express/src/database/migrations/sqlite/0000_init.sql +61 -0
- package/express/src/database/migrations/sqlite/meta/0000_snapshot.json +412 -0
- package/express/src/database/migrations/sqlite/meta/_journal.json +13 -0
- package/express/src/database/schema.ts +3 -0
- package/express/src/env.ts +76 -0
- package/express/src/framework/cache/cache.ts +81 -0
- package/express/src/framework/circuit-breaker/cb.ts +60 -0
- package/express/src/framework/database/connection.ts +196 -0
- package/express/src/framework/database/migrate-hooks.ts +87 -0
- package/express/src/framework/database/paginate.ts +227 -0
- package/express/src/framework/database/schema.ts +20 -0
- package/express/src/framework/database/seed.ts +139 -0
- package/express/src/framework/events/dispatcher.ts +49 -0
- package/express/src/framework/facade.ts +48 -0
- package/express/src/framework/http/app.ts +107 -0
- package/express/src/framework/http/cors.ts +7 -0
- package/express/src/framework/http/logger.ts +69 -0
- package/express/src/framework/http/metrics.ts +22 -0
- package/express/src/framework/http/openapi.ts +54 -0
- package/express/src/framework/http/ratelimiter.ts +16 -0
- package/express/src/framework/http/router.ts +178 -0
- package/express/src/framework/http/security.ts +23 -0
- package/express/src/framework/http/static.ts +23 -0
- package/express/src/framework/http/validation.ts +18 -0
- package/express/src/framework/kernel.ts +52 -0
- package/express/src/framework/maker-cli/db/core.mjs +288 -0
- package/express/src/framework/maker-cli/db/index.mjs +204 -0
- package/express/src/framework/maker-cli/deploy/core.mjs +1047 -0
- package/express/src/framework/maker-cli/deploy/index.mjs +91 -0
- package/express/src/framework/maker-cli/index.mjs +53 -0
- package/express/src/framework/maker-cli/middleware/core.mjs +47 -0
- package/express/src/framework/maker-cli/middleware/index.mjs +17 -0
- package/express/src/framework/maker-cli/module/core.mjs +684 -0
- package/express/src/framework/maker-cli/module/index.mjs +140 -0
- package/express/src/framework/maker-cli/runtime/build-ui.mjs +16 -0
- package/express/src/framework/maker-cli/runtime/core.mjs +543 -0
- package/express/src/framework/maker-cli/runtime/index.mjs +104 -0
- package/express/src/framework/maker-cli/runtime/redis-commander-patch.cjs +20 -0
- package/express/src/framework/maker-cli/stubs/controller/openapi.ts.stub +47 -0
- package/express/src/framework/maker-cli/stubs/controller/openapi.with-model.ts.stub +48 -0
- package/express/src/framework/maker-cli/stubs/controller/plain.ts.stub +54 -0
- package/express/src/framework/maker-cli/stubs/controller/schema.plain.ts.stub +14 -0
- package/express/src/framework/maker-cli/stubs/controller/schema.ts.stub +33 -0
- package/express/src/framework/maker-cli/stubs/deploy/Dockerfile.bun.stub +52 -0
- package/express/src/framework/maker-cli/stubs/deploy/Dockerfile.pnpm.stub +55 -0
- package/express/src/framework/maker-cli/stubs/deploy/Dockerfile.stub +51 -0
- package/express/src/framework/maker-cli/stubs/deploy/Dockerfile.yarn.stub +55 -0
- package/express/src/framework/maker-cli/stubs/deploy/README.stub +59 -0
- package/express/src/framework/maker-cli/stubs/deploy/compose/mysql.server.stub +45 -0
- package/express/src/framework/maker-cli/stubs/deploy/compose/postgres.server.stub +45 -0
- package/express/src/framework/maker-cli/stubs/deploy/compose/sqlite.stub +45 -0
- package/express/src/framework/maker-cli/stubs/deploy/env/mysql.server.stub +68 -0
- package/express/src/framework/maker-cli/stubs/deploy/env/postgres.server.stub +68 -0
- package/express/src/framework/maker-cli/stubs/deploy/env/sqlite.stub +67 -0
- package/express/src/framework/maker-cli/stubs/deploy/scripts/auto-migrate.sh.stub +41 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/README.stub +78 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/compose/noredis.stub +120 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/compose/redis.dev.stub +133 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/compose/redis.stub +131 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/env/local.example.stub +11 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/env/noredis.stub +25 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/env/redis.stub +25 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/nginx-vhost/README.stub +16 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/nginx-vhost/app.example.com.stub +13 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/pgadmin/servers.stub +14 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/redis/redis.conf.stub +7 -0
- package/express/src/framework/maker-cli/stubs/deploy/supervisor/noredis.stub +54 -0
- package/express/src/framework/maker-cli/stubs/deploy/supervisor/redis.stub +70 -0
- package/express/src/framework/maker-cli/stubs/deploy/workflow/local.json.stub +25 -0
- package/express/src/framework/maker-cli/stubs/deploy/workflow/remote.json.stub +24 -0
- package/express/src/framework/maker-cli/stubs/example/console.ts.stub +34 -0
- package/express/src/framework/maker-cli/stubs/example/controller.ts.stub +418 -0
- package/express/src/framework/maker-cli/stubs/example/job.ts.stub +75 -0
- package/express/src/framework/maker-cli/stubs/example/route.api.ts.stub +207 -0
- package/express/src/framework/maker-cli/stubs/example/route.plain.ts.stub +18 -0
- package/express/src/framework/maker-cli/stubs/example/schema.plain.ts.stub +42 -0
- package/express/src/framework/maker-cli/stubs/example/schema.ts.stub +42 -0
- package/express/src/framework/maker-cli/stubs/job/name.ts.stub +25 -0
- package/express/src/framework/maker-cli/stubs/middleware/name.ts.stub +14 -0
- package/express/src/framework/maker-cli/stubs/model/name.mysql.ts.stub +9 -0
- package/express/src/framework/maker-cli/stubs/model/name.postgresql.ts.stub +9 -0
- package/express/src/framework/maker-cli/stubs/model/name.sqlite.ts.stub +9 -0
- package/express/src/framework/maker-cli/stubs/notification/controller.ts.stub +77 -0
- package/express/src/framework/maker-cli/stubs/notification/job.ts.stub +13 -0
- package/express/src/framework/maker-cli/stubs/notification/route.api.ts.stub +50 -0
- package/express/src/framework/maker-cli/stubs/notification/route.plain.ts.stub +12 -0
- package/express/src/framework/maker-cli/stubs/notification/schema.plain.ts.stub +26 -0
- package/express/src/framework/maker-cli/stubs/notification/schema.ts.stub +26 -0
- package/express/src/framework/maker-cli/stubs/route/api.ts.stub +80 -0
- package/express/src/framework/maker-cli/stubs/route/plain.ts.stub +11 -0
- package/express/src/framework/maker-cli/stubs/schedule/name.ts.stub +36 -0
- package/express/src/framework/maker-cli/stubs/seeder/name.ts.stub +20 -0
- package/express/src/framework/maker-cli/stubs/test/unit.ts.stub +22 -0
- package/express/src/framework/maker-cli/utils/env-config.mjs +44 -0
- package/express/src/framework/maker-cli/utils/env-db.mjs +61 -0
- package/express/src/framework/maker-cli/utils/file-ops.mjs +30 -0
- package/express/src/framework/maker-cli/utils/flags.mjs +14 -0
- package/express/src/framework/maker-cli/utils/help.mjs +50 -0
- package/express/src/framework/maker-cli/utils/naming.mjs +13 -0
- package/express/src/framework/maker-cli/utils/process.mjs +52 -0
- package/express/src/framework/modules/discover.ts +54 -0
- package/express/src/framework/modules/routes.ts +21 -0
- package/express/src/framework/notification/index.ts +116 -0
- package/express/src/framework/queue/clear.ts +22 -0
- package/express/src/framework/queue/queue.ts +342 -0
- package/express/src/framework/queue/ui.ts +187 -0
- package/express/src/framework/queue/worker.ts +61 -0
- package/express/src/framework/realtime/broadcast.ts +46 -0
- package/express/src/framework/realtime/index.ts +2 -0
- package/express/src/framework/realtime/socket-cookie.ts +71 -0
- package/express/src/framework/realtime/socket.ts +119 -0
- package/express/src/framework/realtime/types.ts +6 -0
- package/express/src/framework/realtime/ui.ts +16 -0
- package/express/src/framework/redis/client.ts +151 -0
- package/express/src/framework/runtime/runtime.ts +23 -0
- package/express/src/framework/runtime/server-adapter.ts +34 -0
- package/express/src/framework/scheduler/lock.ts +116 -0
- package/express/src/framework/scheduler/run.ts +48 -0
- package/express/src/framework/scheduler/scheduler.ts +155 -0
- package/express/src/framework/server.ts +177 -0
- package/express/src/framework/session/session.ts +98 -0
- package/express/src/framework/storage/storage.ts +785 -0
- package/express/src/framework/support/cookie.ts +62 -0
- package/express/src/framework/support/jwt.ts +33 -0
- package/express/src/framework/support/lifecycle.ts +35 -0
- package/express/src/framework/support/logger.ts +148 -0
- package/express/src/framework/support/mail.ts +48 -0
- package/express/src/framework/support/password.ts +23 -0
- package/express/src/framework/support/upload.ts +160 -0
- package/express/src/framework/support/url.ts +41 -0
- package/express/src/middlewares/auth-middleware.ts +98 -0
- package/express/src/middlewares/role-middleware.ts +25 -0
- package/express/src/modules/auth/controllers/auth.controller.ts +358 -0
- package/express/src/modules/auth/controllers/auth.helpers.ts +104 -0
- package/express/src/modules/auth/controllers/auth.schema.ts +102 -0
- package/express/src/modules/auth/controllers/role.controller.ts +15 -0
- package/express/src/modules/auth/database/models/notifications.ts +24 -0
- package/express/src/modules/auth/database/models/role.ts +14 -0
- package/express/src/modules/auth/database/models/user.ts +46 -0
- package/express/src/modules/auth/database/seeders/role.ts +18 -0
- package/express/src/modules/auth/database/seeders/user.ts +35 -0
- package/express/src/modules/auth/jobs/forgetpass.ts +20 -0
- package/express/src/modules/auth/jobs/registeruser.ts +23 -0
- package/express/src/modules/auth/jobs/verifyemail.ts +18 -0
- package/express/src/modules/auth/routes/api.ts +150 -0
- package/express/src/modules/auth/routes/role.ts +33 -0
- package/express/src/resources/index.html +17 -0
- package/express/src/resources/src/App.vue +5 -0
- package/express/src/resources/src/assets/css/styles.css +14761 -0
- package/express/src/resources/src/assets/css/styles.css.map +1 -0
- package/express/src/resources/src/assets/fonts/public-sans/public-sans-latin-ext.woff2 +0 -0
- package/express/src/resources/src/assets/fonts/public-sans/public-sans-latin.woff2 +0 -0
- package/express/src/resources/src/assets/images/favicon/favicon.ico +0 -0
- package/express/src/resources/src/assets/images/logo.png +0 -0
- package/express/src/resources/src/assets/scss/custom.css +217 -0
- package/express/src/resources/src/assets/scss/custom.css.map +1 -0
- package/express/src/resources/src/assets/scss/custom.scss +1346 -0
- package/express/src/resources/src/components/Button.vue +32 -0
- package/express/src/resources/src/components/Checkbox.vue +29 -0
- package/express/src/resources/src/components/Datepicker.vue +106 -0
- package/express/src/resources/src/components/FeatureButton.vue +53 -0
- package/express/src/resources/src/components/FloatButton.vue +33 -0
- package/express/src/resources/src/components/Href.vue +32 -0
- package/express/src/resources/src/components/Input.vue +223 -0
- package/express/src/resources/src/components/InputGroup.vue +145 -0
- package/express/src/resources/src/components/InputPasswordToggle.vue +213 -0
- package/express/src/resources/src/components/Modal.vue +55 -0
- package/express/src/resources/src/components/Pagebar.vue +26 -0
- package/express/src/resources/src/components/Select.vue +384 -0
- package/express/src/resources/src/components/Spinner.vue +42 -0
- package/express/src/resources/src/components/Switch.vue +65 -0
- package/express/src/resources/src/components/TextArea.vue +117 -0
- package/express/src/resources/src/components/Toast.vue +56 -0
- package/express/src/resources/src/components/datatable/DataTableSkeleton.vue +98 -0
- package/express/src/resources/src/components/datatable/Pagination.vue +147 -0
- package/express/src/resources/src/components/datatable/SelectOpption.vue +64 -0
- package/express/src/resources/src/components/datatable/index.vue +199 -0
- package/express/src/resources/src/composables/useAuth.ts +52 -0
- package/express/src/resources/src/helpers/nformatter.ts +10 -0
- package/express/src/resources/src/helpers/utils.ts +75 -0
- package/express/src/resources/src/layouts/AuthLayout.vue +20 -0
- package/express/src/resources/src/layouts/Layout/Footer.vue +23 -0
- package/express/src/resources/src/layouts/Layout/Header.vue +105 -0
- package/express/src/resources/src/layouts/Layout/Sidebar.vue +137 -0
- package/express/src/resources/src/layouts/Layout/index.vue +87 -0
- package/express/src/resources/src/main.ts +26 -0
- package/express/src/resources/src/pages/auth/forgetPassword.vue +82 -0
- package/express/src/resources/src/pages/auth/login.vue +99 -0
- package/express/src/resources/src/pages/auth/register.vue +133 -0
- package/express/src/resources/src/pages/auth/resetPassword.vue +118 -0
- package/express/src/resources/src/pages/auth/verifyEmail.vue +68 -0
- package/express/src/resources/src/pages/dashboard/index.vue +66 -0
- package/express/src/resources/src/plugins/axios.ts +31 -0
- package/express/src/resources/src/plugins/browserDetect.ts +55 -0
- package/express/src/resources/src/plugins/dialog.ts +216 -0
- package/express/src/resources/src/plugins/gum.ts +367 -0
- package/express/src/resources/src/plugins/pulse.ts +147 -0
- package/express/src/resources/src/plugins/routeProgress.ts +87 -0
- package/express/src/resources/src/router/index.ts +85 -0
- package/express/src/resources/src/stores/admin-ui.ts +148 -0
- package/express/src/resources/src/stores/auth.ts +164 -0
- package/express/src/resources/tsconfig.json +19 -0
- package/express/src/resources/vite.config.ts +46 -0
- package/express/src/storage/app/private/.gitkeep +0 -0
- package/express/src/storage/app/public/.gitkeep +0 -0
- package/express/src/storage/app/tmp/generated/.gitkeep +0 -0
- package/express/src/storage/database/nexwire.sqlite +0 -0
- package/express/src/storage/logs/.gitkeep +0 -0
- package/express/src/storage/tmp/.gitkeep +0 -0
- package/express/src/storage/trash/modules/.gitkeep +0 -0
- package/express/src/types/global.d.ts +26 -0
- package/express/tsconfig.json +19 -0
- package/express/vitest.config.ts +23 -0
- package/hono/.dockerignore +14 -0
- package/hono/.env +44 -0
- package/hono/.env.example +42 -0
- package/hono/.vscode/settings.json +26 -0
- package/hono/LICENSE +21 -0
- package/hono/README.md +211 -0
- package/hono/biome.json +76 -0
- package/hono/drizzle.config.ts +25 -0
- package/hono/gitignore-stub +24 -0
- package/hono/package.json +99 -0
- package/hono/public/.gitkeep +0 -0
- package/hono/src/config/app.ts +41 -0
- package/hono/src/config/auth.ts +12 -0
- package/hono/src/config/cache.ts +16 -0
- package/hono/src/config/cookie.ts +15 -0
- package/hono/src/config/cors.ts +12 -0
- package/hono/src/config/database.ts +29 -0
- package/hono/src/config/index.ts +83 -0
- package/hono/src/config/jwt.ts +19 -0
- package/hono/src/config/logging.ts +13 -0
- package/hono/src/config/mail.ts +24 -0
- package/hono/src/config/openapi.ts +54 -0
- package/hono/src/config/queue.ts +30 -0
- package/hono/src/config/rateLimit.ts +17 -0
- package/hono/src/config/realtime.ts +15 -0
- package/hono/src/config/redis.ts +18 -0
- package/hono/src/config/security.ts +44 -0
- package/hono/src/config/session.ts +17 -0
- package/hono/src/config/storage.ts +22 -0
- package/hono/src/config/validate.ts +40 -0
- package/hono/src/database/migrations/sqlite/0000_init.sql +61 -0
- package/hono/src/database/migrations/sqlite/meta/0000_snapshot.json +412 -0
- package/hono/src/database/migrations/sqlite/meta/_journal.json +13 -0
- package/hono/src/database/schema.ts +3 -0
- package/hono/src/env.ts +76 -0
- package/hono/src/framework/cache/cache.ts +81 -0
- package/hono/src/framework/circuit-breaker/cb.ts +60 -0
- package/hono/src/framework/database/connection.ts +196 -0
- package/hono/src/framework/database/migrate-hooks.ts +87 -0
- package/hono/src/framework/database/paginate.ts +253 -0
- package/hono/src/framework/database/schema.ts +20 -0
- package/hono/src/framework/database/seed.ts +139 -0
- package/hono/src/framework/events/dispatcher.ts +49 -0
- package/hono/src/framework/facade.ts +29 -0
- package/hono/src/framework/http/app.ts +109 -0
- package/hono/src/framework/http/cors.ts +19 -0
- package/hono/src/framework/http/logger.ts +81 -0
- package/hono/src/framework/http/metrics.ts +22 -0
- package/hono/src/framework/http/openapi.ts +42 -0
- package/hono/src/framework/http/ratelimiter.ts +172 -0
- package/hono/src/framework/http/router.ts +76 -0
- package/hono/src/framework/http/security.ts +23 -0
- package/hono/src/framework/http/static.ts +70 -0
- package/hono/src/framework/http/validation.ts +21 -0
- package/hono/src/framework/kernel.ts +48 -0
- package/hono/src/framework/maker-cli/db/core.mjs +288 -0
- package/hono/src/framework/maker-cli/db/index.mjs +204 -0
- package/hono/src/framework/maker-cli/deploy/core.mjs +1038 -0
- package/hono/src/framework/maker-cli/deploy/index.mjs +91 -0
- package/hono/src/framework/maker-cli/index.mjs +53 -0
- package/hono/src/framework/maker-cli/middleware/core.mjs +47 -0
- package/hono/src/framework/maker-cli/middleware/index.mjs +12 -0
- package/hono/src/framework/maker-cli/module/core.mjs +684 -0
- package/hono/src/framework/maker-cli/module/index.mjs +140 -0
- package/hono/src/framework/maker-cli/runtime/build-ui.mjs +17 -0
- package/hono/src/framework/maker-cli/runtime/core.mjs +543 -0
- package/hono/src/framework/maker-cli/runtime/index.mjs +104 -0
- package/hono/src/framework/maker-cli/runtime/redis-commander-patch.cjs +20 -0
- package/hono/src/framework/maker-cli/stubs/controller/openapi.ts.stub +57 -0
- package/hono/src/framework/maker-cli/stubs/controller/openapi.with-model.ts.stub +58 -0
- package/hono/src/framework/maker-cli/stubs/controller/plain.ts.stub +59 -0
- package/hono/src/framework/maker-cli/stubs/controller/schema.plain.ts.stub +14 -0
- package/hono/src/framework/maker-cli/stubs/controller/schema.ts.stub +33 -0
- package/hono/src/framework/maker-cli/stubs/deploy/Dockerfile.bun.stub +52 -0
- package/hono/src/framework/maker-cli/stubs/deploy/Dockerfile.pnpm.stub +55 -0
- package/hono/src/framework/maker-cli/stubs/deploy/Dockerfile.stub +51 -0
- package/hono/src/framework/maker-cli/stubs/deploy/Dockerfile.yarn.stub +55 -0
- package/hono/src/framework/maker-cli/stubs/deploy/README.stub +59 -0
- package/hono/src/framework/maker-cli/stubs/deploy/compose/mysql.server.stub +45 -0
- package/hono/src/framework/maker-cli/stubs/deploy/compose/postgres.server.stub +45 -0
- package/hono/src/framework/maker-cli/stubs/deploy/compose/sqlite.stub +45 -0
- package/hono/src/framework/maker-cli/stubs/deploy/env/mysql.server.stub +68 -0
- package/hono/src/framework/maker-cli/stubs/deploy/env/postgres.server.stub +68 -0
- package/hono/src/framework/maker-cli/stubs/deploy/env/sqlite.stub +67 -0
- package/hono/src/framework/maker-cli/stubs/deploy/scripts/auto-migrate.sh.stub +41 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/README.stub +78 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/compose/noredis.stub +120 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/compose/redis.dev.stub +133 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/compose/redis.stub +131 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/env/local.example.stub +11 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/env/noredis.stub +25 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/env/redis.stub +25 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/nginx-vhost/README.stub +16 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/nginx-vhost/app.example.com.stub +13 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/pgadmin/servers.stub +14 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/redis/redis.conf.stub +7 -0
- package/hono/src/framework/maker-cli/stubs/deploy/supervisor/noredis.stub +54 -0
- package/hono/src/framework/maker-cli/stubs/deploy/supervisor/redis.stub +70 -0
- package/hono/src/framework/maker-cli/stubs/deploy/workflow/local.json.stub +25 -0
- package/hono/src/framework/maker-cli/stubs/deploy/workflow/remote.json.stub +24 -0
- package/hono/src/framework/maker-cli/stubs/example/console.ts.stub +34 -0
- package/hono/src/framework/maker-cli/stubs/example/controller.ts.stub +505 -0
- package/hono/src/framework/maker-cli/stubs/example/job.ts.stub +75 -0
- package/hono/src/framework/maker-cli/stubs/example/route.api.ts.stub +207 -0
- package/hono/src/framework/maker-cli/stubs/example/route.plain.ts.stub +18 -0
- package/hono/src/framework/maker-cli/stubs/example/schema.plain.ts.stub +42 -0
- package/hono/src/framework/maker-cli/stubs/example/schema.ts.stub +42 -0
- package/hono/src/framework/maker-cli/stubs/job/name.ts.stub +25 -0
- package/hono/src/framework/maker-cli/stubs/middleware/name.ts.stub +14 -0
- package/hono/src/framework/maker-cli/stubs/model/name.mysql.ts.stub +9 -0
- package/hono/src/framework/maker-cli/stubs/model/name.postgresql.ts.stub +9 -0
- package/hono/src/framework/maker-cli/stubs/model/name.sqlite.ts.stub +9 -0
- package/hono/src/framework/maker-cli/stubs/notification/controller.ts.stub +86 -0
- package/hono/src/framework/maker-cli/stubs/notification/job.ts.stub +13 -0
- package/hono/src/framework/maker-cli/stubs/notification/route.api.ts.stub +50 -0
- package/hono/src/framework/maker-cli/stubs/notification/route.plain.ts.stub +12 -0
- package/hono/src/framework/maker-cli/stubs/notification/schema.plain.ts.stub +26 -0
- package/hono/src/framework/maker-cli/stubs/notification/schema.ts.stub +26 -0
- package/hono/src/framework/maker-cli/stubs/route/api.ts.stub +80 -0
- package/hono/src/framework/maker-cli/stubs/route/plain.ts.stub +11 -0
- package/hono/src/framework/maker-cli/stubs/schedule/name.ts.stub +36 -0
- package/hono/src/framework/maker-cli/stubs/seeder/name.ts.stub +20 -0
- package/hono/src/framework/maker-cli/stubs/test/unit.ts.stub +22 -0
- package/hono/src/framework/maker-cli/utils/env-config.mjs +44 -0
- package/hono/src/framework/maker-cli/utils/env-db.mjs +61 -0
- package/hono/src/framework/maker-cli/utils/file-ops.mjs +30 -0
- package/hono/src/framework/maker-cli/utils/flags.mjs +14 -0
- package/hono/src/framework/maker-cli/utils/help.mjs +50 -0
- package/hono/src/framework/maker-cli/utils/naming.mjs +13 -0
- package/hono/src/framework/maker-cli/utils/process.mjs +52 -0
- package/hono/src/framework/modules/discover.ts +54 -0
- package/hono/src/framework/modules/routes.ts +24 -0
- package/hono/src/framework/notification/index.ts +116 -0
- package/hono/src/framework/queue/clear.ts +22 -0
- package/hono/src/framework/queue/queue.ts +342 -0
- package/hono/src/framework/queue/ui.ts +214 -0
- package/hono/src/framework/queue/worker.ts +61 -0
- package/hono/src/framework/realtime/broadcast.ts +46 -0
- package/hono/src/framework/realtime/index.ts +2 -0
- package/hono/src/framework/realtime/socket-cookie.ts +68 -0
- package/hono/src/framework/realtime/socket.ts +196 -0
- package/hono/src/framework/realtime/types.ts +6 -0
- package/hono/src/framework/realtime/ui.ts +16 -0
- package/hono/src/framework/redis/client.ts +151 -0
- package/hono/src/framework/runtime/runtime.ts +23 -0
- package/hono/src/framework/runtime/server-adapter.ts +94 -0
- package/hono/src/framework/scheduler/lock.ts +116 -0
- package/hono/src/framework/scheduler/run.ts +48 -0
- package/hono/src/framework/scheduler/scheduler.ts +155 -0
- package/hono/src/framework/server.ts +183 -0
- package/hono/src/framework/session/session.ts +116 -0
- package/hono/src/framework/storage/storage.ts +785 -0
- package/hono/src/framework/support/cookie.ts +99 -0
- package/hono/src/framework/support/jwt.ts +45 -0
- package/hono/src/framework/support/lifecycle.ts +35 -0
- package/hono/src/framework/support/logger.ts +148 -0
- package/hono/src/framework/support/mail.ts +48 -0
- package/hono/src/framework/support/password.ts +23 -0
- package/hono/src/framework/support/url.ts +41 -0
- package/hono/src/middlewares/auth-middleware.ts +98 -0
- package/hono/src/middlewares/role-middleware.ts +25 -0
- package/hono/src/modules/auth/controllers/auth.controller.ts +413 -0
- package/hono/src/modules/auth/controllers/auth.helpers.ts +128 -0
- package/hono/src/modules/auth/controllers/auth.schema.ts +102 -0
- package/hono/src/modules/auth/controllers/role.controller.ts +25 -0
- package/hono/src/modules/auth/database/models/notifications.ts +24 -0
- package/hono/src/modules/auth/database/models/role.ts +14 -0
- package/hono/src/modules/auth/database/models/user.ts +46 -0
- package/hono/src/modules/auth/database/seeders/role.ts +18 -0
- package/hono/src/modules/auth/database/seeders/user.ts +35 -0
- package/hono/src/modules/auth/jobs/forgetpass.ts +20 -0
- package/hono/src/modules/auth/jobs/registeruser.ts +23 -0
- package/hono/src/modules/auth/jobs/verifyemail.ts +18 -0
- package/hono/src/modules/auth/routes/api.ts +150 -0
- package/hono/src/modules/auth/routes/role.ts +33 -0
- package/hono/src/resources/index.html +17 -0
- package/hono/src/resources/src/App.vue +5 -0
- package/hono/src/resources/src/assets/css/styles.css +14913 -0
- package/hono/src/resources/src/assets/css/styles.css.map +1 -0
- package/hono/src/resources/src/assets/fonts/public-sans/public-sans-latin-ext.woff2 +0 -0
- package/hono/src/resources/src/assets/fonts/public-sans/public-sans-latin.woff2 +0 -0
- package/hono/src/resources/src/assets/images/favicon/favicon.ico +0 -0
- package/hono/src/resources/src/assets/images/logo.png +0 -0
- package/hono/src/resources/src/assets/scss/custom.css +217 -0
- package/hono/src/resources/src/assets/scss/custom.css.map +1 -0
- package/hono/src/resources/src/assets/scss/custom.scss +1346 -0
- package/hono/src/resources/src/components/Button.vue +32 -0
- package/hono/src/resources/src/components/Checkbox.vue +29 -0
- package/hono/src/resources/src/components/Datepicker.vue +106 -0
- package/hono/src/resources/src/components/FeatureButton.vue +53 -0
- package/hono/src/resources/src/components/FloatButton.vue +33 -0
- package/hono/src/resources/src/components/Href.vue +32 -0
- package/hono/src/resources/src/components/Input.vue +234 -0
- package/hono/src/resources/src/components/InputGroup.vue +149 -0
- package/hono/src/resources/src/components/InputPasswordToggle.vue +222 -0
- package/hono/src/resources/src/components/Modal.vue +55 -0
- package/hono/src/resources/src/components/Pagebar.vue +26 -0
- package/hono/src/resources/src/components/Select.vue +415 -0
- package/hono/src/resources/src/components/Spinner.vue +42 -0
- package/hono/src/resources/src/components/Switch.vue +65 -0
- package/hono/src/resources/src/components/TextArea.vue +121 -0
- package/hono/src/resources/src/components/Toast.vue +56 -0
- package/hono/src/resources/src/components/datatable/DataTableSkeleton.vue +98 -0
- package/hono/src/resources/src/components/datatable/Pagination.vue +147 -0
- package/hono/src/resources/src/components/datatable/SelectOpption.vue +64 -0
- package/hono/src/resources/src/components/datatable/index.vue +199 -0
- package/hono/src/resources/src/composables/useAuth.ts +52 -0
- package/hono/src/resources/src/helpers/nformatter.ts +10 -0
- package/hono/src/resources/src/helpers/utils.ts +75 -0
- package/hono/src/resources/src/layouts/AuthLayout.vue +20 -0
- package/hono/src/resources/src/layouts/Layout/Footer.vue +23 -0
- package/hono/src/resources/src/layouts/Layout/Header.vue +105 -0
- package/hono/src/resources/src/layouts/Layout/Sidebar.vue +137 -0
- package/hono/src/resources/src/layouts/Layout/index.vue +87 -0
- package/hono/src/resources/src/main.ts +26 -0
- package/hono/src/resources/src/pages/auth/forgetPassword.vue +82 -0
- package/hono/src/resources/src/pages/auth/login.vue +99 -0
- package/hono/src/resources/src/pages/auth/register.vue +133 -0
- package/hono/src/resources/src/pages/auth/resetPassword.vue +118 -0
- package/hono/src/resources/src/pages/auth/verifyEmail.vue +68 -0
- package/hono/src/resources/src/pages/dashboard/index.vue +66 -0
- package/hono/src/resources/src/plugins/axios.ts +31 -0
- package/hono/src/resources/src/plugins/browserDetect.ts +55 -0
- package/hono/src/resources/src/plugins/dialog.ts +216 -0
- package/hono/src/resources/src/plugins/gum.ts +367 -0
- package/hono/src/resources/src/plugins/pulse.ts +147 -0
- package/hono/src/resources/src/plugins/routeProgress.ts +87 -0
- package/hono/src/resources/src/router/index.ts +85 -0
- package/hono/src/resources/src/stores/admin-ui.ts +148 -0
- package/hono/src/resources/src/stores/auth.ts +164 -0
- package/hono/src/resources/tsconfig.json +19 -0
- package/hono/src/resources/vite.config.ts +46 -0
- package/hono/src/storage/app/private/.gitkeep +0 -0
- package/hono/src/storage/app/public/.gitkeep +0 -0
- package/hono/src/storage/app/tmp/generated/.gitkeep +0 -0
- package/hono/src/storage/database/nexwire.sqlite +0 -0
- package/hono/src/storage/logs/.gitkeep +0 -0
- package/hono/src/storage/tmp/.gitkeep +0 -0
- package/hono/src/storage/trash/modules/.gitkeep +0 -0
- package/hono/src/types/global.d.ts +26 -0
- package/hono/tsconfig.json +20 -0
- package/hono/vitest.config.ts +23 -0
- package/package.json +238 -0
- package/src/index.js +204 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="card border">
|
|
3
|
+
<div class="card-header" :class="{ 'd-none': !(props.removable || props.searchable || props.optionable) }">
|
|
4
|
+
<div class="row align-items-center gx-1">
|
|
5
|
+
<div class="col-12 col-md-3">
|
|
6
|
+
<SelectOption :is-options="props.optionable" :option="props.option" :data="dataForOption"
|
|
7
|
+
:selectedoption="selectedoption" :search="searchdata" />
|
|
8
|
+
</div>
|
|
9
|
+
<div class="col-12 col-md-9">
|
|
10
|
+
<slot name="extra-tools"></slot>
|
|
11
|
+
<div class="d-flex align-items-center justify-content-center justify-content-md-end">
|
|
12
|
+
<div v-if="checked.checkcolumn.length > 0" class="me-1" :class="{ 'd-none': !props.removable }">
|
|
13
|
+
<Button type="button" class="btn btn-outline-danger" @click.prevent="remove">
|
|
14
|
+
<i class="bi bi-trash"></i>
|
|
15
|
+
</Button>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="d-flex align-items-center" :class="{ 'd-none': !props.searchable }">
|
|
18
|
+
<Button class="btn btn-outline-secondary rounded-0 rounded-start" type="button" @click="searchMe">
|
|
19
|
+
<i class="bi bi-search"></i>
|
|
20
|
+
</Button>
|
|
21
|
+
<Input v-model="searchdata" type="text" class="w-auto rounded-0 rounded-end" topclass="mb-0"
|
|
22
|
+
placeholder="Search..." @keyup.enter="searchMe" @keyup.delete="searchMe" />
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="card-body">
|
|
29
|
+
<slot name="extra"></slot>
|
|
30
|
+
<div class="table-responsive">
|
|
31
|
+
<table
|
|
32
|
+
class="table table-bordered table-striped border-custom table-sm align-middle m-0 datatable no-shrink-table">
|
|
33
|
+
<slot name="customhead"></slot>
|
|
34
|
+
<thead :class="{ 'd-none': slots.customhead }">
|
|
35
|
+
<tr>
|
|
36
|
+
<th class="align-middle" :class="{ 'd-none': !props.removable || !props.data.current_page }">
|
|
37
|
+
<Checkbox v-model="checked.check" topclass="ms-2" :value="checked.check" :disabled="props.disabled"
|
|
38
|
+
@click="checkAll" />
|
|
39
|
+
</th>
|
|
40
|
+
<th class="text-center align-middle" :class="{ 'd-none': !props.countable }">#</th>
|
|
41
|
+
<slot name="thead"></slot>
|
|
42
|
+
</tr>
|
|
43
|
+
</thead>
|
|
44
|
+
|
|
45
|
+
<slot name="custombody"></slot>
|
|
46
|
+
<tbody :class="{ 'd-none': slots.custombody }">
|
|
47
|
+
<tr v-for="(dt, i) in tableRows" :key="`${dt.id}-${i}`">
|
|
48
|
+
<td class="align-middle" :class="{ 'd-none': !props.removable || !props.data.current_page }">
|
|
49
|
+
<Checkbox v-model="checked.checkcolumn" topclass="ms-2" :value="dt.id" :disabled="props.disabled"
|
|
50
|
+
@change="updateChecked" />
|
|
51
|
+
</td>
|
|
52
|
+
<td class="text-center align-middle" :class="{ 'd-none': !props.countable }">
|
|
53
|
+
{{
|
|
54
|
+
props.data.current_page
|
|
55
|
+
? props.data.per_page * (props.data.current_page - 1) + (i + 1)
|
|
56
|
+
: i + 1
|
|
57
|
+
}}
|
|
58
|
+
</td>
|
|
59
|
+
<slot name="tbody" :td="dt"></slot>
|
|
60
|
+
</tr>
|
|
61
|
+
</tbody>
|
|
62
|
+
</table>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="card-footer" :class="{ 'd-none': props.data.total <= props.data.data?.length }">
|
|
66
|
+
<Pagination :data="props.data" :selectedoption="selectedoption" :search="searchdata" />
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<script setup lang="ts">
|
|
72
|
+
import { debounce } from "lodash-es";
|
|
73
|
+
import { computed, reactive, ref, useSlots, watchEffect } from "vue";
|
|
74
|
+
import { useRoute } from "vue-router";
|
|
75
|
+
import Button from "@/components/Button.vue";
|
|
76
|
+
import Checkbox from "@/components/Checkbox.vue";
|
|
77
|
+
import Input from "@/components/Input.vue";
|
|
78
|
+
import { useGum } from "@/plugins/gum";
|
|
79
|
+
import Pagination from "./Pagination.vue";
|
|
80
|
+
import SelectOption from "./SelectOpption.vue";
|
|
81
|
+
|
|
82
|
+
interface DataRow {
|
|
83
|
+
id: string | number;
|
|
84
|
+
[key: string]: any;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
interface DataPage {
|
|
88
|
+
path: string;
|
|
89
|
+
current_page: number;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
interface DataTableProps {
|
|
93
|
+
data: any;
|
|
94
|
+
search?: string;
|
|
95
|
+
loop?: DataRow[] | false;
|
|
96
|
+
option?: Array<string | number>;
|
|
97
|
+
removable?: boolean;
|
|
98
|
+
countable?: boolean;
|
|
99
|
+
searchable?: boolean;
|
|
100
|
+
optionable?: boolean;
|
|
101
|
+
disabled?: boolean;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const props = withDefaults(defineProps<DataTableProps>(), {
|
|
105
|
+
search: "",
|
|
106
|
+
option: () => [],
|
|
107
|
+
removable: true,
|
|
108
|
+
countable: true,
|
|
109
|
+
searchable: true,
|
|
110
|
+
optionable: true,
|
|
111
|
+
disabled: false
|
|
112
|
+
});
|
|
113
|
+
const gum = useGum();
|
|
114
|
+
const route = useRoute();
|
|
115
|
+
|
|
116
|
+
const slots = useSlots();
|
|
117
|
+
|
|
118
|
+
const emit = defineEmits<(event: "remove", value: Array<string | number>) => void>();
|
|
119
|
+
|
|
120
|
+
// checkbox select
|
|
121
|
+
let checked = reactive<{ check: boolean; checkcolumn: Array<string | number> }>({
|
|
122
|
+
check: false,
|
|
123
|
+
checkcolumn: []
|
|
124
|
+
});
|
|
125
|
+
const checkAll = () => {
|
|
126
|
+
if (!checked.check) {
|
|
127
|
+
props.data.data.forEach((dt: DataRow) => {
|
|
128
|
+
if (!checked.checkcolumn.includes(dt.id)) {
|
|
129
|
+
checked.checkcolumn.push(dt.id);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
} else {
|
|
133
|
+
checked.checkcolumn = [];
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const updateChecked = () => (checked.checkcolumn.length === props.data.data.length ? (checked.check = true) : (checked.check = false));
|
|
137
|
+
|
|
138
|
+
// remove from parent
|
|
139
|
+
const remove = () => {
|
|
140
|
+
emit("remove", checked.checkcolumn);
|
|
141
|
+
checked.check = false;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
// for change data size show
|
|
145
|
+
const selectedoption = ref<string | number | undefined>(undefined);
|
|
146
|
+
const dataForOption = computed<DataPage>(() => ({
|
|
147
|
+
path: props.data.path,
|
|
148
|
+
current_page: props.data.current_page
|
|
149
|
+
}));
|
|
150
|
+
const tableRows = computed<DataRow[]>(() => (props.loop ? props.loop : props.data.data));
|
|
151
|
+
|
|
152
|
+
// search data
|
|
153
|
+
const searchdata = ref(props.search || "");
|
|
154
|
+
const searchMe = debounce(() => {
|
|
155
|
+
const isSearching = !!searchdata.value && searchdata.value.trim() !== "";
|
|
156
|
+
gum.get(props.data.path, {
|
|
157
|
+
query: {
|
|
158
|
+
page: isSearching ? 1 : props.data.current_page,
|
|
159
|
+
size: selectedoption.value,
|
|
160
|
+
search: searchdata.value
|
|
161
|
+
},
|
|
162
|
+
routePath: route.path,
|
|
163
|
+
preserveState: true,
|
|
164
|
+
preserveScroll: true,
|
|
165
|
+
skipFetch: true
|
|
166
|
+
});
|
|
167
|
+
}, 500);
|
|
168
|
+
|
|
169
|
+
// watch instantce
|
|
170
|
+
watchEffect(() => {
|
|
171
|
+
selectedoption.value = props.option.find((x) => Number(x) === Number(props.data.per_page));
|
|
172
|
+
searchdata.value = props.search || "";
|
|
173
|
+
});
|
|
174
|
+
</script>
|
|
175
|
+
|
|
176
|
+
<style lang="scss" scoped>
|
|
177
|
+
.border-custom {
|
|
178
|
+
border-color: #cccccc !important;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.no-shrink-table th,
|
|
182
|
+
.no-shrink-table td {
|
|
183
|
+
white-space: nowrap;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* By default (large screens and up) do not force a min-width:
|
|
187
|
+
allow table to size normally so no horizontal scrollbar on large screens */
|
|
188
|
+
@media (min-width: 992px) {
|
|
189
|
+
.no-shrink-table {
|
|
190
|
+
min-width: 0;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@media (max-width: 991.98px) {
|
|
195
|
+
.no-shrink-table {
|
|
196
|
+
min-width: 1000px;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
</style>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { computed, type Ref, readonly, ref } from "vue";
|
|
2
|
+
|
|
3
|
+
type UnknownRecord = Record<string, unknown>;
|
|
4
|
+
|
|
5
|
+
export type RoleLike = {
|
|
6
|
+
id?: string | number;
|
|
7
|
+
name?: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
slug?: string;
|
|
10
|
+
} & UnknownRecord;
|
|
11
|
+
|
|
12
|
+
export type AuthUser = UnknownRecord & {
|
|
13
|
+
id?: string | number;
|
|
14
|
+
name?: string;
|
|
15
|
+
role?: RoleLike | null;
|
|
16
|
+
roles?: RoleLike[] | null;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const userRef: Ref<AuthUser | null> = ref(null);
|
|
20
|
+
|
|
21
|
+
export function setUser(user: AuthUser | null) {
|
|
22
|
+
userRef.value = user;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function clearUser() {
|
|
26
|
+
userRef.value = null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function useAuth() {
|
|
30
|
+
return {
|
|
31
|
+
user: readonly(userRef),
|
|
32
|
+
isAuthenticated: computed(() => !!userRef.value),
|
|
33
|
+
setUser,
|
|
34
|
+
clearUser
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const authUser = computed<AuthUser>(() => userRef.value ?? {});
|
|
39
|
+
|
|
40
|
+
export function hasRole(...wanted: string[]): boolean {
|
|
41
|
+
const subject = userRef.value;
|
|
42
|
+
if (!subject) return false;
|
|
43
|
+
|
|
44
|
+
const current = (subject.roles ?? (subject.role ? [subject.role] : []))
|
|
45
|
+
.map((item) => (item.name || item.title || item.slug || "").toLowerCase().trim())
|
|
46
|
+
.filter(Boolean);
|
|
47
|
+
|
|
48
|
+
if (!wanted.length) return current.length > 0;
|
|
49
|
+
|
|
50
|
+
const expected = wanted.map((item) => item.toLowerCase().trim()).filter(Boolean);
|
|
51
|
+
return current.some((item) => expected.includes(item));
|
|
52
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const compactFormatter = new Intl.NumberFormat("en", {
|
|
2
|
+
notation: "compact",
|
|
3
|
+
maximumFractionDigits: 1
|
|
4
|
+
});
|
|
5
|
+
|
|
6
|
+
export function formatCompactNumber(value: number): string | number {
|
|
7
|
+
if (!Number.isFinite(value)) return String(value);
|
|
8
|
+
if (Math.abs(value) < 1000) return value;
|
|
9
|
+
return compactFormatter.format(value).replace(/\s/g, "");
|
|
10
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { DateTime } from "luxon";
|
|
3
|
+
|
|
4
|
+
declare const route: (name: string, params?: Record<string, unknown>) => string;
|
|
5
|
+
|
|
6
|
+
export function inArray<T>(needle: T, haystack: T[], strict = false): boolean {
|
|
7
|
+
if (!Array.isArray(haystack)) {
|
|
8
|
+
throw new TypeError("haystack must be an array");
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (strict) {
|
|
12
|
+
return haystack.includes(needle);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
for (const value of haystack) {
|
|
16
|
+
if (value === needle) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (typeof value === "number" && typeof needle === "number" && Number.isNaN(value) && Number.isNaN(needle)) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function empty(v: unknown): boolean {
|
|
29
|
+
if (v == null) return true;
|
|
30
|
+
if (typeof v === "boolean") return v === false;
|
|
31
|
+
if (typeof v === "number") return v === 0 || Number.isNaN(v);
|
|
32
|
+
if (typeof v === "bigint") return v === 0n;
|
|
33
|
+
if (typeof v === "string") return v === "" || v === "0";
|
|
34
|
+
if (Array.isArray(v)) return v.length === 0;
|
|
35
|
+
if (v instanceof Map || v instanceof Set) return v.size === 0;
|
|
36
|
+
if (typeof v === "object") return Object.keys(v).length === 0;
|
|
37
|
+
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export async function downloadFile(url: string, fileName: string): Promise<void> {
|
|
42
|
+
try {
|
|
43
|
+
const isDirectUrl = url.startsWith("/") || url.startsWith("http://") || url.startsWith("https://");
|
|
44
|
+
const targetUrl = isDirectUrl ? url : route(url, { file_name: fileName });
|
|
45
|
+
const res = await axios.get(targetUrl, { responseType: "blob" });
|
|
46
|
+
if (res.data) {
|
|
47
|
+
const objectUrl = window.URL.createObjectURL(new Blob([res.data]));
|
|
48
|
+
const link = document.createElement("a");
|
|
49
|
+
link.href = objectUrl;
|
|
50
|
+
link.setAttribute("download", fileName);
|
|
51
|
+
document.body.appendChild(link);
|
|
52
|
+
link.click();
|
|
53
|
+
link.remove();
|
|
54
|
+
window.URL.revokeObjectURL(objectUrl);
|
|
55
|
+
}
|
|
56
|
+
} catch (e) {
|
|
57
|
+
console.error("Export failed:", e);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export async function downloadExcel(url: string, fileName: string): Promise<void> {
|
|
62
|
+
await downloadFile(url, fileName);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function formatTaxPeriod(value: string): string {
|
|
66
|
+
if (!value) return "";
|
|
67
|
+
const date = DateTime.fromFormat(value, "yyyy-MM");
|
|
68
|
+
return date.isValid ? date.toFormat("MMM yyyy") : value;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function formatDate(value: string | null): string {
|
|
72
|
+
if (!value) return "";
|
|
73
|
+
const date = DateTime.fromISO(value);
|
|
74
|
+
return date.isValid ? date.toFormat("dd MMM yyyy") : value;
|
|
75
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<router-view />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup lang="ts">
|
|
6
|
+
import { onBeforeUnmount, onMounted } from "vue";
|
|
7
|
+
import { useAdminUiStore } from "@/stores/admin-ui";
|
|
8
|
+
|
|
9
|
+
const ui = useAdminUiStore();
|
|
10
|
+
|
|
11
|
+
onMounted(() => {
|
|
12
|
+
ui.initTheme();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
onBeforeUnmount(() => {
|
|
16
|
+
ui.cleanupTheme();
|
|
17
|
+
});
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<style scoped></style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- footer start -->
|
|
3
|
+
<footer
|
|
4
|
+
class="d-flex flex-column flex-sm-row row-gap-2 align-items-center justify-content-center justify-content-sm-between py-3 fst-italic">
|
|
5
|
+
<div class="text-secondary">
|
|
6
|
+
© nexwire {{ startYear }} - {{ currentYear }} ❤️ created by
|
|
7
|
+
<a href="#" target="_blank" class="text-decoration-none">niYam</a>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="d-block">
|
|
10
|
+
<a href="#" target="_blank" class="text-decoration-none me-2">About</a>
|
|
11
|
+
<a href="#" target="_blank" class="text-decoration-none me-2">Support</a>
|
|
12
|
+
<a href="#" target="_blank" class="text-decoration-none me-2">Contact Us</a>
|
|
13
|
+
</div>
|
|
14
|
+
</footer>
|
|
15
|
+
<!-- footer end -->
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
const startYear: number = 2026;
|
|
20
|
+
const currentYear: number = new Date().getFullYear();
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<style scoped></style>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<header :class="{ scrolled: isScrolled }">
|
|
3
|
+
<nav class="navbar bg-transparent p-0">
|
|
4
|
+
<div class="container-fluid p-0 row-gap-2 column-gap-1">
|
|
5
|
+
<button
|
|
6
|
+
id="off-canvas"
|
|
7
|
+
type="button"
|
|
8
|
+
class="nav-btn order-0"
|
|
9
|
+
title="Toggle Button"
|
|
10
|
+
@click="props.onToggleSidebar">
|
|
11
|
+
<i class="bi bi-layout-text-sidebar-reverse"></i>
|
|
12
|
+
</button>
|
|
13
|
+
<div id="pagebar" class="card card-body nav-card order-5 order-sm-2"></div>
|
|
14
|
+
<template v-for="btn in featureButtons" :key="btn.id">
|
|
15
|
+
<button v-if="!btn.render" type="button" class="nav-btn order-3 order-sm-3" :class="btn.class" :title="btn.title || undefined" :aria-label="btn.label || 'button'" v-bind="btn.attrs" @click="btn.onClick">
|
|
16
|
+
<i v-if="btn.icon" :class="btn.icon"></i>
|
|
17
|
+
<span v-if="btn.label" class="ms-1">{{ btn.label }}</span>
|
|
18
|
+
</button>
|
|
19
|
+
<template v-else>
|
|
20
|
+
<component :is="featureComponent(btn)" />
|
|
21
|
+
</template>
|
|
22
|
+
</template>
|
|
23
|
+
<div class="btn-group order-4 order-sm-4">
|
|
24
|
+
<button type="button" class="nav-btn w-100" title="user" data-bs-toggle="dropdown" data-bs-display="static" aria-expanded="false" aria-label="button">
|
|
25
|
+
<i class="bi bi-person-circle"></i>
|
|
26
|
+
</button>
|
|
27
|
+
<ul class="dropdown-menu dropdown-menu-end">
|
|
28
|
+
<li>
|
|
29
|
+
<a class="dropdown-item" href="#">
|
|
30
|
+
<div class="d-flex align-items-center">
|
|
31
|
+
<div class="flex-shrink-0 me-3">
|
|
32
|
+
<i class="bi bi-person-circle fs-1"></i>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="flex-grow-1 text-capitalize">
|
|
35
|
+
<h6 class="mb-0">{{ authUser?.name }}</h6>
|
|
36
|
+
<small class="text-muted">{{ authUser.role?.name }}</small>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</a>
|
|
40
|
+
</li>
|
|
41
|
+
<li>
|
|
42
|
+
<div class="dropdown-divider my-1"></div>
|
|
43
|
+
</li>
|
|
44
|
+
<li>
|
|
45
|
+
<router-link class="dropdown-item" to="/profile">
|
|
46
|
+
<i class="bi bi-person-check me-3"></i><span>My Profile</span>
|
|
47
|
+
</router-link>
|
|
48
|
+
</li>
|
|
49
|
+
<li>
|
|
50
|
+
<button type="button" class="dropdown-item" @click="props.onLogout">
|
|
51
|
+
<i class="bi bi-power me-3"></i><span>Log Out</span>
|
|
52
|
+
</button>
|
|
53
|
+
</li>
|
|
54
|
+
</ul>
|
|
55
|
+
</div>
|
|
56
|
+
<button id="theme-switch" type="button" title="theme" class="nav-btn order-1 order-sm-5" aria-label="button" @click="props.onToggleTheme">
|
|
57
|
+
<i :class="themeIconClass"></i>
|
|
58
|
+
</button>
|
|
59
|
+
</div>
|
|
60
|
+
</nav>
|
|
61
|
+
</header>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<script setup lang="ts">
|
|
65
|
+
import { computed, h, inject } from "vue";
|
|
66
|
+
import { authUser } from "@/composables/useAuth";
|
|
67
|
+
|
|
68
|
+
interface ButtonEntry {
|
|
69
|
+
id: symbol;
|
|
70
|
+
icon?: string;
|
|
71
|
+
label: string;
|
|
72
|
+
title: string;
|
|
73
|
+
attrs?: Record<string, string>;
|
|
74
|
+
class?: any;
|
|
75
|
+
onClick: () => void;
|
|
76
|
+
render?: () => any[];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const featureButtons = inject<ButtonEntry[]>("featureButtons")!;
|
|
80
|
+
|
|
81
|
+
function featureComponent(btn: ButtonEntry) {
|
|
82
|
+
return {
|
|
83
|
+
name: "FeatureSlot",
|
|
84
|
+
render: () => h("div", { class: ["order-3 order-sm-4", btn.class] }, btn.render!())
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
interface HeaderProps {
|
|
89
|
+
isScrolled: boolean;
|
|
90
|
+
themeMode: "light" | "dark" | "auto";
|
|
91
|
+
onLogout: () => void | Promise<void>;
|
|
92
|
+
onToggleSidebar: () => void;
|
|
93
|
+
onToggleTheme: () => void;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const props = defineProps<HeaderProps>();
|
|
97
|
+
|
|
98
|
+
const themeIconClass = computed(() => {
|
|
99
|
+
if (props.themeMode === "light") return "bi bi-brightness-high-fill";
|
|
100
|
+
if (props.themeMode === "dark") return "bi bi-moon-stars";
|
|
101
|
+
return "bi bi-circle-half";
|
|
102
|
+
});
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- sidebar start -->
|
|
3
|
+
<div class="sidebar">
|
|
4
|
+
<a
|
|
5
|
+
href="#"
|
|
6
|
+
role="button"
|
|
7
|
+
class="sidebar-toggle card card-body rounded-circle position-absolute top-0 end-0 d-xl-none"
|
|
8
|
+
title="sidebar-toggle"
|
|
9
|
+
@click.prevent="props.onToggleSidebar">
|
|
10
|
+
<i class="bi bi-chevron-left fw-bold"></i>
|
|
11
|
+
</a>
|
|
12
|
+
|
|
13
|
+
<div class="app-brand">
|
|
14
|
+
<a href="#" aria-label="logo">
|
|
15
|
+
<img src="@/assets/images/logo.png" alt="nexwire" />
|
|
16
|
+
</a>
|
|
17
|
+
</div>
|
|
18
|
+
<div id="accordion-sidebar" class="accordion accordion-flush">
|
|
19
|
+
<ul class="list-group px-3">
|
|
20
|
+
<li class="list-group-item" :class="{ active: isActive('/') }">
|
|
21
|
+
<router-link to="/">
|
|
22
|
+
<div class="menu-icon">
|
|
23
|
+
<i class="bi bi-house"></i>
|
|
24
|
+
</div>
|
|
25
|
+
<span>Dashboard</span>
|
|
26
|
+
</router-link>
|
|
27
|
+
</li>
|
|
28
|
+
<li class="split-label">
|
|
29
|
+
<span class="text-uppercase">setup</span>
|
|
30
|
+
</li>
|
|
31
|
+
<li class="list-group-item accordion-item">
|
|
32
|
+
<a
|
|
33
|
+
href="#"
|
|
34
|
+
class="accordion-button collapsed"
|
|
35
|
+
type="button"
|
|
36
|
+
data-bs-toggle="collapse"
|
|
37
|
+
data-bs-target="#flush-collapseOne"
|
|
38
|
+
aria-expanded="false"
|
|
39
|
+
aria-controls="flush-collapseOne">
|
|
40
|
+
<div class="menu-icon">
|
|
41
|
+
<i class="bi bi-shield-check"></i>
|
|
42
|
+
</div>
|
|
43
|
+
<span>Content</span>
|
|
44
|
+
</a>
|
|
45
|
+
<ul
|
|
46
|
+
id="flush-collapseOne"
|
|
47
|
+
class="list-group accordion-collapse collapse"
|
|
48
|
+
data-bs-parent="#accordion-sidebar">
|
|
49
|
+
<li class="list-group-item">
|
|
50
|
+
<a href="#">Posts</a>
|
|
51
|
+
</li>
|
|
52
|
+
<li class="list-group-item">
|
|
53
|
+
<a href="#">Pages</a>
|
|
54
|
+
</li>
|
|
55
|
+
<li class="list-group-item accordion-item">
|
|
56
|
+
<a
|
|
57
|
+
href="#"
|
|
58
|
+
class="accordion-button collapsed"
|
|
59
|
+
type="button"
|
|
60
|
+
data-bs-toggle="collapse"
|
|
61
|
+
data-bs-target="#flush-collapseTwo"
|
|
62
|
+
aria-expanded="false"
|
|
63
|
+
aria-controls="flush-collapseTwo">
|
|
64
|
+
<span>Media</span>
|
|
65
|
+
</a>
|
|
66
|
+
<ul id="flush-collapseTwo" class="list-group accordion-collapse collapse">
|
|
67
|
+
<li class="list-group-item">
|
|
68
|
+
<a href="#">Image</a>
|
|
69
|
+
</li>
|
|
70
|
+
<li class="list-group-item active">
|
|
71
|
+
<a href="#">Audio</a>
|
|
72
|
+
</li>
|
|
73
|
+
<li class="list-group-item accordion-item">
|
|
74
|
+
<a
|
|
75
|
+
href="#"
|
|
76
|
+
class="accordion-button collapsed"
|
|
77
|
+
type="button"
|
|
78
|
+
data-bs-toggle="collapse"
|
|
79
|
+
data-bs-target="#flush-collapseThree"
|
|
80
|
+
aria-expanded="false"
|
|
81
|
+
aria-controls="flush-collapseThree">
|
|
82
|
+
<span>Settings</span>
|
|
83
|
+
</a>
|
|
84
|
+
<ul id="flush-collapseThree" class="list-group accordion-collapse collapse">
|
|
85
|
+
<li class="list-group-item">
|
|
86
|
+
<a href="#">Users</a>
|
|
87
|
+
</li>
|
|
88
|
+
<li class="list-group-item">
|
|
89
|
+
<a href="#">Roles</a>
|
|
90
|
+
</li>
|
|
91
|
+
</ul>
|
|
92
|
+
</li>
|
|
93
|
+
</ul>
|
|
94
|
+
</li>
|
|
95
|
+
</ul>
|
|
96
|
+
</li>
|
|
97
|
+
<li class="list-group-item">
|
|
98
|
+
<a href="#">
|
|
99
|
+
<div class="menu-icon">
|
|
100
|
+
<i class="bi bi-chat"></i>
|
|
101
|
+
</div>
|
|
102
|
+
<span>Comments</span>
|
|
103
|
+
</a>
|
|
104
|
+
</li>
|
|
105
|
+
<li class="list-group-item">
|
|
106
|
+
<a href="#">
|
|
107
|
+
<div class="menu-icon">
|
|
108
|
+
<i class="bi bi-gear"></i>
|
|
109
|
+
</div>
|
|
110
|
+
<span>Tools</span>
|
|
111
|
+
</a>
|
|
112
|
+
</li>
|
|
113
|
+
</ul>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
<!-- sidebar end -->
|
|
117
|
+
</template>
|
|
118
|
+
|
|
119
|
+
<script setup lang="ts">
|
|
120
|
+
import { onBeforeUnmount, onMounted } from "vue";
|
|
121
|
+
import { useRoute } from "vue-router";
|
|
122
|
+
import { useAdminUiStore } from "@/stores/admin-ui";
|
|
123
|
+
|
|
124
|
+
const props = defineProps<{ onToggleSidebar: () => void }>();
|
|
125
|
+
|
|
126
|
+
const ui = useAdminUiStore();
|
|
127
|
+
const route = useRoute();
|
|
128
|
+
|
|
129
|
+
function isActive(path: string) {
|
|
130
|
+
return route.path === path;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
onMounted(() => ui.initSidebarCollapsePersistence());
|
|
134
|
+
onBeforeUnmount(() => ui.cleanupSidebarCollapsePersistence());
|
|
135
|
+
</script>
|
|
136
|
+
|
|
137
|
+
<style lang="scss" scoped></style>
|