create-nexwire 4.2.2 → 4.2.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 (90) hide show
  1. package/express/package.json +48 -23
  2. package/express/src/database/migrations/sqlite/0000_init.sql +47 -60
  3. package/express/src/database/migrations/sqlite/meta/0000_snapshot.json +1 -89
  4. package/express/src/database/migrations/sqlite/meta/_journal.json +1 -1
  5. package/express/src/database/schema.ts +2 -3
  6. package/express/src/framework/database/app-schema.ts +37 -0
  7. package/express/src/framework/database/connection.ts +198 -196
  8. package/express/src/framework/database/seed.ts +35 -22
  9. package/express/src/framework/facade.ts +35 -5
  10. package/express/src/framework/kernel.ts +54 -52
  11. package/express/src/framework/maker-cli/db/core.mjs +291 -288
  12. package/express/src/framework/maker-cli/index.mjs +2 -0
  13. package/express/src/framework/maker-cli/module/core.mjs +155 -87
  14. package/express/src/framework/maker-cli/module/index.mjs +13 -4
  15. package/express/src/framework/maker-cli/provider/core.mjs +49 -0
  16. package/express/src/framework/maker-cli/provider/index.mjs +12 -0
  17. package/express/src/framework/maker-cli/stubs/notification/controller.ts.stub +76 -77
  18. package/express/src/framework/maker-cli/stubs/notification/job.ts.stub +11 -13
  19. package/express/src/framework/maker-cli/stubs/notification/model.ts.stub +29 -0
  20. package/express/src/framework/maker-cli/stubs/notification/provider.ts.stub +174 -0
  21. package/express/src/framework/maker-cli/stubs/notification/route.api.ts.stub +11 -10
  22. package/express/src/framework/maker-cli/stubs/notification/route.plain.ts.stub +1 -1
  23. package/express/src/framework/maker-cli/stubs/notification/schema.plain.ts.stub +25 -25
  24. package/express/src/framework/maker-cli/stubs/notification/schema.ts.stub +25 -25
  25. package/express/src/framework/maker-cli/stubs/provider/module-barrel.ts.stub +19 -0
  26. package/express/src/framework/maker-cli/stubs/provider/module.ts.stub +21 -0
  27. package/express/src/framework/maker-cli/stubs/provider/name.ts.stub +21 -0
  28. package/express/src/framework/maker-cli/utils/help.mjs +6 -1
  29. package/express/src/framework/notification/index.ts +65 -47
  30. package/express/src/framework/providers/adapter.ts +139 -0
  31. package/express/src/framework/providers/contracts.ts +126 -0
  32. package/express/src/framework/providers/loader.ts +105 -0
  33. package/express/src/framework/providers/registry.ts +88 -0
  34. package/express/src/middlewares/auth-middleware.ts +65 -38
  35. package/express/src/providers/README.md +107 -0
  36. package/express/src/resources/src/main.ts +1 -1
  37. package/express/src/resources/src/pages/auth/forgetPassword.vue +1 -1
  38. package/express/src/resources/src/pages/auth/login.vue +1 -1
  39. package/express/src/resources/src/pages/auth/register.vue +1 -1
  40. package/express/src/resources/src/pages/auth/resetPassword.vue +1 -1
  41. package/express/src/resources/src/pages/auth/verifyEmail.vue +1 -1
  42. package/express/src/resources/src/pages/dashboard/index.vue +66 -66
  43. package/express/src/storage/database/nexwire.sqlite +0 -0
  44. package/hono/package.json +44 -19
  45. package/hono/src/database/migrations/sqlite/0000_init.sql +47 -60
  46. package/hono/src/database/migrations/sqlite/meta/0000_snapshot.json +1 -89
  47. package/hono/src/database/migrations/sqlite/meta/_journal.json +1 -1
  48. package/hono/src/database/schema.ts +2 -3
  49. package/hono/src/framework/database/app-schema.ts +37 -0
  50. package/hono/src/framework/database/connection.ts +198 -196
  51. package/hono/src/framework/database/seed.ts +35 -22
  52. package/hono/src/framework/facade.ts +59 -29
  53. package/hono/src/framework/kernel.ts +50 -48
  54. package/hono/src/framework/maker-cli/db/core.mjs +291 -288
  55. package/hono/src/framework/maker-cli/index.mjs +2 -0
  56. package/hono/src/framework/maker-cli/module/core.mjs +123 -52
  57. package/hono/src/framework/maker-cli/module/index.mjs +13 -4
  58. package/hono/src/framework/maker-cli/provider/core.mjs +49 -0
  59. package/hono/src/framework/maker-cli/provider/index.mjs +12 -0
  60. package/hono/src/framework/maker-cli/stubs/notification/controller.ts.stub +90 -85
  61. package/hono/src/framework/maker-cli/stubs/notification/job.ts.stub +10 -12
  62. package/hono/src/framework/maker-cli/stubs/notification/model.ts.stub +29 -0
  63. package/hono/src/framework/maker-cli/stubs/notification/provider.ts.stub +174 -0
  64. package/hono/src/framework/maker-cli/stubs/notification/route.api.ts.stub +11 -10
  65. package/hono/src/framework/maker-cli/stubs/notification/route.plain.ts.stub +1 -1
  66. package/hono/src/framework/maker-cli/stubs/notification/schema.plain.ts.stub +25 -25
  67. package/hono/src/framework/maker-cli/stubs/notification/schema.ts.stub +25 -25
  68. package/hono/src/framework/maker-cli/stubs/provider/module-barrel.ts.stub +19 -0
  69. package/hono/src/framework/maker-cli/stubs/provider/module.ts.stub +21 -0
  70. package/hono/src/framework/maker-cli/stubs/provider/name.ts.stub +21 -0
  71. package/hono/src/framework/maker-cli/utils/help.mjs +6 -1
  72. package/hono/src/framework/notification/index.ts +65 -47
  73. package/hono/src/framework/providers/adapter.ts +139 -0
  74. package/hono/src/framework/providers/contracts.ts +126 -0
  75. package/hono/src/framework/providers/loader.ts +105 -0
  76. package/hono/src/framework/providers/registry.ts +88 -0
  77. package/hono/src/middlewares/auth-middleware.ts +65 -38
  78. package/hono/src/providers/README.md +107 -0
  79. package/hono/src/resources/src/main.ts +1 -1
  80. package/hono/src/resources/src/pages/auth/forgetPassword.vue +1 -1
  81. package/hono/src/resources/src/pages/auth/login.vue +1 -1
  82. package/hono/src/resources/src/pages/auth/register.vue +1 -1
  83. package/hono/src/resources/src/pages/auth/resetPassword.vue +1 -1
  84. package/hono/src/resources/src/pages/auth/verifyEmail.vue +1 -1
  85. package/hono/src/resources/src/pages/dashboard/index.vue +66 -66
  86. package/hono/src/storage/database/nexwire.sqlite +0 -0
  87. package/package.json +10 -10
  88. package/src/index.js +14 -6
  89. package/express/src/modules/auth/database/models/notification.ts +0 -24
  90. package/hono/src/modules/auth/database/models/notification.ts +0 -24
