nuxt-users 1.1.2 → 1.1.4

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.
Files changed (51) hide show
  1. package/.vscode/settings.json +18 -0
  2. package/CHANGELOG.md +174 -0
  3. package/README.md +12 -2
  4. package/dist/cli.d.mts +1 -0
  5. package/dist/cli.d.ts +1 -0
  6. package/dist/cli.mjs +269 -0
  7. package/dist/module.d.mts +1 -51
  8. package/dist/module.d.ts +7 -0
  9. package/dist/module.json +2 -2
  10. package/dist/module.mjs +11 -81
  11. package/dist/runtime/assets/colors.css +1 -0
  12. package/dist/runtime/components/ForgotPasswordForm.vue +21 -23
  13. package/dist/runtime/components/LoginForm.vue +42 -30
  14. package/dist/runtime/components/LoginForm.vue.d.ts +8 -8
  15. package/dist/runtime/components/ResetPasswordForm.vue +40 -33
  16. package/dist/runtime/plugin.js +13 -3
  17. package/dist/runtime/server/api/login.post.js +1 -1
  18. package/dist/runtime/server/services/password.js +1 -2
  19. package/dist/shared/nuxt-users.Dtq4WcpY.d.mts +58 -0
  20. package/dist/shared/nuxt-users.Dtq4WcpY.d.ts +58 -0
  21. package/dist/shared/nuxt-users.eSQUrS6l.mjs +333 -0
  22. package/dist/utils.d.mts +37 -0
  23. package/dist/utils.d.ts +37 -0
  24. package/dist/utils.mjs +3 -0
  25. package/package.json +59 -27
  26. package/data/default.sqlite3 +0 -0
  27. package/dist/runtime/server/utils/create-migrations-table.d.ts +0 -2
  28. package/dist/runtime/server/utils/create-migrations-table.js +0 -35
  29. package/dist/runtime/server/utils/create-password-reset-tokens-table.d.ts +0 -2
  30. package/dist/runtime/server/utils/create-password-reset-tokens-table.js +0 -40
  31. package/dist/runtime/server/utils/create-personal-access-tokens-table.d.ts +0 -2
  32. package/dist/runtime/server/utils/create-personal-access-tokens-table.js +0 -56
  33. package/dist/runtime/server/utils/create-user.d.ts +0 -1
  34. package/dist/runtime/server/utils/create-user.js +0 -1
  35. package/dist/runtime/server/utils/create-users-table.d.ts +0 -2
  36. package/dist/runtime/server/utils/create-users-table.js +0 -44
  37. package/dist/runtime/server/utils/db.d.ts +0 -8
  38. package/dist/runtime/server/utils/db.js +0 -61
  39. package/dist/runtime/server/utils/migrate.d.ts +0 -4
  40. package/dist/runtime/server/utils/migrate.js +0 -63
  41. package/dist/runtime/server/utils/user.d.ts +0 -21
  42. package/dist/runtime/server/utils/user.js +0 -50
  43. package/src/cli/create-migrations-table.ts +0 -24
  44. package/src/cli/create-password-reset-tokens-table.ts +0 -24
  45. package/src/cli/create-personal-access-tokens-table.ts +0 -24
  46. package/src/cli/create-user.ts +0 -40
  47. package/src/cli/create-users-table.ts +0 -24
  48. package/src/cli/main.ts +0 -28
  49. package/src/cli/migrate.ts +0 -24
  50. package/src/cli/project-info.ts +0 -45
  51. package/src/cli/utils.ts +0 -70
package/src/cli/utils.ts DELETED
@@ -1,70 +0,0 @@
1
- import type { ModuleOptions, DatabaseConfig } from '../types'
2
-
3
- export const defaultOptions: ModuleOptions = {
4
- connector: {
5
- name: 'sqlite',
6
- options: {
7
- path: './data/default.sqlite3',
8
- },
9
- },
10
- tables: {
11
- users: 'users',
12
- personalAccessTokens: 'personal_access_tokens',
13
- passwordResetTokens: 'password_reset_tokens',
14
- },
15
- mailer: {
16
- host: 'smtp.ethereal.email',
17
- port: 587,
18
- secure: false,
19
- auth: {
20
- user: 'user@ethereal.email',
21
- pass: 'password',
22
- },
23
- defaults: {
24
- from: '"Nuxt Users Module" <noreply@example.com>',
25
- },
26
- },
27
- passwordResetBaseUrl: 'http://localhost:3000',
28
- }
29
-
30
- export const getOptionsFromEnv = (): ModuleOptions => {
31
- const connectorName = process.env.DB_CONNECTOR || 'sqlite'
32
-
33
- let connectorOptions: DatabaseConfig
34
-
35
- switch (connectorName) {
36
- case 'sqlite':
37
- connectorOptions = {
38
- path: process.env.DB_PATH || './data/default.sqlite3',
39
- }
40
- break
41
- case 'mysql':
42
- connectorOptions = {
43
- host: process.env.DB_HOST || 'localhost',
44
- port: Number.parseInt(process.env.DB_PORT || '3306'),
45
- user: process.env.DB_USER || 'root',
46
- password: process.env.DB_PASSWORD || '',
47
- database: process.env.DB_NAME || 'nuxt_users',
48
- }
49
- break
50
- case 'postgresql':
51
- connectorOptions = {
52
- host: process.env.DB_HOST || 'localhost',
53
- port: Number.parseInt(process.env.DB_PORT || '5432'),
54
- user: process.env.DB_USER || 'postgres',
55
- password: process.env.DB_PASSWORD || '',
56
- database: process.env.DB_NAME || 'nuxt_users',
57
- }
58
- break
59
- default:
60
- throw new Error(`Unsupported database connector: ${connectorName}`)
61
- }
62
-
63
- return {
64
- ...defaultOptions,
65
- connector: {
66
- name: connectorName as 'sqlite' | 'mysql' | 'postgresql',
67
- options: connectorOptions,
68
- },
69
- }
70
- }