@zincapp/znvault-cli 2.9.2 → 2.10.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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AA4SzC,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiCjE"}
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
// Path: znvault-cli/src/commands/completion.ts
|
|
2
|
+
import * as output from '../lib/output.js';
|
|
3
|
+
/**
|
|
4
|
+
* Generate Bash completion script
|
|
5
|
+
*/
|
|
6
|
+
function generateBashCompletion() {
|
|
7
|
+
return `# znvault bash completion
|
|
8
|
+
# Add to ~/.bashrc or ~/.bash_profile:
|
|
9
|
+
# eval "$(znvault completion bash)"
|
|
10
|
+
|
|
11
|
+
_znvault_completions() {
|
|
12
|
+
local cur prev words cword
|
|
13
|
+
_init_completion || return
|
|
14
|
+
|
|
15
|
+
# Top-level commands
|
|
16
|
+
local commands="login logout whoami config profile health status cluster tenant user superadmin lockdown audit emergency cert agent update apikey policy permissions secret kms role backup notification tui dashboard self-update advisor completion version help"
|
|
17
|
+
|
|
18
|
+
# Subcommands for each command group
|
|
19
|
+
local cluster_cmds="status takeover release promote maintenance"
|
|
20
|
+
local tenant_cmds="list get create update delete usage"
|
|
21
|
+
local user_cmds="list get create update delete unlock reset-password disable-totp"
|
|
22
|
+
local superadmin_cmds="list create reset-password unlock disable enable"
|
|
23
|
+
local lockdown_cmds="status trigger clear history threats"
|
|
24
|
+
local audit_cmds="list verify export"
|
|
25
|
+
local agent_cmds="list get register-token revoke-token"
|
|
26
|
+
local update_cmds="list get create upload set-latest"
|
|
27
|
+
local apikey_cmds="list get create delete rotate permissions conditions enable disable policies attach-policy detach-policy self managed"
|
|
28
|
+
local policy_cmds="list get create update delete toggle validate attachments attach-user attach-role detach-user detach-role test"
|
|
29
|
+
local secret_cmds="list get create update delete copy"
|
|
30
|
+
local kms_cmds="key encrypt decrypt sign verify"
|
|
31
|
+
local role_cmds="list get create update delete users assign unassign"
|
|
32
|
+
local backup_cmds="config list create restore delete"
|
|
33
|
+
local notification_cmds="config test"
|
|
34
|
+
local advisor_cmds="audit rules suggest llm"
|
|
35
|
+
local advisor_llm_cmds="status get config test delete"
|
|
36
|
+
local profile_cmds="list create delete use rename"
|
|
37
|
+
local completion_cmds="bash zsh"
|
|
38
|
+
|
|
39
|
+
case "\${cword}" in
|
|
40
|
+
1)
|
|
41
|
+
COMPREPLY=( \$(compgen -W "\${commands}" -- "\${cur}") )
|
|
42
|
+
;;
|
|
43
|
+
2)
|
|
44
|
+
case "\${prev}" in
|
|
45
|
+
cluster) COMPREPLY=( \$(compgen -W "\${cluster_cmds}" -- "\${cur}") ) ;;
|
|
46
|
+
tenant) COMPREPLY=( \$(compgen -W "\${tenant_cmds}" -- "\${cur}") ) ;;
|
|
47
|
+
user) COMPREPLY=( \$(compgen -W "\${user_cmds}" -- "\${cur}") ) ;;
|
|
48
|
+
superadmin) COMPREPLY=( \$(compgen -W "\${superadmin_cmds}" -- "\${cur}") ) ;;
|
|
49
|
+
lockdown) COMPREPLY=( \$(compgen -W "\${lockdown_cmds}" -- "\${cur}") ) ;;
|
|
50
|
+
audit) COMPREPLY=( \$(compgen -W "\${audit_cmds}" -- "\${cur}") ) ;;
|
|
51
|
+
agent) COMPREPLY=( \$(compgen -W "\${agent_cmds}" -- "\${cur}") ) ;;
|
|
52
|
+
update) COMPREPLY=( \$(compgen -W "\${update_cmds}" -- "\${cur}") ) ;;
|
|
53
|
+
apikey|api-key) COMPREPLY=( \$(compgen -W "\${apikey_cmds}" -- "\${cur}") ) ;;
|
|
54
|
+
policy) COMPREPLY=( \$(compgen -W "\${policy_cmds}" -- "\${cur}") ) ;;
|
|
55
|
+
secret) COMPREPLY=( \$(compgen -W "\${secret_cmds}" -- "\${cur}") ) ;;
|
|
56
|
+
kms) COMPREPLY=( \$(compgen -W "\${kms_cmds}" -- "\${cur}") ) ;;
|
|
57
|
+
role) COMPREPLY=( \$(compgen -W "\${role_cmds}" -- "\${cur}") ) ;;
|
|
58
|
+
backup) COMPREPLY=( \$(compgen -W "\${backup_cmds}" -- "\${cur}") ) ;;
|
|
59
|
+
notification) COMPREPLY=( \$(compgen -W "\${notification_cmds}" -- "\${cur}") ) ;;
|
|
60
|
+
advisor) COMPREPLY=( \$(compgen -W "\${advisor_cmds}" -- "\${cur}") ) ;;
|
|
61
|
+
profile) COMPREPLY=( \$(compgen -W "\${profile_cmds}" -- "\${cur}") ) ;;
|
|
62
|
+
completion) COMPREPLY=( \$(compgen -W "\${completion_cmds}" -- "\${cur}") ) ;;
|
|
63
|
+
*) ;;
|
|
64
|
+
esac
|
|
65
|
+
;;
|
|
66
|
+
3)
|
|
67
|
+
# Handle nested subcommands (e.g., advisor llm)
|
|
68
|
+
if [[ "\${words[1]}" == "advisor" && "\${prev}" == "llm" ]]; then
|
|
69
|
+
COMPREPLY=( \$(compgen -W "\${advisor_llm_cmds}" -- "\${cur}") )
|
|
70
|
+
fi
|
|
71
|
+
;;
|
|
72
|
+
*)
|
|
73
|
+
# Complete options based on current command
|
|
74
|
+
local opts=""
|
|
75
|
+
case "\${words[1]}" in
|
|
76
|
+
login) opts="--username -u --password -p --totp" ;;
|
|
77
|
+
health) opts="--json --leader" ;;
|
|
78
|
+
status) opts="--json" ;;
|
|
79
|
+
secret)
|
|
80
|
+
case "\${words[2]}" in
|
|
81
|
+
list) opts="--tenant -t --type --tag --json" ;;
|
|
82
|
+
get) opts="--tenant -t --json --decrypt" ;;
|
|
83
|
+
create) opts="--tenant -t --type --tags --expires --file --suggest --json" ;;
|
|
84
|
+
*) ;;
|
|
85
|
+
esac
|
|
86
|
+
;;
|
|
87
|
+
advisor)
|
|
88
|
+
case "\${words[2]}" in
|
|
89
|
+
audit) opts="--tenant --category --severity --ai-summary --json" ;;
|
|
90
|
+
suggest) opts="--tenant --environment --service --team --json" ;;
|
|
91
|
+
llm)
|
|
92
|
+
case "\${words[3]}" in
|
|
93
|
+
config) opts="--provider --api-key --model --max-tokens --enabled" ;;
|
|
94
|
+
status|get) opts="--json" ;;
|
|
95
|
+
*) ;;
|
|
96
|
+
esac
|
|
97
|
+
;;
|
|
98
|
+
*) ;;
|
|
99
|
+
esac
|
|
100
|
+
;;
|
|
101
|
+
*) ;;
|
|
102
|
+
esac
|
|
103
|
+
# Add global options
|
|
104
|
+
opts="\${opts} --url --insecure --profile --plain --help -h"
|
|
105
|
+
COMPREPLY=( \$(compgen -W "\${opts}" -- "\${cur}") )
|
|
106
|
+
;;
|
|
107
|
+
esac
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
complete -F _znvault_completions znvault
|
|
111
|
+
`;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Generate Zsh completion script
|
|
115
|
+
*/
|
|
116
|
+
function generateZshCompletion() {
|
|
117
|
+
return `#compdef znvault
|
|
118
|
+
# znvault zsh completion
|
|
119
|
+
# Add to ~/.zshrc:
|
|
120
|
+
# eval "$(znvault completion zsh)"
|
|
121
|
+
|
|
122
|
+
_znvault() {
|
|
123
|
+
local -a commands subcommands opts
|
|
124
|
+
local curcontext="\$curcontext" state line
|
|
125
|
+
|
|
126
|
+
_arguments -C \\
|
|
127
|
+
'--url[Vault server URL]:url:_urls' \\
|
|
128
|
+
'--insecure[Skip TLS certificate verification]' \\
|
|
129
|
+
'--profile[Use a specific configuration profile]:profile:->profiles' \\
|
|
130
|
+
'--plain[Use plain text output]' \\
|
|
131
|
+
'(-h --help)'{-h,--help}'[Show help]' \\
|
|
132
|
+
'(-V --version)'{-V,--version}'[Show version]' \\
|
|
133
|
+
'1: :->command' \\
|
|
134
|
+
'*:: :->args'
|
|
135
|
+
|
|
136
|
+
case \$state in
|
|
137
|
+
profiles)
|
|
138
|
+
local -a profiles
|
|
139
|
+
profiles=(\${(f)"\$(znvault profile list --plain 2>/dev/null | awk '{print \$1}')"})
|
|
140
|
+
_describe -t profiles 'profile' profiles
|
|
141
|
+
;;
|
|
142
|
+
command)
|
|
143
|
+
commands=(
|
|
144
|
+
'login:Authenticate with the vault server'
|
|
145
|
+
'logout:Clear stored credentials'
|
|
146
|
+
'whoami:Show current authenticated user'
|
|
147
|
+
'config:Manage CLI configuration'
|
|
148
|
+
'profile:Manage configuration profiles'
|
|
149
|
+
'health:Check vault server health'
|
|
150
|
+
'status:Show comprehensive system status'
|
|
151
|
+
'cluster:Cluster management commands'
|
|
152
|
+
'tenant:Tenant management commands'
|
|
153
|
+
'user:User management commands'
|
|
154
|
+
'superadmin:Superadmin management commands'
|
|
155
|
+
'lockdown:Lockdown and breach detection commands'
|
|
156
|
+
'audit:Audit log commands'
|
|
157
|
+
'emergency:Emergency operations'
|
|
158
|
+
'cert:Certificate management'
|
|
159
|
+
'agent:Manage remote agents'
|
|
160
|
+
'update:Manage agent updates'
|
|
161
|
+
'apikey:API key management'
|
|
162
|
+
'policy:ABAC policy management'
|
|
163
|
+
'permissions:Manage and view permissions'
|
|
164
|
+
'secret:Manage secrets'
|
|
165
|
+
'kms:KMS operations'
|
|
166
|
+
'role:RBAC role management'
|
|
167
|
+
'backup:Backup management'
|
|
168
|
+
'notification:Email notification configuration'
|
|
169
|
+
'tui:Launch interactive terminal dashboard'
|
|
170
|
+
'dashboard:Launch interactive dashboard'
|
|
171
|
+
'self-update:Update znvault CLI'
|
|
172
|
+
'advisor:AI-powered security advisor'
|
|
173
|
+
'completion:Generate shell completion scripts'
|
|
174
|
+
'version:Show version'
|
|
175
|
+
'help:Display help'
|
|
176
|
+
)
|
|
177
|
+
_describe -t commands 'command' commands
|
|
178
|
+
;;
|
|
179
|
+
args)
|
|
180
|
+
case \$words[1] in
|
|
181
|
+
cluster)
|
|
182
|
+
subcommands=(
|
|
183
|
+
'status:Show cluster status'
|
|
184
|
+
'takeover:Force leadership takeover'
|
|
185
|
+
'release:Release leadership'
|
|
186
|
+
'promote:Promote a node'
|
|
187
|
+
'maintenance:Toggle maintenance mode'
|
|
188
|
+
)
|
|
189
|
+
_describe -t subcommands 'subcommand' subcommands
|
|
190
|
+
;;
|
|
191
|
+
tenant)
|
|
192
|
+
subcommands=(
|
|
193
|
+
'list:List all tenants'
|
|
194
|
+
'get:Get tenant details'
|
|
195
|
+
'create:Create a new tenant'
|
|
196
|
+
'update:Update a tenant'
|
|
197
|
+
'delete:Delete a tenant'
|
|
198
|
+
'usage:Show tenant usage'
|
|
199
|
+
)
|
|
200
|
+
_describe -t subcommands 'subcommand' subcommands
|
|
201
|
+
;;
|
|
202
|
+
user)
|
|
203
|
+
subcommands=(
|
|
204
|
+
'list:List users'
|
|
205
|
+
'get:Get user details'
|
|
206
|
+
'create:Create a user'
|
|
207
|
+
'update:Update a user'
|
|
208
|
+
'delete:Delete a user'
|
|
209
|
+
'unlock:Unlock a user'
|
|
210
|
+
'reset-password:Reset user password'
|
|
211
|
+
'disable-totp:Disable 2FA for user'
|
|
212
|
+
)
|
|
213
|
+
_describe -t subcommands 'subcommand' subcommands
|
|
214
|
+
;;
|
|
215
|
+
secret)
|
|
216
|
+
subcommands=(
|
|
217
|
+
'list:List secrets'
|
|
218
|
+
'get:Get a secret'
|
|
219
|
+
'create:Create a secret'
|
|
220
|
+
'update:Update a secret'
|
|
221
|
+
'delete:Delete a secret'
|
|
222
|
+
'copy:Copy a secret'
|
|
223
|
+
)
|
|
224
|
+
_describe -t subcommands 'subcommand' subcommands
|
|
225
|
+
;;
|
|
226
|
+
advisor)
|
|
227
|
+
subcommands=(
|
|
228
|
+
'audit:Run a security audit'
|
|
229
|
+
'rules:List security rules'
|
|
230
|
+
'suggest:Get AI suggestions'
|
|
231
|
+
'llm:Manage LLM configuration'
|
|
232
|
+
)
|
|
233
|
+
_describe -t subcommands 'subcommand' subcommands
|
|
234
|
+
;;
|
|
235
|
+
profile)
|
|
236
|
+
subcommands=(
|
|
237
|
+
'list:List all profiles'
|
|
238
|
+
'create:Create a new profile'
|
|
239
|
+
'delete:Delete a profile'
|
|
240
|
+
'use:Switch active profile'
|
|
241
|
+
'rename:Rename a profile'
|
|
242
|
+
)
|
|
243
|
+
_describe -t subcommands 'subcommand' subcommands
|
|
244
|
+
;;
|
|
245
|
+
kms)
|
|
246
|
+
subcommands=(
|
|
247
|
+
'key:Key management'
|
|
248
|
+
'encrypt:Encrypt data'
|
|
249
|
+
'decrypt:Decrypt data'
|
|
250
|
+
'sign:Sign data'
|
|
251
|
+
'verify:Verify signature'
|
|
252
|
+
)
|
|
253
|
+
_describe -t subcommands 'subcommand' subcommands
|
|
254
|
+
;;
|
|
255
|
+
backup)
|
|
256
|
+
subcommands=(
|
|
257
|
+
'config:Configure backups'
|
|
258
|
+
'list:List backups'
|
|
259
|
+
'create:Create a backup'
|
|
260
|
+
'restore:Restore from backup'
|
|
261
|
+
'delete:Delete a backup'
|
|
262
|
+
)
|
|
263
|
+
_describe -t subcommands 'subcommand' subcommands
|
|
264
|
+
;;
|
|
265
|
+
apikey|api-key)
|
|
266
|
+
subcommands=(
|
|
267
|
+
'list:List API keys'
|
|
268
|
+
'get:Get API key details'
|
|
269
|
+
'create:Create an API key'
|
|
270
|
+
'delete:Delete an API key'
|
|
271
|
+
'rotate:Rotate an API key'
|
|
272
|
+
'permissions:Update permissions'
|
|
273
|
+
'enable:Enable an API key'
|
|
274
|
+
'disable:Disable an API key'
|
|
275
|
+
'self:View current API key'
|
|
276
|
+
'managed:Managed API keys'
|
|
277
|
+
)
|
|
278
|
+
_describe -t subcommands 'subcommand' subcommands
|
|
279
|
+
;;
|
|
280
|
+
completion)
|
|
281
|
+
subcommands=(
|
|
282
|
+
'bash:Generate bash completion'
|
|
283
|
+
'zsh:Generate zsh completion'
|
|
284
|
+
)
|
|
285
|
+
_describe -t subcommands 'shell' subcommands
|
|
286
|
+
;;
|
|
287
|
+
*)
|
|
288
|
+
_files
|
|
289
|
+
;;
|
|
290
|
+
esac
|
|
291
|
+
;;
|
|
292
|
+
esac
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
_znvault "\$@"
|
|
296
|
+
`;
|
|
297
|
+
}
|
|
298
|
+
export function registerCompletionCommands(program) {
|
|
299
|
+
const completion = program
|
|
300
|
+
.command('completion')
|
|
301
|
+
.description('Generate shell completion scripts');
|
|
302
|
+
completion
|
|
303
|
+
.command('bash')
|
|
304
|
+
.description('Generate bash completion script')
|
|
305
|
+
.action(() => {
|
|
306
|
+
console.log(generateBashCompletion());
|
|
307
|
+
});
|
|
308
|
+
completion
|
|
309
|
+
.command('zsh')
|
|
310
|
+
.description('Generate zsh completion script')
|
|
311
|
+
.action(() => {
|
|
312
|
+
console.log(generateZshCompletion());
|
|
313
|
+
});
|
|
314
|
+
// Default action shows installation instructions
|
|
315
|
+
completion.action(() => {
|
|
316
|
+
output.section('Shell Completion Setup');
|
|
317
|
+
console.log('');
|
|
318
|
+
output.info('Bash (add to ~/.bashrc):');
|
|
319
|
+
console.log(' eval "$(znvault completion bash)"');
|
|
320
|
+
console.log('');
|
|
321
|
+
output.info('Zsh (add to ~/.zshrc):');
|
|
322
|
+
console.log(' eval "$(znvault completion zsh)"');
|
|
323
|
+
console.log('');
|
|
324
|
+
output.info('Or save to a file:');
|
|
325
|
+
console.log(' znvault completion bash > /etc/bash_completion.d/znvault');
|
|
326
|
+
console.log(' znvault completion zsh > /usr/local/share/zsh/site-functions/_znvault');
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
//# sourceMappingURL=completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.js","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAG/C,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAE3C;;GAEG;AACH,SAAS,sBAAsB;IAC7B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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wB,CAAC,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAClC,OAAO,CAAC,GAAG,CAAC,4DAA4D,CAAC,CAAC;QAC1E,OAAO,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;IACzF,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,7 @@ import { registerNotificationCommands } from './commands/notification.js';
|
|
|
23
23
|
import { registerTuiCommands } from './commands/tui.js';
|
|
24
24
|
import { registerSelfUpdateCommands } from './commands/self-update.js';
|
|
25
25
|
import { registerAdvisorCommands } from './commands/advisor.js';
|
|
26
|
+
import { registerCompletionCommands } from './commands/completion.js';
|
|
26
27
|
import { client } from './lib/client.js';
|
|
27
28
|
import { setRuntimeProfile, getActiveProfileName, getConfig } from './lib/config.js';
|
|
28
29
|
import { cliBanner, helpHint } from './lib/visual.js';
|
|
@@ -40,7 +41,7 @@ program
|
|
|
40
41
|
.option('--insecure', 'Skip TLS certificate verification')
|
|
41
42
|
.option('--profile <name>', 'Use a specific configuration profile')
|
|
42
43
|
.option('--plain', 'Use plain text output (no colors or TUI)')
|
|
43
|
-
.hook('preAction', (thisCommand) => {
|
|
44
|
+
.hook('preAction', (thisCommand, actionCommand) => {
|
|
44
45
|
// Apply global options
|
|
45
46
|
const opts = thisCommand.opts();
|
|
46
47
|
// Set output mode first (before any output)
|
|
@@ -55,6 +56,12 @@ program
|
|
|
55
56
|
if (opts.url !== undefined || opts.insecure !== undefined) {
|
|
56
57
|
client.configure(opts.url, opts.insecure);
|
|
57
58
|
}
|
|
59
|
+
// Skip profile indicator for completion commands (output is evaluated by shell)
|
|
60
|
+
const cmdPath = actionCommand.name();
|
|
61
|
+
const parentName = actionCommand.parent?.name();
|
|
62
|
+
if (parentName === 'completion' || cmdPath === 'completion') {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
58
65
|
// Show current profile indicator
|
|
59
66
|
const config = getConfig();
|
|
60
67
|
profileIndicator(getActiveProfileName(), config.url);
|
|
@@ -83,6 +90,7 @@ registerNotificationCommands(program);
|
|
|
83
90
|
registerTuiCommands(program);
|
|
84
91
|
registerSelfUpdateCommands(program);
|
|
85
92
|
registerAdvisorCommands(program);
|
|
93
|
+
registerCompletionCommands(program);
|
|
86
94
|
// Configure context-aware help (hides superadmin-only commands for regular users)
|
|
87
95
|
configureContextHelp(program);
|
|
88
96
|
// Run background update check (non-blocking)
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CA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