@@ -0,0 +1,107 @@
1
+ # Providers
2
+
3
+ Provider files in this folder are imported automatically when the application
4
+ boots. Use them for anything the **whole app** needs — a replacement auth
5
+ implementation, a payment gateway, an SMS driver, a storage backend.
6
+
7
+ There is no wiring step: drop a file in here and it runs.
8
+
9
+ ## How it works
10
+
11
+ 1. Every `src/providers/**/*.{ts,js,mjs}` file is imported at boot.
12
+ 2. Every `src/modules/<module>/providers.ts` file is imported at boot too, so a
13
+ module can plug itself into the app without the app knowing about it.
14
+ 3. Every `src/modules/<module>/providers/*.ts` file is imported at boot as well,
15
+ for a module that offers more than one implementation.
16
+ 4. A provider file claims a contract by registering an implementation.
17
+
18
+ ```ts
19
+ // src/providers/payment.ts
20
+ import { registerProvider } from "@/framework/facade.js";
21
+
22
+ registerProvider("payment", {
23
+ async charge(order) {
24
+ return { id: "ch_123", status: "paid" };
25
+ }
26
+ });
27
+ ```
28
+
29
+ Read it back the same way:
30
+
31
+ ```ts
32
+ import { getProvider } from "@/framework/facade.js";
33
+
34
+ const payment = getProvider<any>("payment");
35
+ ```
36
+
37
+ ## Generating one
38
+
39
+ ```bash
40
+ npm run maker provider:make payment
41
+ npm run maker module:make-provider billing stripe
42
+ ```
43
+
44
+ `provider:make` writes `src/providers/<name>.ts` for the whole app.
45
+ `module:make-provider` writes `src/modules/<module>/providers/<name>.ts` for a
46
+ single module. Both files register themselves when they are imported.
47
+
48
+ ## Replacing the built-in auth
49
+
50
+ The framework ships with an auth module under `src/modules/auth`. To replace
51
+ it, delete that folder and register your own auth provider:
52
+
53
+ ```ts
54
+ // src/providers/auth.ts
55
+ import { registerAuthProvider } from "@/framework/facade.js";
56
+ import type { AuthProvider } from "@/framework/facade.js";
57
+
58
+ const authProvider: AuthProvider = {
59
+ async getUserById(id) {
60
+ // Return any user shape you like. Extra fields (tenantId, plan, status, ...)
61
+ // are passed straight through to `c.get("auth")` / `res.locals.auth`.
62
+ return { id, email: "user@example.com", tenantId: 42, plan: "pro" };
63
+ },
64
+ async findRefreshToken(jti) {
65
+ // Return the stored refresh token, or null when it is unknown.
66
+ return { id: 1, jti, revoked: false, expiresAt: new Date() };
67
+ },
68
+ async revokeRefreshToken(tokenId) {
69
+ // Optional. Called when a refresh token is expired or revoked.
70
+ },
71
+ async getAuthContext(user, payload) {
72
+ // Optional. Shapes what handlers receive as the auth context.
73
+ return { id: user.id, email: user.email, tenantId: user.tenantId };
74
+ },
75
+ async getUserContact(userId) {
76
+ // Optional. Used by `notify()` to find the email address of a user.
77
+ return { email: "user@example.com", name: "User" };
78
+ }
79
+ };
80
+
81
+ registerAuthProvider(authProvider);
82
+ ```
83
+
84
+ Import `registerAuthProvider` and the `AuthProvider` type from
85
+ `@/framework/facade.js` — never from `@/framework/...` internals. The facade is
86
+ the public API of the framework.
87
+
88
+ ## Module-to-module
89
+
90
+ Modules do not import each other. They talk through:
91
+
92
+ - `src/modules/<module>/facade.ts` — the public API of a module.
93
+ - `dispatchEvent` / `dispatchCommand` — for cross-module notifications.
94
+ - `src/providers/` — for app-wide implementations.
95
+
96
+ ## Contract reference
97
+
98
+ | Method | Required | Purpose |
99
+ | ----------------------------------- | -------- | -------------------------------------------------------------- |
100
+ | `getUserById(id)` | Yes | Loads a user. Any extra fields are passed through to the auth context. |
101
+ | `findRefreshToken(jti)` | Yes | Loads a stored refresh token by its JWT id. |
102
+ | `revokeRefreshToken(id)` | No | Revokes a refresh token. `deleteRefreshToken(id)` also works. |
103
+ | `getAuthContext(user, payload)` | No | Shapes the object handlers receive as `auth`. |
104
+ | `getUserContact(userId)` | No | Finds the email/name of a user, used by notifications. |
105
+
106
+ When no provider is registered and `src/modules/auth` was deleted, the auth
107
+ middleware logs a warning and lets the request through instead of crashing.
@@ -1,5 +1,5 @@
1
1
  import "@/plugins/axios";
