create-mantiq 0.7.0 → 0.7.2
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/package.json +2 -1
- package/skeleton/.env.example +64 -0
- package/skeleton/README.md +46 -0
- package/skeleton/app/Console/Commands/.gitkeep +0 -0
- package/skeleton/app/Enums/UserStatus.ts +7 -0
- package/skeleton/app/Http/Controllers/HomeController.ts +78 -0
- package/skeleton/app/Http/Middleware/.gitkeep +0 -0
- package/skeleton/app/Models/User.ts +7 -0
- package/skeleton/app/Providers/AppServiceProvider.ts +25 -0
- package/skeleton/app/Providers/DatabaseServiceProvider.ts +17 -0
- package/skeleton/bootstrap/.gitkeep +0 -0
- package/skeleton/config/ai.ts +51 -0
- package/skeleton/config/app.ts +108 -0
- package/skeleton/config/auth.ts +51 -0
- package/skeleton/config/broadcasting.ts +93 -0
- package/skeleton/config/cache.ts +61 -0
- package/skeleton/config/cors.ts +77 -0
- package/skeleton/config/database.ts +120 -0
- package/skeleton/config/filesystem.ts +58 -0
- package/skeleton/config/hashing.ts +47 -0
- package/skeleton/config/heartbeat.ts +112 -0
- package/skeleton/config/logging.ts +58 -0
- package/skeleton/config/mail.ts +93 -0
- package/skeleton/config/notify.ts +141 -0
- package/skeleton/config/queue.ts +59 -0
- package/skeleton/config/search.ts +96 -0
- package/skeleton/config/services.ts +110 -0
- package/skeleton/config/session.ts +84 -0
- package/skeleton/config/vite.ts +33 -0
- package/skeleton/database/factories/.gitkeep +0 -0
- package/skeleton/database/migrations/001_create_users_table.ts +19 -0
- package/skeleton/database/migrations/002_create_personal_access_tokens_table.ts +22 -0
- package/skeleton/database/seeders/DatabaseSeeder.ts +7 -0
- package/skeleton/index.ts +20 -0
- package/skeleton/mantiq.ts +8 -0
- package/skeleton/package.json +34 -0
- package/skeleton/public/.gitkeep +0 -0
- package/skeleton/routes/api.ts +8 -0
- package/skeleton/routes/channels.ts +23 -0
- package/skeleton/routes/console.ts +24 -0
- package/skeleton/routes/web.ts +6 -0
- package/skeleton/storage/cache/.gitkeep +0 -0
- package/skeleton/storage/framework/.gitkeep +0 -0
- package/skeleton/tests/feature/api.test.ts +14 -0
- package/skeleton/tests/feature/home.test.ts +17 -0
- package/skeleton/tests/unit/example.test.ts +11 -0
- package/skeleton/tsconfig.json +27 -0
- package/src/index.ts +289 -25
- package/src/templates.ts +141 -945
- package/src/terminal.ts +64 -0
- package/stubs/api-only/routes/api.ts.stub +24 -0
- package/stubs/api-only/tests/feature/token-auth.test.ts.stub +69 -0
- package/stubs/auth/api/app/Http/Controllers/ApiAuthController.ts.stub +57 -0
- package/stubs/auth/api/routes/api.ts.stub +24 -0
- package/stubs/auth/api/tests/feature/token-auth.test.ts.stub +69 -0
- package/stubs/auth/shared/app/Http/Requests/LoginRequest.ts.stub +10 -0
- package/stubs/auth/shared/app/Http/Requests/RegisterRequest.ts.stub +11 -0
- package/stubs/auth/web/app/Http/Controllers/AuthController.ts.stub +43 -0
- package/stubs/auth/web/app/Http/Controllers/PageController.ts.stub +66 -0
- package/stubs/auth/web/routes/web.ts.stub +25 -0
- package/stubs/auth/web/svelte/src/App.svelte.stub +77 -0
- package/stubs/auth/web/svelte/src/pages.ts.stub +17 -0
- package/stubs/auth/web/tests/feature/auth.test.ts.stub +69 -0
- package/stubs/auth/web/vue/src/App.vue.stub +74 -0
- package/stubs/auth/web/vue/src/pages.ts.stub +17 -0
- package/stubs/manifest.json +630 -2
- package/stubs/noauth/app/Http/Controllers/PageController.ts.stub +41 -0
- package/stubs/noauth/app/Models/User.ts.stub +5 -0
- package/stubs/noauth/database/migrations/001_create_users_table.ts.stub +17 -0
- package/stubs/noauth/routes/api.ts.stub +16 -0
- package/stubs/noauth/routes/web.ts.stub +15 -0
- package/stubs/noauth/svelte/src/App.svelte.stub +68 -0
- package/stubs/noauth/svelte/src/pages.ts.stub +7 -0
- package/stubs/noauth/vue/src/App.vue.stub +62 -0
- package/stubs/noauth/vue/src/pages.ts.stub +7 -0
- package/stubs/react/src/App.tsx.stub +4 -2
- package/stubs/react/src/components/layout/search-dialog.tsx.stub +2 -2
- package/stubs/react/src/components/layout/sidebar-data.ts.stub +2 -2
- package/stubs/react/src/lib/api.ts.stub +30 -6
- package/stubs/react/src/pages/Login.tsx.stub +3 -3
- package/stubs/react/src/pages/users/dialogs.tsx.stub +7 -26
- package/stubs/react/vite.config.ts.stub +26 -3
- package/stubs/shared/app/Http/Controllers/ApiAuthController.ts.stub +57 -0
- package/stubs/shared/app/Http/Controllers/AuthController.ts.stub +14 -38
- package/stubs/shared/app/Http/Controllers/PageController.ts.stub +3 -3
- package/stubs/shared/app/Http/Controllers/UserController.ts.stub +61 -0
- package/stubs/shared/app/Http/Requests/LoginRequest.ts.stub +10 -0
- package/stubs/shared/app/Http/Requests/RegisterRequest.ts.stub +11 -0
- package/stubs/shared/app/Http/Requests/StoreUserRequest.ts.stub +11 -0
- package/stubs/shared/app/Http/Requests/UpdateUserRequest.ts.stub +11 -0
- package/stubs/shared/config/app.ts.stub +36 -0
- package/stubs/shared/config/vite.ts.stub +8 -0
- package/stubs/shared/database/factories/UserFactory.ts.stub +4 -6
- package/stubs/shared/routes/api.ts.stub +12 -102
- package/stubs/shared/routes/web.ts.stub +5 -3
- package/stubs/shared/tests/feature/auth.test.ts.stub +69 -0
- package/stubs/shared/tests/feature/users.test.ts.stub +90 -0
- package/stubs/svelte/src/App.svelte.stub +1 -1
- package/stubs/svelte/src/lib/api.ts.stub +30 -6
- package/stubs/svelte/src/main.ts.stub +3 -1
- package/stubs/svelte/src/pages/Login.svelte.stub +3 -3
- package/stubs/svelte/vite.config.ts.stub +20 -1
- package/stubs/tailwind-only/react/src/components/layout/app-sidebar.tsx.stub +68 -0
- package/stubs/tailwind-only/react/src/components/layout/authenticated-layout.tsx.stub +57 -0
- package/stubs/tailwind-only/react/src/components/layout/header.tsx.stub +52 -0
- package/stubs/tailwind-only/react/src/components/layout/main.tsx.stub +21 -0
- package/stubs/tailwind-only/react/src/components/layout/nav-group.tsx.stub +185 -0
- package/stubs/tailwind-only/react/src/components/layout/nav-user.tsx.stub +106 -0
- package/stubs/tailwind-only/react/src/components/layout/sidebar-data.ts.stub +58 -0
- package/stubs/tailwind-only/react/src/components/layout/theme-toggle.tsx.stub +36 -0
- package/stubs/tailwind-only/react/src/components/layout/top-nav.tsx.stub +72 -0
- package/stubs/tailwind-only/react/src/lib/utils.ts.stub +6 -0
- package/stubs/tailwind-only/react/src/pages/Dashboard.tsx.stub +205 -0
- package/stubs/tailwind-only/react/src/pages/Login.tsx.stub +122 -0
- package/stubs/tailwind-only/react/src/pages/Register.tsx.stub +137 -0
- package/stubs/tailwind-only/react/src/pages/Users.tsx.stub +426 -0
- package/stubs/tailwind-only/react/src/pages/account/layout.tsx.stub +64 -0
- package/stubs/tailwind-only/react/src/pages/account/preferences.tsx.stub +80 -0
- package/stubs/tailwind-only/react/src/pages/account/profile.tsx.stub +67 -0
- package/stubs/tailwind-only/react/src/pages/account/security.tsx.stub +91 -0
- package/stubs/tailwind-only/react/src/style.css.stub +14 -0
- package/stubs/tailwind-only/svelte/src/lib/components/layout/app-sidebar.svelte.stub +104 -0
- package/stubs/tailwind-only/svelte/src/lib/components/layout/authenticated-layout.svelte.stub +51 -0
- package/stubs/tailwind-only/svelte/src/lib/components/layout/header.svelte.stub +66 -0
- package/stubs/tailwind-only/svelte/src/lib/components/layout/main.svelte.stub +26 -0
- package/stubs/tailwind-only/svelte/src/lib/components/layout/nav-group.svelte.stub +131 -0
- package/stubs/tailwind-only/svelte/src/lib/components/layout/nav-user.svelte.stub +104 -0
- package/stubs/tailwind-only/svelte/src/lib/components/layout/sidebar-data.ts.stub +57 -0
- package/stubs/tailwind-only/svelte/src/lib/components/layout/theme-toggle.svelte.stub +28 -0
- package/stubs/tailwind-only/svelte/src/lib/components/layout/top-nav.svelte.stub +99 -0
- package/stubs/tailwind-only/svelte/src/lib/utils.ts.stub +6 -0
- package/stubs/tailwind-only/svelte/src/pages/Dashboard.svelte.stub +192 -0
- package/stubs/tailwind-only/svelte/src/pages/Login.svelte.stub +120 -0
- package/stubs/tailwind-only/svelte/src/pages/Register.svelte.stub +134 -0
- package/stubs/tailwind-only/svelte/src/pages/Users.svelte.stub +293 -0
- package/stubs/tailwind-only/svelte/src/pages/account/Layout.svelte.stub +61 -0
- package/stubs/tailwind-only/svelte/src/pages/account/Preferences.svelte.stub +81 -0
- package/stubs/tailwind-only/svelte/src/pages/account/Profile.svelte.stub +76 -0
- package/stubs/tailwind-only/svelte/src/pages/account/Security.svelte.stub +140 -0
- package/stubs/tailwind-only/svelte/src/style.css.stub +127 -0
- package/stubs/tailwind-only/vue/src/components/layout/AppSidebar.vue.stub +60 -0
- package/stubs/tailwind-only/vue/src/components/layout/AuthenticatedLayout.vue.stub +73 -0
- package/stubs/tailwind-only/vue/src/components/layout/Header.vue.stub +54 -0
- package/stubs/tailwind-only/vue/src/components/layout/Main.vue.stub +22 -0
- package/stubs/tailwind-only/vue/src/components/layout/NavGroup.vue.stub +107 -0
- package/stubs/tailwind-only/vue/src/components/layout/NavUser.vue.stub +104 -0
- package/stubs/tailwind-only/vue/src/components/layout/ThemeToggle.vue.stub +28 -0
- package/stubs/tailwind-only/vue/src/components/layout/TopNav.vue.stub +86 -0
- package/stubs/tailwind-only/vue/src/components/layout/sidebar-data.ts.stub +57 -0
- package/stubs/tailwind-only/vue/src/lib/utils.ts.stub +7 -0
- package/stubs/tailwind-only/vue/src/pages/Dashboard.vue.stub +195 -0
- package/stubs/tailwind-only/vue/src/pages/Login.vue.stub +121 -0
- package/stubs/tailwind-only/vue/src/pages/Register.vue.stub +137 -0
- package/stubs/tailwind-only/vue/src/pages/Users.vue.stub +401 -0
- package/stubs/tailwind-only/vue/src/pages/account/Layout.vue.stub +56 -0
- package/stubs/tailwind-only/vue/src/pages/account/Preferences.vue.stub +81 -0
- package/stubs/tailwind-only/vue/src/pages/account/Profile.vue.stub +69 -0
- package/stubs/tailwind-only/vue/src/pages/account/Security.vue.stub +85 -0
- package/stubs/tailwind-only/vue/src/style.css.stub +26 -0
- package/stubs/themes/corporate/react/src/components/layout/app-sidebar.tsx.stub +74 -0
- package/stubs/themes/corporate/react/src/components/layout/authenticated-layout.tsx.stub +42 -0
- package/stubs/themes/corporate/react/src/pages/Dashboard.tsx.stub +310 -0
- package/stubs/themes/corporate/react/src/pages/Login.tsx.stub +122 -0
- package/stubs/themes/corporate/react/src/pages/Register.tsx.stub +144 -0
- package/stubs/themes/corporate/react/src/style.css.stub +135 -0
- package/stubs/themes/corporate/svelte/src/pages/Dashboard.svelte.stub +271 -0
- package/stubs/themes/corporate/svelte/src/pages/Login.svelte.stub +117 -0
- package/stubs/themes/corporate/svelte/src/pages/Register.svelte.stub +138 -0
- package/stubs/themes/corporate/svelte/src/style.css.stub +134 -0
- package/stubs/themes/corporate/vue/src/pages/Dashboard.vue.stub +325 -0
- package/stubs/themes/corporate/vue/src/pages/Login.vue.stub +118 -0
- package/stubs/themes/corporate/vue/src/pages/Register.vue.stub +139 -0
- package/stubs/themes/corporate/vue/src/style.css.stub +134 -0
- package/stubs/themes/minimal/react/src/components/layout/app-sidebar.tsx.stub +68 -0
- package/stubs/themes/minimal/react/src/components/layout/authenticated-layout.tsx.stub +42 -0
- package/stubs/themes/minimal/react/src/pages/Dashboard.tsx.stub +166 -0
- package/stubs/themes/minimal/react/src/pages/Login.tsx.stub +95 -0
- package/stubs/themes/minimal/react/src/pages/Register.tsx.stub +73 -0
- package/stubs/themes/minimal/react/src/style.css.stub +142 -0
- package/stubs/themes/minimal/svelte/src/pages/Dashboard.svelte.stub +149 -0
- package/stubs/themes/minimal/svelte/src/pages/Login.svelte.stub +90 -0
- package/stubs/themes/minimal/svelte/src/pages/Register.svelte.stub +70 -0
- package/stubs/themes/minimal/svelte/src/style.css.stub +142 -0
- package/stubs/themes/minimal/vue/src/pages/Dashboard.vue.stub +163 -0
- package/stubs/themes/minimal/vue/src/pages/Login.vue.stub +91 -0
- package/stubs/themes/minimal/vue/src/pages/Register.vue.stub +73 -0
- package/stubs/themes/minimal/vue/src/style.css.stub +142 -0
- package/stubs/themes/starter/react/src/components/layout/app-sidebar.tsx.stub +74 -0
- package/stubs/themes/starter/react/src/components/layout/authenticated-layout.tsx.stub +42 -0
- package/stubs/themes/starter/react/src/pages/Dashboard.tsx.stub +236 -0
- package/stubs/themes/starter/react/src/pages/Login.tsx.stub +131 -0
- package/stubs/themes/starter/react/src/pages/Register.tsx.stub +145 -0
- package/stubs/themes/starter/react/src/style.css.stub +141 -0
- package/stubs/themes/starter/svelte/src/pages/Dashboard.svelte.stub +212 -0
- package/stubs/themes/starter/svelte/src/pages/Login.svelte.stub +126 -0
- package/stubs/themes/starter/svelte/src/pages/Register.svelte.stub +139 -0
- package/stubs/themes/starter/svelte/src/style.css.stub +141 -0
- package/stubs/themes/starter/vue/src/pages/Dashboard.vue.stub +228 -0
- package/stubs/themes/starter/vue/src/pages/Login.vue.stub +127 -0
- package/stubs/themes/starter/vue/src/pages/Register.vue.stub +140 -0
- package/stubs/themes/starter/vue/src/style.css.stub +141 -0
- package/stubs/themes/workspace/react/src/components/layout/app-sidebar.tsx.stub +97 -0
- package/stubs/themes/workspace/react/src/components/layout/authenticated-layout.tsx.stub +42 -0
- package/stubs/themes/workspace/react/src/pages/Dashboard.tsx.stub +304 -0
- package/stubs/themes/workspace/react/src/pages/Login.tsx.stub +131 -0
- package/stubs/themes/workspace/react/src/pages/Register.tsx.stub +82 -0
- package/stubs/themes/workspace/react/src/style.css.stub +138 -0
- package/stubs/themes/workspace/svelte/src/pages/Dashboard.svelte.stub +215 -0
- package/stubs/themes/workspace/svelte/src/pages/Login.svelte.stub +124 -0
- package/stubs/themes/workspace/svelte/src/pages/Register.svelte.stub +76 -0
- package/stubs/themes/workspace/svelte/src/style.css.stub +134 -0
- package/stubs/themes/workspace/vue/src/pages/Dashboard.vue.stub +220 -0
- package/stubs/themes/workspace/vue/src/pages/Login.vue.stub +128 -0
- package/stubs/themes/workspace/vue/src/pages/Register.vue.stub +80 -0
- package/stubs/themes/workspace/vue/src/style.css.stub +134 -0
- package/stubs/vue/src/App.vue.stub +2 -1
- package/stubs/vue/src/lib/api.ts.stub +30 -6
- package/stubs/vue/src/main.ts.stub +3 -1
- package/stubs/vue/src/pages/Login.vue.stub +3 -3
- package/stubs/vue/vite.config.ts.stub +20 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// import { env } from '@mantiq/core'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
|--------------------------------------------------------------------------
|
|
7
|
+
| Notification Channels
|
|
8
|
+
|--------------------------------------------------------------------------
|
|
9
|
+
|
|
|
10
|
+
| Configure notification delivery channels. Built-in channels:
|
|
11
|
+
| mail, database, broadcast, slack, sms, telegram, discord, webhook,
|
|
12
|
+
| whatsapp, firebase, imessage, rcs
|
|
13
|
+
|
|
|
14
|
+
| "mail", "database", and "broadcast" work out of the box with no
|
|
15
|
+
| additional config. The channels below require external credentials.
|
|
16
|
+
|
|
|
17
|
+
*/
|
|
18
|
+
channels: {
|
|
19
|
+
|
|
20
|
+
/*
|
|
21
|
+
|----------------------------------------------------------------------
|
|
22
|
+
| Slack
|
|
23
|
+
|----------------------------------------------------------------------
|
|
24
|
+
|
|
|
25
|
+
| Send notifications to Slack via webhook URL or Bot API token.
|
|
26
|
+
| Webhook: paste the Incoming Webhook URL from Slack.
|
|
27
|
+
| Bot: create a Slack App and use the Bot User OAuth Token.
|
|
28
|
+
|
|
|
29
|
+
*/
|
|
30
|
+
// slack: {
|
|
31
|
+
// webhookUrl: env('SLACK_WEBHOOK_URL', ''),
|
|
32
|
+
// token: env('SLACK_BOT_TOKEN', ''),
|
|
33
|
+
// },
|
|
34
|
+
|
|
35
|
+
/*
|
|
36
|
+
|----------------------------------------------------------------------
|
|
37
|
+
| SMS (Twilio / Vonage)
|
|
38
|
+
|----------------------------------------------------------------------
|
|
39
|
+
|
|
|
40
|
+
| Send SMS notifications via Twilio or Vonage (Nexmo).
|
|
41
|
+
|
|
|
42
|
+
| Supported drivers: 'twilio', 'vonage'
|
|
43
|
+
|
|
|
44
|
+
*/
|
|
45
|
+
// sms: {
|
|
46
|
+
// driver: 'twilio' as const,
|
|
47
|
+
// twilio: {
|
|
48
|
+
// sid: env('TWILIO_SID', ''),
|
|
49
|
+
// token: env('TWILIO_TOKEN', ''),
|
|
50
|
+
// from: env('TWILIO_FROM', ''),
|
|
51
|
+
// },
|
|
52
|
+
// // vonage: {
|
|
53
|
+
// // apiKey: env('VONAGE_API_KEY', ''),
|
|
54
|
+
// // apiSecret: env('VONAGE_API_SECRET', ''),
|
|
55
|
+
// // from: env('VONAGE_FROM', ''),
|
|
56
|
+
// // },
|
|
57
|
+
// },
|
|
58
|
+
|
|
59
|
+
/*
|
|
60
|
+
|----------------------------------------------------------------------
|
|
61
|
+
| Telegram
|
|
62
|
+
|----------------------------------------------------------------------
|
|
63
|
+
|
|
|
64
|
+
| Send notifications via Telegram Bot API.
|
|
65
|
+
| Create a bot with @BotFather and paste the token here.
|
|
66
|
+
|
|
|
67
|
+
*/
|
|
68
|
+
// telegram: {
|
|
69
|
+
// botToken: env('TELEGRAM_BOT_TOKEN', ''),
|
|
70
|
+
// },
|
|
71
|
+
|
|
72
|
+
/*
|
|
73
|
+
|----------------------------------------------------------------------
|
|
74
|
+
| Discord
|
|
75
|
+
|----------------------------------------------------------------------
|
|
76
|
+
|
|
|
77
|
+
| Send notifications to Discord channels via webhook URL.
|
|
78
|
+
| Create a webhook in Channel Settings → Integrations → Webhooks.
|
|
79
|
+
|
|
|
80
|
+
| Note: Discord webhookUrl is set per-notification, not globally.
|
|
81
|
+
|
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
/*
|
|
85
|
+
|----------------------------------------------------------------------
|
|
86
|
+
| WhatsApp (Meta Business API)
|
|
87
|
+
|----------------------------------------------------------------------
|
|
88
|
+
|
|
|
89
|
+
| Send WhatsApp messages via the Meta Business Platform API.
|
|
90
|
+
| Requires a verified WhatsApp Business Account.
|
|
91
|
+
|
|
|
92
|
+
*/
|
|
93
|
+
// whatsapp: {
|
|
94
|
+
// accessToken: env('WHATSAPP_ACCESS_TOKEN', ''),
|
|
95
|
+
// phoneNumberId: env('WHATSAPP_PHONE_NUMBER_ID', ''),
|
|
96
|
+
// },
|
|
97
|
+
|
|
98
|
+
/*
|
|
99
|
+
|----------------------------------------------------------------------
|
|
100
|
+
| Firebase Cloud Messaging (FCM)
|
|
101
|
+
|----------------------------------------------------------------------
|
|
102
|
+
|
|
|
103
|
+
| Send push notifications to mobile and web apps via Firebase.
|
|
104
|
+
| Provide either a static accessToken or a serviceAccountKey JSON
|
|
105
|
+
| string for automatic token generation.
|
|
106
|
+
|
|
|
107
|
+
*/
|
|
108
|
+
// firebase: {
|
|
109
|
+
// projectId: env('FIREBASE_PROJECT_ID', ''),
|
|
110
|
+
// serviceAccountKey: env('FIREBASE_SERVICE_ACCOUNT_KEY', ''),
|
|
111
|
+
// },
|
|
112
|
+
|
|
113
|
+
/*
|
|
114
|
+
|----------------------------------------------------------------------
|
|
115
|
+
| Apple iMessage (Business Chat)
|
|
116
|
+
|----------------------------------------------------------------------
|
|
117
|
+
|
|
|
118
|
+
| Send iMessage notifications via Apple Business Chat service.
|
|
119
|
+
| Requires an Apple Business Chat account and service endpoint.
|
|
120
|
+
|
|
|
121
|
+
*/
|
|
122
|
+
// imessage: {
|
|
123
|
+
// serviceUrl: env('IMESSAGE_SERVICE_URL', ''),
|
|
124
|
+
// authToken: env('IMESSAGE_AUTH_TOKEN', ''),
|
|
125
|
+
// },
|
|
126
|
+
|
|
127
|
+
/*
|
|
128
|
+
|----------------------------------------------------------------------
|
|
129
|
+
| RCS (Rich Communication Services)
|
|
130
|
+
|----------------------------------------------------------------------
|
|
131
|
+
|
|
|
132
|
+
| Send rich messages via RCS Business Messaging API.
|
|
133
|
+
| Supports rich cards, carousels, and suggested actions.
|
|
134
|
+
|
|
|
135
|
+
*/
|
|
136
|
+
// rcs: {
|
|
137
|
+
// agentId: env('RCS_AGENT_ID', ''),
|
|
138
|
+
// accessToken: env('RCS_ACCESS_TOKEN', ''),
|
|
139
|
+
// },
|
|
140
|
+
},
|
|
141
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { env } from '@mantiq/core'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
|--------------------------------------------------------------------------
|
|
7
|
+
| Default Queue Connection
|
|
8
|
+
|--------------------------------------------------------------------------
|
|
9
|
+
|
|
|
10
|
+
| The default queue connection used when dispatching jobs. The "sync"
|
|
11
|
+
| driver processes jobs immediately during the request — no background
|
|
12
|
+
| worker needed. Switch to "sqlite" for persistent background processing.
|
|
13
|
+
|
|
|
14
|
+
| Supported: 'sync', 'sqlite'
|
|
15
|
+
|
|
|
16
|
+
*/
|
|
17
|
+
default: env('QUEUE_CONNECTION', 'sync'),
|
|
18
|
+
|
|
19
|
+
/*
|
|
20
|
+
|--------------------------------------------------------------------------
|
|
21
|
+
| Queue Connections
|
|
22
|
+
|--------------------------------------------------------------------------
|
|
23
|
+
|
|
|
24
|
+
| Here you may configure the connection information for each queue
|
|
25
|
+
| backend used by your application.
|
|
26
|
+
|
|
|
27
|
+
| Run workers with: bun mantiq queue:work
|
|
28
|
+
|
|
|
29
|
+
*/
|
|
30
|
+
connections: {
|
|
31
|
+
// Synchronous — jobs run inline (no background worker needed)
|
|
32
|
+
sync: {
|
|
33
|
+
driver: 'sync' as const,
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
// SQLite — persistent queue stored in a local database file
|
|
37
|
+
sqlite: {
|
|
38
|
+
driver: 'sqlite' as const,
|
|
39
|
+
database: import.meta.dir + '/../database/queue.sqlite',
|
|
40
|
+
table: 'jobs',
|
|
41
|
+
retryAfter: 60, // Seconds before a stalled job is retried
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
/*
|
|
46
|
+
|--------------------------------------------------------------------------
|
|
47
|
+
| Failed Queue Jobs
|
|
48
|
+
|--------------------------------------------------------------------------
|
|
49
|
+
|
|
|
50
|
+
| These options configure the behavior of failed queue job logging so you
|
|
51
|
+
| can study why certain jobs have failed. Inspect with: bun mantiq queue:failed
|
|
52
|
+
|
|
|
53
|
+
*/
|
|
54
|
+
failed: {
|
|
55
|
+
driver: 'sqlite' as const,
|
|
56
|
+
database: import.meta.dir + '/../database/queue.sqlite',
|
|
57
|
+
table: 'failed_jobs',
|
|
58
|
+
},
|
|
59
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// import { env } from '@mantiq/core'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
|--------------------------------------------------------------------------
|
|
7
|
+
| Default Search Engine
|
|
8
|
+
|--------------------------------------------------------------------------
|
|
9
|
+
|
|
|
10
|
+
| The default search engine used when performing full-text searches on
|
|
11
|
+
| models with the Searchable trait. The "collection" engine works
|
|
12
|
+
| in-memory with no external dependencies — ideal for development.
|
|
13
|
+
|
|
|
14
|
+
| Supported: 'collection', 'database', 'algolia', 'meilisearch',
|
|
15
|
+
| 'typesense', 'elasticsearch'
|
|
16
|
+
|
|
|
17
|
+
*/
|
|
18
|
+
default: 'collection',
|
|
19
|
+
|
|
20
|
+
/*
|
|
21
|
+
|--------------------------------------------------------------------------
|
|
22
|
+
| Index Prefix
|
|
23
|
+
|--------------------------------------------------------------------------
|
|
24
|
+
|
|
|
25
|
+
| This prefix is added to all search index names. Useful to avoid
|
|
26
|
+
| collisions when multiple applications share the same search service.
|
|
27
|
+
|
|
|
28
|
+
*/
|
|
29
|
+
prefix: '',
|
|
30
|
+
|
|
31
|
+
/*
|
|
32
|
+
|--------------------------------------------------------------------------
|
|
33
|
+
| Queue Indexing
|
|
34
|
+
|--------------------------------------------------------------------------
|
|
35
|
+
|
|
|
36
|
+
| When true, model index updates are dispatched to the queue for
|
|
37
|
+
| background processing, keeping your request cycle fast.
|
|
38
|
+
|
|
|
39
|
+
*/
|
|
40
|
+
queue: false,
|
|
41
|
+
|
|
42
|
+
/*
|
|
43
|
+
|--------------------------------------------------------------------------
|
|
44
|
+
| Soft Delete Behavior
|
|
45
|
+
|--------------------------------------------------------------------------
|
|
46
|
+
|
|
|
47
|
+
| When true, soft-deleted models remain in the search index and can
|
|
48
|
+
| be included in search results.
|
|
49
|
+
|
|
|
50
|
+
*/
|
|
51
|
+
softDelete: false,
|
|
52
|
+
|
|
53
|
+
/*
|
|
54
|
+
|--------------------------------------------------------------------------
|
|
55
|
+
| Search Engines
|
|
56
|
+
|--------------------------------------------------------------------------
|
|
57
|
+
|
|
|
58
|
+
| Configure the search engine backends available to your application.
|
|
59
|
+
| Uncomment and configure the engines you need.
|
|
60
|
+
|
|
|
61
|
+
*/
|
|
62
|
+
engines: {
|
|
63
|
+
// In-memory — no external service needed (development)
|
|
64
|
+
collection: {
|
|
65
|
+
driver: 'collection' as const,
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
// SQL LIKE queries — uses your existing database
|
|
69
|
+
database: {
|
|
70
|
+
driver: 'database' as const,
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
// Algolia — hosted search API (https://algolia.com)
|
|
74
|
+
// algolia: {
|
|
75
|
+
// driver: 'algolia' as const,
|
|
76
|
+
// applicationId: env('ALGOLIA_APP_ID', ''),
|
|
77
|
+
// apiKey: env('ALGOLIA_SECRET', ''),
|
|
78
|
+
// },
|
|
79
|
+
|
|
80
|
+
// Meilisearch — open-source (https://meilisearch.com)
|
|
81
|
+
// meilisearch: {
|
|
82
|
+
// driver: 'meilisearch' as const,
|
|
83
|
+
// host: env('MEILISEARCH_HOST', 'http://127.0.0.1:7700'),
|
|
84
|
+
// apiKey: env('MEILISEARCH_KEY', ''),
|
|
85
|
+
// },
|
|
86
|
+
|
|
87
|
+
// Typesense — open-source (https://typesense.org)
|
|
88
|
+
// typesense: {
|
|
89
|
+
// driver: 'typesense' as const,
|
|
90
|
+
// host: env('TYPESENSE_HOST', 'localhost'),
|
|
91
|
+
// port: Number(env('TYPESENSE_PORT', '8108')),
|
|
92
|
+
// apiKey: env('TYPESENSE_API_KEY', ''),
|
|
93
|
+
// protocol: 'http',
|
|
94
|
+
// },
|
|
95
|
+
},
|
|
96
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { env } from '@mantiq/core'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
|--------------------------------------------------------------------------
|
|
7
|
+
| Third-Party Services
|
|
8
|
+
|--------------------------------------------------------------------------
|
|
9
|
+
|
|
|
10
|
+
| Centralized credentials for external services used by your application.
|
|
11
|
+
| Other config files (mail, notify, filesystem, search) reference these
|
|
12
|
+
| same env vars, but this file gives you a single place to see all
|
|
13
|
+
| third-party integrations at a glance.
|
|
14
|
+
|
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
|--------------------------------------------------------------------------
|
|
19
|
+
| AWS (S3, SES, etc.)
|
|
20
|
+
|--------------------------------------------------------------------------
|
|
21
|
+
*/
|
|
22
|
+
aws: {
|
|
23
|
+
accessKeyId: env('AWS_ACCESS_KEY_ID', ''),
|
|
24
|
+
secretAccessKey: env('AWS_SECRET_ACCESS_KEY', ''),
|
|
25
|
+
region: env('AWS_REGION', 'us-east-1'),
|
|
26
|
+
bucket: env('AWS_BUCKET', ''),
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
/*
|
|
30
|
+
|--------------------------------------------------------------------------
|
|
31
|
+
| Stripe
|
|
32
|
+
|--------------------------------------------------------------------------
|
|
33
|
+
*/
|
|
34
|
+
stripe: {
|
|
35
|
+
key: env('STRIPE_KEY', ''),
|
|
36
|
+
secret: env('STRIPE_SECRET', ''),
|
|
37
|
+
webhookSecret: env('STRIPE_WEBHOOK_SECRET', ''),
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
/*
|
|
41
|
+
|--------------------------------------------------------------------------
|
|
42
|
+
| Resend
|
|
43
|
+
|--------------------------------------------------------------------------
|
|
44
|
+
*/
|
|
45
|
+
resend: {
|
|
46
|
+
apiKey: env('RESEND_API_KEY', ''),
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
/*
|
|
50
|
+
|--------------------------------------------------------------------------
|
|
51
|
+
| Slack
|
|
52
|
+
|--------------------------------------------------------------------------
|
|
53
|
+
*/
|
|
54
|
+
slack: {
|
|
55
|
+
webhookUrl: env('SLACK_WEBHOOK_URL', ''),
|
|
56
|
+
botToken: env('SLACK_BOT_TOKEN', ''),
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
/*
|
|
60
|
+
|--------------------------------------------------------------------------
|
|
61
|
+
| Twilio (SMS)
|
|
62
|
+
|--------------------------------------------------------------------------
|
|
63
|
+
*/
|
|
64
|
+
twilio: {
|
|
65
|
+
sid: env('TWILIO_SID', ''),
|
|
66
|
+
token: env('TWILIO_TOKEN', ''),
|
|
67
|
+
from: env('TWILIO_FROM', ''),
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
/*
|
|
71
|
+
|--------------------------------------------------------------------------
|
|
72
|
+
| Telegram
|
|
73
|
+
|--------------------------------------------------------------------------
|
|
74
|
+
*/
|
|
75
|
+
telegram: {
|
|
76
|
+
botToken: env('TELEGRAM_BOT_TOKEN', ''),
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
/*
|
|
80
|
+
|--------------------------------------------------------------------------
|
|
81
|
+
| Firebase
|
|
82
|
+
|--------------------------------------------------------------------------
|
|
83
|
+
*/
|
|
84
|
+
firebase: {
|
|
85
|
+
projectId: env('FIREBASE_PROJECT_ID', ''),
|
|
86
|
+
serviceAccountKey: env('FIREBASE_SERVICE_ACCOUNT_KEY', ''),
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
/*
|
|
90
|
+
|--------------------------------------------------------------------------
|
|
91
|
+
| Algolia
|
|
92
|
+
|--------------------------------------------------------------------------
|
|
93
|
+
*/
|
|
94
|
+
algolia: {
|
|
95
|
+
applicationId: env('ALGOLIA_APP_ID', ''),
|
|
96
|
+
apiKey: env('ALGOLIA_SECRET', ''),
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
/*
|
|
100
|
+
|--------------------------------------------------------------------------
|
|
101
|
+
| Redis
|
|
102
|
+
|--------------------------------------------------------------------------
|
|
103
|
+
*/
|
|
104
|
+
redis: {
|
|
105
|
+
url: env('REDIS_URL', ''),
|
|
106
|
+
host: env('REDIS_HOST', '127.0.0.1'),
|
|
107
|
+
port: Number(env('REDIS_PORT', '6379')),
|
|
108
|
+
password: env('REDIS_PASSWORD', ''),
|
|
109
|
+
},
|
|
110
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { env } from '@mantiq/core'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
|--------------------------------------------------------------------------
|
|
7
|
+
| Default Session Driver
|
|
8
|
+
|--------------------------------------------------------------------------
|
|
9
|
+
|
|
|
10
|
+
| This option controls the default session "driver" used by requests.
|
|
11
|
+
| The "memory" driver is fast but sessions are lost on restart. Use
|
|
12
|
+
| "file" for persistence across server restarts.
|
|
13
|
+
|
|
|
14
|
+
| Supported: 'memory', 'file', 'cookie'
|
|
15
|
+
|
|
|
16
|
+
*/
|
|
17
|
+
driver: env('SESSION_DRIVER', 'memory'),
|
|
18
|
+
|
|
19
|
+
/*
|
|
20
|
+
|--------------------------------------------------------------------------
|
|
21
|
+
| Session Lifetime
|
|
22
|
+
|--------------------------------------------------------------------------
|
|
23
|
+
|
|
|
24
|
+
| The number of minutes a session may remain idle before it expires.
|
|
25
|
+
|
|
|
26
|
+
*/
|
|
27
|
+
lifetime: Number(env('SESSION_LIFETIME', '120')),
|
|
28
|
+
|
|
29
|
+
/*
|
|
30
|
+
|--------------------------------------------------------------------------
|
|
31
|
+
| Session Cookie Name
|
|
32
|
+
|--------------------------------------------------------------------------
|
|
33
|
+
|
|
|
34
|
+
| The name of the cookie used to identify a session instance by ID.
|
|
35
|
+
| Change this if running multiple MantiqJS apps on the same domain.
|
|
36
|
+
|
|
|
37
|
+
*/
|
|
38
|
+
cookie: env('SESSION_COOKIE', 'mantiq_session'),
|
|
39
|
+
|
|
40
|
+
/*
|
|
41
|
+
|--------------------------------------------------------------------------
|
|
42
|
+
| Session Cookie Path
|
|
43
|
+
|--------------------------------------------------------------------------
|
|
44
|
+
|
|
|
45
|
+
| The path for which the session cookie is available. Typically this
|
|
46
|
+
| will be the root path of your application.
|
|
47
|
+
|
|
|
48
|
+
*/
|
|
49
|
+
path: '/',
|
|
50
|
+
|
|
51
|
+
/*
|
|
52
|
+
|--------------------------------------------------------------------------
|
|
53
|
+
| HTTPS Only Cookies
|
|
54
|
+
|--------------------------------------------------------------------------
|
|
55
|
+
|
|
|
56
|
+
| When true, the session cookie will only be sent over HTTPS connections.
|
|
57
|
+
| Automatically enabled in production.
|
|
58
|
+
|
|
|
59
|
+
*/
|
|
60
|
+
secure: env('APP_ENV', 'production') === 'production',
|
|
61
|
+
|
|
62
|
+
/*
|
|
63
|
+
|--------------------------------------------------------------------------
|
|
64
|
+
| HTTP Access Only
|
|
65
|
+
|--------------------------------------------------------------------------
|
|
66
|
+
|
|
|
67
|
+
| When true, JavaScript cannot access the session cookie. This provides
|
|
68
|
+
| protection against XSS attacks that attempt to steal session IDs.
|
|
69
|
+
|
|
|
70
|
+
*/
|
|
71
|
+
httpOnly: true,
|
|
72
|
+
|
|
73
|
+
/*
|
|
74
|
+
|--------------------------------------------------------------------------
|
|
75
|
+
| Same-Site Cookies
|
|
76
|
+
|--------------------------------------------------------------------------
|
|
77
|
+
|
|
|
78
|
+
| Controls when the session cookie is sent with cross-site requests.
|
|
79
|
+
| 'Lax' allows top-level navigations, 'Strict' blocks all cross-site,
|
|
80
|
+
| 'None' allows all (requires secure: true).
|
|
81
|
+
|
|
|
82
|
+
*/
|
|
83
|
+
sameSite: 'Lax' as const,
|
|
84
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
|--------------------------------------------------------------------------
|
|
5
|
+
| React Fast Refresh
|
|
6
|
+
|--------------------------------------------------------------------------
|
|
7
|
+
|
|
|
8
|
+
| Injects the React Refresh preamble into dev mode HTML so that HMR
|
|
9
|
+
| works correctly. Required for React — without it, components throw
|
|
10
|
+
| "can't detect preamble" and the page renders blank.
|
|
11
|
+
|
|
|
12
|
+
| Set to false for Vue/Svelte (they don't need this preamble).
|
|
13
|
+
|
|
|
14
|
+
*/
|
|
15
|
+
reactRefresh: false,
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
|--------------------------------------------------------------------------
|
|
19
|
+
| Server-Side Rendering
|
|
20
|
+
|--------------------------------------------------------------------------
|
|
21
|
+
|
|
|
22
|
+
| SSR renders pages on the server so users see content immediately
|
|
23
|
+
| instead of a blank shell. The entry file exports a render() function.
|
|
24
|
+
|
|
|
25
|
+
| In dev: Vite's ssrLoadModule() loads the entry with HMR.
|
|
26
|
+
| In prod: the pre-built bundle at bootstrap/ssr/ is used.
|
|
27
|
+
|
|
|
28
|
+
*/
|
|
29
|
+
// ssr: {
|
|
30
|
+
// entry: 'src/ssr.tsx',
|
|
31
|
+
// bundle: 'bootstrap/ssr/ssr.js',
|
|
32
|
+
// },
|
|
33
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Migration } from '@mantiq/database'
|
|
2
|
+
import type { SchemaBuilder } from '@mantiq/database'
|
|
3
|
+
|
|
4
|
+
export default class CreateUsersTable extends Migration {
|
|
5
|
+
override async up(schema: SchemaBuilder) {
|
|
6
|
+
await schema.create('users', (t) => {
|
|
7
|
+
t.id()
|
|
8
|
+
t.string('name', 100)
|
|
9
|
+
t.string('email', 150).unique()
|
|
10
|
+
t.string('password', 255)
|
|
11
|
+
t.string('remember_token', 100).nullable()
|
|
12
|
+
t.timestamps()
|
|
13
|
+
})
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
override async down(schema: SchemaBuilder) {
|
|
17
|
+
await schema.dropIfExists('users')
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Migration } from '@mantiq/database'
|
|
2
|
+
import type { SchemaBuilder } from '@mantiq/database'
|
|
3
|
+
|
|
4
|
+
export default class CreatePersonalAccessTokensTable extends Migration {
|
|
5
|
+
override async up(schema: SchemaBuilder) {
|
|
6
|
+
await schema.create('personal_access_tokens', (t) => {
|
|
7
|
+
t.id()
|
|
8
|
+
t.string('tokenable_type')
|
|
9
|
+
t.unsignedBigInteger('tokenable_id')
|
|
10
|
+
t.string('name')
|
|
11
|
+
t.string('token', 64).unique()
|
|
12
|
+
t.json('abilities').nullable()
|
|
13
|
+
t.timestamp('last_used_at').nullable()
|
|
14
|
+
t.timestamp('expires_at').nullable()
|
|
15
|
+
t.timestamps()
|
|
16
|
+
})
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
override async down(schema: SchemaBuilder) {
|
|
20
|
+
await schema.dropIfExists('personal_access_tokens')
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Application, CoreServiceProvider, HttpKernel, RouterImpl, Discoverer } from '@mantiq/core'
|
|
2
|
+
|
|
3
|
+
const app = await Application.create(import.meta.dir, 'config')
|
|
4
|
+
|
|
5
|
+
const discoverer = new Discoverer(import.meta.dir)
|
|
6
|
+
const isDev = process.env['APP_ENV'] !== 'production'
|
|
7
|
+
const manifest = await discoverer.resolve(isDev)
|
|
8
|
+
const userProviders = await discoverer.loadProviders(manifest)
|
|
9
|
+
|
|
10
|
+
await app.bootstrap([CoreServiceProvider], userProviders)
|
|
11
|
+
|
|
12
|
+
const router = app.make(RouterImpl)
|
|
13
|
+
await discoverer.loadRoutes(manifest, router)
|
|
14
|
+
|
|
15
|
+
export default app
|
|
16
|
+
|
|
17
|
+
if (import.meta.main) {
|
|
18
|
+
const kernel = app.make(HttpKernel)
|
|
19
|
+
await kernel.start()
|
|
20
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "skeleton",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "bun run --watch index.ts",
|
|
8
|
+
"start": "bun run index.ts",
|
|
9
|
+
"mantiq": "bun run mantiq.ts"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@mantiq/auth": "^0.5.0",
|
|
13
|
+
"@mantiq/cli": "^0.5.0",
|
|
14
|
+
"@mantiq/core": "^0.5.0",
|
|
15
|
+
"@mantiq/database": "^0.5.0",
|
|
16
|
+
"@mantiq/events": "^0.5.0",
|
|
17
|
+
"@mantiq/filesystem": "^0.5.0",
|
|
18
|
+
"@mantiq/heartbeat": "^0.5.0",
|
|
19
|
+
"@mantiq/helpers": "^0.5.0",
|
|
20
|
+
"@mantiq/logging": "^0.5.0",
|
|
21
|
+
"@mantiq/queue": "^0.5.0",
|
|
22
|
+
"@mantiq/realtime": "^0.5.0",
|
|
23
|
+
"@mantiq/validation": "^0.5.0",
|
|
24
|
+
"@mantiq/mail": "^0.5.0",
|
|
25
|
+
"@mantiq/notify": "^0.5.0",
|
|
26
|
+
"@mantiq/search": "^0.5.0",
|
|
27
|
+
"@mantiq/health": "^0.5.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@mantiq/testing": "^0.5.0",
|
|
31
|
+
"bun-types": "latest",
|
|
32
|
+
"typescript": "^5.7.0"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Broadcast Channels
|
|
3
|
+
*
|
|
4
|
+
* Define authorization callbacks for broadcast channels here.
|
|
5
|
+
* Private and presence channels require authentication.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* import { broadcast } from '@mantiq/core'
|
|
9
|
+
*
|
|
10
|
+
* // Private channel — only the owner can listen
|
|
11
|
+
* broadcast.channel('orders.{orderId}', (user, orderId) => {
|
|
12
|
+
* return user.id === Order.find(orderId)?.user_id
|
|
13
|
+
* })
|
|
14
|
+
*
|
|
15
|
+
* // Presence channel — returns user info for member tracking
|
|
16
|
+
* broadcast.channel('chat.{roomId}', (user, roomId) => {
|
|
17
|
+
* return { id: user.id, name: user.name }
|
|
18
|
+
* })
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
export default function () {
|
|
22
|
+
// Define your broadcast channel authorization here
|
|
23
|
+
}
|