From 8a976861fb15ce7b6b5935dd7862b105e790a348 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Mon, 25 Jul 2022 11:31:14 +0530 Subject: [PATCH 1/3] Add type --- src/platform/types/config.ts | 63 ++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/platform/types/config.ts diff --git a/src/platform/types/config.ts b/src/platform/types/config.ts new file mode 100644 index 00000000..2e08657e --- /dev/null +++ b/src/platform/types/config.ts @@ -0,0 +1,63 @@ +/* +Copyright 2022 The Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +export type Config = { + /** + * The default homeserver used by Hydrogen; auto filled in the login UI. + * eg: https://matrix.org + * REQUIRED + */ + defaultHomeServer: string; + /** + * The submit endpoint for your preferred rageshake server. + * eg: https://element.io/bugreports/submit + * Read more about rageshake at https://github.com/matrix-org/rageshake + * OPTIONAL + */ + bugReportEndpointUrl: string; + /** + * Paths to theme-manifests + * eg: ["assets/theme-element.json", "assets/theme-awesome.json"] + * REQUIRED + */ + themeManifests: string[]; + /** + * This configures the default theme(s) used by Hydrogen. + * These themes appear as "Default" option in the theme chooser UI and are also + * used as a fallback when other themes fail to load. + * Whether the dark or light variant is used depends on the system preference. + * OPTIONAL + */ + defaultTheme: { + // id of light theme + light: string; + // id of dark theme + dark: string; + }; + /** + * Configuration for push notifications. + * See https://spec.matrix.org/latest/client-server-api/#post_matrixclientv3pushersset + * OPTIONAL + */ + push: { + // See app_id in the request body in above link + appId: string; + // The host used for pushing notification + gatewayUrl: string; + // See pushkey in above link + applicationServerKey: string; + }; +}; From 63bdbee39ccd59f7964ad260cfe254c8eb24fae2 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Mon, 25 Jul 2022 11:33:22 +0530 Subject: [PATCH 2/3] Make optional fields optional --- src/platform/types/config.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platform/types/config.ts b/src/platform/types/config.ts index 2e08657e..165bd22b 100644 --- a/src/platform/types/config.ts +++ b/src/platform/types/config.ts @@ -27,7 +27,7 @@ export type Config = { * Read more about rageshake at https://github.com/matrix-org/rageshake * OPTIONAL */ - bugReportEndpointUrl: string; + bugReportEndpointUrl?: string; /** * Paths to theme-manifests * eg: ["assets/theme-element.json", "assets/theme-awesome.json"] @@ -41,7 +41,7 @@ export type Config = { * Whether the dark or light variant is used depends on the system preference. * OPTIONAL */ - defaultTheme: { + defaultTheme?: { // id of light theme light: string; // id of dark theme @@ -52,7 +52,7 @@ export type Config = { * See https://spec.matrix.org/latest/client-server-api/#post_matrixclientv3pushersset * OPTIONAL */ - push: { + push?: { // See app_id in the request body in above link appId: string; // The host used for pushing notification From 170460f5a956f164578b35319d2d632c668616d6 Mon Sep 17 00:00:00 2001 From: Bruno Windels <274386+bwindels@users.noreply.github.com> Date: Fri, 29 Jul 2022 12:02:09 +0200 Subject: [PATCH 3/3] add link to sygnal webpush docs as well --- src/platform/types/config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platform/types/config.ts b/src/platform/types/config.ts index 165bd22b..8a5eabf2 100644 --- a/src/platform/types/config.ts +++ b/src/platform/types/config.ts @@ -50,6 +50,7 @@ export type Config = { /** * Configuration for push notifications. * See https://spec.matrix.org/latest/client-server-api/#post_matrixclientv3pushersset + * and https://github.com/matrix-org/sygnal/blob/main/docs/applications.md#webpush * OPTIONAL */ push?: {