2
- import { createHead } from "@vueuse/head";
2
+ import { createHead } from "@unhead/vue/client";
3
3
  import { createPinia } from "pinia";
4
4
  import { createApp } from "vue";
5
5
  import { DialogPlugin } from "@/plugins/dialog";
@@ -43,7 +43,7 @@
43
43
  </template>
44
44
 
45
45
  <script setup lang="ts">
46
- import { useHead } from "@vueuse/head";
46
+ import { useHead } from "@unhead/vue";
47
47
  import { ref } from "vue";
48
48
  import Button from "@/components/Button.vue";
49
49
  import Input from "@/components/Input.vue";
@@ -47,7 +47,7 @@
47
47
  </template>
48
48
 
49
49
  <script setup lang="ts">
50
- import { useHead } from "@vueuse/head";
50
+ import { useHead } from "@unhead/vue";
51
51
  import { ref } from "vue";
52
52
  import { useRouter } from "vue-router";
53
53
  import Button from "@/components/Button.vue";
@@ -65,7 +65,7 @@
65
65
  </template>
66
66
 
67
67
  <script setup lang="ts">
68
- import { useHead } from "@vueuse/head";
68
+ import { useHead } from "@unhead/vue";
69
69
  import { ref } from "vue";
70
70
  import { useRouter } from "vue-router";
