dsh-auth-remote 0.1.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.
Files changed (94) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/CHANGELOG.zh-CN.md +16 -0
  3. package/CONTRIBUTING.md +23 -0
  4. package/CONTRIBUTING.zh-CN.md +23 -0
  5. package/LICENSE +21 -0
  6. package/README.md +65 -0
  7. package/README.zh-CN.md +65 -0
  8. package/cordis.patch.yml +45 -0
  9. package/dist/cli.js +1858 -0
  10. package/dist/cli.js.map +7 -0
  11. package/dist/client.js +3076 -0
  12. package/dist/client.js.map +7 -0
  13. package/dist/index.js +2473 -0
  14. package/dist/index.js.map +7 -0
  15. package/dist/login.css +230 -0
  16. package/dist/login.css.map +7 -0
  17. package/dist/login.js +2865 -0
  18. package/dist/login.js.map +7 -0
  19. package/dist/types/adapters/dsh/browser-auth.d.ts +8 -0
  20. package/dist/types/adapters/dsh/browser-auth.d.ts.map +1 -0
  21. package/dist/types/adapters/dsh/browser-capability.d.ts +8 -0
  22. package/dist/types/adapters/dsh/browser-capability.d.ts.map +1 -0
  23. package/dist/types/adapters/dsh/compatibility.d.ts +7 -0
  24. package/dist/types/adapters/dsh/compatibility.d.ts.map +1 -0
  25. package/dist/types/adapters/dsh/readiness.d.ts +22 -0
  26. package/dist/types/adapters/dsh/readiness.d.ts.map +1 -0
  27. package/dist/types/adapters/dsh/startup-urls.d.ts +4 -0
  28. package/dist/types/adapters/dsh/startup-urls.d.ts.map +1 -0
  29. package/dist/types/adapters/dsh/webserver.d.ts +36 -0
  30. package/dist/types/adapters/dsh/webserver.d.ts.map +1 -0
  31. package/dist/types/auth/password.d.ts +12 -0
  32. package/dist/types/auth/password.d.ts.map +1 -0
  33. package/dist/types/auth/service.d.ts +90 -0
  34. package/dist/types/auth/service.d.ts.map +1 -0
  35. package/dist/types/auth/sessions.d.ts +8 -0
  36. package/dist/types/auth/sessions.d.ts.map +1 -0
  37. package/dist/types/auth/totp.d.ts +10 -0
  38. package/dist/types/auth/totp.d.ts.map +1 -0
  39. package/dist/types/cli/index.d.ts +3 -0
  40. package/dist/types/cli/index.d.ts.map +1 -0
  41. package/dist/types/cli/ipc-client.d.ts +18 -0
  42. package/dist/types/cli/ipc-client.d.ts.map +1 -0
  43. package/dist/types/cli/language.d.ts +14 -0
  44. package/dist/types/cli/language.d.ts.map +1 -0
  45. package/dist/types/cli/profile.d.ts +10 -0
  46. package/dist/types/cli/profile.d.ts.map +1 -0
  47. package/dist/types/cli/prompt.d.ts +20 -0
  48. package/dist/types/cli/prompt.d.ts.map +1 -0
  49. package/dist/types/config.d.ts +27 -0
  50. package/dist/types/config.d.ts.map +1 -0
  51. package/dist/types/http/admin-socket.d.ts +18 -0
  52. package/dist/types/http/admin-socket.d.ts.map +1 -0
  53. package/dist/types/http/connections.d.ts +21 -0
  54. package/dist/types/http/connections.d.ts.map +1 -0
  55. package/dist/types/http/gate.d.ts +24 -0
  56. package/dist/types/http/gate.d.ts.map +1 -0
  57. package/dist/types/http/origin-policy.d.ts +35 -0
  58. package/dist/types/http/origin-policy.d.ts.map +1 -0
  59. package/dist/types/http/origin.d.ts +5 -0
  60. package/dist/types/http/origin.d.ts.map +1 -0
  61. package/dist/types/http/request-context.d.ts +5 -0
  62. package/dist/types/http/request-context.d.ts.map +1 -0
  63. package/dist/types/http/routes.d.ts +15 -0
  64. package/dist/types/http/routes.d.ts.map +1 -0
  65. package/dist/types/index.d.ts +33 -0
  66. package/dist/types/index.d.ts.map +1 -0
  67. package/dist/types/shared/admin-contract.d.ts +40 -0
  68. package/dist/types/shared/admin-contract.d.ts.map +1 -0
  69. package/dist/types/shared/auth-contract.d.ts +33 -0
  70. package/dist/types/shared/auth-contract.d.ts.map +1 -0
  71. package/dist/types/shared/i18n.d.ts +323 -0
  72. package/dist/types/shared/i18n.d.ts.map +1 -0
  73. package/dist/types/shared/locales/en.d.ts +151 -0
  74. package/dist/types/shared/locales/en.d.ts.map +1 -0
  75. package/dist/types/shared/locales/zh.d.ts +150 -0
  76. package/dist/types/shared/locales/zh.d.ts.map +1 -0
  77. package/dist/types/storage/lock.d.ts +17 -0
  78. package/dist/types/storage/lock.d.ts.map +1 -0
  79. package/dist/types/storage/state.d.ts +34 -0
  80. package/dist/types/storage/state.d.ts.map +1 -0
  81. package/dist/types/storage/store.d.ts +30 -0
  82. package/dist/types/storage/store.d.ts.map +1 -0
  83. package/docs/deployment.md +89 -0
  84. package/docs/deployment.zh-CN.md +89 -0
  85. package/docs/development.md +43 -0
  86. package/docs/development.zh-CN.md +43 -0
  87. package/docs/releasing.md +44 -0
  88. package/docs/releasing.zh-CN.md +44 -0
  89. package/docs/reverse-proxy.md +27 -0
  90. package/docs/reverse-proxy.zh-CN.md +27 -0
  91. package/examples/nginx.conf +27 -0
  92. package/examples/traefik-dsh.yml +20 -0
  93. package/examples/web-profile-auth-remote.patch.yml +14 -0
  94. package/package.json +112 -0
