-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathauto-updater.lua
665 lines (602 loc) · 25.3 KB
/
auto-updater.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
-- Auto-Updater v2.12
-- by Hexarobi
-- For Lua Scripts for the Stand Mod Menu for GTA5
-- https://github.com/hexarobi/stand-lua-auto-updater
local config = {
debug_mode = false,
http_check_delay = 250,
extraction_ignored_filenames = {
"readme",
"readme.txt",
"readme.md",
"license",
"license.txt",
"license.md",
"version",
"version.txt",
"version.lua",
}
}
---
--- Dependencies
---
--util.ensure_package_is_installed('lua/json')
--local status_json, json = pcall(require, "json")
--if not status_json then error("Could not load json lib. Make sure it is selected under Stand > Lua Scripts > Repository > json") end
local status_crypto, crypto = pcall(require, "crypto")
if not status_crypto then util.log("Could not load crypto lib") end
--local status_inspect, inspect = pcall(require, "inspect")
--if not status_inspect then util.log("Could not load inspect lib") end
---
--- Utilities
---
local function parse_url_host(url)
return url:match("://(.-)/")
end
local function parse_url_path(url)
return "/"..url:match("://.-/(.*)")
end
local function get_github_raw_url(github_project_url, branch, script_relpath)
local project_path = github_project_url:match("^https://github.com/([^/]+/[^/]+)$")
if project_path then
return "https://raw.githubusercontent.com/"..project_path.."/"..branch.."/"..script_relpath
end
end
local function modify_github_url_branch(url, switch_to_branch)
local root, path = url:match("^(https://raw.githubusercontent.com/[^/]+/[^/]+)/[^/]+/([^/].*)$")
return root.."/"..switch_to_branch.."/"..path
end
local function debug_log(message)
if config.debug_mode then
util.log("[auto-updater] "..message)
end
end
---
--- Version File
---
local function save_version_data(auto_update_config)
local file = io.open(auto_update_config.version_file, "wb")
if file == nil then util.toast("Error opening version file for writing: "..auto_update_config.version_file, TOAST_ALL) return end
file:write(soup.json.encode(auto_update_config.version_data))
file:close()
end
local function load_version_data(auto_update_config)
local file = io.open(auto_update_config.version_file)
if file then
local version = file:read()
file:close()
local status, version_data = pcall(soup.json.decode, version)
if not status and type(version) == "string" then
version_data = {version_id=version}
end
auto_update_config.version_data = version_data
--util.toast("Loaded version data "..inspect(auto_update_config.version_data), TOAST_ALL)
else
auto_update_config.version_data = {}
--util.toast("Created new version data "..inspect(auto_update_config.version_data), TOAST_ALL)
end
end
local function update_version_last_checked_time(auto_update_config)
load_version_data(auto_update_config)
auto_update_config.version_data.last_checked = util.current_unix_time_seconds()
save_version_data(auto_update_config)
end
local function update_version_id(auto_update_config, version_id, file_hash)
local script_version = auto_update_config.version_data.script_version
load_version_data(auto_update_config)
auto_update_config.version_data.version_id = version_id
auto_update_config.version_data.file_hash = file_hash
auto_update_config.version_data.fresh_update = true
auto_update_config.version_data.last_checked = util.current_unix_time_seconds()
auto_update_config.version_data.script_version = script_version
save_version_data(auto_update_config)
end
local function process_version(auto_update_config, result, headers)
local file_hash
if crypto then
file_hash = crypto.md5(result)
end
if headers then
for header_key, header_value in pairs(headers) do
if header_key:lower() == "etag" then
update_version_id(auto_update_config, header_value, file_hash)
end
end
end
end
---
--- Replacer
---
local function update_file(path, content)
debug_log("Updating file "..path)
local dirpath = path:match("(.-)([^\\/]-%.?)$")
filesystem.mkdirs(dirpath)
local file = io.open(path, "wb")
if file == nil then
util.toast("Error updating "..path..". Could not open file for writing.", TOAST_ALL)
return false
end
file:write(content)
file:close()
debug_log("Updated file "..path)
return true
end
local function replace_current_script(auto_update_config, content)
if update_file(auto_update_config.script_path, content) then
auto_update_config.script_updated = true
end
end
local function parse_script_version(auto_update_config, script)
auto_update_config.version_data.script_version = script:match('SCRIPT_VERSION = "([^ ]+)"')
end
---
--- Full Restarter
---
local function is_root(cmd)
return not cmd:getParent():isValid()
end
local function get_path_config(cmd)
local path = cmd.name_for_config
while true do
cmd = cmd:getParent()
if is_root(cmd) then break end
path = cmd.name_for_config..">"..path
end
return path
end
local function force_full_restart()
-- Not using util.restart_script because updated libraries would not be re-required
local menu_script_path = get_path_config(menu.my_root())
local script_body = "\
util.yield(50)\
local script_stop_command_ref = menu.ref_by_path(\""..menu_script_path..">Stop Script\")\
if menu.is_ref_valid(script_stop_command_ref) then\
menu.focus(script_stop_command_ref)\
util.yield(50)\
menu.trigger_command(script_stop_command_ref)\
end\
util.yield(50)\
local script_command_ref = menu.ref_by_path(\""..menu_script_path..">Start Script\")\
if menu.is_ref_valid(script_command_ref) then\
menu.focus(script_command_ref)\
util.yield(50)\
menu.trigger_command(script_command_ref)\
end\
io.remove(filesystem.scripts_dir()..SCRIPT_RELPATH)\
util.stop_script()\
"
update_file(filesystem.scripts_dir().."\\restartscript.lua", script_body)
local menu_item
menu_item = menu.ref_by_path("Stand>Lua Scripts")
if menu.is_ref_valid(menu_item) then
menu.focus(menu_item)
menu.trigger_command(menu_item)
util.yield(50)
end
local restart_script = menu.ref_by_path("Stand>Lua Scripts>restartscript>Start Script")
if menu.is_ref_valid(restart_script) then
menu.focus(restart_script)
util.yield(50)
menu.trigger_command(restart_script)
end
util.stop_script()
end
---
--- Zip Extractor
---
local function escape_pattern(text)
return text:gsub("([^%w])", "%%%1")
end
local function is_ignored_filename(filename)
local filename_lower = filename:lower()
for _, ignored_filename in pairs(config.extraction_ignored_filenames) do
if ignored_filename == filename_lower then
return true
end
end
return false
end
local function build_script_run_name(script_name)
if script_name ~= nil then
return script_name:gsub("_", ""):gsub(" ", ""):gsub("-", "")
end
end
local function extract_zip(auto_update_config)
debug_log("Extracting zip file "..auto_update_config.script_path)
if auto_update_config.extracted_files == nil then auto_update_config.extracted_files = {} end
local first_lua_file
local fr = soup.FileReader(auto_update_config.script_path)
local zr = soup.ZipReader(fr)
for _, f in zr:getFileList() do
for _2, extraction in pairs(auto_update_config.extractions) do
local pattern = "^"..escape_pattern(extraction.from).."/(.*[^/])$"
local relative_path = f.name:match(pattern)
if relative_path and not is_ignored_filename(relative_path) then
local output_filepath = filesystem.stand_dir() .. extraction.to .. "/" .. relative_path
debug_log("Extracting file "..output_filepath)
local expand_status, content = pcall(zr.getFileContents, zr, f)
if not expand_status then
debug_log("Failed to extract "..f.name..": "..content)
else
local lua_filename = f.name:match("([^/]+)%.lua$")
if first_lua_file == nil and lua_filename then
debug_log("Found first lua filename "..lua_filename)
first_lua_file = lua_filename
if auto_update_config.script_run_name == nil then
auto_update_config.script_run_name = build_script_run_name(lua_filename)
end
if auto_update_config.script_filepath == nil then
auto_update_config.script_filepath = output_filepath
end
end
update_file(output_filepath, content)
debug_log("Extracted file "..output_filepath)
table.insert(auto_update_config.extracted_files, output_filepath)
end
else
debug_log("Skipping file due to name doesnt match pattern "..pattern.." "..f.name)
end
end
util.yield()
end
end
---
--- Uninstaller
---
local function delete_file(filepath)
if filepath == nil or not filesystem.exists(filepath) then return end
debug_log("Deleting file "..filepath)
io.remove(filepath)
end
local function uninstall(auto_update_config)
delete_file(auto_update_config.script_path)
if auto_update_config.extracted_files ~= nil then
for _, extracted_file in pairs(auto_update_config.extracted_files) do
delete_file(extracted_file)
end
end
end
---
--- GitHub API
---
local function parse_github_user_and_project(url)
local user, project = url:match("^https://github%.com/([^/]+)/([^/]+)/?$")
if not user or not project then
error("Invalid project url (must be a GitHub.com project): "..url)
end
return user, project
end
local function fetch_json(url)
local fetch_complete = false
local response
async_http.init(parse_url_host(url), parse_url_path(url), function(result, headers, status_code)
response = soup.json.decode(result)
fetch_complete = true
end, function()
util.toast("Error fetching "..url, TOAST_ALL)
fetch_complete = true
end)
async_http.dispatch()
while fetch_complete ~= true do util.yield() end
return response
end
local function get_default_branch(auto_update_config)
local user, project = parse_github_user_and_project(auto_update_config.project_url)
local response = fetch_json("https://api.github.com/repos/"..user.."/"..project.."/branches")
if response == nil or response[1] == nil then
error("Error fetching project default branch. Make sure the project URL is correct, and use CloudFlare DNS 1.1.1.1")
end
return response[1].name
end
---
--- Config Defaults
---
local function initial_project_config(auto_update_config)
-- Faster config assumes main branch for now, will use final_project_config to detect actual branch name
if auto_update_config.project_url ~= nil then
local user, project = parse_github_user_and_project(auto_update_config.project_url)
if auto_update_config.author == nil then
auto_update_config.author = user
end
if auto_update_config.source_url == nil then
auto_update_config.source_url = auto_update_config.project_url
auto_update_config.is_project_archive = true
auto_update_config.script_relpath = user .. "-" .. project .. "-main.zip"
end
end
end
local function final_project_config(auto_update_config)
-- Slower config makes API call to get proper branch name, only used at install time
if auto_update_config.project_url ~= nil and auto_update_config.is_project_archive then
if auto_update_config.branch == nil then
-- Get branch from API
auto_update_config.branch = get_default_branch(auto_update_config)
debug_log("Set branch "..auto_update_config.branch)
end
local user, project = parse_github_user_and_project(auto_update_config.project_url)
auto_update_config.source_url = "https://codeload.github.com/"..user.."/"..project.."/zip/refs/heads/" .. auto_update_config.branch
local filename = user .. "-" .. project .. "-" .. auto_update_config.branch .. ".zip"
auto_update_config.script_relpath = filename
auto_update_config.script_path = filesystem.store_dir() .. "auto-updater/compressed/" .. filename
if auto_update_config.extractions == nil then
auto_update_config.extractions = {
{
from=project .. "-" .. auto_update_config.branch,
to="Lua Scripts\\",
}
}
end
end
end
local function expand_auto_update_config(auto_update_config)
initial_project_config(auto_update_config)
auto_update_config.script_relpath = auto_update_config.script_relpath:gsub("\\", "/")
if auto_update_config.script_path == nil then
auto_update_config.script_path = filesystem.scripts_dir() .. auto_update_config.script_relpath
end
if auto_update_config.script_filename == nil then
auto_update_config.script_filename = ("/"..auto_update_config.script_relpath):match("^.*/(.+)$")
end
if auto_update_config.script_name == nil then
auto_update_config.script_name = auto_update_config.script_filename:match(".-([^\\/]-%.?)[.]lua$")
if auto_update_config.script_name == nil then
auto_update_config.script_name = auto_update_config.script_filename:match(".-([^\\/]-%.?)[.]pluto$")
end
end
if auto_update_config.name == nil then
auto_update_config.name = auto_update_config.script_filename
end
if auto_update_config.script_run_name == nil and auto_update_config.script_name then
auto_update_config.script_run_name = build_script_run_name(auto_update_config.script_name)
end
auto_update_config.script_reldirpath = ("/"..auto_update_config.script_relpath):match("^(.*)/[^/]+$")
filesystem.mkdirs(filesystem.scripts_dir() .. auto_update_config.script_reldirpath)
if auto_update_config.version_file == nil then
auto_update_config.version_store_dir = filesystem.store_dir() .. "auto-updater/versions" .. auto_update_config.script_reldirpath
filesystem.mkdirs(auto_update_config.version_store_dir)
auto_update_config.version_file = auto_update_config.version_store_dir .. "/" .. auto_update_config.script_filename .. ".version"
end
if auto_update_config.source_url == nil then -- For backward compatibility with older configs
auto_update_config.source_url = "https://" .. auto_update_config.source_host .. "/" .. auto_update_config.source_path
end
if auto_update_config.switch_to_branch ~= nil then
auto_update_config.source_url = modify_github_url_branch(auto_update_config.source_url, auto_update_config.switch_to_branch)
end
--if auto_update_config.restart_delay == nil then
-- auto_update_config.restart_delay = 100
--end
if auto_update_config.http_timeout == nil then
auto_update_config.http_timeout = 45000
end
if auto_update_config.expected_status_code == nil then
auto_update_config.expected_status_code = 200
end
if auto_update_config.check_interval == nil then
auto_update_config.check_interval = 86400 -- Daily = 86400 seconds
end
load_version_data(auto_update_config)
end
---
--- Downloader
---
local is_download_complete
local function is_result_valid(auto_update_config, result, headers, status_code)
if status_code == 304 then
-- No update found
update_version_last_checked_time(auto_update_config)
is_download_complete = true
return false
end
if status_code == 302 then
util.toast("Error updating "..auto_update_config.name..": Unexpected redirection from "..auto_update_config.source_url.." to "..headers["Location"], TOAST_ALL)
is_download_complete = false
return false
end
if status_code ~= auto_update_config.expected_status_code then
util.toast("Error updating "..auto_update_config.name..": Unexpected status code: "..status_code .. " for URL "..auto_update_config.source_url, TOAST_ALL)
is_download_complete = false
return false
end
if not result or result == "" then
util.toast("Error updating "..auto_update_config.name..": Empty content", TOAST_ALL)
is_download_complete = false
return false
end
if auto_update_config.verify_file_begins_with ~= nil then
if not string.startswith(result, auto_update_config.verify_file_begins_with) then
util.toast("Error updating "..auto_update_config.name..": Found invalid content", TOAST_ALL)
is_download_complete = false
return false
end
end
if auto_update_config.verify_file_begins_with == nil and auto_update_config.verify_file_does_not_begin_with == nil then
auto_update_config.verify_file_does_not_begin_with = "<"
end
if auto_update_config.verify_file_does_not_begin_with ~= nil
and string.startswith(result, auto_update_config.verify_file_does_not_begin_with) then
util.toast("Error updating "..auto_update_config.name..": Found invalid content", TOAST_ALL)
is_download_complete = false
return false
end
return true
end
local function process_auto_update(auto_update_config)
final_project_config(auto_update_config)
async_http.init(parse_url_host(auto_update_config.source_url), parse_url_path(auto_update_config.source_url), function(result, headers, status_code)
if not is_result_valid(auto_update_config, result, headers, status_code) then
return
end
replace_current_script(auto_update_config, result)
parse_script_version(auto_update_config, result)
process_version(auto_update_config, result, headers)
if auto_update_config.extractions ~= nil then
extract_zip(auto_update_config)
end
is_download_complete = true
if not auto_update_config.silent_updates then
util.toast("Updated "..auto_update_config.name, TOAST_ALL)
end
end, function()
util.toast("Error updating "..auto_update_config.name..": Update failed to download.", TOAST_ALL)
is_download_complete = true
end)
-- Only use cached version if this is not a clean reinstall, and if the file still exists on disk
if auto_update_config.clean_reinstall ~= true and filesystem.exists(auto_update_config.script_path) then
-- Use ETags to only fetch files if they have been updated
-- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag
if auto_update_config.version_data.version_id then
--debug_log("Adding existing etag "..inspect(auto_update_config.version_data.version_id))
async_http.add_header("If-None-Match", auto_update_config.version_data.version_id)
end
end
async_http.dispatch()
end
local function is_due_for_update_check(auto_update_config)
return (
auto_update_config == nil
or auto_update_config.clean_reinstall == true
or auto_update_config.version_data == nil
or auto_update_config.version_data.last_checked == nil
or auto_update_config.check_interval == 0
or ((util.current_unix_time_seconds() - auto_update_config.version_data.last_checked) > auto_update_config.check_interval)
or (not filesystem.exists(auto_update_config.script_path))
)
end
local function is_update_disabled()
return not async_http.have_access()
end
---
--- Require with Auto Update (for libs)
---
local function require_with_auto_update(auto_update_config)
auto_update_config.lib_require_path = auto_update_config.script_relpath:gsub("[.]lua$", ""):gsub("[.]pluto$", "")
--if auto_update_config.auto_restart == nil then auto_update_config.auto_restart = false end
run_auto_update(auto_update_config)
local auto_loaded_lib_status, loaded_lib = pcall(require, auto_update_config.lib_require_path)
if not auto_loaded_lib_status then
util.toast("Failed to load required file: "..auto_update_config.script_relpath.."\n"..tostring(loaded_lib), TOAST_ALL)
return
end
auto_update_config.loaded_lib = loaded_lib
return loaded_lib
end
local function build_source_url(auto_update_config, dependency)
return get_github_raw_url(auto_update_config.project_url, auto_update_config.branch, dependency)
end
local function expand_dependency(auto_update_config, dependency)
if type(dependency) == "string" then
local source_url = build_source_url(auto_update_config, dependency)
if not source_url then
error("Failed to build dependency source URL")
end
dependency = {
source_url=build_source_url(auto_update_config, dependency),
script_relpath=dependency,
}
end
dependency.is_dependency = true
if dependency.silent_updates == nil then dependency.silent_updates = auto_update_config.silent_updates end
return dependency
end
---
--- Auto Update Check
---
function run_auto_update(auto_update_config)
expand_auto_update_config(auto_update_config)
debug_log("Running auto-update on "..auto_update_config.script_filename.."...")
if is_update_disabled() then
if SCRIPT_MANUAL_START and not SCRIPT_SILENT_START then
util.toast("Cannot auto-update due to disabled internet access. To enable updates, please stop the script then uncheck the `Disable Internet Access` option.", TOAST_ALL)
end
return false
end
local busy_menu
if not auto_update_config.is_dependency then
--util.set_busy(true)
busy_menu = menu.divider(menu.my_root(), "Please wait...")
end
if is_due_for_update_check(auto_update_config) then
is_download_complete = nil
util.create_thread(function()
process_auto_update(auto_update_config)
end)
local i = 1
while (is_download_complete == nil and i < (auto_update_config.http_timeout / config.http_check_delay)) do
util.yield(config.http_check_delay)
i = i + 1
debug_log("Checking "..auto_update_config.script_filename.."...")
end
if is_download_complete == nil then
util.toast("Error updating "..auto_update_config.script_filename..": HTTP Timeout. This error can often be resolved by using Cloudflare DNS settings: 1.1.1.1 and 1.0.0.1 For more info visit http://1.1.1.1/dns/", TOAST_ALL)
return false
end
if (auto_update_config.script_updated and not auto_update_config.is_dependency) and auto_update_config.auto_restart ~= false then
debug_log("Restarting...")
if auto_update_config.restart_delay then util.yield(auto_update_config.restart_delay) end
force_full_restart()
return
end
end
local dependency_updated = false
if auto_update_config.dependencies ~= nil then
for _, dependency in pairs(auto_update_config.dependencies) do
dependency = expand_dependency(auto_update_config, dependency)
if (is_due_for_update_check(auto_update_config) or auto_update_config.script_updated or auto_update_config.version_data.fresh_update) then dependency.check_interval = 0 end
if dependency.is_required and (dependency.script_relpath:match("(.*)[.]lua$") or dependency.script_relpath:match("(.*)[.]pluto$")) then
require_with_auto_update(dependency)
else
run_auto_update(dependency)
end
if dependency.script_updated then dependency_updated = true end
end
end
if auto_update_config.version_data.fresh_update and not auto_update_config.is_dependency then
-- TODO: Show changelog
if auto_update_config.version_data.script_version and (SCRIPT_MANUAL_START and not SCRIPT_SILENT_START) then
util.toast("Updated "..auto_update_config.script_filename.." to "..tostring(auto_update_config.version_data.script_version), TOAST_ALL)
end
auto_update_config.version_data.fresh_update = false
save_version_data(auto_update_config)
end
if (dependency_updated) and auto_update_config.auto_restart ~= false then
debug_log("Dependency updated. Restarting...")
if auto_update_config.restart_delay then util.yield(auto_update_config.restart_delay) end
force_full_restart()
return
end
if not auto_update_config.is_dependency then
--util.set_busy(false)
if menu.is_ref_valid(busy_menu) then
menu.delete(busy_menu)
end
end
return true
end
---
--- Legacy Compatibility
---
-- Wrapper for old function names
function auto_update(auto_update_config)
run_auto_update(auto_update_config)
end
---
--- Self-Update
---
util.create_thread(function()
run_auto_update({
source_url="https://raw.githubusercontent.com/hexarobi/stand-lua-auto-updater/main/auto-updater.lua",
script_relpath="lib/auto-updater.lua",
auto_restart = false,
verify_file_begins_with="--",
check_interval = 86400,
})
end)
---
--- Return Object
---
return {
run_auto_update = run_auto_update,
require_with_auto_update = require_with_auto_update,
expand_auto_update_config = expand_auto_update_config,
uninstall = uninstall,
}