71
71
  import Button from "@/components/Button.vue";
@@ -53,7 +53,7 @@
53
53
  </template>
54
54
 
55
55
  <script setup lang="ts">
56
- import { useHead } from "@vueuse/head";
56
+ import { useHead } from "@unhead/vue";
57
57
  import { ref } from "vue";
58
58
  import { useRoute, useRouter } from "vue-router";
59
59
  import Button from "@/components/Button.vue";
@@ -23,7 +23,7 @@
23
23
  </template>
24
24
 
25
25
  <script setup lang="ts">
26
- import { useHead } from "@vueuse/head";
26
+ import { useHead } from "@unhead/vue";
27
27
  import { ref } from "vue";
28
28
  import { useRoute } from "vue-router";
29
29
  import { useGum } from "@/plugins/gum";
@@ -1,66 +1,66 @@
1
- <template>
2
- <Pagebar title="Dashboard" />
3
-
4
- <div class="dashboard-placeholder">
5
- <div class="row g-2 mb-2">
6
- <div class="col-12 col-md-4">
7
- <div class="placeholder-card"></div>
8
- </div>
9
- <div class="col-12 col-md-4">
10
- <div class="placeholder-card"></div>
11
- </div>
12
- <div class="col-12 col-md-4">
13
- <div class="placeholder-card"></div>
14
- </div>
15
- </div>
16
-
17
- <div class="placeholder-panel"></div>
18
- </div>
19
- </template>
20
-
21
- <script setup lang="ts">
22
- import { useHead } from "@vueuse/head";
23
- import { onMounted, onUnmounted } from "vue";
24
- import Pagebar from "@/components/Pagebar.vue";
25
- import { useAuth } from "@/composables/useAuth";
26
- import { pulse } from "@/plugins/pulse";
27
-
28
- useHead({ title: "Dashboard" });
29
-
30
- const { user } = useAuth();
31
-
32
- onMounted(() => {
33
- const ch = pulse.channel("user");
34
- ch.listen("user.changed", () => alert("me"));
35
- onUnmounted(() => ch.stopListening("user.changed"));
36
- });
37
-
38
- // const hardRefresh = () => window.location.reload();
39
- </script>
40
-
41
- <style scoped>
42
- .placeholder-card,
43
- .placeholder-panel {
44
- border: 1px solid var(--app-border);
45
- border-radius: 0.3rem;
46
- background: var(--app-surface);
47
- }
48
-
49
- .placeholder-card {
50
- min-height: 220px;
51
- }
52
-
53
- .placeholder-panel {
54
- min-height: 520px;
55
- }
56
-
57
- @media (max-width: 768px) {
58
- .placeholder-card {
59
- min-height: 160px;
60
- }
61
-
62
- .placeholder-panel {
63
- min-height: 360px;
64
- }
65
- }
66
- </style>
1
+ <template>
2
+ <Pagebar title="Dashboard" />
3
+
4
+ <div class="dashboard-placeholder">
5
+ <div class="row g-2 mb-2">
6
+ <div class="col-12 col-md-4">
7
+ <div class="placeholder-card"></div>
8
+ </div>
9
+ <div class="col-12 col-md-4">
10
+ <div class="placeholder-card"></div>
11
+ </div>
12
+ <div class="col-12 col-md-4">
13
+ <div class="placeholder-card"></div>
14
+ </div>
15
+ </div>
16
+
17
+ <div class="placeholder-panel"></div>
18
+ </div>
19
+ </template>
20
+
21
+ <script setup lang="ts">
22
+ import { useHead } from "@unhead/vue";
23
+ import { onMounted, onUnmounted } from "vue";
24
+ import Pagebar from "@/components/Pagebar.vue";
25
+ import { useAuth } from "@/composables/useAuth";
26
+ import { pulse } from "@/plugins/pulse";
27
+
28
+ useHead({ title: "Dashboard" });
29
+
30
+ const { user } = useAuth();
31
+
32
+ onMounted(() => {
33
+ const ch = pulse.channel("user");
34
+ ch.listen("user.changed", () => alert("me"));
35
+ onUnmounted(() => ch.stopListening("user.changed"));
36
+ });
37
+
38
+ // const hardRefresh = () => window.location.reload();
39
+ </script>
40
+
41
+ <style scoped>
42
+ .placeholder-card,
43
+ .placeholder-panel {
44
+ border: 1px solid var(--app-border);
45
+ border-radius: 0.3rem;
46
+ background: var(--app-surface);
47
+ }
48
+
49
+ .placeholder-card {
50
+ min-height: 220px;
51
+ }
52
+
53
+ .placeholder-panel {
54
+ min-height: 520px;
55
+ }
56
+
57
+ @media (max-width: 768px) {
58
+ .placeholder-card {
59
+ min-height: 160px;
60
+ }
61
+
62
+ .placeholder-panel {
63
+ min-height: 360px;
64
+ }
65
+ }
66
+ </style>
package/hono/package.json CHANGED
@@ -32,17 +32,17 @@
32
32
  "@aws-sdk/s3-request-presigner": "^3.1111.0",
