@meldgrove/ui 0.0.0-stage → 0.1.1
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/LICENSE +202 -0
- package/README.md +213 -2
- package/dist/components/alert-dialog.d.ts +18 -0
- package/dist/components/alert-dialog.js +44 -0
- package/dist/components/alert.d.ts +9 -0
- package/dist/components/alert.js +25 -0
- package/dist/components/avatar.d.ts +11 -0
- package/dist/components/avatar.js +24 -0
- package/dist/components/badge.d.ts +9 -0
- package/dist/components/badge.js +25 -0
- package/dist/components/breadcrumb.d.ts +11 -0
- package/dist/components/breadcrumb.js +28 -0
- package/dist/components/button-group.d.ts +11 -0
- package/dist/components/button-group.js +27 -0
- package/dist/components/button.d.ts +10 -0
- package/dist/components/button.js +36 -0
- package/dist/components/calendar.d.ts +8 -0
- package/dist/components/calendar.js +73 -0
- package/dist/components/card.d.ts +9 -0
- package/dist/components/card.js +25 -0
- package/dist/components/chart.d.ts +44 -0
- package/dist/components/chart.js +117 -0
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/checkbox.js +10 -0
- package/dist/components/collapsible.d.ts +5 -0
- package/dist/components/collapsible.js +13 -0
- package/dist/components/command.d.ts +18 -0
- package/dist/components/command.js +35 -0
- package/dist/components/confirm-dialog.d.ts +15 -0
- package/dist/components/confirm-dialog.js +26 -0
- package/dist/components/copy-button.d.ts +6 -0
- package/dist/components/copy-button.js +23 -0
- package/dist/components/dialog.d.ts +17 -0
- package/dist/components/dialog.js +39 -0
- package/dist/components/dropdown-menu.d.ts +25 -0
- package/dist/components/dropdown-menu.js +53 -0
- package/dist/components/empty.d.ts +11 -0
- package/dist/components/empty.js +33 -0
- package/dist/components/field.d.ts +24 -0
- package/dist/components/field.js +74 -0
- package/dist/components/hover-card.d.ts +6 -0
- package/dist/components/hover-card.js +16 -0
- package/dist/components/input-group.d.ts +16 -0
- package/dist/components/input-group.js +64 -0
- package/dist/components/input.d.ts +3 -0
- package/dist/components/input.js +7 -0
- package/dist/components/item.d.ts +23 -0
- package/dist/components/item.js +67 -0
- package/dist/components/kbd.d.ts +3 -0
- package/dist/components/kbd.js +11 -0
- package/dist/components/label.d.ts +4 -0
- package/dist/components/label.js +9 -0
- package/dist/components/native-select.d.ts +8 -0
- package/dist/components/native-select.js +14 -0
- package/dist/components/pager.d.ts +7 -0
- package/dist/components/pager.js +11 -0
- package/dist/components/pagination.d.ts +13 -0
- package/dist/components/pagination.js +30 -0
- package/dist/components/popover.d.ts +10 -0
- package/dist/components/popover.js +28 -0
- package/dist/components/progress.d.ts +4 -0
- package/dist/components/progress.js +9 -0
- package/dist/components/radio-group.d.ts +5 -0
- package/dist/components/radio-group.js +13 -0
- package/dist/components/scroll-area.d.ts +5 -0
- package/dist/components/scroll-area.js +12 -0
- package/dist/components/secret-field.d.ts +23 -0
- package/dist/components/secret-field.js +47 -0
- package/dist/components/select.d.ts +15 -0
- package/dist/components/select.js +40 -0
- package/dist/components/separator.d.ts +4 -0
- package/dist/components/separator.js +9 -0
- package/dist/components/sheet.d.ts +14 -0
- package/dist/components/sheet.js +42 -0
- package/dist/components/sidebar.d.ts +70 -0
- package/dist/components/sidebar.js +212 -0
- package/dist/components/skeleton.d.ts +2 -0
- package/dist/components/skeleton.js +6 -0
- package/dist/components/sonner.d.ts +5 -0
- package/dist/components/sonner.js +14 -0
- package/dist/components/spinner.d.ts +2 -0
- package/dist/components/spinner.js +7 -0
- package/dist/components/states.d.ts +14 -0
- package/dist/components/states.js +18 -0
- package/dist/components/switch.d.ts +6 -0
- package/dist/components/switch.js +9 -0
- package/dist/components/table.d.ts +17 -0
- package/dist/components/table.js +34 -0
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +30 -0
- package/dist/components/textarea.d.ts +3 -0
- package/dist/components/textarea.js +7 -0
- package/dist/components/toggle-group.d.ts +9 -0
- package/dist/components/toggle-group.js +23 -0
- package/dist/components/toggle.d.ts +9 -0
- package/dist/components/toggle.js +27 -0
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/components/tooltip.js +19 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.js +13 -0
- package/dist/lib/format.d.ts +8 -0
- package/dist/lib/format.js +38 -0
- package/dist/lib/i18n-core.d.ts +38 -0
- package/dist/lib/i18n-core.js +61 -0
- package/dist/lib/i18n.d.ts +11 -0
- package/dist/lib/i18n.js +19 -0
- package/dist/lib/portal.d.ts +13 -0
- package/dist/lib/portal.js +17 -0
- package/dist/lib/theme.d.ts +5 -0
- package/dist/lib/theme.js +17 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +5 -0
- package/dist/standalone/meldgrove-updates.js +57 -0
- package/dist/styles.css +11 -0
- package/dist/theme.css +62 -0
- package/dist/tokens.css +94 -0
- package/dist/updates/controller.d.ts +249 -0
- package/dist/updates/controller.js +657 -0
- package/dist/updates/core.d.ts +10 -0
- package/dist/updates/core.js +10 -0
- package/dist/updates/index.d.ts +15 -0
- package/dist/updates/index.js +15 -0
- package/dist/updates/messages.d.ts +92 -0
- package/dist/updates/messages.js +182 -0
- package/dist/updates/notice.d.ts +3 -0
- package/dist/updates/notice.js +6 -0
- package/dist/updates/react.d.ts +56 -0
- package/dist/updates/react.js +72 -0
- package/dist/updates/state.d.ts +224 -0
- package/dist/updates/state.js +411 -0
- package/dist/updates/transport.d.ts +50 -0
- package/dist/updates/transport.js +76 -0
- package/dist/updates/types.d.ts +77 -0
- package/dist/updates/types.js +68 -0
- package/dist/updates/update-button.d.ts +9 -0
- package/dist/updates/update-button.js +161 -0
- package/dist/updates/updates-settings.d.ts +17 -0
- package/dist/updates/updates-settings.js +97 -0
- package/package.json +159 -4
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The update button and the "Updates" settings for React apps:
|
|
3
|
+
*
|
|
4
|
+
* <UpdatesProvider appName="Meldgrove Handbook" project="handbook" url="/api/admin/updates" guideUrl="…">
|
|
5
|
+
* <UpdateButton /> (top bar, admins only)
|
|
6
|
+
* <UpdatesSettingsCard /> (admin settings)
|
|
7
|
+
* </UpdatesProvider>
|
|
8
|
+
*/
|
|
9
|
+
export { UpdateButton } from "./update-button.js";
|
|
10
|
+
export { UpdatesSettings, UpdatesSettingsCard, automaticText } from "./updates-settings.js";
|
|
11
|
+
export { UpdatesProvider, UpdatesContextProvider, useUpdatesController, useUpdatesSnapshot, } from "./react.js";
|
|
12
|
+
export { toastNotice } from "./notice.js";
|
|
13
|
+
export { UpdatesController, runningVersion, } from "./controller.js";
|
|
14
|
+
export { fetchTransport, readCookie, SignedOutError } from "./transport.js";
|
|
15
|
+
export * from "./types.js";
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The update button and the "Updates" settings, in English and German
|
|
3
|
+
* (the table in the updater's README). `{app}` is the app's name, `{project}`
|
|
4
|
+
* its Compose project (for the updater's systemd unit).
|
|
5
|
+
*/
|
|
6
|
+
export declare const messages: import("../lib/i18n-core.ts").Messages<{
|
|
7
|
+
updates: string;
|
|
8
|
+
checkForUpdates: string;
|
|
9
|
+
checking: string;
|
|
10
|
+
upToDate: string;
|
|
11
|
+
upToDateVersion: string;
|
|
12
|
+
available: string;
|
|
13
|
+
releaseNotes: string;
|
|
14
|
+
changes: string;
|
|
15
|
+
opensInNewTab: string;
|
|
16
|
+
moreChanges: string;
|
|
17
|
+
moreChanges_one: string;
|
|
18
|
+
installNow: string;
|
|
19
|
+
installAnyway: string;
|
|
20
|
+
installsOn: string;
|
|
21
|
+
installsNextCheck: string;
|
|
22
|
+
attention: string;
|
|
23
|
+
attentionText: string;
|
|
24
|
+
attentionLocked: string;
|
|
25
|
+
failed: string;
|
|
26
|
+
stillRunning: string;
|
|
27
|
+
tryAgain: string;
|
|
28
|
+
installing: string;
|
|
29
|
+
stage_pulling: string;
|
|
30
|
+
stage_starting: string;
|
|
31
|
+
"stage_rolling-back": string;
|
|
32
|
+
stage_deploying: string;
|
|
33
|
+
restarts: string;
|
|
34
|
+
confirmTitle: string;
|
|
35
|
+
confirmText: string;
|
|
36
|
+
confirmAnywayTitle: string;
|
|
37
|
+
confirmAnywayText: string;
|
|
38
|
+
install: string;
|
|
39
|
+
updated: string;
|
|
40
|
+
restarting: string;
|
|
41
|
+
slow: string;
|
|
42
|
+
stopWaiting: string;
|
|
43
|
+
notStarted: string;
|
|
44
|
+
notConfirmed: string;
|
|
45
|
+
noAnswer: string;
|
|
46
|
+
failedLine: string;
|
|
47
|
+
installed: string;
|
|
48
|
+
installedFooter: string;
|
|
49
|
+
checked: string;
|
|
50
|
+
notChecked: string;
|
|
51
|
+
checkNow: string;
|
|
52
|
+
checkFailed: string;
|
|
53
|
+
stable: string;
|
|
54
|
+
preview: string;
|
|
55
|
+
off: string;
|
|
56
|
+
offText: string;
|
|
57
|
+
deploymentGuide: string;
|
|
58
|
+
unreachable: string;
|
|
59
|
+
development: string;
|
|
60
|
+
sectionText: string;
|
|
61
|
+
installedVersion: string;
|
|
62
|
+
channel: string;
|
|
63
|
+
recommended: string;
|
|
64
|
+
stableText: string;
|
|
65
|
+
stableTextNoCooldown: string;
|
|
66
|
+
previewText: string;
|
|
67
|
+
switchBack: string;
|
|
68
|
+
saveChannel: string;
|
|
69
|
+
channelSaved: string;
|
|
70
|
+
channelNotSaved: string;
|
|
71
|
+
automatic: string;
|
|
72
|
+
autoReleases: string;
|
|
73
|
+
autoReleasesWindow: string;
|
|
74
|
+
autoNextCheck: string;
|
|
75
|
+
autoNextCheckWindow: string;
|
|
76
|
+
autoOff: string;
|
|
77
|
+
autoPlatform: string;
|
|
78
|
+
sectionUnreachable: string;
|
|
79
|
+
sectionUnreachableHelp: string;
|
|
80
|
+
lastCheck: string;
|
|
81
|
+
updaterVersion: string;
|
|
82
|
+
signedOut: string;
|
|
83
|
+
days: string;
|
|
84
|
+
days_one: string;
|
|
85
|
+
hours: string;
|
|
86
|
+
hours_one: string;
|
|
87
|
+
minutes: string;
|
|
88
|
+
minutes_one: string;
|
|
89
|
+
seconds: string;
|
|
90
|
+
seconds_one: string;
|
|
91
|
+
}>;
|
|
92
|
+
export type UpdatesMessageKey = keyof (typeof messages)["en"];
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { defineMessages } from "../lib/i18n-core.js";
|
|
2
|
+
/**
|
|
3
|
+
* The update button and the "Updates" settings, in English and German
|
|
4
|
+
* (the table in the updater's README). `{app}` is the app's name, `{project}`
|
|
5
|
+
* its Compose project (for the updater's systemd unit).
|
|
6
|
+
*/
|
|
7
|
+
export const messages = defineMessages({
|
|
8
|
+
en: {
|
|
9
|
+
updates: "Updates",
|
|
10
|
+
checkForUpdates: "Check for updates",
|
|
11
|
+
checking: "Checking for updates…",
|
|
12
|
+
upToDate: "Up to date",
|
|
13
|
+
upToDateVersion: "Up to date · {version}",
|
|
14
|
+
available: "Update available",
|
|
15
|
+
releaseNotes: "Release notes",
|
|
16
|
+
changes: "Changes",
|
|
17
|
+
opensInNewTab: "(opens in a new tab)",
|
|
18
|
+
moreChanges: "and {n} more changes",
|
|
19
|
+
moreChanges_one: "and 1 more change",
|
|
20
|
+
installNow: "Install now",
|
|
21
|
+
installAnyway: "Install anyway…",
|
|
22
|
+
installsOn: "Installs automatically on {date}",
|
|
23
|
+
installsNextCheck: "Installs automatically at the next check",
|
|
24
|
+
attention: "{version} needs upgrade steps",
|
|
25
|
+
attentionText: "This release changes the setup. Take the upgrade steps from its release notes on the server first.",
|
|
26
|
+
attentionLocked: "The image tag set where {app} is deployed does not reach {version}. Take the upgrade steps, then change the tag there.",
|
|
27
|
+
failed: "Update to {version} failed",
|
|
28
|
+
stillRunning: "{version} is still running.",
|
|
29
|
+
tryAgain: "Try again",
|
|
30
|
+
installing: "Installing {version}…",
|
|
31
|
+
stage_pulling: "Downloading",
|
|
32
|
+
stage_starting: "Starting",
|
|
33
|
+
"stage_rolling-back": "Going back to {version}",
|
|
34
|
+
stage_deploying: "Deploying",
|
|
35
|
+
restarts: "{app} restarts. This page reloads when it is back.",
|
|
36
|
+
confirmTitle: "Install {version} now?",
|
|
37
|
+
confirmText: "{app} restarts and is unavailable for a moment. Database changes run automatically.",
|
|
38
|
+
confirmAnywayTitle: "Install {version} without its upgrade steps?",
|
|
39
|
+
confirmAnywayText: "The release notes name the steps this release needs on the server. Without them, {app} may not start again.",
|
|
40
|
+
install: "Install",
|
|
41
|
+
updated: "Updated to {version}",
|
|
42
|
+
restarting: "Restarting…",
|
|
43
|
+
slow: "This takes longer than expected. Check the server (journalctl -u meldgrove-updater-{project}).",
|
|
44
|
+
stopWaiting: "Stop waiting",
|
|
45
|
+
notStarted: "The installation did not start",
|
|
46
|
+
notConfirmed: "The installation could not be confirmed",
|
|
47
|
+
noAnswer: "{app} did not answer in time.",
|
|
48
|
+
failedLine: "{version} failed: {message}",
|
|
49
|
+
installed: "Installed",
|
|
50
|
+
installedFooter: "Installed: {version} · {channel}",
|
|
51
|
+
checked: "Checked {time}",
|
|
52
|
+
notChecked: "Not checked yet",
|
|
53
|
+
checkNow: "Check now",
|
|
54
|
+
checkFailed: "Last check failed: {error}",
|
|
55
|
+
stable: "Stable",
|
|
56
|
+
preview: "Preview",
|
|
57
|
+
off: "Automatic updates are off on this server",
|
|
58
|
+
offText: "Automatic updates are off on this server, so it cannot install from here. See the {guide}.",
|
|
59
|
+
deploymentGuide: "deployment guide",
|
|
60
|
+
unreachable: "No update service. See the deployment guide.",
|
|
61
|
+
development: "development",
|
|
62
|
+
// Settings section
|
|
63
|
+
sectionText: "New versions of {app} and how they install.",
|
|
64
|
+
installedVersion: "Installed version",
|
|
65
|
+
channel: "Channel",
|
|
66
|
+
recommended: "recommended",
|
|
67
|
+
stableText: "Releases. Updates that need no action install automatically after {cooldown}.",
|
|
68
|
+
stableTextNoCooldown: "Releases. Updates that need no action install automatically.",
|
|
69
|
+
previewText: "Unstable: every change on main as soon as its checks pass, before it is released. New features first, and now and then a new bug. Previews have no release notes.",
|
|
70
|
+
switchBack: "Switching back to Stable keeps this version until a release is newer.",
|
|
71
|
+
saveChannel: "Save channel",
|
|
72
|
+
channelSaved: "Channel saved",
|
|
73
|
+
channelNotSaved: "The update service did not switch the channel.",
|
|
74
|
+
automatic: "Automatic installs",
|
|
75
|
+
autoReleases: "On: releases install automatically after {cooldown}.",
|
|
76
|
+
autoReleasesWindow: "On: releases install automatically after {cooldown}, between {start} and {end} ({timezone}).",
|
|
77
|
+
autoNextCheck: "On: updates install automatically at the next check.",
|
|
78
|
+
autoNextCheckWindow: "On: updates install automatically at the next check, between {start} and {end} ({timezone}).",
|
|
79
|
+
autoOff: "Off on this server: nothing installs automatically.",
|
|
80
|
+
autoPlatform: "The platform installs them (deploy link).",
|
|
81
|
+
sectionUnreachable: "The update service is not reachable.",
|
|
82
|
+
sectionUnreachableHelp: "Automatic updates need the updater service from compose.yaml ({guide}).",
|
|
83
|
+
lastCheck: "Last check",
|
|
84
|
+
updaterVersion: "Updater {version}",
|
|
85
|
+
signedOut: "Sign in again as an admin to manage updates.",
|
|
86
|
+
days: "{count} days",
|
|
87
|
+
days_one: "1 day",
|
|
88
|
+
hours: "{count} hours",
|
|
89
|
+
hours_one: "1 hour",
|
|
90
|
+
minutes: "{count} minutes",
|
|
91
|
+
minutes_one: "1 minute",
|
|
92
|
+
seconds: "{count} seconds",
|
|
93
|
+
seconds_one: "1 second",
|
|
94
|
+
},
|
|
95
|
+
de: {
|
|
96
|
+
updates: "Updates",
|
|
97
|
+
checkForUpdates: "Nach Updates suchen",
|
|
98
|
+
checking: "Suche nach Updates …",
|
|
99
|
+
upToDate: "Aktuell",
|
|
100
|
+
upToDateVersion: "Aktuell · {version}",
|
|
101
|
+
available: "Update verfügbar",
|
|
102
|
+
releaseNotes: "Versionshinweise",
|
|
103
|
+
changes: "Änderungen",
|
|
104
|
+
opensInNewTab: "(öffnet in neuem Tab)",
|
|
105
|
+
moreChanges: "und {n} weitere Änderungen",
|
|
106
|
+
moreChanges_one: "und 1 weitere Änderung",
|
|
107
|
+
installNow: "Jetzt installieren",
|
|
108
|
+
installAnyway: "Trotzdem installieren …",
|
|
109
|
+
installsOn: "Wird am {date} automatisch installiert",
|
|
110
|
+
installsNextCheck: "Wird bei der nächsten Prüfung automatisch installiert",
|
|
111
|
+
attention: "{version} braucht Schritte beim Upgrade",
|
|
112
|
+
attentionText: "Diese Version ändert die Einrichtung. Führe zuerst die Upgrade-Schritte aus den Versionshinweisen auf dem Server aus.",
|
|
113
|
+
attentionLocked: "Das Image-Tag, mit dem {app} deployt ist, erreicht {version} nicht. Führe die Upgrade-Schritte aus und ändere dann dort das Tag.",
|
|
114
|
+
failed: "Update auf {version} fehlgeschlagen",
|
|
115
|
+
stillRunning: "{version} läuft weiter.",
|
|
116
|
+
tryAgain: "Erneut versuchen",
|
|
117
|
+
installing: "{version} wird installiert …",
|
|
118
|
+
stage_pulling: "Download",
|
|
119
|
+
stage_starting: "Start",
|
|
120
|
+
"stage_rolling-back": "Zurück zu {version}",
|
|
121
|
+
stage_deploying: "Deployment",
|
|
122
|
+
restarts: "{app} startet neu. Diese Seite lädt neu, sobald sie wieder da ist.",
|
|
123
|
+
confirmTitle: "{version} jetzt installieren?",
|
|
124
|
+
confirmText: "{app} startet neu und ist kurz nicht erreichbar. Änderungen an der Datenbank laufen automatisch.",
|
|
125
|
+
confirmAnywayTitle: "{version} ohne Upgrade-Schritte installieren?",
|
|
126
|
+
confirmAnywayText: "Die Versionshinweise nennen die Schritte, die diese Version auf dem Server braucht. Ohne sie startet {app} vielleicht nicht wieder.",
|
|
127
|
+
install: "Installieren",
|
|
128
|
+
updated: "Auf {version} aktualisiert",
|
|
129
|
+
restarting: "Neustart …",
|
|
130
|
+
slow: "Das dauert länger als erwartet. Prüfe den Server (journalctl -u meldgrove-updater-{project}).",
|
|
131
|
+
stopWaiting: "Nicht mehr warten",
|
|
132
|
+
notStarted: "Die Installation hat nicht begonnen",
|
|
133
|
+
notConfirmed: "Die Installation ließ sich nicht bestätigen",
|
|
134
|
+
noAnswer: "{app} hat nicht rechtzeitig geantwortet.",
|
|
135
|
+
failedLine: "{version} fehlgeschlagen: {message}",
|
|
136
|
+
installed: "Installiert",
|
|
137
|
+
installedFooter: "Installiert: {version} · {channel}",
|
|
138
|
+
checked: "Geprüft {time}",
|
|
139
|
+
notChecked: "Noch nicht geprüft",
|
|
140
|
+
checkNow: "Jetzt prüfen",
|
|
141
|
+
checkFailed: "Letzte Prüfung fehlgeschlagen: {error}",
|
|
142
|
+
stable: "Stabil",
|
|
143
|
+
preview: "Vorschau",
|
|
144
|
+
off: "Automatische Updates sind auf diesem Server aus",
|
|
145
|
+
offText: "Automatische Updates sind auf diesem Server aus, daher kann es hier nicht installiert werden. Siehe {guide}.",
|
|
146
|
+
deploymentGuide: "Anleitung zum Deployment",
|
|
147
|
+
unreachable: "Kein Update-Dienst. Siehe Anleitung zum Deployment.",
|
|
148
|
+
development: "Entwicklung",
|
|
149
|
+
sectionText: "Neue Versionen von {app} und wie sie installiert werden.",
|
|
150
|
+
installedVersion: "Installierte Version",
|
|
151
|
+
channel: "Kanal",
|
|
152
|
+
recommended: "empfohlen",
|
|
153
|
+
stableText: "Veröffentlichte Versionen. Updates ohne nötige Schritte werden nach {cooldown} automatisch installiert.",
|
|
154
|
+
stableTextNoCooldown: "Veröffentlichte Versionen. Updates ohne nötige Schritte werden automatisch installiert.",
|
|
155
|
+
previewText: "Instabil: jede Änderung auf main, sobald ihre Prüfungen bestanden sind, noch vor der Veröffentlichung. Neues zuerst, und ab und zu ein neuer Fehler. Vorschauen haben keine Versionshinweise.",
|
|
156
|
+
switchBack: "Zurück auf Stabil bleibt diese Version, bis eine Veröffentlichung neuer ist.",
|
|
157
|
+
saveChannel: "Kanal speichern",
|
|
158
|
+
channelSaved: "Kanal gespeichert",
|
|
159
|
+
channelNotSaved: "Der Update-Dienst hat den Kanal nicht gewechselt.",
|
|
160
|
+
automatic: "Automatische Installation",
|
|
161
|
+
autoReleases: "An: Veröffentlichte Versionen werden nach {cooldown} automatisch installiert.",
|
|
162
|
+
autoReleasesWindow: "An: Veröffentlichte Versionen werden nach {cooldown} automatisch installiert, zwischen {start} und {end} ({timezone}).",
|
|
163
|
+
autoNextCheck: "An: Updates werden bei der nächsten Prüfung automatisch installiert.",
|
|
164
|
+
autoNextCheckWindow: "An: Updates werden bei der nächsten Prüfung automatisch installiert, zwischen {start} und {end} ({timezone}).",
|
|
165
|
+
autoOff: "Aus auf diesem Server: Nichts wird automatisch installiert.",
|
|
166
|
+
autoPlatform: "Die Plattform installiert sie (Deploy-Link).",
|
|
167
|
+
sectionUnreachable: "Der Update-Dienst ist nicht erreichbar.",
|
|
168
|
+
sectionUnreachableHelp: "Automatische Updates brauchen den Dienst updater aus compose.yaml ({guide}).",
|
|
169
|
+
lastCheck: "Letzte Prüfung",
|
|
170
|
+
updaterVersion: "Updater {version}",
|
|
171
|
+
signedOut: "Melde dich erneut als Admin an, um Updates zu verwalten.",
|
|
172
|
+
// Dative after "nach": "nach 3 Tagen".
|
|
173
|
+
days: "{count} Tagen",
|
|
174
|
+
days_one: "1 Tag",
|
|
175
|
+
hours: "{count} Stunden",
|
|
176
|
+
hours_one: "1 Stunde",
|
|
177
|
+
minutes: "{count} Minuten",
|
|
178
|
+
minutes_one: "1 Minute",
|
|
179
|
+
seconds: "{count} Sekunden",
|
|
180
|
+
seconds_one: "1 Sekunde",
|
|
181
|
+
},
|
|
182
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { toast } from "sonner";
|
|
2
|
+
/** Shows a notice of the update controller as a toast (`Toaster` from `@meldgrove/ui/sonner`). */
|
|
3
|
+
export function toastNotice(notice) {
|
|
4
|
+
const show = notice.kind === "success" ? toast.success : toast.error;
|
|
5
|
+
show(notice.title, notice.description ? { description: notice.description } : undefined);
|
|
6
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type Locale } from "../lib/i18n.tsx";
|
|
3
|
+
import { UpdatesController, type Notice, type SignedOutReason, type UpdatesSnapshot } from "./controller.ts";
|
|
4
|
+
import { type InstallStorage } from "./state.ts";
|
|
5
|
+
import { type UpdatesTransport } from "./transport.ts";
|
|
6
|
+
import type { UpdatesResponse } from "./types.ts";
|
|
7
|
+
/**
|
|
8
|
+
* Read once when the provider mounts: `project`, `url`, `transport`,
|
|
9
|
+
* `storageKey`, `storage`, `initialResponse`. The others follow changes. In Next.js, functions (`transport`, `notify`, `onSignedOut`) need
|
|
10
|
+
* the provider in a client component of the app.
|
|
11
|
+
*/
|
|
12
|
+
export type UpdatesProviderProps = {
|
|
13
|
+
/** The app's name in texts, e.g. "Meldgrove Handbook". */
|
|
14
|
+
appName: string;
|
|
15
|
+
/** The Compose project of a server installation (the updater's systemd unit), e.g. "handbook". */
|
|
16
|
+
project: string;
|
|
17
|
+
/** The status route, e.g. "/api/admin/updates"; or pass `transport`. */
|
|
18
|
+
url?: string;
|
|
19
|
+
/** How to reach the routes when `fetch` with the page's session is not enough. */
|
|
20
|
+
transport?: UpdatesTransport;
|
|
21
|
+
/** Section "Automatic updates" of the app's deployment guide. */
|
|
22
|
+
guideUrl?: string;
|
|
23
|
+
/** Default: the locale of `UIProvider`. */
|
|
24
|
+
locale?: Locale;
|
|
25
|
+
/** Locale of full dates, e.g. "de-DE" for 19.11.2026; default "en-GB" for English, "de-DE" for German. Relative times follow `locale`. */
|
|
26
|
+
dateLocale?: string;
|
|
27
|
+
/** IANA time zone of dates, e.g. "Europe/Berlin"; default: the browser's. */
|
|
28
|
+
timeZone?: string;
|
|
29
|
+
/** sessionStorage prefix; default `meldgrove.updates.<project>`. */
|
|
30
|
+
storageKey?: string;
|
|
31
|
+
/** Where a tab keeps its followed installation, in place of `storageKey`. */
|
|
32
|
+
storage?: InstallStorage;
|
|
33
|
+
/** A status the server already has, shown before the browser's first request. */
|
|
34
|
+
initialResponse?: UpdatesResponse;
|
|
35
|
+
/** Default: a toast (mount `Toaster` from `@meldgrove/ui/sonner`). */
|
|
36
|
+
notify?: (notice: Notice) => void;
|
|
37
|
+
/** Called once when the routes stop answering: "signed-out" (401, sign-in page) or "forbidden" (403, 404). */
|
|
38
|
+
onSignedOut?: (reason: SignedOutReason) => void;
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* The update status of the page, shared by the update button and the
|
|
43
|
+
* "Updates" settings. Render it for app admins only: everyone else gets 404
|
|
44
|
+
* from the routes.
|
|
45
|
+
*/
|
|
46
|
+
export declare function UpdatesProvider(props: UpdatesProviderProps): import("react").JSX.Element;
|
|
47
|
+
/** Provides a controller that something else created and starts (the standalone elements, tests). */
|
|
48
|
+
export declare function UpdatesContextProvider(props: {
|
|
49
|
+
controller: UpdatesController;
|
|
50
|
+
guideUrl: string | null;
|
|
51
|
+
children: ReactNode;
|
|
52
|
+
}): import("react").JSX.Element;
|
|
53
|
+
export declare function useUpdatesController(): UpdatesController;
|
|
54
|
+
export declare function useGuideUrl(): string | null;
|
|
55
|
+
/** The current snapshot of the page's update status; re-renders when it changes. */
|
|
56
|
+
export declare function useUpdatesSnapshot(): UpdatesSnapshot;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext, useEffect, useMemo, useState, useSyncExternalStore, } from "react";
|
|
4
|
+
import { useLocale } from "../lib/i18n.js";
|
|
5
|
+
import { UpdatesController } from "./controller.js";
|
|
6
|
+
import { toastNotice } from "./notice.js";
|
|
7
|
+
import { installStorage } from "./state.js";
|
|
8
|
+
import { fetchTransport } from "./transport.js";
|
|
9
|
+
const UpdatesContext = createContext(null);
|
|
10
|
+
/**
|
|
11
|
+
* The update status of the page, shared by the update button and the
|
|
12
|
+
* "Updates" settings. Render it for app admins only: everyone else gets 404
|
|
13
|
+
* from the routes.
|
|
14
|
+
*/
|
|
15
|
+
export function UpdatesProvider(props) {
|
|
16
|
+
const contextLocale = useLocale();
|
|
17
|
+
const locale = props.locale ?? contextLocale;
|
|
18
|
+
const [controller] = useState(() => {
|
|
19
|
+
const transport = props.transport ?? (props.url ? fetchTransport({ url: props.url }) : null);
|
|
20
|
+
if (!transport)
|
|
21
|
+
throw new Error("UpdatesProvider needs `url` or `transport`.");
|
|
22
|
+
return new UpdatesController({
|
|
23
|
+
transport,
|
|
24
|
+
appName: props.appName,
|
|
25
|
+
project: props.project,
|
|
26
|
+
locale,
|
|
27
|
+
dateLocale: props.dateLocale,
|
|
28
|
+
timeZone: props.timeZone,
|
|
29
|
+
storage: props.storage ?? (props.storageKey ? installStorage(props.storageKey) : undefined),
|
|
30
|
+
initialResponse: props.initialResponse,
|
|
31
|
+
notify: props.notify ?? toastNotice,
|
|
32
|
+
onSignedOut: props.onSignedOut,
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
controller.start();
|
|
37
|
+
return () => controller.dispose();
|
|
38
|
+
}, [controller]);
|
|
39
|
+
useEffect(() => controller.setLocale(locale), [controller, locale]);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
controller.configure({
|
|
42
|
+
appName: props.appName,
|
|
43
|
+
notify: props.notify ?? toastNotice,
|
|
44
|
+
onSignedOut: props.onSignedOut ?? null,
|
|
45
|
+
dateLocale: props.dateLocale ?? null,
|
|
46
|
+
timeZone: props.timeZone ?? null,
|
|
47
|
+
});
|
|
48
|
+
}, [controller, props.appName, props.notify, props.onSignedOut, props.dateLocale, props.timeZone]);
|
|
49
|
+
return (_jsx(UpdatesContextProvider, { controller: controller, guideUrl: props.guideUrl ?? null, children: props.children }));
|
|
50
|
+
}
|
|
51
|
+
/** Provides a controller that something else created and starts (the standalone elements, tests). */
|
|
52
|
+
export function UpdatesContextProvider(props) {
|
|
53
|
+
const value = useMemo(() => ({ controller: props.controller, guideUrl: props.guideUrl }), [props.controller, props.guideUrl]);
|
|
54
|
+
return _jsx(UpdatesContext.Provider, { value: value, children: props.children });
|
|
55
|
+
}
|
|
56
|
+
function useUpdatesContext() {
|
|
57
|
+
const value = useContext(UpdatesContext);
|
|
58
|
+
if (!value)
|
|
59
|
+
throw new Error("Render the update button and settings inside UpdatesProvider.");
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
export function useUpdatesController() {
|
|
63
|
+
return useUpdatesContext().controller;
|
|
64
|
+
}
|
|
65
|
+
export function useGuideUrl() {
|
|
66
|
+
return useUpdatesContext().guideUrl;
|
|
67
|
+
}
|
|
68
|
+
/** The current snapshot of the page's update status; re-renders when it changes. */
|
|
69
|
+
export function useUpdatesSnapshot() {
|
|
70
|
+
const controller = useUpdatesController();
|
|
71
|
+
return useSyncExternalStore(controller.subscribe, controller.getSnapshot, controller.getServerSnapshot);
|
|
72
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import type { Update, UpdaterStatus, UpdatesResponse } from "./types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* The update button's logic, free of React and of the page: which state a
|
|
4
|
+
* status shows, and how an installation is followed until the updater
|
|
5
|
+
* reports its result (https://github.com/meldgrove/updater#the-apps-update-button).
|
|
6
|
+
*/
|
|
7
|
+
export type ButtonState = "loading" | "unreachable" | "installing" | "checking" | "off" | "failed" | "available" | "attention" | "current";
|
|
8
|
+
/**
|
|
9
|
+
* An installation this tab follows: one an administrator started here
|
|
10
|
+
* (remembered before the request), or one a status reported. Kept in
|
|
11
|
+
* sessionStorage across reloads.
|
|
12
|
+
*/
|
|
13
|
+
export type PendingInstall = {
|
|
14
|
+
version: string;
|
|
15
|
+
/** The app's version when this tab began to follow it. */
|
|
16
|
+
from: string | null;
|
|
17
|
+
/** Epoch milliseconds (this browser's clock): when this tab began to follow it. */
|
|
18
|
+
startedAt: number;
|
|
19
|
+
/** The updater accepted it (202) or a status reported it; until then the request's answer was unclear. */
|
|
20
|
+
confirmed: boolean;
|
|
21
|
+
/** The `last` of the newest status before it (the earlier result): never this installation's result. */
|
|
22
|
+
earlier: LastResult | null;
|
|
23
|
+
/** `installing.startedAt` (the updater's clock), once a status reported the installation: with the version, its identity. */
|
|
24
|
+
installStartedAt: string | null;
|
|
25
|
+
/** When the install request answered (epoch ms, this browser's clock); null: not yet, or the tab adopted the installation. */
|
|
26
|
+
answeredAt: number | null;
|
|
27
|
+
/** Why the answer to the install request was unclear. */
|
|
28
|
+
reason: string | null;
|
|
29
|
+
/** The latest error of the install request or of a status request since. */
|
|
30
|
+
lastError: string | null;
|
|
31
|
+
/** A reachable status answered after it started without reporting it (unconfirmed attempts only). */
|
|
32
|
+
unreported: boolean;
|
|
33
|
+
/** The app or its update service did not answer at least once since (it restarted). */
|
|
34
|
+
outage: boolean;
|
|
35
|
+
};
|
|
36
|
+
type Installing = NonNullable<UpdaterStatus["installing"]>;
|
|
37
|
+
type LastResult = NonNullable<UpdaterStatus["last"]>;
|
|
38
|
+
export declare const SLOW_AFTER_MS: number;
|
|
39
|
+
/** How long an unconfirmed attempt is reconciled with the status, from its start, before it is forgotten. */
|
|
40
|
+
export declare const RECONCILE_MS = 60000;
|
|
41
|
+
/** A page that starts with an unconfirmed attempt asks the update service at least this long before it ends it. */
|
|
42
|
+
export declare const PAGE_GRACE_MS = 10000;
|
|
43
|
+
/** A failure the popover shows: its version, why, and the offer to try again (null: no longer offered). */
|
|
44
|
+
export type Failure = {
|
|
45
|
+
version: string;
|
|
46
|
+
message: string | null;
|
|
47
|
+
offer: Update | null;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* The failure to show: that of an installation this tab followed (`recent`,
|
|
51
|
+
* while it is still the updater's latest result) unless a newer version is
|
|
52
|
+
* offered (see `replacedFailure`), else the latest result when it failed and
|
|
53
|
+
* the update is marked failed.
|
|
54
|
+
*/
|
|
55
|
+
export declare function failureOf(response: UpdatesResponse | undefined, recent?: LastResult | null): Failure | null;
|
|
56
|
+
/**
|
|
57
|
+
* A failed latest result that the popover shows as a line in an offer
|
|
58
|
+
* ("0.2.1 failed: …"): a newer offer took its place, or the updater offers the
|
|
59
|
+
* same version again without marking it failed (Updater 0.2 does so when the
|
|
60
|
+
* deploy link failed or no host took or finished the installation), so the
|
|
61
|
+
* reason stays visible after a reload.
|
|
62
|
+
*/
|
|
63
|
+
export declare function replacedFailure(response: UpdatesResponse | undefined, recent?: LastResult | null): {
|
|
64
|
+
version: string;
|
|
65
|
+
message: string | null;
|
|
66
|
+
} | null;
|
|
67
|
+
/** What the popover shows: the button's state, but a running check does not hide the result before it. */
|
|
68
|
+
export declare function panelState(response: UpdatesResponse | undefined, pending: PendingInstall | null, recent?: LastResult | null): Exclude<ButtonState, "checking">;
|
|
69
|
+
/** The state of the button: the first that applies. */
|
|
70
|
+
export declare function buttonState(response: UpdatesResponse | undefined, options: {
|
|
71
|
+
checking: boolean;
|
|
72
|
+
pending: PendingInstall | null;
|
|
73
|
+
recent?: LastResult | null;
|
|
74
|
+
}): ButtonState;
|
|
75
|
+
/**
|
|
76
|
+
* Whether a click opens the popover (else it checks): there is something to
|
|
77
|
+
* show. A followed installation always has one, for its progress and the
|
|
78
|
+
* warning after 15 minutes, also while the app or its update service restarts.
|
|
79
|
+
*/
|
|
80
|
+
export declare function hasPanel(state: ButtonState, response: UpdatesResponse | undefined, pending?: PendingInstall | null): boolean;
|
|
81
|
+
/** Whether an Update can be installed from the popover: not in mode off, and an attention offer only while the channel is not locked. */
|
|
82
|
+
export declare function canInstall(status: UpdaterStatus, update: Update): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* An attempt to install `version`, remembered before the request; unconfirmed
|
|
85
|
+
* until the updater accepts it. `before`: the newest status, whose `last` is
|
|
86
|
+
* the earlier result.
|
|
87
|
+
*/
|
|
88
|
+
export declare function startAttempt(version: string, before: UpdatesResponse | undefined, now: number): PendingInstall;
|
|
89
|
+
/** Follows an installation that a status reports (another administrator's, an automatic one, or a retry). */
|
|
90
|
+
export declare function adoptInstall(installing: Installing, response: UpdatesResponse, now: number): PendingInstall;
|
|
91
|
+
/**
|
|
92
|
+
* An installation the administrator stopped waiting for: its version and
|
|
93
|
+
* `installing.startedAt` when a status reported it, else when this tab's
|
|
94
|
+
* attempt started (epoch ms).
|
|
95
|
+
*/
|
|
96
|
+
export type Ignored = {
|
|
97
|
+
version: string;
|
|
98
|
+
installStartedAt: string | null;
|
|
99
|
+
startedAt: number;
|
|
100
|
+
};
|
|
101
|
+
/** What "Stop waiting" leaves alone from then on: the identity stored on the attempt, not the latest status. */
|
|
102
|
+
export declare function ignoreInstall(pending: PendingInstall): Ignored;
|
|
103
|
+
/** Whether a reported installation is the one the administrator stopped waiting for. */
|
|
104
|
+
export declare function isIgnored(installing: Installing, ignored: Ignored | null): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Takes a fresh status into the followed installation: confirms an attempt
|
|
107
|
+
* the status reports (running or finished), and adopts a reported
|
|
108
|
+
* installation when this tab follows none, or in place of an unconfirmed
|
|
109
|
+
* attempt (another administrator or an automatic install was faster).
|
|
110
|
+
* A reachable status that reports neither marks an unconfirmed attempt as
|
|
111
|
+
* unreported, but only one requested after the install request answered
|
|
112
|
+
* (`sentAt`, epoch ms): an earlier one cannot know of it. An answer without
|
|
113
|
+
* status (`reachable: false`) is an observed outage. `ignored`: an
|
|
114
|
+
* installation this tab stopped waiting for.
|
|
115
|
+
*/
|
|
116
|
+
export declare function followStatus(pending: PendingInstall | null, response: UpdatesResponse, now: number, ignored?: Ignored | null, sentAt?: number): PendingInstall | null;
|
|
117
|
+
/**
|
|
118
|
+
* A status request failed (network error, timeout, 5xx) or the update service
|
|
119
|
+
* did not answer (`reachable: false`) while following: an observed outage,
|
|
120
|
+
* with its error for the attempt's reconciliation.
|
|
121
|
+
*/
|
|
122
|
+
export declare function noteOutage(pending: PendingInstall, error: string | null): PendingInstall;
|
|
123
|
+
/** An answer to the install request: 202; a refusal (409 or another 4xx); or unclear (200, network error, timeout, unreadable, 5xx). */
|
|
124
|
+
export type InstallAnswer = {
|
|
125
|
+
kind: "accepted";
|
|
126
|
+
response: UpdatesResponse | null;
|
|
127
|
+
} | {
|
|
128
|
+
kind: "refused";
|
|
129
|
+
error: string;
|
|
130
|
+
response: UpdatesResponse | null;
|
|
131
|
+
} | {
|
|
132
|
+
kind: "unclear";
|
|
133
|
+
error: string | null;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* What an answer to the install request does with the attempt: accepted
|
|
137
|
+
* confirms it (also without a readable status); a refusal forgets it (and
|
|
138
|
+
* returns the error), unless its status reports a running installation, which
|
|
139
|
+
* is followed instead; an unclear answer keeps it, to reconcile with the
|
|
140
|
+
* status until `reconcileDeadline`.
|
|
141
|
+
*/
|
|
142
|
+
export declare function answerInstall(attempt: PendingInstall, answer: InstallAnswer, now: number): {
|
|
143
|
+
pending: PendingInstall | null;
|
|
144
|
+
error: string | null;
|
|
145
|
+
};
|
|
146
|
+
export type InstallOutcome = "done" | "failed" | "waiting" | "slow";
|
|
147
|
+
/**
|
|
148
|
+
* Where the followed installation stands after `response`, a status answer
|
|
149
|
+
* received after it started (undefined: none, or the app did not answer).
|
|
150
|
+
* The first that applies:
|
|
151
|
+
* 1. `last` reports it failed or rolled back: failed.
|
|
152
|
+
* 2. The updater still installs it: waiting, also when the app already runs
|
|
153
|
+
* the version (on a server it may still roll back).
|
|
154
|
+
* 3. `last` reports it installed: done.
|
|
155
|
+
* 4. `last` reports the platform accepted it: done once the app runs the
|
|
156
|
+
* version, or, where the app's version cannot tell (none, or a digest),
|
|
157
|
+
* once it changed or the app answered again after an outage.
|
|
158
|
+
* 5. Nothing reports it any more and the app runs the version: done.
|
|
159
|
+
* Otherwise it turns slow after 15 minutes. (An unconfirmed attempt ends
|
|
160
|
+
* earlier, at `reconcileDeadline`, on a timer of its own.)
|
|
161
|
+
*/
|
|
162
|
+
export declare function installOutcome(pending: PendingInstall, response: UpdatesResponse | undefined, now: number): InstallOutcome;
|
|
163
|
+
/**
|
|
164
|
+
* The version the app runs now, when it is not the one this page was loaded
|
|
165
|
+
* from (`pageVersion`: the app's version in the page's first status) and the
|
|
166
|
+
* update service reports no installation: the page runs old code and
|
|
167
|
+
* reloads. Another tab, another administrator or an automatic install
|
|
168
|
+
* updated the app. Null otherwise: in development (no app version), and
|
|
169
|
+
* without update service (it restarts during an installation, which may
|
|
170
|
+
* still roll back).
|
|
171
|
+
*/
|
|
172
|
+
export declare function staleVersion(pageVersion: string | null, response: UpdatesResponse): string | null;
|
|
173
|
+
/** How long a status request may take. */
|
|
174
|
+
export declare const STATUS_TIMEOUT_MS = 10000;
|
|
175
|
+
/**
|
|
176
|
+
* The timeout of a status request: never past the reconciliation deadline
|
|
177
|
+
* (epoch ms) of an unconfirmed attempt; a request after it is a normal one.
|
|
178
|
+
*/
|
|
179
|
+
export declare function statusTimeout(deadline: number | null, now: number): number;
|
|
180
|
+
/**
|
|
181
|
+
* When the wait for an unconfirmed attempt ends (epoch ms): 60 s after it
|
|
182
|
+
* started, but not before 10 s after this page started (`pageStart`), so that
|
|
183
|
+
* a page loaded after the deadline (after a sign-in) asks the update service
|
|
184
|
+
* once first; null: confirmed, no deadline.
|
|
185
|
+
*/
|
|
186
|
+
export declare function reconcileDeadline(pending: PendingInstall | null, pageStart: number): number | null;
|
|
187
|
+
/**
|
|
188
|
+
* Why an unconfirmed attempt ended at its deadline: it did not start, with
|
|
189
|
+
* the reason of the unclear answer, when a reachable status answered without
|
|
190
|
+
* it; otherwise it could not be confirmed, with the latest error.
|
|
191
|
+
*/
|
|
192
|
+
export declare function unconfirmedEnd(pending: PendingInstall): {
|
|
193
|
+
message: "notStarted" | "notConfirmed";
|
|
194
|
+
detail: string | null;
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* Where a tab keeps its followed installation and the one it stopped waiting
|
|
198
|
+
* for (sessionStorage, so a reload during the restart keeps following).
|
|
199
|
+
* `prefix`: one per app, e.g. "meldgrove.updates.handbook".
|
|
200
|
+
*/
|
|
201
|
+
export declare function installStorage(prefix: string): {
|
|
202
|
+
loadPending(): PendingInstall | null;
|
|
203
|
+
savePending(pending: PendingInstall | null): void;
|
|
204
|
+
loadIgnored(): Ignored | null;
|
|
205
|
+
saveIgnored(ignored: Ignored | null): void;
|
|
206
|
+
};
|
|
207
|
+
export type InstallStorage = ReturnType<typeof installStorage>;
|
|
208
|
+
/** "3d", "12h", "30m", "45s" or seconds ("3600") as a count and unit; null for none or unknown. */
|
|
209
|
+
export declare function cooldownParts(cooldown: string | null): {
|
|
210
|
+
unit: "days" | "hours" | "minutes" | "seconds";
|
|
211
|
+
count: number;
|
|
212
|
+
} | null;
|
|
213
|
+
/** "02:00-05:00" as its start and end. */
|
|
214
|
+
export declare function windowParts(window: string | null): {
|
|
215
|
+
start: string;
|
|
216
|
+
end: string;
|
|
217
|
+
} | null;
|
|
218
|
+
/** How many notes the popover lists, and how many changes it leaves out. */
|
|
219
|
+
export declare const MAX_NOTES = 8;
|
|
220
|
+
export declare function noteSummary(update: Update): {
|
|
221
|
+
notes: string[];
|
|
222
|
+
more: number;
|
|
223
|
+
};
|
|
224
|
+
export {};
|