@@ -0,0 +1,323 @@
1
+ import { en } from './locales/en.js';
2
+ import { zh } from './locales/zh.js';
3
+ export { en, zh };
4
+ export declare const dictionaries: {
5
+ readonly en: {
6
+ readonly brand: "DSH · Remote sign-in";
7
+ readonly errorNetwork: "Connection failed. Check your network and try again.";
8
+ readonly errorRateLimited: "Too many attempts. Try again in about {seconds} seconds.";
9
+ readonly errorUnauthorized: "Your session has expired. Sign in again.";
10
+ readonly errorServiceUnavailable: "The service is temporarily unavailable. Try again later.";
11
+ readonly errorGeneric: "The operation could not be completed. Try again.";
12
+ readonly loginInitialTitle: "Sign in to DSH";
13
+ readonly loginInitialLoading: "Checking sign-in status…";
14
+ readonly loginLanguageLabel: "Language";
15
+ readonly loginSetupTitle: "Set up your account first";
16
+ readonly loginSetupDescription: "Run this command in a terminal on the server running DSH, then create a username and password when prompted. The web page cannot create the account.";
17
+ readonly loginSetupCopy: "Copy command";
18
+ readonly loginSetupRecheck: "I finished setup";
19
+ readonly loginSetupCopied: "Command copied.";
20
+ readonly loginSetupCopyFallback: "Select and copy the command manually.";
21
+ readonly loginSetupNotFound: "No account was found. Check that the command used this profile, then try again.";
22
+ readonly loginTitle: "Sign in to DSH";
23
+ readonly loginDescription: "Enter the single-user account created in the server terminal.";
24
+ readonly loginUsername: "Username";
25
+ readonly loginPassword: "Password";
26
+ readonly loginContinue: "Continue";
27
+ readonly loginMfaTitle: "Verify your second factor";
28
+ readonly loginMfaDescription: "Enter the six-digit code from your authenticator or a one-time backup code. This challenge expires in five minutes.";
29
+ readonly loginMfaCode: "Verification or backup code";
30
+ readonly loginMfaSubmit: "Verify and sign in";
31
+ readonly loginBackToPassword: "Back to password sign-in";
32
+ readonly loginMfaExhausted: "This challenge is exhausted. Enter your password again.";
33
+ readonly loginBindingTitle: "Connect an authenticator";
34
+ readonly loginBindingDescription: "Scan the QR code with your authenticator, or enter the secret below. After confirmation, ten one-time backup codes will appear and you will need to sign in again.";
35
+ readonly loginBindingQrAlt: "Authenticator setup QR code";
36
+ readonly loginBindingManualSecret: "Manual secret";
37
+ readonly loginBindingCode: "Six-digit code from the authenticator";
38
+ readonly loginBindingConfirm: "Confirm setup";
39
+ readonly loginBindingRestart: "Sign in again";
40
+ readonly loginBindingQrUnavailable: "The QR code is unavailable. Use the manual secret above.";
41
+ readonly loginBindingExhausted: "This setup challenge is exhausted. Enter your password again.";
42
+ readonly loginBackupTitle: "Save your backup codes";
43
+ readonly loginBackupDescription: "These codes are shown only once. Store them safely; each code can be used only once. Sign in again after saving them.";
44
+ readonly loginBackupSaved: "I saved them; sign in again";
45
+ readonly loginOptionalTitle: "Protect your account";
46
+ readonly loginOptionalDescription: "This profile lets you connect an authenticator later. Connecting one now adds protection; you can also do it in Security settings.";
47
+ readonly loginOptionalBindNow: "Connect TOTP now";
48
+ readonly loginOptionalSkip: "Skip and enter DSH";
49
+ readonly loginOptionalVerifyTitle: "Verify again before setup";
50
+ readonly loginOptionalVerifyDescription: "Enter your current password to protect your account.";
51
+ readonly loginOptionalCurrentPassword: "Current password";
52
+ readonly loginOptionalStart: "Start setup";
53
+ readonly loginOptionalSkipLater: "Connect later and enter DSH";
54
+ readonly loginReasonExpired: "Your session has expired. Sign in again.";
55
+ readonly loginReasonUpdated: "Security settings changed. Sign in again.";
56
+ readonly loginReasonSignedOut: "You signed out of this device.";
57
+ readonly loginUnavailableTitle: "Sign-in is temporarily unavailable";
58
+ readonly loginUnavailableDescription: "The service status is unavailable. Check the connection and retry.";
59
+ readonly loginRetry: "Check again";
60
+ readonly loginErrorInvalidCredentials: "The username or password is incorrect. Try again.";
61
+ readonly loginErrorInvalidFactor: "The verification or backup code is incorrect. After five failed attempts, you must enter your password again.";
62
+ readonly loginErrorChallenge: "This verification expired. Enter your username and password again.";
63
+ readonly loginErrorUninitialized: "The account is not set up. Run the setup command in the server terminal.";
64
+ readonly settingsSectionLabel: "Security";
65
+ readonly settingsSectionAria: "Security settings";
66
+ readonly settingsTitle: "Account security";
67
+ readonly settingsAccountSummary: "Account: {username} · TOTP: {totp}";
68
+ readonly settingsTotpEnabled: "Enabled";
69
+ readonly settingsTotpNotBound: "Not connected";
70
+ readonly settingsLoading: "Loading account status…";
71
+ readonly settingsChangePassword: "Change password";
72
+ readonly settingsBindTotp: "Connect TOTP";
73
+ readonly settingsRebindTotp: "Reconnect TOTP";
74
+ readonly settingsSessions: "Session management";
75
+ readonly settingsPasswordMismatch: "The new passwords do not match.";
76
+ readonly settingsPasswordDescription: "After this change, every device must sign in again.";
77
+ readonly settingsCurrentPassword: "Current password";
78
+ readonly settingsCurrentCode: "Current verification or backup code";
79
+ readonly settingsNewPassword: "New password";
80
+ readonly settingsConfirmPassword: "Confirm new password";
81
+ readonly settingsSavePassword: "Save new password";
82
+ readonly settingsBindDescription: "Enter your current credentials. After connecting the new authenticator, every device must sign in again.";
83
+ readonly settingsStartBinding: "Start setup";
84
+ readonly settingsDisableTotp: "Turn off TOTP";
85
+ readonly settingsDisableDescription: "After turning off TOTP, every device must sign in again.";
86
+ readonly settingsScanQr: "Scan the QR code";
87
+ readonly settingsQrAlt: "Authenticator setup QR code";
88
+ readonly settingsQrUnavailable: "The QR code is unavailable. Use the manual secret below.";
89
+ readonly settingsQrLoading: "Generating the QR code; you can use the manual secret below.";
90
+ readonly settingsManualSecret: "Manual secret:";
91
+ readonly settingsNewCode: "Six-digit code from the new authenticator";
92
+ readonly settingsConfirmBinding: "Confirm setup";
93
+ readonly settingsRestartBinding: "Start over";
94
+ readonly settingsSignOutCurrent: "Sign out this device";
95
+ readonly settingsSignOutAll: "Sign out every device";
96
+ readonly settingsSignOutAllDescription: "Enter your current credentials. All signed-in devices and open connections will be revoked.";
97
+ readonly settingsBackupTitle: "Save your backup codes";
98
+ readonly settingsBackupDescription: "These codes are shown only once. Store them safely; each code can be used only once.";
99
+ readonly settingsBackupSaved: "I saved them; sign in again";
100
+ readonly settingsErrorInvalidCredentials: "The current password is incorrect.";
101
+ readonly settingsErrorInvalidFactor: "The current verification or backup code is incorrect.";
102
+ readonly settingsErrorInvalidInput: "The input is invalid. Passwords must meet the server length rules.";
103
+ readonly settingsErrorChallenge: "The setup challenge expired. Start setup again.";
104
+ readonly settingsErrorTotpRequired: "This profile requires TOTP, so it cannot be turned off.";
105
+ readonly cliHelp: "dsh-auth-remote {version}\n\nUsage:\n dsh plugin --profile web exec dsh-auth-remote [--lang en|zh] COMMAND\n\nCommands:\n init Create the single account interactively\n status [--json] Show non-sensitive authentication status\n reset-password Reset the password and revoke all sessions\n reset-totp Clear TOTP, backup codes and all sessions\n revoke-sessions Sign out every device\n\nOptions:\n --lang en|zh Choose the language for human-readable output\n --help, -h Show this help\n --version, -v Show the package version\n\nThe command uses the profile selected by dsh plugin exec and the caller's DSH_HOME.\n";
106
+ readonly cliPromptUsername: "Username: ";
107
+ readonly cliPromptPassword: "Password: ";
108
+ readonly cliPromptPasswordAgain: "Enter password again: ";
109
+ readonly cliPromptNewPassword: "New password: ";
110
+ readonly cliPromptNewPasswordAgain: "Enter new password again: ";
111
+ readonly cliPromptConfirmTarget: "Enter {profile} to confirm {command}: ";
112
+ readonly cliTargetProfile: "Target profile: {profile}";
113
+ readonly cliDataFile: "State file: {path}";
114
+ readonly cliStatusProfile: "Profile: {profile}";
115
+ readonly cliStatusAccount: "Account: {state}";
116
+ readonly cliStatusTotp: "TOTP: {state}";
117
+ readonly cliStatusSessions: "Active sessions: {count}";
118
+ readonly cliStatusService: "Service: {state}";
119
+ readonly cliInitialized: "Initialized";
120
+ readonly cliNotInitialized: "Not initialized";
121
+ readonly cliTotpEnabled: "Enabled";
122
+ readonly cliTotpDisabled: "Disabled";
123
+ readonly cliOnlineReady: "Online and ready";
124
+ readonly cliOnlineNotReady: "Online but not ready";
125
+ readonly cliOffline: "Offline";
126
+ readonly cliCompleted: "{command} completed; the change is durable and effective.";
127
+ readonly cliErrorInvalidArguments: "Invalid command or arguments. Use --help.";
128
+ readonly cliErrorInvalidLanguage: "Invalid --lang value. Use en or zh.";
129
+ readonly cliErrorDuplicateLanguage: "Specify --lang only once.";
130
+ readonly cliErrorMissingLanguage: "Missing value for --lang. Use en or zh.";
131
+ readonly cliErrorPasswordsMismatch: "The passwords do not match.";
132
+ readonly cliErrorConfirmationMismatch: "The confirmation did not match the target profile.";
133
+ readonly cliErrorPasswordLength: "Password must contain 12–256 Unicode characters.";
134
+ readonly cliErrorTerminalRequired: "An interactive terminal is required.";
135
+ readonly cliErrorTerminalClosed: "Terminal input closed.";
136
+ readonly cliErrorCancelled: "Cancelled.";
137
+ readonly cliErrorProfileDirectory: "The current directory is not the selected DSH profile under DSH_HOME.";
138
+ readonly cliErrorProfileManifest: "The profile package.json is missing.";
139
+ readonly cliErrorUnsafeManagementDirectory: "The management directory has unsafe permissions.";
140
+ readonly cliErrorUnsafeManagementSocket: "The management socket has unsafe permissions.";
141
+ readonly cliErrorManagementUnavailable: "The management socket is unavailable.";
142
+ readonly cliErrorOutcomeUnknown: "The management request disconnected or timed out. Its result is unknown; check status before trying again.";
143
+ readonly cliErrorOfflineLock: "The management socket is unavailable while the service holds the profile lock. Offline access was refused.";
144
+ readonly cliErrorInvalidCredentials: "The current credentials are incorrect.";
145
+ readonly cliErrorAlreadyInitialized: "The account is already initialized.";
146
+ readonly cliErrorInvalidInput: "The input is invalid.";
147
+ readonly cliErrorInvalidFactor: "The verification or backup code is incorrect.";
148
+ readonly cliErrorUninitialized: "The account is not initialized.";
149
+ readonly cliErrorTotpRequired: "This profile requires TOTP.";
150
+ readonly cliErrorConflict: "The account state changed. Check status and retry.";
151
+ readonly cliErrorBusy: "The service is busy. Try again later.";
152
+ readonly cliErrorUnknown: "The operation failed. Check status before trying again.";
153
+ };
154
+ readonly zh: {
155
+ readonly brand: "DSH · 远程登录";
156
+ readonly errorNetwork: "连接失败,请检查网络后重试。";
157
+ readonly errorRateLimited: "尝试过于频繁,请约 {seconds} 秒后重试。";
158
+ readonly errorUnauthorized: "会话已失效,请重新登录。";
159
+ readonly errorServiceUnavailable: "服务暂时不可用,请稍后重试。";
160
+ readonly errorGeneric: "操作未完成,请重试。";
161
+ readonly loginInitialTitle: "登录 DSH";
162
+ readonly loginInitialLoading: "正在检查登录状态…";
163
+ readonly loginLanguageLabel: "语言";
164
+ readonly loginSetupTitle: "先初始化账号";
165
+ readonly loginSetupDescription: "请在运行 DSH 的服务器终端输入下列命令,然后按提示创建用户名和密码。网页不会创建账号。";
166
+ readonly loginSetupCopy: "复制命令";
167
+ readonly loginSetupRecheck: "我已完成初始化";
168
+ readonly loginSetupCopied: "命令已复制。";
169
+ readonly loginSetupCopyFallback: "请手动选择并复制命令。";
170
+ readonly loginSetupNotFound: "尚未检测到账号。请确认命令使用了当前 profile,再重新检查。";
171
+ readonly loginTitle: "登录 DSH";
172
+ readonly loginDescription: "输入服务器终端创建的单用户账号。";
173
+ readonly loginUsername: "用户名";
174
+ readonly loginPassword: "密码";
175
+ readonly loginContinue: "继续";
176
+ readonly loginMfaTitle: "验证第二因素";
177
+ readonly loginMfaDescription: "输入身份验证器中的 6 位数字,或输入一次性备用码。挑战 5 分钟后失效。";
178
+ readonly loginMfaCode: "验证码或备用码";
179
+ readonly loginMfaSubmit: "验证并登录";
180
+ readonly loginBackToPassword: "返回密码登录";
181
+ readonly loginMfaExhausted: "本次挑战已用尽,请重新输入密码。";
182
+ readonly loginBindingTitle: "绑定身份验证器";
183
+ readonly loginBindingDescription: "使用身份验证器扫描二维码,或手动输入下方密钥。确认成功后将显示 10 个一次性备用码,并要求重新登录。";
184
+ readonly loginBindingQrAlt: "身份验证器绑定二维码";
185
+ readonly loginBindingManualSecret: "手工密钥";
186
+ readonly loginBindingCode: "身份验证器中的 6 位验证码";
187
+ readonly loginBindingConfirm: "确认绑定";
188
+ readonly loginBindingRestart: "重新登录";
189
+ readonly loginBindingQrUnavailable: "二维码暂不可用,请使用上方手工密钥。";
190
+ readonly loginBindingExhausted: "绑定挑战已用尽,请重新输入密码。";
191
+ readonly loginBackupTitle: "保存备用码";
192
+ readonly loginBackupDescription: "这些备用码只会显示这一次。请存放在安全的位置,每个备用码只能使用一次。保存后重新登录。";
193
+ readonly loginBackupSaved: "我已保存,重新登录";
194
+ readonly loginOptionalTitle: "保护你的账号";
195
+ readonly loginOptionalDescription: "当前 profile 允许稍后绑定身份验证器。现在绑定可以增加保护;跳过后也可在安全设置中绑定。";
196
+ readonly loginOptionalBindNow: "现在绑定 TOTP";
197
+ readonly loginOptionalSkip: "跳过,进入 DSH";
198
+ readonly loginOptionalVerifyTitle: "再次验证后绑定";
199
+ readonly loginOptionalVerifyDescription: "为保护账号,请再次输入当前密码。";
200
+ readonly loginOptionalCurrentPassword: "当前密码";
201
+ readonly loginOptionalStart: "开始绑定";
202
+ readonly loginOptionalSkipLater: "稍后绑定,进入 DSH";
203
+ readonly loginReasonExpired: "会话已失效,请重新登录。";
204
+ readonly loginReasonUpdated: "安全设置已更新,请重新登录。";
205
+ readonly loginReasonSignedOut: "已退出当前设备。";
206
+ readonly loginUnavailableTitle: "暂时无法登录";
207
+ readonly loginUnavailableDescription: "服务状态暂时无法取得,请检查连接并重试。";
208
+ readonly loginRetry: "重新检查";
209
+ readonly loginErrorInvalidCredentials: "用户名或密码不正确,请重试。";
210
+ readonly loginErrorInvalidFactor: "验证码或备用码不正确;连续失败 5 次后需重新输入密码。";
211
+ readonly loginErrorChallenge: "本次验证已失效,请重新输入用户名和密码。";
212
+ readonly loginErrorUninitialized: "账号尚未初始化,请先在服务器终端运行初始化命令。";
213
+ readonly settingsSectionLabel: "安全";
214
+ readonly settingsSectionAria: "安全设置";
215
+ readonly settingsTitle: "账号安全";
216
+ readonly settingsAccountSummary: "账号:{username} · TOTP:{totp}";
217
+ readonly settingsTotpEnabled: "已启用";
218
+ readonly settingsTotpNotBound: "未绑定";
219
+ readonly settingsLoading: "正在读取账号状态…";
220
+ readonly settingsChangePassword: "修改密码";
221
+ readonly settingsBindTotp: "绑定 TOTP";
222
+ readonly settingsRebindTotp: "重新绑定 TOTP";
223
+ readonly settingsSessions: "会话管理";
224
+ readonly settingsPasswordMismatch: "两次输入的新密码不一致。";
225
+ readonly settingsPasswordDescription: "完成后所有设备都需要重新登录。";
226
+ readonly settingsCurrentPassword: "当前密码";
227
+ readonly settingsCurrentCode: "当前验证码或备用码";
228
+ readonly settingsNewPassword: "新密码";
229
+ readonly settingsConfirmPassword: "再次输入新密码";
230
+ readonly settingsSavePassword: "保存新密码";
231
+ readonly settingsBindDescription: "请输入当前凭证;新绑定完成后所有设备都需要重新登录。";
232
+ readonly settingsStartBinding: "开始绑定";
233
+ readonly settingsDisableTotp: "关闭 TOTP";
234
+ readonly settingsDisableDescription: "关闭后所有设备都需要重新登录。";
235
+ readonly settingsScanQr: "扫描二维码";
236
+ readonly settingsQrAlt: "身份验证器绑定二维码";
237
+ readonly settingsQrUnavailable: "二维码暂不可用,请使用下方手工密钥。";
238
+ readonly settingsQrLoading: "二维码生成中;也可以使用下方手工密钥。";
239
+ readonly settingsManualSecret: "手工密钥:";
240
+ readonly settingsNewCode: "新身份验证器的 6 位验证码";
241
+ readonly settingsConfirmBinding: "确认绑定";
242
+ readonly settingsRestartBinding: "重新开始";
243
+ readonly settingsSignOutCurrent: "退出当前设备";
244
+ readonly settingsSignOutAll: "退出全部设备";
245
+ readonly settingsSignOutAllDescription: "请输入当前凭证;提交后所有已登录设备和长连接都会失效。";
246
+ readonly settingsBackupTitle: "保存备用码";
247
+ readonly settingsBackupDescription: "这些备用码只会显示这一次。请存放在安全的位置,每个备用码只能使用一次。";
248
+ readonly settingsBackupSaved: "我已保存,重新登录";
249
+ readonly settingsErrorInvalidCredentials: "当前密码不正确。";
250
+ readonly settingsErrorInvalidFactor: "当前验证码或备用码不正确。";
251
+ readonly settingsErrorInvalidInput: "输入不符合要求;密码需符合服务端长度规则。";
252
+ readonly settingsErrorChallenge: "绑定挑战已失效,请重新开始绑定。";
253
+ readonly settingsErrorTotpRequired: "当前 profile 要求 TOTP,无法关闭。";
254
+ readonly cliHelp: "dsh-auth-remote {version}\n\n用法:\n dsh plugin --profile web exec dsh-auth-remote [--lang en|zh] COMMAND\n\n命令:\n init 在终端交互初始化单用户账号\n status [--json] 查看不含秘密的认证状态\n reset-password 重置密码并撤销全部会话\n reset-totp 清除 TOTP、备用码及全部会话\n revoke-sessions 退出所有设备\n\n选项:\n --lang en|zh 选择人类可读输出的语言\n --help, -h 显示帮助\n --version, -v 显示包版本\n\n命令使用 dsh plugin exec 选定的 profile 和调用者的 DSH_HOME。\n";
255
+ readonly cliPromptUsername: "用户名: ";
256
+ readonly cliPromptPassword: "密码: ";
257
+ readonly cliPromptPasswordAgain: "再次输入密码: ";
258
+ readonly cliPromptNewPassword: "新密码: ";
259
+ readonly cliPromptNewPasswordAgain: "再次输入新密码: ";
260
+ readonly cliPromptConfirmTarget: "输入 {profile} 以确认 {command}: ";
261
+ readonly cliTargetProfile: "目标 profile: {profile}";
262
+ readonly cliDataFile: "数据文件: {path}";
263
+ readonly cliStatusProfile: "profile: {profile}";
264
+ readonly cliStatusAccount: "账号: {state}";
265
+ readonly cliStatusTotp: "TOTP: {state}";
266
+ readonly cliStatusSessions: "有效会话: {count}";
267
+ readonly cliStatusService: "服务: {state}";
268
+ readonly cliInitialized: "已初始化";
269
+ readonly cliNotInitialized: "未初始化";
270
+ readonly cliTotpEnabled: "已启用";
271
+ readonly cliTotpDisabled: "未启用";
272
+ readonly cliOnlineReady: "在线且就绪";
273
+ readonly cliOnlineNotReady: "在线但未就绪";
274
+ readonly cliOffline: "离线";
275
+ readonly cliCompleted: "{command} 已完成;变更已持久化并生效。";
276
+ readonly cliErrorInvalidArguments: "命令或参数无效,请使用 --help。";
277
+ readonly cliErrorInvalidLanguage: "--lang 的值无效,请使用 en 或 zh。";
278
+ readonly cliErrorDuplicateLanguage: "--lang 只能指定一次。";
279
+ readonly cliErrorMissingLanguage: "--lang 缺少值,请使用 en 或 zh。";
280
+ readonly cliErrorPasswordsMismatch: "两次输入的密码不一致。";
281
+ readonly cliErrorConfirmationMismatch: "确认输入与目标 profile 不一致。";
282
+ readonly cliErrorPasswordLength: "密码须包含 12–256 个 Unicode 字符。";
283
+ readonly cliErrorTerminalRequired: "此操作需要交互终端。";
284
+ readonly cliErrorTerminalClosed: "终端输入已关闭。";
285
+ readonly cliErrorCancelled: "已取消。";
286
+ readonly cliErrorProfileDirectory: "当前目录不是 DSH_HOME 下选定的 DSH profile。";
287
+ readonly cliErrorProfileManifest: "缺少 profile 的 package.json。";
288
+ readonly cliErrorUnsafeManagementDirectory: "管理目录权限不安全。";
289
+ readonly cliErrorUnsafeManagementSocket: "管理 socket 权限不安全。";
290
+ readonly cliErrorManagementUnavailable: "管理 socket 不可用。";
291
+ readonly cliErrorOutcomeUnknown: "管理请求已断开或超时,结果未知;再次操作前请先检查状态。";
292
+ readonly cliErrorOfflineLock: "服务仍持有 profile 锁且管理 socket 不可用,已拒绝离线操作。";
293
+ readonly cliErrorInvalidCredentials: "当前凭证不正确。";
294
+ readonly cliErrorAlreadyInitialized: "账号已初始化。";
295
+ readonly cliErrorInvalidInput: "输入无效。";
296
+ readonly cliErrorInvalidFactor: "验证码或备用码不正确。";
297
+ readonly cliErrorUninitialized: "账号尚未初始化。";
298
+ readonly cliErrorTotpRequired: "此 profile 要求 TOTP。";
299
+ readonly cliErrorConflict: "账号状态已变化,请检查状态后重试。";
300
+ readonly cliErrorBusy: "服务正忙,请稍后重试。";
301
+ readonly cliErrorUnknown: "操作失败;再次操作前请先检查状态。";
302
+ };
303
+ };
304
+ export type Locale = keyof typeof dictionaries;
305
+ export type MessageKey = keyof typeof en;
306
+ type Placeholders<Text extends string> = Text extends `${string}{${infer Name}}${infer Rest}` ? Name | Placeholders<Rest> : never;
307
+ type SameSet<Left, Right> = [Left] extends [Right] ? ([Right] extends [Left] ? true : false) : false;
308
+ type MismatchedPlaceholderKeys = {
309
+ [Key in MessageKey]: SameSet<Placeholders<(typeof en)[Key]>, Placeholders<(typeof zh)[Key]>> extends true ? never : Key;
310
+ }[MessageKey];
311
+ /** A compile-time failure here identifies any key whose placeholder names differ by language. */
312
+ export declare const localePlaceholdersMatch: MismatchedPlaceholderKeys extends never ? true : never;
313
+ type FormatArgs<Key extends MessageKey> = [Placeholders<(typeof en)[Key]>] extends [never] ? [] : [values: Record<Placeholders<(typeof en)[Key]>, string | number>];
314
+ /** Only exact en/zh values are valid for the login page's stored preference. */
315
+ export declare function parseExactLocale(value: unknown): Locale | null;
316
+ /** CLI and language-tag inputs use Chinese for zh variants and English otherwise. */
317
+ export declare function localeFromLanguageTag(value: string | undefined): Locale;
318
+ export declare function normalizeLocale(value: unknown): Locale;
319
+ /** Returns plain text. Insert into textContent, React text, or escape before HTML templates. */
320
+ export declare function formatMessage<Key extends MessageKey>(locale: Locale | string | undefined, key: Key, ...args: FormatArgs<Key>): string;
321
+ /** For the existing standalone login HTML templates; dynamic values remain text. */
322
+ export declare function escapeHtmlText(value: string): string;
323
+ //# sourceMappingURL=i18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/shared/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AAEpC,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAAA;AACjB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAsB,CAAA;AAE/C,MAAM,MAAM,MAAM,GAAG,MAAM,OAAO,YAAY,CAAA;AAC9C,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,EAAE,CAAA;AAExC,KAAK,YAAY,CAAC,IAAI,SAAS,MAAM,IAAI,IAAI,SAAS,GAAG,MAAM,IAAI,MAAM,IAAI,IAAI,MAAM,IAAI,EAAE,GACzF,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,GACzB,KAAK,CAAA;AACT,KAAK,OAAO,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAA;AACpG,KAAK,yBAAyB,GAAG;KAC9B,GAAG,IAAI,UAAU,GAAG,OAAO,CAC1B,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAC9B,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAC/B,SAAS,IAAI,GACV,KAAK,GACL,GAAG;CACR,CAAC,UAAU,CAAC,CAAA;AAEb,iGAAiG;AACjG,eAAO,MAAM,uBAAuB,EAAE,yBAAyB,SAAS,KAAK,GAAG,IAAI,GAAG,KAAY,CAAA;AAEnG,KAAK,UAAU,CAAC,GAAG,SAAS,UAAU,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GACtF,EAAE,GACF,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAAA;AAErE,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAE9D;AAED,qFAAqF;AACrF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAEvE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEtD;AAED,gGAAgG;AAChG,wBAAgB,aAAa,CAAC,GAAG,SAAS,UAAU,EAClD,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EACnC,GAAG,EAAE,GAAG,EACR,GAAG,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,GACvB,MAAM,CAOR;AAED,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAepD"}
@@ -0,0 +1,151 @@
1
+ /** Human-facing text only. Protocol identifiers and command names stay unchanged. */
2
+ export declare const en: {
3
+ readonly brand: "DSH · Remote sign-in";
4
+ readonly errorNetwork: "Connection failed. Check your network and try again.";
5
+ readonly errorRateLimited: "Too many attempts. Try again in about {seconds} seconds.";
6
+ readonly errorUnauthorized: "Your session has expired. Sign in again.";
7
+ readonly errorServiceUnavailable: "The service is temporarily unavailable. Try again later.";
8
+ readonly errorGeneric: "The operation could not be completed. Try again.";
9
+ readonly loginInitialTitle: "Sign in to DSH";
10
+ readonly loginInitialLoading: "Checking sign-in status…";
11
+ readonly loginLanguageLabel: "Language";
12
+ readonly loginSetupTitle: "Set up your account first";
13
+ readonly loginSetupDescription: "Run this command in a terminal on the server running DSH, then create a username and password when prompted. The web page cannot create the account.";
14
+ readonly loginSetupCopy: "Copy command";
15
+ readonly loginSetupRecheck: "I finished setup";
16
+ readonly loginSetupCopied: "Command copied.";
17
+ readonly loginSetupCopyFallback: "Select and copy the command manually.";
18
+ readonly loginSetupNotFound: "No account was found. Check that the command used this profile, then try again.";
19
+ readonly loginTitle: "Sign in to DSH";
20
+ readonly loginDescription: "Enter the single-user account created in the server terminal.";
21
+ readonly loginUsername: "Username";
22
+ readonly loginPassword: "Password";
23
+ readonly loginContinue: "Continue";
24
+ readonly loginMfaTitle: "Verify your second factor";
25
+ readonly loginMfaDescription: "Enter the six-digit code from your authenticator or a one-time backup code. This challenge expires in five minutes.";
26
+ readonly loginMfaCode: "Verification or backup code";
27
+ readonly loginMfaSubmit: "Verify and sign in";
28
+ readonly loginBackToPassword: "Back to password sign-in";
29
+ readonly loginMfaExhausted: "This challenge is exhausted. Enter your password again.";
30
+ readonly loginBindingTitle: "Connect an authenticator";
31
+ readonly loginBindingDescription: "Scan the QR code with your authenticator, or enter the secret below. After confirmation, ten one-time backup codes will appear and you will need to sign in again.";
32
+ readonly loginBindingQrAlt: "Authenticator setup QR code";
33
+ readonly loginBindingManualSecret: "Manual secret";
34
+ readonly loginBindingCode: "Six-digit code from the authenticator";
35
+ readonly loginBindingConfirm: "Confirm setup";
36
+ readonly loginBindingRestart: "Sign in again";
37
+ readonly loginBindingQrUnavailable: "The QR code is unavailable. Use the manual secret above.";
38
+ readonly loginBindingExhausted: "This setup challenge is exhausted. Enter your password again.";
39
+ readonly loginBackupTitle: "Save your backup codes";
40
+ readonly loginBackupDescription: "These codes are shown only once. Store them safely; each code can be used only once. Sign in again after saving them.";
41
+ readonly loginBackupSaved: "I saved them; sign in again";
42
+ readonly loginOptionalTitle: "Protect your account";
43
+ readonly loginOptionalDescription: "This profile lets you connect an authenticator later. Connecting one now adds protection; you can also do it in Security settings.";
44
+ readonly loginOptionalBindNow: "Connect TOTP now";
45
+ readonly loginOptionalSkip: "Skip and enter DSH";
46
+ readonly loginOptionalVerifyTitle: "Verify again before setup";
47
+ readonly loginOptionalVerifyDescription: "Enter your current password to protect your account.";
48
+ readonly loginOptionalCurrentPassword: "Current password";
49
+ readonly loginOptionalStart: "Start setup";
50
+ readonly loginOptionalSkipLater: "Connect later and enter DSH";
51
+ readonly loginReasonExpired: "Your session has expired. Sign in again.";
52
+ readonly loginReasonUpdated: "Security settings changed. Sign in again.";
53
+ readonly loginReasonSignedOut: "You signed out of this device.";
54
+ readonly loginUnavailableTitle: "Sign-in is temporarily unavailable";
55
+ readonly loginUnavailableDescription: "The service status is unavailable. Check the connection and retry.";
56
+ readonly loginRetry: "Check again";
57
+ readonly loginErrorInvalidCredentials: "The username or password is incorrect. Try again.";
58
+ readonly loginErrorInvalidFactor: "The verification or backup code is incorrect. After five failed attempts, you must enter your password again.";
59
+ readonly loginErrorChallenge: "This verification expired. Enter your username and password again.";
60
+ readonly loginErrorUninitialized: "The account is not set up. Run the setup command in the server terminal.";
61
+ readonly settingsSectionLabel: "Security";
62
+ readonly settingsSectionAria: "Security settings";
63
+ readonly settingsTitle: "Account security";
64
+ readonly settingsAccountSummary: "Account: {username} · TOTP: {totp}";
65
+ readonly settingsTotpEnabled: "Enabled";
66
+ readonly settingsTotpNotBound: "Not connected";
67
+ readonly settingsLoading: "Loading account status…";
68
+ readonly settingsChangePassword: "Change password";
69
+ readonly settingsBindTotp: "Connect TOTP";
70
+ readonly settingsRebindTotp: "Reconnect TOTP";
71
+ readonly settingsSessions: "Session management";
72
+ readonly settingsPasswordMismatch: "The new passwords do not match.";
73
+ readonly settingsPasswordDescription: "After this change, every device must sign in again.";
74
+ readonly settingsCurrentPassword: "Current password";
75
+ readonly settingsCurrentCode: "Current verification or backup code";
76
+ readonly settingsNewPassword: "New password";
77
+ readonly settingsConfirmPassword: "Confirm new password";
78
+ readonly settingsSavePassword: "Save new password";
79
+ readonly settingsBindDescription: "Enter your current credentials. After connecting the new authenticator, every device must sign in again.";
80
+ readonly settingsStartBinding: "Start setup";
81
+ readonly settingsDisableTotp: "Turn off TOTP";
82
+ readonly settingsDisableDescription: "After turning off TOTP, every device must sign in again.";
83
+ readonly settingsScanQr: "Scan the QR code";
84
+ readonly settingsQrAlt: "Authenticator setup QR code";
85
+ readonly settingsQrUnavailable: "The QR code is unavailable. Use the manual secret below.";
86
+ readonly settingsQrLoading: "Generating the QR code; you can use the manual secret below.";
87
+ readonly settingsManualSecret: "Manual secret:";
88
+ readonly settingsNewCode: "Six-digit code from the new authenticator";
89
+ readonly settingsConfirmBinding: "Confirm setup";
90
+ readonly settingsRestartBinding: "Start over";
91
+ readonly settingsSignOutCurrent: "Sign out this device";
92
+ readonly settingsSignOutAll: "Sign out every device";
93
+ readonly settingsSignOutAllDescription: "Enter your current credentials. All signed-in devices and open connections will be revoked.";
94
+ readonly settingsBackupTitle: "Save your backup codes";
95
+ readonly settingsBackupDescription: "These codes are shown only once. Store them safely; each code can be used only once.";
96
+ readonly settingsBackupSaved: "I saved them; sign in again";
97
+ readonly settingsErrorInvalidCredentials: "The current password is incorrect.";
98
+ readonly settingsErrorInvalidFactor: "The current verification or backup code is incorrect.";
99
+ readonly settingsErrorInvalidInput: "The input is invalid. Passwords must meet the server length rules.";
100
+ readonly settingsErrorChallenge: "The setup challenge expired. Start setup again.";
101
+ readonly settingsErrorTotpRequired: "This profile requires TOTP, so it cannot be turned off.";
102
+ readonly cliHelp: "dsh-auth-remote {version}\n\nUsage:\n dsh plugin --profile web exec dsh-auth-remote [--lang en|zh] COMMAND\n\nCommands:\n init Create the single account interactively\n status [--json] Show non-sensitive authentication status\n reset-password Reset the password and revoke all sessions\n reset-totp Clear TOTP, backup codes and all sessions\n revoke-sessions Sign out every device\n\nOptions:\n --lang en|zh Choose the language for human-readable output\n --help, -h Show this help\n --version, -v Show the package version\n\nThe command uses the profile selected by dsh plugin exec and the caller's DSH_HOME.\n";
103
+ readonly cliPromptUsername: "Username: ";
104
+ readonly cliPromptPassword: "Password: ";
105
+ readonly cliPromptPasswordAgain: "Enter password again: ";
106
+ readonly cliPromptNewPassword: "New password: ";
107
+ readonly cliPromptNewPasswordAgain: "Enter new password again: ";
108
+ readonly cliPromptConfirmTarget: "Enter {profile} to confirm {command}: ";
109
+ readonly cliTargetProfile: "Target profile: {profile}";
110
+ readonly cliDataFile: "State file: {path}";
111
+ readonly cliStatusProfile: "Profile: {profile}";
112
+ readonly cliStatusAccount: "Account: {state}";
113
+ readonly cliStatusTotp: "TOTP: {state}";
114
+ readonly cliStatusSessions: "Active sessions: {count}";
115
+ readonly cliStatusService: "Service: {state}";
116
+ readonly cliInitialized: "Initialized";
117
+ readonly cliNotInitialized: "Not initialized";
118
+ readonly cliTotpEnabled: "Enabled";
119
+ readonly cliTotpDisabled: "Disabled";
120
+ readonly cliOnlineReady: "Online and ready";
121
+ readonly cliOnlineNotReady: "Online but not ready";
122
+ readonly cliOffline: "Offline";
123
+ readonly cliCompleted: "{command} completed; the change is durable and effective.";
124
+ readonly cliErrorInvalidArguments: "Invalid command or arguments. Use --help.";
125
+ readonly cliErrorInvalidLanguage: "Invalid --lang value. Use en or zh.";
126
+ readonly cliErrorDuplicateLanguage: "Specify --lang only once.";
127
+ readonly cliErrorMissingLanguage: "Missing value for --lang. Use en or zh.";
128
+ readonly cliErrorPasswordsMismatch: "The passwords do not match.";
129
+ readonly cliErrorConfirmationMismatch: "The confirmation did not match the target profile.";
130
+ readonly cliErrorPasswordLength: "Password must contain 12–256 Unicode characters.";
131
+ readonly cliErrorTerminalRequired: "An interactive terminal is required.";
132
+ readonly cliErrorTerminalClosed: "Terminal input closed.";
133
+ readonly cliErrorCancelled: "Cancelled.";
134
+ readonly cliErrorProfileDirectory: "The current directory is not the selected DSH profile under DSH_HOME.";
135
+ readonly cliErrorProfileManifest: "The profile package.json is missing.";
136
+ readonly cliErrorUnsafeManagementDirectory: "The management directory has unsafe permissions.";
137
+ readonly cliErrorUnsafeManagementSocket: "The management socket has unsafe permissions.";
138
+ readonly cliErrorManagementUnavailable: "The management socket is unavailable.";
139
+ readonly cliErrorOutcomeUnknown: "The management request disconnected or timed out. Its result is unknown; check status before trying again.";
140
+ readonly cliErrorOfflineLock: "The management socket is unavailable while the service holds the profile lock. Offline access was refused.";
141
+ readonly cliErrorInvalidCredentials: "The current credentials are incorrect.";
142
+ readonly cliErrorAlreadyInitialized: "The account is already initialized.";
143
+ readonly cliErrorInvalidInput: "The input is invalid.";
144
+ readonly cliErrorInvalidFactor: "The verification or backup code is incorrect.";
145
+ readonly cliErrorUninitialized: "The account is not initialized.";
146
+ readonly cliErrorTotpRequired: "This profile requires TOTP.";
147
+ readonly cliErrorConflict: "The account state changed. Check status and retry.";
148
+ readonly cliErrorBusy: "The service is busy. Try again later.";
149
+ readonly cliErrorUnknown: "The operation failed. Check status before trying again.";
150
+ };
151
+ //# sourceMappingURL=en.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../src/shared/locales/en.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsLL,CAAA"}