33
33
  "@bull-board/api": "^8.6.1",
34
34
  "@bull-board/hono": "^8.6.1",
35
- "@hono/node-server": "^2.1.0",
35
+ "@hono/node-server": "^2.1.5",
36
36
  "@hono/zod-openapi": "~1.5.3",
37
37
  "@libsql/client": "^0.17.4",
38
38
  "@scalar/hono-api-reference": "^0.10.20",
39
39
  "@socket.io/admin-ui": "^0.5.1",
40
40
  "@socket.io/bun-engine": "^0.1.1",
41
41
  "@socket.io/redis-adapter": "^8.3.0",
42
- "@vitejs/plugin-vue": "^6.0.8",
42
+ "@unhead/vue": "^3.4.3",
43
+ "@vitejs/plugin-vue": "^6.0.10",
43
44
  "@vuepic/vue-datepicker": "^14.0.0",
44
45
  "@vueuse/core": "^14.4.0",
45
- "@vueuse/head": "^2.0.0",
46
46
  "axios": "^1.19.0",
47
47
  "bcryptjs": "^3.0.3",
48
48
  "bootstrap": "^5.3.8",
@@ -50,48 +50,73 @@
50
50
  "bullmq": "^5.81.3",
51
51
  "bullmq-durable": "^0.2.0",
