levix-bot 4.9.1 → 5.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 +57 -3
- package/SETUP.md +63 -7
- package/app.cjs +159 -46
- package/deploy/install.sh +10 -5
- package/package.json +9 -6
- package/public/dashboard/assets/40af6d88b63079a0-BZ8ojJNu.woff2 +0 -0
- package/public/dashboard/assets/481acf6760031cee-BypgxfGb.woff2 +0 -0
- package/public/dashboard/assets/6d3351fc535f8ef3-D2-eand5.woff2 +0 -0
- package/public/dashboard/assets/8ab0af53a3bda9d3-CyCXRvzh.woff2 +0 -0
- package/public/dashboard/assets/8f262393e9249e61-TQp-UTiE.woff2 +0 -0
- package/public/dashboard/assets/94d65887a83f1282-DmpS2jIq.woff2 +0 -0
- package/public/dashboard/assets/99e400330f36ae77-D3oMJlXt.woff2 +0 -0
- package/public/dashboard/assets/9d1f41b13e519d90-BVNSOH3d.woff2 +0 -0
- package/public/dashboard/assets/a005256cb957ecc7-CoYeBiSI.woff2 +0 -0
- package/public/dashboard/assets/b19c2080652a3c2b-DIC32ArD.woff2 +0 -0
- package/public/dashboard/assets/c4064400db3750ce-BehTv68k.woff2 +0 -0
- package/public/dashboard/assets/c69d345fa1068c2d-CmI34b-g.woff2 +0 -0
- package/public/dashboard/assets/cc27b30471250057-6fWv1k7M.woff2 +0 -0
- package/public/dashboard/assets/d8c30647abfeffe6-eXO_dkmS.woff2 +0 -0
- package/public/dashboard/assets/eb83d8d40af4411f-Buze_B52.woff2 +0 -0
- package/public/dashboard/assets/effc6711249e7349-qRpaaN48.woff2 +0 -0
- package/public/dashboard/assets/gateway-BDYet0pI.css +1 -0
- package/public/dashboard/assets/gateway-BYt6-s1O.js +1 -0
- package/public/dashboard/assets/index-B9wFpD_z.css +2 -0
- package/public/dashboard/assets/index-DWcQmu0_.js +124 -0
- package/public/dashboard/assets/index-Da-j89O-.js +458 -0
- package/public/dashboard/font-licenses/jetbrainsmono-OFL.txt +93 -0
- package/public/dashboard/font-licenses/plusjakartasans-OFL.txt +93 -0
- package/public/dashboard/font-licenses/tajawal-OFL.txt +93 -0
- package/public/dashboard/gateway.html +17 -0
- package/public/dashboard/index.html +3 -5
- package/public/ui-boot.js +33 -14
- package/scheduler.cjs +76 -23
- package/src/auth/auth-storage.cjs +54 -7
- package/src/auth/use-database-auth-state.js +70 -39
- package/src/automation/engine.js +412 -0
- package/src/automation/limits.cjs +6 -0
- package/src/automation/manage.js +290 -0
- package/src/automation/reactions.js +471 -0
- package/src/automation/rules.cjs +114 -0
- package/src/automation/status.cjs +76 -0
- package/src/backup/account.cjs +29 -0
- package/src/backup/activation.cjs +247 -0
- package/src/backup/content.cjs +36 -0
- package/src/backup/create.cjs +280 -0
- package/src/backup/extensions.cjs +101 -0
- package/src/backup/format.cjs +565 -0
- package/src/backup/jobs.cjs +111 -0
- package/src/backup/journal.cjs +41 -0
- package/src/backup/plan.cjs +223 -0
- package/src/backup/recovery.cjs +110 -0
- package/src/backup/restore.cjs +460 -0
- package/src/backup/uploads.cjs +146 -0
- package/src/bootstrap/core.js +50 -12
- package/src/bootstrap/panel.js +53 -2
- package/src/bootstrap/session-startup-policy.js +8 -1
- package/src/cli.js +163 -22
- package/src/commands/autodelete.cjs +41 -57
- package/src/commands/autoschedule.cjs +7 -33
- package/src/commands/blacklist.cjs +17 -35
- package/src/commands/block.cjs +4 -18
- package/src/commands/calc.cjs +22 -74
- package/src/commands/debt.cjs +28 -59
- package/src/commands/deleteschedule.cjs +7 -23
- package/src/commands/digit.cjs +5 -39
- package/src/commands/gemini.cjs +135 -218
- package/src/commands/group/add.cjs +28 -76
- package/src/commands/group/all.cjs +4 -15
- package/src/commands/group/antilink.cjs +28 -41
- package/src/commands/group/antispam.cjs +25 -35
- package/src/commands/group/approveall.cjs +7 -21
- package/src/commands/group/clearwarns.cjs +4 -18
- package/src/commands/group/deletenote.cjs +4 -18
- package/src/commands/group/demote.cjs +6 -23
- package/src/commands/group/flagged.cjs +10 -19
- package/src/commands/group/kick.cjs +26 -36
- package/src/commands/group/media.cjs +21 -36
- package/src/commands/group/members.cjs +16 -28
- package/src/commands/group/note.cjs +3 -14
- package/src/commands/group/policy.cjs +16 -37
- package/src/commands/group/promote.cjs +5 -22
- package/src/commands/group/removeall.cjs +6 -38
- package/src/commands/group/rules.cjs +4 -19
- package/src/commands/group/save.cjs +4 -18
- package/src/commands/group/setname.cjs +5 -19
- package/src/commands/group/setpp.cjs +8 -26
- package/src/commands/group/setrules.cjs +4 -15
- package/src/commands/group/setwarn.cjs +6 -23
- package/src/commands/group/tagadmins.cjs +5 -16
- package/src/commands/group/warn.cjs +5 -16
- package/src/commands/group/warns.cjs +12 -33
- package/src/commands/group/welcome.cjs +17 -34
- package/src/commands/group.cjs +91 -68
- package/src/commands/help.cjs +48 -89
- package/src/commands/lang.cjs +38 -97
- package/src/commands/listschedules.cjs +19 -30
- package/src/commands/loop.cjs +9 -55
- package/src/commands/md.cjs +2 -13
- package/src/commands/memory.cjs +53 -87
- package/src/commands/mod.cjs +40 -79
- package/src/commands/notes.cjs +4 -15
- package/src/commands/pack.cjs +26 -49
- package/src/commands/packs.cjs +8 -18
- package/src/commands/perm.cjs +48 -51
- package/src/commands/ping.cjs +2 -10
- package/src/commands/poll.cjs +5 -38
- package/src/commands/prayer.cjs +55 -36
- package/src/commands/qr.cjs +4 -18
- package/src/commands/rand.cjs +9 -58
- package/src/commands/restart.cjs +15 -33
- package/src/commands/schedule.cjs +5 -25
- package/src/commands/score.cjs +6 -27
- package/src/commands/send.cjs +4 -18
- package/src/commands/setprefix.cjs +11 -23
- package/src/commands/shortlink.cjs +13 -39
- package/src/commands/status.cjs +188 -76
- package/src/commands/sticker.cjs +5 -16
- package/src/commands/stickers.cjs +16 -20
- package/src/commands/stopbot.cjs +9 -25
- package/src/commands/stt.cjs +75 -107
- package/src/commands/todo.cjs +11 -31
- package/src/commands/toimage.cjs +11 -27
- package/src/commands/translate.cjs +53 -36
- package/src/commands/tts.cjs +46 -40
- package/src/commands/unblock.cjs +3 -17
- package/src/commands/update.cjs +23 -0
- package/src/commands/weather.cjs +40 -47
- package/src/config/ai-identity.cjs +14 -1
- package/src/config/baileys.config.js +16 -3
- package/src/config/data-dir.cjs +37 -0
- package/src/config/defaults.cjs +1 -0
- package/src/config/exit-codes.cjs +11 -0
- package/src/config/lock.cjs +55 -81
- package/src/config/official-links.cjs +61 -0
- package/src/config/paths.cjs +4 -33
- package/src/config/release.cjs +87 -0
- package/src/config/settings.cjs +199 -10
- package/src/core/connection.js +77 -9
- package/src/core/events.js +119 -33
- package/src/core/session.js +536 -84
- package/src/core/socket.js +81 -10
- package/src/db/copy.cjs +136 -0
- package/src/db/db.cjs +241 -36
- package/src/db/startup-guard.js +5 -0
- package/src/db/store.cjs +561 -54
- package/src/diagnostics/baileysLog.cjs +87 -0
- package/src/diagnostics/debugLog.cjs +16 -4
- package/src/diagnostics/device.cjs +4 -2
- package/src/diagnostics/nodeRuntime.cjs +131 -0
- package/src/diagnostics/signalSessionInspect.cjs +38 -0
- package/src/domain/command.js +24 -22
- package/src/extensions/autoReply.cjs +521 -0
- package/src/extensions/context.cjs +73 -0
- package/src/extensions/contract.cjs +69 -0
- package/src/extensions/entitlement/client.cjs +381 -0
- package/src/extensions/entitlement/index.cjs +629 -0
- package/src/extensions/entitlement/installation.cjs +117 -0
- package/src/extensions/entitlement/keys.cjs +72 -0
- package/src/extensions/entitlement/state.cjs +201 -0
- package/src/extensions/entitlement/target.cjs +7 -0
- package/src/extensions/entitlement/token.cjs +225 -0
- package/src/extensions/host.cjs +519 -0
- package/src/extensions/templateKeys.cjs +81 -0
- package/src/handlers/command.handler.js +191 -64
- package/src/handlers/group.handler.js +78 -18
- package/src/handlers/message.handler.js +56 -25
- package/src/i18n/catalog.generated.cjs +3537 -0
- package/src/index.js +51 -12
- package/src/legal/bundled/ar.json +102 -0
- package/src/legal/bundled/en.json +102 -0
- package/src/legal/bundled/es-419.json +102 -0
- package/src/legal/bundled/pt-BR.json +102 -0
- package/src/legal/cli.cjs +200 -0
- package/src/legal/consent.cjs +187 -0
- package/src/legal/document.cjs +156 -0
- package/src/legal/keys.cjs +100 -0
- package/src/legal/release.cjs +226 -0
- package/src/legal/remote.cjs +419 -0
- package/src/legal/terms.cjs +142 -0
- package/src/messaging/escape.cjs +31 -0
- package/src/messaging/health.cjs +65 -0
- package/src/messaging/identity.cjs +42 -0
- package/src/messaging/message.cjs +136 -0
- package/src/messaging/parser.cjs +88 -0
- package/src/messaging/router.cjs +217 -0
- package/src/middleware/permissions.middleware.js +34 -2
- package/src/panel/account-profile.cjs +489 -0
- package/src/panel/fallback-page.cjs +177 -0
- package/src/panel/password-reset.cjs +13 -14
- package/src/panel/recovery-email.cjs +3 -1
- package/src/routes/backup.api.esm.js +175 -0
- package/src/routes/dashboard.api.esm.js +183 -7
- package/src/routes/plus.api.esm.js +172 -0
- package/src/routes/reactions.api.esm.js +60 -0
- package/src/services/aiAgent.cjs +56 -43
- package/src/services/aiDocs.cjs +187 -0
- package/src/services/aiImage.cjs +183 -0
- package/src/services/aiMedia.cjs +146 -0
- package/src/services/aiProviders.cjs +76 -80
- package/src/services/aiRouter.cjs +2 -2
- package/src/services/aiToolAuth.cjs +76 -4
- package/src/services/aiTools.cjs +431 -105
- package/src/services/autoDelete.cjs +9 -1
- package/src/services/levix-docs.generated.json +2623 -0
- package/src/services/memoryPolicy.cjs +56 -0
- package/src/services/updateCheck.cjs +362 -0
- package/src/stickers/errors.cjs +53 -97
- package/src/stickers/library.cjs +13 -6
- package/src/stickers/owner.cjs +1 -1
- package/src/utils/commandContext.cjs +13 -0
- package/src/utils/commandDocs.cjs +42 -20
- package/src/utils/geminiHttpOptions.cjs +56 -0
- package/src/utils/geminiMedia.cjs +28 -3
- package/src/utils/groupMetadataCache.cjs +386 -21
- package/src/utils/httpsFetch.cjs +113 -0
- package/src/utils/i18n.cjs +117 -7
- package/src/utils/linkPreview.cjs +90 -0
- package/src/utils/logger.cjs +6 -0
- package/src/utils/markdownParser.cjs +3 -3
- package/src/utils/memory.cjs +375 -28
- package/src/utils/messageContent.cjs +7 -1
- package/src/utils/moderationAction.cjs +116 -73
- package/src/utils/moderationSummary.cjs +32 -56
- package/src/utils/permissionLevel.cjs +7 -28
- package/src/utils/permissions.cjs +23 -14
- package/src/utils/permissions.esm.js +99 -166
- package/src/utils/recentMessageCache.esm.js +241 -37
- package/src/utils/recurrence.cjs +78 -66
- package/src/utils/sendBotMessage.cjs +14 -29
- package/src/utils/sendBotMessage.esm.js +28 -13
- package/src/utils/statusMessage.cjs +94 -33
- package/src/utils/stickerBot.cjs +18 -16
- package/src/utils/storage.cjs +2 -0
- package/src/utils/storage.esm.js +2 -0
- package/src/utils/thumbnail.cjs +5 -21
- package/public/dashboard/assets/index-B1sOW2VX.js +0 -561
- package/public/dashboard/assets/index-CK8osB4o.css +0 -2
- package/public/dashboard.css +0 -3127
- package/public/dashboard.js +0 -1981
- package/public/gateway-i18n.js +0 -321
- package/public/gateway.js +0 -70
- package/views/dashboard.ejs +0 -775
- package/views/login.ejs +0 -408
- package/views/qr.ejs +0 -155
- package/views/setup.ejs +0 -118
package/public/gateway-i18n.js
DELETED
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
// The gateway pages' bilingual text (login · setup · QR).
|
|
2
|
-
//
|
|
3
|
-
// The English copy is the markup's own default; this file carries both
|
|
4
|
-
// languages and rewrites the marked nodes as the DOM is parsed, so a page
|
|
5
|
-
// follows the shared <html lang> that ui-boot.js set — no client framework and
|
|
6
|
-
// no second render. It is the same idea as views/dashboard.ejs + dashboard.js,
|
|
7
|
-
// kept in its own file because the QR page loads neither.
|
|
8
|
-
//
|
|
9
|
-
// Markup contract:
|
|
10
|
-
// data-i18n="key" -> textContent
|
|
11
|
-
// data-i18n-html="key" -> innerHTML (the string may carry <strong>)
|
|
12
|
-
// data-i18n-placeholder="key" -> placeholder
|
|
13
|
-
// data-i18n-aria-label="key" -> aria-label
|
|
14
|
-
// data-i18n-title="key" -> title attribute
|
|
15
|
-
// data-i18n-error="code" -> the server-rendered error, translated by code
|
|
16
|
-
// data-i18n-n="8" -> the {n} in the string
|
|
17
|
-
// <html data-brand> -> the {brand} in the string
|
|
18
|
-
|
|
19
|
-
(function () {
|
|
20
|
-
var DICT = {
|
|
21
|
-
en: {
|
|
22
|
-
// Titles
|
|
23
|
-
titleLogin: "{brand} · Sign in",
|
|
24
|
-
titleSetup: "{brand} · First run",
|
|
25
|
-
titleQr: "{brand} · Link WhatsApp",
|
|
26
|
-
|
|
27
|
-
// Shared
|
|
28
|
-
tagline: "Personal WhatsApp Bot",
|
|
29
|
-
storyAbout: "About {brand}",
|
|
30
|
-
by: "by",
|
|
31
|
-
backToApp: "Back to app",
|
|
32
|
-
showPassword: "Show password",
|
|
33
|
-
hidePassword: "Hide password",
|
|
34
|
-
|
|
35
|
-
// Login
|
|
36
|
-
selfHosted: "Self-hosted by design",
|
|
37
|
-
loginHeadline: "The quiet control room behind every chat.",
|
|
38
|
-
loginLede:
|
|
39
|
-
"Connection, commands, memory, and moderation stay together—on your server and within reach.",
|
|
40
|
-
loginTrust: "<span></span> Private workspace · direct control",
|
|
41
|
-
secureAccess: "Secure access",
|
|
42
|
-
welcomeBack: "Welcome back",
|
|
43
|
-
loginSub: "Sign in to manage your {brand} workspace.",
|
|
44
|
-
passwordLabel: "Control panel password",
|
|
45
|
-
passwordPlaceholder: "Enter your password",
|
|
46
|
-
openWorkspace: "Open workspace",
|
|
47
|
-
forgotPassword: "Forgot password?",
|
|
48
|
-
|
|
49
|
-
// Password reset
|
|
50
|
-
backToSignIn: "Back to sign in",
|
|
51
|
-
resetEyebrow: "Password reset",
|
|
52
|
-
resetTitle: "Reset your password",
|
|
53
|
-
resetSubtitle:
|
|
54
|
-
"{brand} sends a one-time code to your WhatsApp — the linked account's own chat. The code works for 10 minutes.",
|
|
55
|
-
resetSubtitleChannels:
|
|
56
|
-
"{brand} can send a one-time code to WhatsApp, or to your recovery email. The code works for 10 minutes.",
|
|
57
|
-
resetSend: "Send code to WhatsApp",
|
|
58
|
-
resetSendEmail: "Send code to email",
|
|
59
|
-
resetEmailHint: "The code goes to",
|
|
60
|
-
resetCodeLabel: "Reset code",
|
|
61
|
-
resetCodePlaceholder: "6 digits",
|
|
62
|
-
newPassword: "New password",
|
|
63
|
-
minLengthPlaceholder: "At least {n} characters",
|
|
64
|
-
repeatPassword: "Repeat password",
|
|
65
|
-
repeatPlaceholder: "Type it again",
|
|
66
|
-
resetSubmit: "Set new password",
|
|
67
|
-
resetChooseChannel: "Choose another recovery method",
|
|
68
|
-
resetErrThrottled: "Too many requests. Try again in {n} seconds.",
|
|
69
|
-
resetErrNoSession:
|
|
70
|
-
"WhatsApp isn't connected, so the code can't be sent. Sign in on the server and run `levix reset-password`, or start the WhatsApp session first.",
|
|
71
|
-
resetErrSendFailed: "Couldn't send the WhatsApp message. Try again in a minute.",
|
|
72
|
-
resetErrNoEmail: "Email recovery isn't set up.",
|
|
73
|
-
resetErrUnverified:
|
|
74
|
-
"The recovery email has to be verified again in Settings. Use WhatsApp or run `levix reset-password` on the server.",
|
|
75
|
-
resetErrLocked:
|
|
76
|
-
"Too many wrong codes today, so reset is paused. Try again later, or run `levix reset-password` on the server.",
|
|
77
|
-
resetErrRateLimited: "The mail service is busy. Try again in a little while.",
|
|
78
|
-
resetErrUnavailable: "Couldn't reach the mail service. Try again.",
|
|
79
|
-
resetErrInvalid: "The mail service rejected the request.",
|
|
80
|
-
resetErrStart: "Couldn't start the reset. Try again.",
|
|
81
|
-
resetErrServer: "Couldn't reach the server. Try again.",
|
|
82
|
-
resetDone: "Password updated. Taking you to sign in…",
|
|
83
|
-
resetErrWrongCode: "Wrong code.",
|
|
84
|
-
resetErrAttemptsLeft: "{n} attempts left.",
|
|
85
|
-
resetErrExpired: "That code is no longer valid. Send a new one.",
|
|
86
|
-
resetErrMismatch: "The two passwords don't match.",
|
|
87
|
-
resetErrInvalidPassword: "That password isn't allowed.",
|
|
88
|
-
resetErrFailed: "Couldn't reset the password. Try again.",
|
|
89
|
-
|
|
90
|
-
// Setup
|
|
91
|
-
firstMinute: "Your first minute",
|
|
92
|
-
setupHeadline: "Make the workspace yours.",
|
|
93
|
-
setupLede:
|
|
94
|
-
"Choose one strong password, then manage the assistant from a single private control room.",
|
|
95
|
-
setupTrust: "<span></span> One setup · no configuration files",
|
|
96
|
-
createWorkspace: "Create your workspace",
|
|
97
|
-
setupWelcome: "Welcome to {brand}",
|
|
98
|
-
setupSub: "Protect the linked WhatsApp account with at least {n} characters.",
|
|
99
|
-
setupCodeLabel: "Setup code",
|
|
100
|
-
setupCodePlaceholder: "Printed in the bot's terminal",
|
|
101
|
-
setupCodeHint: "Confirms you can access the server running {brand}.",
|
|
102
|
-
setupPasswordLabel: "Password",
|
|
103
|
-
createWorkspaceBtn: "Create workspace",
|
|
104
|
-
|
|
105
|
-
// QR pairing
|
|
106
|
-
directLine: "A direct line",
|
|
107
|
-
qrHeadline: "Bring your assistant online.",
|
|
108
|
-
qrLede: "One scan securely links {brand} to the WhatsApp account you choose.",
|
|
109
|
-
qrTrust: "<span></span> Live pairing status",
|
|
110
|
-
linkDevice: "Link device",
|
|
111
|
-
qrScanTitle: "Scan with WhatsApp",
|
|
112
|
-
qrWaiting: "Waiting…",
|
|
113
|
-
qrStep1: "<span>Open</span> WhatsApp on the phone the bot should use.",
|
|
114
|
-
qrStep2: "<span>Choose</span> Settings → Linked devices → Link a device.",
|
|
115
|
-
qrStep3: "<span>Scan</span> the code shown above.",
|
|
116
|
-
qrCallout:
|
|
117
|
-
"No code yet? Press <strong>Start session</strong> on the dashboard's Connection screen.",
|
|
118
|
-
backToDashboard: "Back to dashboard",
|
|
119
|
-
qrScanMe: "Scan me",
|
|
120
|
-
qrWaitingCode: "Waiting for a code…",
|
|
121
|
-
qrConnected: "Connected",
|
|
122
|
-
qrLinked: "Linked ✓",
|
|
123
|
-
qrNotStarted: "Not started — start it from the dashboard",
|
|
124
|
-
qrConnecting: "Connecting…",
|
|
125
|
-
|
|
126
|
-
// Server-rendered errors, keyed by the code app.cjs passes beside them
|
|
127
|
-
tooManyAttempts: "Too many attempts. Try again later.",
|
|
128
|
-
incorrectPassword: "Incorrect Password",
|
|
129
|
-
wrongSetupCode: "Wrong setup code.",
|
|
130
|
-
passwordMismatch: "The two passwords don't match.",
|
|
131
|
-
invalidPassword: "Password must be at least {n} characters",
|
|
132
|
-
},
|
|
133
|
-
ar: {
|
|
134
|
-
// Titles
|
|
135
|
-
titleLogin: "{brand} · تسجيل الدخول",
|
|
136
|
-
titleSetup: "{brand} · التشغيل الأول",
|
|
137
|
-
titleQr: "{brand} · ربط واتساب",
|
|
138
|
-
|
|
139
|
-
// Shared
|
|
140
|
-
tagline: "بوت واتساب شخصي",
|
|
141
|
-
storyAbout: "عن {brand}",
|
|
142
|
-
by: "من",
|
|
143
|
-
backToApp: "العودة للتطبيق",
|
|
144
|
-
showPassword: "إظهار كلمة المرور",
|
|
145
|
-
hidePassword: "إخفاء كلمة المرور",
|
|
146
|
-
|
|
147
|
-
// Login
|
|
148
|
-
selfHosted: "استضافة ذاتية بالتصميم",
|
|
149
|
-
loginHeadline: "غرفة التحكم الهادئة خلف كل محادثة.",
|
|
150
|
-
loginLede: "الاتصال والأوامر والذاكرة والإشراف في مكان واحد — على خادمك وفي متناول يدك.",
|
|
151
|
-
loginTrust: "<span></span> مساحة عمل خاصة · تحكم مباشر",
|
|
152
|
-
secureAccess: "وصول آمن",
|
|
153
|
-
welcomeBack: "أهلاً بعودتك",
|
|
154
|
-
loginSub: "سجّل الدخول لإدارة مساحة عمل {brand}.",
|
|
155
|
-
passwordLabel: "كلمة مرور لوحة التحكم",
|
|
156
|
-
passwordPlaceholder: "أدخل كلمة المرور",
|
|
157
|
-
openWorkspace: "افتح مساحة العمل",
|
|
158
|
-
forgotPassword: "نسيت كلمة المرور؟",
|
|
159
|
-
|
|
160
|
-
// Password reset
|
|
161
|
-
backToSignIn: "العودة لتسجيل الدخول",
|
|
162
|
-
resetEyebrow: "إعادة تعيين كلمة المرور",
|
|
163
|
-
resetTitle: "أعِد تعيين كلمة المرور",
|
|
164
|
-
resetSubtitle:
|
|
165
|
-
"يرسل {brand} كوداً لمرة واحدة إلى واتساب الخاص بك — محادثة الحساب المرتبط نفسه. يصلح الكود لمدة 10 دقائق.",
|
|
166
|
-
resetSubtitleChannels:
|
|
167
|
-
"يستطيع {brand} إرسال كود لمرة واحدة إلى واتساب، أو إلى بريد الاسترداد. يصلح الكود لمدة 10 دقائق.",
|
|
168
|
-
resetSend: "أرسل الكود إلى واتساب",
|
|
169
|
-
resetSendEmail: "أرسل الكود إلى البريد",
|
|
170
|
-
resetEmailHint: "يصل الكود إلى",
|
|
171
|
-
resetCodeLabel: "كود إعادة التعيين",
|
|
172
|
-
resetCodePlaceholder: "6 أرقام",
|
|
173
|
-
newPassword: "كلمة المرور الجديدة",
|
|
174
|
-
minLengthPlaceholder: "لا تقل عن {n} خانات",
|
|
175
|
-
repeatPassword: "أعِد كتابة كلمة المرور",
|
|
176
|
-
repeatPlaceholder: "اكتبها مرة أخرى",
|
|
177
|
-
resetSubmit: "تعيين كلمة المرور الجديدة",
|
|
178
|
-
resetChooseChannel: "اختر طريقة استرداد أخرى",
|
|
179
|
-
resetErrThrottled: "طلبات كثيرة جداً. حاول مرة أخرى خلال {n} ثانية.",
|
|
180
|
-
resetErrNoSession:
|
|
181
|
-
"واتساب غير متصل، لذا لا يمكن إرسال الكود. سجّل الدخول على الخادم ونفّذ `levix reset-password`، أو ابدأ جلسة واتساب أولاً.",
|
|
182
|
-
resetErrSendFailed: "تعذّر إرسال رسالة واتساب. حاول مرة أخرى خلال دقيقة.",
|
|
183
|
-
resetErrNoEmail: "استرداد البريد غير مُعد.",
|
|
184
|
-
resetErrUnverified:
|
|
185
|
-
"يجب التحقق من بريد الاسترداد مرة أخرى من الإعدادات. استخدم واتساب أو نفّذ `levix reset-password` على الخادم.",
|
|
186
|
-
resetErrLocked:
|
|
187
|
-
"أُدخلت أكواد خاطئة كثيرة اليوم، لذا أُوقفت إعادة التعيين مؤقتاً. حاول لاحقاً أو نفّذ `levix reset-password` على الخادم.",
|
|
188
|
-
resetErrRateLimited: "خدمة البريد مشغولة. حاول مرة أخرى بعد قليل.",
|
|
189
|
-
resetErrUnavailable: "تعذّر الوصول إلى خدمة البريد. حاول مرة أخرى.",
|
|
190
|
-
resetErrInvalid: "رفضت خدمة البريد الطلب.",
|
|
191
|
-
resetErrStart: "تعذّر بدء إعادة التعيين. حاول مرة أخرى.",
|
|
192
|
-
resetErrServer: "تعذّر الوصول إلى الخادم. حاول مرة أخرى.",
|
|
193
|
-
resetDone: "تم تحديث كلمة المرور. جارٍ تحويلك لتسجيل الدخول…",
|
|
194
|
-
resetErrWrongCode: "كود غير صحيح.",
|
|
195
|
-
resetErrAttemptsLeft: "{n} محاولات متبقية.",
|
|
196
|
-
resetErrExpired: "هذا الكود لم يعد صالحاً. أرسل كوداً جديداً.",
|
|
197
|
-
resetErrMismatch: "كلمتا المرور غير متطابقتين.",
|
|
198
|
-
resetErrInvalidPassword: "كلمة المرور غير مقبولة.",
|
|
199
|
-
resetErrFailed: "تعذّر إعادة تعيين كلمة المرور. حاول مرة أخرى.",
|
|
200
|
-
|
|
201
|
-
// Setup
|
|
202
|
-
firstMinute: "دقيقتك الأولى",
|
|
203
|
-
setupHeadline: "اجعل مساحة العمل ملكك.",
|
|
204
|
-
setupLede: "اختر كلمة مرور قوية واحدة، ثم أدِر المساعد من غرفة تحكم خاصة واحدة.",
|
|
205
|
-
setupTrust: "<span></span> إعداد واحد · بلا ملفات إعداد",
|
|
206
|
-
createWorkspace: "أنشئ مساحة عملك",
|
|
207
|
-
setupWelcome: "مرحباً بك في {brand}",
|
|
208
|
-
setupSub: "احمِ حساب واتساب المرتبط بكلمة مرور لا تقل عن {n} خانات.",
|
|
209
|
-
setupCodeLabel: "رمز الإعداد",
|
|
210
|
-
setupCodePlaceholder: "يُطبع في طرفية البوت",
|
|
211
|
-
setupCodeHint: "يتأكد من إمكانية وصولك إلى الخادم الذي يعمل عليه {brand}.",
|
|
212
|
-
setupPasswordLabel: "كلمة المرور",
|
|
213
|
-
createWorkspaceBtn: "إنشاء مساحة العمل",
|
|
214
|
-
|
|
215
|
-
// QR pairing
|
|
216
|
-
directLine: "خط مباشر",
|
|
217
|
-
qrHeadline: "اجعل مساعدك متصلاً.",
|
|
218
|
-
qrLede: "مسحة واحدة تربط {brand} بأمان بحساب واتساب الذي تختاره.",
|
|
219
|
-
qrTrust: "<span></span> حالة الربط المباشرة",
|
|
220
|
-
linkDevice: "ربط جهاز",
|
|
221
|
-
qrScanTitle: "امسح باستخدام واتساب",
|
|
222
|
-
qrWaiting: "بانتظار…",
|
|
223
|
-
qrStep1: "<span>افتح</span> واتساب على الهاتف الذي سيعمل عليه البوت.",
|
|
224
|
-
qrStep2: "<span>اختر</span> الإعدادات ← الأجهزة المرتبطة ← ربط جهاز.",
|
|
225
|
-
qrStep3: "<span>امسح</span> الرمز الظاهر بالأعلى.",
|
|
226
|
-
qrCallout: "لا يوجد رمز بعد؟ اضغط <strong>بدء الاتصال</strong> في شاشة الاتصال بلوحة التحكم.",
|
|
227
|
-
backToDashboard: "العودة إلى لوحة التحكم",
|
|
228
|
-
qrScanMe: "امسحني",
|
|
229
|
-
qrWaitingCode: "بانتظار رمز…",
|
|
230
|
-
qrConnected: "متصل",
|
|
231
|
-
qrLinked: "تم الربط ✓",
|
|
232
|
-
qrNotStarted: "لم تبدأ — ابدأها من لوحة التحكم",
|
|
233
|
-
qrConnecting: "جارٍ الاتصال…",
|
|
234
|
-
|
|
235
|
-
// Server-rendered errors, keyed by the code app.cjs passes beside them
|
|
236
|
-
tooManyAttempts: "محاولات كثيرة جداً. حاول مرة أخرى لاحقاً.",
|
|
237
|
-
incorrectPassword: "كلمة المرور غير صحيحة",
|
|
238
|
-
wrongSetupCode: "رمز الإعداد غير صحيح.",
|
|
239
|
-
passwordMismatch: "كلمتا المرور غير متطابقتين.",
|
|
240
|
-
invalidPassword: "يجب ألا تقل كلمة المرور عن {n} خانات",
|
|
241
|
-
},
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
var root = document.documentElement;
|
|
245
|
-
var lang = root.lang === "ar" ? "ar" : "en";
|
|
246
|
-
|
|
247
|
-
function t(key, vars) {
|
|
248
|
-
var value = (DICT[lang] && DICT[lang][key]) || DICT.en[key] || key;
|
|
249
|
-
if (vars) {
|
|
250
|
-
Object.keys(vars).forEach(function (name) {
|
|
251
|
-
value = value.split("{" + name + "}").join(vars[name] == null ? "" : String(vars[name]));
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
return value;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
function varsFor(el) {
|
|
258
|
-
return {
|
|
259
|
-
n: el.getAttribute("data-i18n-n"),
|
|
260
|
-
brand: root.getAttribute("data-brand") || "",
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
function paint(el) {
|
|
265
|
-
var key = el.getAttribute("data-i18n");
|
|
266
|
-
if (key) el.textContent = t(key, varsFor(el));
|
|
267
|
-
var htmlKey = el.getAttribute("data-i18n-html");
|
|
268
|
-
if (htmlKey) el.innerHTML = t(htmlKey, varsFor(el));
|
|
269
|
-
var placeholder = el.getAttribute("data-i18n-placeholder");
|
|
270
|
-
if (placeholder) el.setAttribute("placeholder", t(placeholder, varsFor(el)));
|
|
271
|
-
var ariaLabel = el.getAttribute("data-i18n-aria-label");
|
|
272
|
-
if (ariaLabel) el.setAttribute("aria-label", t(ariaLabel, varsFor(el)));
|
|
273
|
-
var title = el.getAttribute("data-i18n-title");
|
|
274
|
-
if (title) el.setAttribute("title", t(title, varsFor(el)));
|
|
275
|
-
var errorCode = el.getAttribute("data-i18n-error");
|
|
276
|
-
if (errorCode && DICT[lang] && DICT[lang][errorCode]) {
|
|
277
|
-
el.textContent = t(errorCode, varsFor(el));
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
function apply(scope) {
|
|
282
|
-
var nodes = (scope || document).querySelectorAll(
|
|
283
|
-
"[data-i18n],[data-i18n-html],[data-i18n-placeholder],[data-i18n-aria-label],[data-i18n-title],[data-i18n-error]",
|
|
284
|
-
);
|
|
285
|
-
for (var i = 0; i < nodes.length; i += 1) paint(nodes[i]);
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
function setLanguage(nextLang) {
|
|
289
|
-
if (nextLang !== "ar" && nextLang !== "en") return;
|
|
290
|
-
lang = nextLang;
|
|
291
|
-
root.lang = lang;
|
|
292
|
-
root.dir = lang === "ar" ? "rtl" : "ltr";
|
|
293
|
-
window.LevixGatewayI18n.lang = lang;
|
|
294
|
-
apply();
|
|
295
|
-
window.dispatchEvent(new CustomEvent("levix-gateway-lang", { detail: { lang: lang } }));
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
function setTheme(nextTheme) {
|
|
299
|
-
if (nextTheme === "dark" || nextTheme === "light") {
|
|
300
|
-
root.setAttribute("data-theme", nextTheme);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
window.addEventListener("levix-ui-prefs", function (event) {
|
|
305
|
-
var detail = event.detail || {};
|
|
306
|
-
if (detail.theme) setTheme(detail.theme);
|
|
307
|
-
if (detail.language) setLanguage(detail.language);
|
|
308
|
-
});
|
|
309
|
-
|
|
310
|
-
window.addEventListener("storage", function (event) {
|
|
311
|
-
if (event.key === "levix_theme" && (event.newValue === "dark" || event.newValue === "light")) {
|
|
312
|
-
setTheme(event.newValue);
|
|
313
|
-
}
|
|
314
|
-
if (event.key === "levix_lang" && (event.newValue === "ar" || event.newValue === "en")) {
|
|
315
|
-
setLanguage(event.newValue);
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
|
|
319
|
-
window.LevixGatewayI18n = { lang: lang, t: t, apply: apply };
|
|
320
|
-
apply();
|
|
321
|
-
})();
|
package/public/gateway.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
// Shared behaviour for the gateway pages (login · setup · reset).
|
|
2
|
-
//
|
|
3
|
-
// Two small things, both of which must never break the form if the script
|
|
4
|
-
// itself fails to load: the page works without either one.
|
|
5
|
-
|
|
6
|
-
(function () {
|
|
7
|
-
function updateEyeLabels() {
|
|
8
|
-
var i18n = window.LevixGatewayI18n;
|
|
9
|
-
var showLabel = i18n ? i18n.t("showPassword") : "Show password";
|
|
10
|
-
var hideLabel = i18n ? i18n.t("hidePassword") : "Hide password";
|
|
11
|
-
document.querySelectorAll(".eye-btn").forEach(function (btn) {
|
|
12
|
-
var isPressed = btn.getAttribute("aria-pressed") === "true";
|
|
13
|
-
btn.setAttribute("aria-label", isPressed ? hideLabel : showLabel);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
document.querySelectorAll(".eye-btn").forEach(function (btn) {
|
|
18
|
-
btn.setAttribute("aria-pressed", "false");
|
|
19
|
-
});
|
|
20
|
-
updateEyeLabels();
|
|
21
|
-
|
|
22
|
-
window.addEventListener("levix-gateway-lang", updateEyeLabels);
|
|
23
|
-
window.addEventListener("levix-ui-prefs", updateEyeLabels);
|
|
24
|
-
window.addEventListener("storage", function (e) {
|
|
25
|
-
if (e.key === "levix_lang") updateEyeLabels();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
// Eye toggles. One delegated listener covers every password field on the
|
|
29
|
-
// page — the button carries two icons and swaps which one is visible.
|
|
30
|
-
document.addEventListener("click", function (event) {
|
|
31
|
-
var btn = event.target.closest ? event.target.closest(".eye-btn") : null;
|
|
32
|
-
if (!btn) return;
|
|
33
|
-
event.preventDefault();
|
|
34
|
-
var input = btn.parentElement ? btn.parentElement.querySelector("input") : null;
|
|
35
|
-
if (!input) return;
|
|
36
|
-
var show = input.type === "password";
|
|
37
|
-
var start = input.selectionStart;
|
|
38
|
-
var end = input.selectionEnd;
|
|
39
|
-
input.type = show ? "text" : "password";
|
|
40
|
-
input.focus({ preventScroll: true });
|
|
41
|
-
if (start !== null && end !== null) input.setSelectionRange(start, end);
|
|
42
|
-
var on = btn.querySelector(".eye-on");
|
|
43
|
-
var off = btn.querySelector(".eye-off");
|
|
44
|
-
if (on) on.style.display = show ? "none" : "";
|
|
45
|
-
if (off) off.style.display = show ? "" : "none";
|
|
46
|
-
var i18n = window.LevixGatewayI18n;
|
|
47
|
-
var showLabel = i18n ? i18n.t("showPassword") : "Show password";
|
|
48
|
-
var hideLabel = i18n ? i18n.t("hidePassword") : "Hide password";
|
|
49
|
-
btn.setAttribute("aria-label", show ? hideLabel : showLabel);
|
|
50
|
-
btn.setAttribute("aria-pressed", String(show));
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
// Blur the password screens whenever the page can't be watched: another
|
|
54
|
-
// tab, a minimised window, the OS task switcher. This is best effort —
|
|
55
|
-
// the web platform cannot truly forbid screenshots — but it keeps the form
|
|
56
|
-
// out of task-switcher thumbnails and casual over-the-shoulder captures.
|
|
57
|
-
var root = document.documentElement;
|
|
58
|
-
function engage() {
|
|
59
|
-
root.classList.add("screen-guard");
|
|
60
|
-
}
|
|
61
|
-
function release() {
|
|
62
|
-
root.classList.remove("screen-guard");
|
|
63
|
-
}
|
|
64
|
-
document.addEventListener("visibilitychange", function () {
|
|
65
|
-
if (document.visibilityState === "hidden") engage();
|
|
66
|
-
else release();
|
|
67
|
-
});
|
|
68
|
-
window.addEventListener("blur", engage);
|
|
69
|
-
window.addEventListener("focus", release);
|
|
70
|
-
})();
|