52
52
  "chalk": "^5.6.2",
53
- "commander": "^14.0.3",
53
+ "commander": "^15.0.0",
54
54
  "croner": "^10.0.1",
55
55
  "dotenv": "^17.4.2",
56
56
  "dotenv-expand": "^13.0.0",
57
- "drizzle-orm": "^0.45.2",
57
+ "drizzle-orm": "^0.45.4",
58
58
  "glob": "^13.0.6",
59
- "hono": "^4.13.1",
59
+ "hono": "^4.13.14",
60
60
  "hono-rate-limiter": "^0.5.3",
61
61
  "ioredis": "^5.11.1",
62
62
  "lodash-es": "^4.18.1",
63
63
  "luxon": "^3.7.2",
64
- "maildev": "^2.2.1",
64
+ "maildev": "^3.0.0",
65
65
  "mysql2": "^3.23.3",
66
- "nodemailer": "^9.0.5",
66
+ "nodemailer": "^10.2.1",
67
67
  "pinia": "^3.0.4",
68
68
  "pino": "^10.3.1",
69
69
  "postgres": "^3.4.9",
70
70
  "redis-commander": "^0.9.0",
71
71
  "sass": "^1.100.0",
72
- "socket.io": "^4.8.3",
73
- "socket.io-client": "^4.8.3",
72
+ "socket.io": "^4.8.4",
73
+ "socket.io-client": "^4.8.4",
74
74
  "stoker": "^2.0.1",
75
- "vite": "^8.2.1",
75
+ "vite": "^8.3.5",
76
76
  "vue": "^3.5.41",
77
77
  "vue-router": "^5.2.0",
78
78
  "vue-select": "^4.0.0-beta.6",
79
- "zod": "^4.4.3"
79
+ "zod": "^4.6.7"
80
+ },
81
+ "overrides": {
82
+ "@esbuild-kit/core-utils": {
83
+ "esbuild": "^0.25.12"
84
+ },
85
+ "@maildev/mcp": {
86
+ "zod": "^4.6.7"
87
+ },
88
+ "@maildev/smtp": {
89
+ "jsdom": "^27.4.0",
90
+ "nodemailer": "^10.2.1"
91
+ },
92
+ "redis-commander": {
93
+ "express": "^4.22.3",
94
+ "body-parser": "^1.20.9",
95
+ "bcrypt": "npm:bcryptjs@^3.0.3",
96
+ "bcryptjs": "^3.0.3"
97
+ }
98
+ },
99
+ "allowScripts": {
100
+ "@parcel/watcher": true,
101
+ "esbuild": true,
102
+ "msgpackr-extract": true,
103
+ "redis-commander": true,
104
+ "vue-demi": true
80
105
  },
81
106
  "devDependencies": {
82
107
  "@biomejs/biome": "^2.5.7",
83
108
  "@types/bootstrap": "^5.2.11",
84
109
  "@types/lodash-es": "^4.17.12",
85
- "@types/node": "^25.9.5",
86
- "@vitest/coverage-v8": "^4.1.10",
87
- "drizzle-kit": "^0.31.10",
88
- "tsc-alias": "^1.9.2",
89
- "tsx": "^4.23.12",
110
+ "@types/node": "^25.9.9",
111
+ "@vitest/coverage-v8": "^5.0.5",
112
+ "drizzle-kit": "^0.31.11",
113
+ "tsc-alias": "^1.9.9",
114
+ "tsx": "^4.23.15",
90
115
  "typescript": "^6.0.3",
91
- "vitest": "^4.1.10"
116
+ "vitest": "^5.0.5"
92
117
  },
93
118
  "engines": {
94
- "node": ">=22",
119
+ "node": ">=22.12.0",
95
120
  "bun": ">=1.3",
96
121
  "pnpm": ">=11",
97
122
  "yarn": ">=4"
@@ -1,61 +1,48 @@
1
- CREATE TABLE `notifications` (
2
- `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
3
- `user_id` integer NOT NULL,
4
- `type` text NOT NULL,
5
- `title` text NOT NULL,
6
- `body` text,
7
- `data` text,
8
- `link` text,
9
- `read_at` integer,
10
- `created_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL,
11
- FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE cascade ON DELETE cascade
12
- );
13
- --> statement-breakpoint
14
- CREATE TABLE `roles` (
15
- `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
16
- `name` text NOT NULL,
17
- `created_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL,
18
- `updated_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL
19
- );
20
- --> statement-breakpoint
21
- CREATE UNIQUE INDEX `roles_name_unique` ON `roles` (`name`);--> statement-breakpoint
22
- CREATE TABLE `email_verification_tokens` (
23
- `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
24
- `email` text NOT NULL,
25
- `token` text NOT NULL,
26
- `expires_at` integer NOT NULL,
27
- `created_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL
28
- );
29
- --> statement-breakpoint
30
- CREATE TABLE `password_reset_tokens` (
31
- `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
32
- `email` text NOT NULL,
33
- `token` text NOT NULL,
34
- `expires_at` integer NOT NULL,
35
- `created_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL
36
- );
37
- --> statement-breakpoint
38
- CREATE TABLE `refresh_tokens` (
39
- `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
40
- `user_id` integer,
41
- `jti` text NOT NULL,
42
- `revoked` integer DEFAULT false,
43
- `expires_at` integer NOT NULL,
44
- `created_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL,
45
- FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE cascade ON DELETE set null
46
- );
47
- --> statement-breakpoint
48
- CREATE UNIQUE INDEX `refresh_tokens_jti_unique` ON `refresh_tokens` (`jti`);--> statement-breakpoint
49
- CREATE TABLE `users` (
50
- `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
51
- `name` text NOT NULL,
52
- `email` text NOT NULL,
53
- `password` text NOT NULL,
54
- `role_id` integer,
55
- `email_verified_at` integer,
56
- `created_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL,
57
- `updated_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL,
58
- FOREIGN KEY (`role_id`) REFERENCES `roles`(`id`) ON UPDATE cascade ON DELETE set null
59
- );
60
- --> statement-breakpoint
1
+ CREATE TABLE `roles` (
2
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
3
+ `name` text NOT NULL,
4
+ `created_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL,
5
+ `updated_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL
6
+ );
7
+ --> statement-breakpoint
8
+ CREATE UNIQUE INDEX `roles_name_unique` ON `roles` (`name`);--> statement-breakpoint
9
+ CREATE TABLE `email_verification_tokens` (
10
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
11
+ `email` text NOT NULL,
12
+ `token` text NOT NULL,
13
+ `expires_at` integer NOT NULL,
14
+ `created_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL
15
+ );
16
+ --> statement-breakpoint
17
+ CREATE TABLE `password_reset_tokens` (
18
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
19
+ `email` text NOT NULL,
20
+ `token` text NOT NULL,
21
+ `expires_at` integer NOT NULL,
22
+ `created_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL
23
+ );
24
+ --> statement-breakpoint
25
+ CREATE TABLE `refresh_tokens` (
26
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
27
+ `user_id` integer,
28
+ `jti` text NOT NULL,
29
+ `revoked` integer DEFAULT false,
30
+ `expires_at` integer NOT NULL,
31
+ `created_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL,
32
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE cascade ON DELETE set null
33
+ );
34
+ --> statement-breakpoint
35
+ CREATE UNIQUE INDEX `refresh_tokens_jti_unique` ON `refresh_tokens` (`jti`);--> statement-breakpoint
36
+ CREATE TABLE `users` (
37
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
38
+ `name` text NOT NULL,
39
+ `email` text NOT NULL,
40
+ `password` text NOT NULL,
41
+ `role_id` integer,
42
+ `email_verified_at` integer,
43
+ `created_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL,
44
+ `updated_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL,
45
+ FOREIGN KEY (`role_id`) REFERENCES `roles`(`id`) ON UPDATE cascade ON DELETE set null
46
+ );
47
+ --> statement-breakpoint
61
48
  CREATE UNIQUE INDEX `users_email_unique` ON `users` (`email`);
@@ -1,97 +1,9 @@
1
1
  {
2
2
  "version": "6",
3
3
  "dialect": "sqlite",
4
- "id": "e2276ee8-13c8-4baf-ab07-32e843a089ac",
4
+ "id": "f0fe475e-8a3e-4c5c-9b5e-9ec41ddfde71",
5
5
  "prevId": "00000000-0000-0000-0000-000000000000",
6
6
  "tables": {
7
- "notifications": {
8
- "name": "notifications",
9
- "columns": {
10
- "id": {
11
- "name": "id",
12
- "type": "integer",
13
- "primaryKey": true,
14
- "notNull": true,
15
- "autoincrement": true
16
- },
17
- "user_id": {
18
- "name": "user_id",
19
- "type": "integer",
20
- "primaryKey": false,
21
- "notNull": true,
22
- "autoincrement": false
23
- },
24
- "type": {
25
- "name": "type",
26
- "type": "text",
27
- "primaryKey": false,
28
- "notNull": true,
29
- "autoincrement": false
30
- },
31
- "title": {
32
- "name": "title",
33
- "type": "text",
34
- "primaryKey": false,
35
- "notNull": true,
36
- "autoincrement": false
37
- },
38
- "body": {
39
- "name": "body",
40
- "type": "text",
41
- "primaryKey": false,
42
- "notNull": false,
43
- "autoincrement": false
44
- },
45
- "data": {
46
- "name": "data",
47
- "type": "text",
48
- "primaryKey": false,
49
- "notNull": false,
50
- "autoincrement": false
51
- },
52
- "link": {
53
- "name": "link",
54
- "type": "text",
55
- "primaryKey": false,
56
- "notNull": false,
57
- "autoincrement": false
58
- },
59
- "read_at": {
60
- "name": "read_at",
61
- "type": "integer",
62
- "primaryKey": false,
63
- "notNull": false,
64
- "autoincrement": false
65
- },
66
- "created_at": {
67
- "name": "created_at",
68
- "type": "integer",
69
- "primaryKey": false,
70
- "notNull": true,
71
- "autoincrement": false,
72
- "default": "(cast((julianday('now') - 2440587.5)*86400000 as integer))"
73
- }
74
- },
75
- "indexes": {},
76
- "foreignKeys": {
77
- "notifications_user_id_users_id_fk": {
78
- "name": "notifications_user_id_users_id_fk",
79
- "tableFrom": "notifications",
80
- "tableTo": "users",
81
- "columnsFrom": [
82
- "user_id"
83
- ],
84
- "columnsTo": [
85
- "id"
86
- ],
87
- "onDelete": "cascade",
88
- "onUpdate": "cascade"
89
- }
90
- },
91
- "compositePrimaryKeys": {},
92
- "uniqueConstraints": {},
93
- "checkConstraints": {}
94
- },
95
7
  "roles": {
96
8
  "name": "roles",
97
9
  "columns": {
@@ -5,7 +5,7 @@
5
5
  {
6
6
  "idx": 0,
7
7
  "version": "6",
8
- "when": 1791141088797,
8
+ "when": 1792936160057,
9
9
  "tag": "0000_init",
10
10
  "breakpoints": true
11
11
  }
@@ -1,3 +1,2 @@
1
- export * from "../modules/auth/database/models/notification.js";
2
- export * from "../modules/auth/database/models/role.js";
3
- export * from "../modules/auth/database/models/user.js";
1
+ export * from "../modules/auth/database/models/role.js";
2
+ export * from "../modules/auth/database/models/user.js";