diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 826c05ff3..2bc9563ba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -306,8 +306,18 @@ jobs: - name: check git status run: git --no-pager diff --exit-code + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Set up pnpm + uses: pnpm/action-setup@v3 + with: + version: 9 + - name: Install dependencies - run: sudo apt update && sudo apt install -y -q libappindicator3-dev gir1.2-appindicator3-0.1 libxxf86vm-dev gcc-mingw-w64-x86-64 + run: sudo apt update && sudo apt install -y -q libgtk-3-dev libwebkit2gtk-4.1-dev libsoup-3.0-dev libayatana-appindicator3-dev gcc-mingw-w64-x86-64 - name: Decode GPG signing key if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository @@ -327,9 +337,9 @@ jobs: - name: Install goversioninfo run: go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@233067e - name: Generate windows syso amd64 - run: goversioninfo -64 -icon client/ui/assets/netbird.ico -manifest client/ui/manifest.xml -product-name ${{ env.PRODUCT_NAME }}-"UI" -copyright "${{ env.COPYRIGHT }}" -ver-major ${{ steps.semver_parser.outputs.major }} -ver-minor ${{ steps.semver_parser.outputs.minor }} -ver-patch ${{ steps.semver_parser.outputs.patch }} -ver-build 0 -file-version ${{ steps.semver_parser.outputs.fullversion }}.0 -product-version ${{ steps.semver_parser.outputs.fullversion }}.0 -o client/ui/resources_windows_amd64.syso + run: goversioninfo -64 -icon client/ui-wails/build/windows/icon.ico -manifest client/ui-wails/build/windows/wails.exe.manifest -product-name ${{ env.PRODUCT_NAME }}-"UI" -copyright "${{ env.COPYRIGHT }}" -ver-major ${{ steps.semver_parser.outputs.major }} -ver-minor ${{ steps.semver_parser.outputs.minor }} -ver-patch ${{ steps.semver_parser.outputs.patch }} -ver-build 0 -file-version ${{ steps.semver_parser.outputs.fullversion }}.0 -product-version ${{ steps.semver_parser.outputs.fullversion }}.0 -o client/ui-wails/resources_windows_amd64.syso - name: Generate windows syso arm64 - run: goversioninfo -arm -64 -icon client/ui/assets/netbird.ico -manifest client/ui/manifest.xml -product-name ${{ env.PRODUCT_NAME }}-"UI" -copyright "${{ env.COPYRIGHT }}" -ver-major ${{ steps.semver_parser.outputs.major }} -ver-minor ${{ steps.semver_parser.outputs.minor }} -ver-patch ${{ steps.semver_parser.outputs.patch }} -ver-build 0 -file-version ${{ steps.semver_parser.outputs.fullversion }}.0 -product-version ${{ steps.semver_parser.outputs.fullversion }}.0 -o client/ui/resources_windows_arm64.syso + run: goversioninfo -arm -64 -icon client/ui-wails/build/windows/icon.ico -manifest client/ui-wails/build/windows/wails.exe.manifest -product-name ${{ env.PRODUCT_NAME }}-"UI" -copyright "${{ env.COPYRIGHT }}" -ver-major ${{ steps.semver_parser.outputs.major }} -ver-minor ${{ steps.semver_parser.outputs.minor }} -ver-patch ${{ steps.semver_parser.outputs.patch }} -ver-build 0 -file-version ${{ steps.semver_parser.outputs.fullversion }}.0 -product-version ${{ steps.semver_parser.outputs.fullversion }}.0 -o client/ui-wails/resources_windows_arm64.syso - name: Run GoReleaser uses: goreleaser/goreleaser-action@v4 @@ -393,6 +403,14 @@ jobs: run: go mod tidy - name: check git status run: git --no-pager diff --exit-code + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + - name: Set up pnpm + uses: pnpm/action-setup@v3 + with: + version: 9 - name: Run GoReleaser id: goreleaser uses: goreleaser/goreleaser-action@v4 diff --git a/.goreleaser_ui.yaml b/.goreleaser_ui.yaml index 470f1deaa..e18aac435 100644 --- a/.goreleaser_ui.yaml +++ b/.goreleaser_ui.yaml @@ -1,9 +1,14 @@ version: 2 project_name: netbird-ui + +before: + hooks: + - sh -c 'cd client/ui-wails/frontend && pnpm install --frozen-lockfile && pnpm build' + builds: - id: netbird-ui - dir: client/ui + dir: client/ui-wails binary: netbird-ui env: - CGO_ENABLED=1 @@ -16,7 +21,7 @@ builds: mod_timestamp: "{{ .CommitTimestamp }}" - id: netbird-ui-windows-amd64 - dir: client/ui + dir: client/ui-wails binary: netbird-ui env: - CGO_ENABLED=1 @@ -31,7 +36,7 @@ builds: mod_timestamp: "{{ .CommitTimestamp }}" - id: netbird-ui-windows-arm64 - dir: client/ui + dir: client/ui-wails binary: netbird-ui env: - CGO_ENABLED=1 @@ -70,12 +75,15 @@ nfpms: scripts: postinstall: "release_files/ui-post-install.sh" contents: - - src: client/ui/build/netbird.desktop + - src: client/ui-wails/build/linux/netbird.desktop dst: /usr/share/applications/netbird.desktop - - src: client/ui/assets/netbird.png + - src: client/ui-wails/build/appicon.png dst: /usr/share/pixmaps/netbird.png dependencies: - netbird + - libgtk-3-0 + - libwebkit2gtk-4.1-0 + - libayatana-appindicator3-1 - maintainer: Netbird description: Netbird client UI. @@ -89,12 +97,15 @@ nfpms: scripts: postinstall: "release_files/ui-post-install.sh" contents: - - src: client/ui/build/netbird.desktop + - src: client/ui-wails/build/linux/netbird.desktop dst: /usr/share/applications/netbird.desktop - - src: client/ui/assets/netbird.png + - src: client/ui-wails/build/appicon.png dst: /usr/share/pixmaps/netbird.png dependencies: - netbird + - gtk3 + - webkit2gtk4.1 + - libayatana-appindicator3 rpm: signature: key_file: '{{ if index .Env "GPG_RPM_KEY_FILE" }}{{ .Env.GPG_RPM_KEY_FILE }}{{ end }}' diff --git a/.goreleaser_ui_darwin.yaml b/.goreleaser_ui_darwin.yaml index 0a0082075..4ee9b4507 100644 --- a/.goreleaser_ui_darwin.yaml +++ b/.goreleaser_ui_darwin.yaml @@ -1,9 +1,14 @@ version: 2 project_name: netbird-ui + +before: + hooks: + - sh -c 'cd client/ui-wails/frontend && pnpm install --frozen-lockfile && pnpm build' + builds: - id: netbird-ui-darwin - dir: client/ui + dir: client/ui-wails binary: netbird-ui env: - CGO_ENABLED=1 @@ -20,8 +25,6 @@ builds: ldflags: - -s -w -X github.com/netbirdio/netbird/version.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.CommitDate}} -X main.builtBy=goreleaser mod_timestamp: "{{ .CommitTimestamp }}" - tags: - - load_wgnt_from_rsrc universal_binaries: - id: netbird-ui-darwin diff --git a/client/ui-wails/.gitignore b/client/ui-wails/.gitignore index d779b3d07..0f4fa7363 100644 --- a/client/ui-wails/.gitignore +++ b/client/ui-wails/.gitignore @@ -2,6 +2,5 @@ bin frontend/dist frontend/node_modules -frontend/bindings build/linux/appimage/build build/windows/nsis/MicrosoftEdgeWebview2Setup.exe diff --git a/client/ui-wails/build/linux/netbird.desktop b/client/ui-wails/build/linux/netbird.desktop new file mode 100644 index 000000000..0b702fc07 --- /dev/null +++ b/client/ui-wails/build/linux/netbird.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Netbird +Exec=env WEBKIT_DISABLE_DMABUF_RENDERER=1 /usr/bin/netbird-ui +Icon=netbird +Type=Application +Terminal=false +Categories=Utility; +Keywords=netbird; \ No newline at end of file diff --git a/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/connection.ts b/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/connection.ts new file mode 100644 index 000000000..bff04759e --- /dev/null +++ b/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/connection.ts @@ -0,0 +1,40 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +/** + * Connection groups the daemon RPCs that drive login / connect / disconnect. + * @module + */ + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime"; + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import * as $models from "./models.js"; + +export function Down(): $CancellablePromise { + return $Call.ByID(1062334452); +} + +export function Login(p: $models.LoginParams): $CancellablePromise<$models.LoginResult> { + return $Call.ByID(782816741, p).then(($result: any) => { + return $$createType0($result); + }); +} + +export function Logout(p: $models.LogoutParams): $CancellablePromise { + return $Call.ByID(4028053230, p); +} + +export function Up(p: $models.UpParams): $CancellablePromise { + return $Call.ByID(1178388469, p); +} + +export function WaitSSOLogin(p: $models.WaitSSOParams): $CancellablePromise { + return $Call.ByID(3487329509, p); +} + +// Private type creation functions +const $$createType0 = $models.LoginResult.createFrom; diff --git a/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/debug.ts b/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/debug.ts new file mode 100644 index 000000000..4711064bb --- /dev/null +++ b/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/debug.ts @@ -0,0 +1,35 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +/** + * Debug groups debug / log-level / packet-trace RPCs. + * @module + */ + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime"; + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import * as $models from "./models.js"; + +export function Bundle(p: $models.DebugBundleParams): $CancellablePromise<$models.DebugBundleResult> { + return $Call.ByID(1875836985, p).then(($result: any) => { + return $$createType0($result); + }); +} + +export function GetLogLevel(): $CancellablePromise<$models.LogLevel> { + return $Call.ByID(2713455331).then(($result: any) => { + return $$createType1($result); + }); +} + +export function SetLogLevel(lvl: $models.LogLevel): $CancellablePromise { + return $Call.ByID(2627038775, lvl); +} + +// Private type creation functions +const $$createType0 = $models.DebugBundleResult.createFrom; +const $$createType1 = $models.LogLevel.createFrom; diff --git a/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/index.ts b/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/index.ts new file mode 100644 index 000000000..90203c174 --- /dev/null +++ b/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/index.ts @@ -0,0 +1,47 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import * as Connection from "./connection.js"; +import * as Debug from "./debug.js"; +import * as Networks from "./networks.js"; +import * as Peers from "./peers.js"; +import * as Profiles from "./profiles.js"; +import * as Settings from "./settings.js"; +import * as Update from "./update.js"; +export { + Connection, + Debug, + Networks, + Peers, + Profiles, + Settings, + Update +}; + +export { + ActiveProfile, + Config, + ConfigParams, + DebugBundleParams, + DebugBundleResult, + Features, + LocalPeer, + LogLevel, + LoginParams, + LoginResult, + LogoutParams, + Network, + PeerLink, + PeerStatus, + Profile, + ProfileRef, + SelectNetworksParams, + SetConfigParams, + Status, + SystemEvent, + UpParams, + UpdateAvailable, + UpdateProgress, + UpdateResult, + WaitSSOParams +} from "./models.js"; diff --git a/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/models.ts b/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/models.ts new file mode 100644 index 000000000..d22a345e0 --- /dev/null +++ b/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/models.ts @@ -0,0 +1,1067 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import { Create as $Create } from "@wailsio/runtime"; + +/** + * ActiveProfile is the result of GetActiveProfile. + */ +export class ActiveProfile { + "profileName": string; + "username": string; + + /** Creates a new ActiveProfile instance. */ + constructor($$source: Partial = {}) { + if (!("profileName" in $$source)) { + this["profileName"] = ""; + } + if (!("username" in $$source)) { + this["username"] = ""; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new ActiveProfile instance from a string or object. + */ + static createFrom($$source: any = {}): ActiveProfile { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new ActiveProfile($$parsedSource as Partial); + } +} + +/** + * Config is the daemon configuration the UI exposes in the settings window. + * Pointer fields mark "set" vs "unset" so the UI can omit a value to keep the + * daemon's current setting (matching SetConfigRequest's optional semantics). + */ +export class Config { + "managementUrl": string; + "adminUrl": string; + "configFile": string; + "logFile": string; + "preSharedKey": string; + "interfaceName": string; + "wireguardPort": number; + "mtu": number; + "disableAutoConnect": boolean; + "serverSshAllowed": boolean; + "rosenpassEnabled": boolean; + "rosenpassPermissive": boolean; + "disableNotifications": boolean; + "lazyConnectionEnabled": boolean; + "blockInbound": boolean; + "networkMonitor": boolean; + "disableClientRoutes": boolean; + "disableServerRoutes": boolean; + "disableDns": boolean; + "blockLanAccess": boolean; + "enableSshRoot": boolean; + "enableSshSftp": boolean; + "enableSshLocalPortForwarding": boolean; + "enableSshRemotePortForwarding": boolean; + "disableSshAuth": boolean; + "sshJwtCacheTtl": number; + + /** Creates a new Config instance. */ + constructor($$source: Partial = {}) { + if (!("managementUrl" in $$source)) { + this["managementUrl"] = ""; + } + if (!("adminUrl" in $$source)) { + this["adminUrl"] = ""; + } + if (!("configFile" in $$source)) { + this["configFile"] = ""; + } + if (!("logFile" in $$source)) { + this["logFile"] = ""; + } + if (!("preSharedKey" in $$source)) { + this["preSharedKey"] = ""; + } + if (!("interfaceName" in $$source)) { + this["interfaceName"] = ""; + } + if (!("wireguardPort" in $$source)) { + this["wireguardPort"] = 0; + } + if (!("mtu" in $$source)) { + this["mtu"] = 0; + } + if (!("disableAutoConnect" in $$source)) { + this["disableAutoConnect"] = false; + } + if (!("serverSshAllowed" in $$source)) { + this["serverSshAllowed"] = false; + } + if (!("rosenpassEnabled" in $$source)) { + this["rosenpassEnabled"] = false; + } + if (!("rosenpassPermissive" in $$source)) { + this["rosenpassPermissive"] = false; + } + if (!("disableNotifications" in $$source)) { + this["disableNotifications"] = false; + } + if (!("lazyConnectionEnabled" in $$source)) { + this["lazyConnectionEnabled"] = false; + } + if (!("blockInbound" in $$source)) { + this["blockInbound"] = false; + } + if (!("networkMonitor" in $$source)) { + this["networkMonitor"] = false; + } + if (!("disableClientRoutes" in $$source)) { + this["disableClientRoutes"] = false; + } + if (!("disableServerRoutes" in $$source)) { + this["disableServerRoutes"] = false; + } + if (!("disableDns" in $$source)) { + this["disableDns"] = false; + } + if (!("blockLanAccess" in $$source)) { + this["blockLanAccess"] = false; + } + if (!("enableSshRoot" in $$source)) { + this["enableSshRoot"] = false; + } + if (!("enableSshSftp" in $$source)) { + this["enableSshSftp"] = false; + } + if (!("enableSshLocalPortForwarding" in $$source)) { + this["enableSshLocalPortForwarding"] = false; + } + if (!("enableSshRemotePortForwarding" in $$source)) { + this["enableSshRemotePortForwarding"] = false; + } + if (!("disableSshAuth" in $$source)) { + this["disableSshAuth"] = false; + } + if (!("sshJwtCacheTtl" in $$source)) { + this["sshJwtCacheTtl"] = 0; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new Config instance from a string or object. + */ + static createFrom($$source: any = {}): Config { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new Config($$parsedSource as Partial); + } +} + +/** + * ConfigParams selects which profile/user to read or write config for. + */ +export class ConfigParams { + "profileName": string; + "username": string; + + /** Creates a new ConfigParams instance. */ + constructor($$source: Partial = {}) { + if (!("profileName" in $$source)) { + this["profileName"] = ""; + } + if (!("username" in $$source)) { + this["username"] = ""; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new ConfigParams instance from a string or object. + */ + static createFrom($$source: any = {}): ConfigParams { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new ConfigParams($$parsedSource as Partial); + } +} + +/** + * DebugBundleParams configures what the daemon collects when generating a + * debug bundle. + */ +export class DebugBundleParams { + "anonymize": boolean; + "systemInfo": boolean; + "uploadUrl": string; + "logFileCount": number; + + /** Creates a new DebugBundleParams instance. */ + constructor($$source: Partial = {}) { + if (!("anonymize" in $$source)) { + this["anonymize"] = false; + } + if (!("systemInfo" in $$source)) { + this["systemInfo"] = false; + } + if (!("uploadUrl" in $$source)) { + this["uploadUrl"] = ""; + } + if (!("logFileCount" in $$source)) { + this["logFileCount"] = 0; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new DebugBundleParams instance from a string or object. + */ + static createFrom($$source: any = {}): DebugBundleParams { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new DebugBundleParams($$parsedSource as Partial); + } +} + +/** + * DebugBundleResult mirrors DebugBundleResponse — Path is set on local-only + * bundles, UploadedKey on successful uploads, UploadFailureReason on failed + * uploads. + */ +export class DebugBundleResult { + "path": string; + "uploadedKey": string; + "uploadFailureReason": string; + + /** Creates a new DebugBundleResult instance. */ + constructor($$source: Partial = {}) { + if (!("path" in $$source)) { + this["path"] = ""; + } + if (!("uploadedKey" in $$source)) { + this["uploadedKey"] = ""; + } + if (!("uploadFailureReason" in $$source)) { + this["uploadFailureReason"] = ""; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new DebugBundleResult instance from a string or object. + */ + static createFrom($$source: any = {}): DebugBundleResult { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new DebugBundleResult($$parsedSource as Partial); + } +} + +/** + * Features reports which UI surfaces the daemon has disabled. The Fyne UI uses + * these flags to grey out menu items the operator turned off server-side. + */ +export class Features { + "disableProfiles": boolean; + "disableUpdateSettings": boolean; + "disableNetworks": boolean; + + /** Creates a new Features instance. */ + constructor($$source: Partial = {}) { + if (!("disableProfiles" in $$source)) { + this["disableProfiles"] = false; + } + if (!("disableUpdateSettings" in $$source)) { + this["disableUpdateSettings"] = false; + } + if (!("disableNetworks" in $$source)) { + this["disableNetworks"] = false; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new Features instance from a string or object. + */ + static createFrom($$source: any = {}): Features { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new Features($$parsedSource as Partial); + } +} + +/** + * LocalPeer mirrors LocalPeerState — what this client looks like on the mesh. + */ +export class LocalPeer { + "ip": string; + "pubKey": string; + "fqdn": string; + "networks": string[]; + + /** Creates a new LocalPeer instance. */ + constructor($$source: Partial = {}) { + if (!("ip" in $$source)) { + this["ip"] = ""; + } + if (!("pubKey" in $$source)) { + this["pubKey"] = ""; + } + if (!("fqdn" in $$source)) { + this["fqdn"] = ""; + } + if (!("networks" in $$source)) { + this["networks"] = []; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new LocalPeer instance from a string or object. + */ + static createFrom($$source: any = {}): LocalPeer { + const $$createField3_0 = $$createType0; + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + if ("networks" in $$parsedSource) { + $$parsedSource["networks"] = $$createField3_0($$parsedSource["networks"]); + } + return new LocalPeer($$parsedSource as Partial); + } +} + +/** + * LogLevel is a single log-level value the daemon understands ("error", + * "warn", "info", "debug", "trace"). + */ +export class LogLevel { + "level": string; + + /** Creates a new LogLevel instance. */ + constructor($$source: Partial = {}) { + if (!("level" in $$source)) { + this["level"] = ""; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new LogLevel instance from a string or object. + */ + static createFrom($$source: any = {}): LogLevel { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new LogLevel($$parsedSource as Partial); + } +} + +/** + * LoginParams carries the fields the UI sets when starting a login. + */ +export class LoginParams { + "profileName": string; + "username": string; + "managementUrl": string; + "setupKey": string; + "preSharedKey": string; + "hostname": string; + "hint": string; + + /** Creates a new LoginParams instance. */ + constructor($$source: Partial = {}) { + if (!("profileName" in $$source)) { + this["profileName"] = ""; + } + if (!("username" in $$source)) { + this["username"] = ""; + } + if (!("managementUrl" in $$source)) { + this["managementUrl"] = ""; + } + if (!("setupKey" in $$source)) { + this["setupKey"] = ""; + } + if (!("preSharedKey" in $$source)) { + this["preSharedKey"] = ""; + } + if (!("hostname" in $$source)) { + this["hostname"] = ""; + } + if (!("hint" in $$source)) { + this["hint"] = ""; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new LoginParams instance from a string or object. + */ + static createFrom($$source: any = {}): LoginParams { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new LoginParams($$parsedSource as Partial); + } +} + +/** + * LoginResult is the daemon's reply to a Login call. + */ +export class LoginResult { + "needsSsoLogin": boolean; + "userCode": string; + "verificationUri": string; + "verificationUriComplete": string; + + /** Creates a new LoginResult instance. */ + constructor($$source: Partial = {}) { + if (!("needsSsoLogin" in $$source)) { + this["needsSsoLogin"] = false; + } + if (!("userCode" in $$source)) { + this["userCode"] = ""; + } + if (!("verificationUri" in $$source)) { + this["verificationUri"] = ""; + } + if (!("verificationUriComplete" in $$source)) { + this["verificationUriComplete"] = ""; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new LoginResult instance from a string or object. + */ + static createFrom($$source: any = {}): LoginResult { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new LoginResult($$parsedSource as Partial); + } +} + +/** + * LogoutParams selects the profile the daemon should log out. + */ +export class LogoutParams { + "profileName": string; + "username": string; + + /** Creates a new LogoutParams instance. */ + constructor($$source: Partial = {}) { + if (!("profileName" in $$source)) { + this["profileName"] = ""; + } + if (!("username" in $$source)) { + this["username"] = ""; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new LogoutParams instance from a string or object. + */ + static createFrom($$source: any = {}): LogoutParams { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new LogoutParams($$parsedSource as Partial); + } +} + +/** + * Network is one routed network the daemon offers to the client. + */ +export class Network { + "id": string; + "range": string; + "selected": boolean; + "domains": string[]; + "resolvedIps": { [_ in string]?: string[] }; + + /** Creates a new Network instance. */ + constructor($$source: Partial = {}) { + if (!("id" in $$source)) { + this["id"] = ""; + } + if (!("range" in $$source)) { + this["range"] = ""; + } + if (!("selected" in $$source)) { + this["selected"] = false; + } + if (!("domains" in $$source)) { + this["domains"] = []; + } + if (!("resolvedIps" in $$source)) { + this["resolvedIps"] = {}; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new Network instance from a string or object. + */ + static createFrom($$source: any = {}): Network { + const $$createField3_0 = $$createType0; + const $$createField4_0 = $$createType1; + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + if ("domains" in $$parsedSource) { + $$parsedSource["domains"] = $$createField3_0($$parsedSource["domains"]); + } + if ("resolvedIps" in $$parsedSource) { + $$parsedSource["resolvedIps"] = $$createField4_0($$parsedSource["resolvedIps"]); + } + return new Network($$parsedSource as Partial); + } +} + +/** + * PeerLink is one of the named connections between this peer and its mgmt + * or signal server. + */ +export class PeerLink { + "url": string; + "connected": boolean; + "error"?: string; + + /** Creates a new PeerLink instance. */ + constructor($$source: Partial = {}) { + if (!("url" in $$source)) { + this["url"] = ""; + } + if (!("connected" in $$source)) { + this["connected"] = false; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new PeerLink instance from a string or object. + */ + static createFrom($$source: any = {}): PeerLink { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new PeerLink($$parsedSource as Partial); + } +} + +/** + * PeerStatus is the frontend-facing shape of a daemon PeerState. Carries + * enough detail for the dashboard's compact peer row plus the on-click + * troubleshooting expansion (ICE candidate types, endpoints, handshake age). + */ +export class PeerStatus { + "ip": string; + "pubKey": string; + "connStatus": string; + "connStatusUpdateUnix": number; + "relayed": boolean; + "localIceCandidateType": string; + "remoteIceCandidateType": string; + "localIceCandidateEndpoint": string; + "remoteIceCandidateEndpoint": string; + "fqdn": string; + "bytesRx": number; + "bytesTx": number; + "latencyMs": number; + "relayAddress": string; + "lastHandshakeUnix": number; + "rosenpassEnabled": boolean; + "networks": string[]; + + /** Creates a new PeerStatus instance. */ + constructor($$source: Partial = {}) { + if (!("ip" in $$source)) { + this["ip"] = ""; + } + if (!("pubKey" in $$source)) { + this["pubKey"] = ""; + } + if (!("connStatus" in $$source)) { + this["connStatus"] = ""; + } + if (!("connStatusUpdateUnix" in $$source)) { + this["connStatusUpdateUnix"] = 0; + } + if (!("relayed" in $$source)) { + this["relayed"] = false; + } + if (!("localIceCandidateType" in $$source)) { + this["localIceCandidateType"] = ""; + } + if (!("remoteIceCandidateType" in $$source)) { + this["remoteIceCandidateType"] = ""; + } + if (!("localIceCandidateEndpoint" in $$source)) { + this["localIceCandidateEndpoint"] = ""; + } + if (!("remoteIceCandidateEndpoint" in $$source)) { + this["remoteIceCandidateEndpoint"] = ""; + } + if (!("fqdn" in $$source)) { + this["fqdn"] = ""; + } + if (!("bytesRx" in $$source)) { + this["bytesRx"] = 0; + } + if (!("bytesTx" in $$source)) { + this["bytesTx"] = 0; + } + if (!("latencyMs" in $$source)) { + this["latencyMs"] = 0; + } + if (!("relayAddress" in $$source)) { + this["relayAddress"] = ""; + } + if (!("lastHandshakeUnix" in $$source)) { + this["lastHandshakeUnix"] = 0; + } + if (!("rosenpassEnabled" in $$source)) { + this["rosenpassEnabled"] = false; + } + if (!("networks" in $$source)) { + this["networks"] = []; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new PeerStatus instance from a string or object. + */ + static createFrom($$source: any = {}): PeerStatus { + const $$createField16_0 = $$createType0; + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + if ("networks" in $$parsedSource) { + $$parsedSource["networks"] = $$createField16_0($$parsedSource["networks"]); + } + return new PeerStatus($$parsedSource as Partial); + } +} + +/** + * Profile is one named daemon profile. + */ +export class Profile { + "name": string; + "isActive": boolean; + + /** Creates a new Profile instance. */ + constructor($$source: Partial = {}) { + if (!("name" in $$source)) { + this["name"] = ""; + } + if (!("isActive" in $$source)) { + this["isActive"] = false; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new Profile instance from a string or object. + */ + static createFrom($$source: any = {}): Profile { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new Profile($$parsedSource as Partial); + } +} + +/** + * ProfileRef identifies a profile by name+username. + */ +export class ProfileRef { + "profileName": string; + "username": string; + + /** Creates a new ProfileRef instance. */ + constructor($$source: Partial = {}) { + if (!("profileName" in $$source)) { + this["profileName"] = ""; + } + if (!("username" in $$source)) { + this["username"] = ""; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new ProfileRef instance from a string or object. + */ + static createFrom($$source: any = {}): ProfileRef { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new ProfileRef($$parsedSource as Partial); + } +} + +/** + * SelectNetworksParams selects which networks to enable / disable. + * All means "every available network" (used by Select-All / Deselect-All buttons); + * Append means "leave the existing selection in place and merge these IDs in". + */ +export class SelectNetworksParams { + "networkIds": string[]; + "append": boolean; + "all": boolean; + + /** Creates a new SelectNetworksParams instance. */ + constructor($$source: Partial = {}) { + if (!("networkIds" in $$source)) { + this["networkIds"] = []; + } + if (!("append" in $$source)) { + this["append"] = false; + } + if (!("all" in $$source)) { + this["all"] = false; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new SelectNetworksParams instance from a string or object. + */ + static createFrom($$source: any = {}): SelectNetworksParams { + const $$createField0_0 = $$createType0; + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + if ("networkIds" in $$parsedSource) { + $$parsedSource["networkIds"] = $$createField0_0($$parsedSource["networkIds"]); + } + return new SelectNetworksParams($$parsedSource as Partial); + } +} + +/** + * SetConfigParams is a partial update — only fields with non-nil pointers + * are sent to the daemon. The frontend uses this to flip individual toggles. + */ +export class SetConfigParams { + "profileName": string; + "username": string; + "managementUrl": string; + "adminUrl": string; + "interfaceName"?: string | null; + "wireguardPort"?: number | null; + "mtu"?: number | null; + "preSharedKey"?: string | null; + "disableAutoConnect"?: boolean | null; + "serverSshAllowed"?: boolean | null; + "rosenpassEnabled"?: boolean | null; + "rosenpassPermissive"?: boolean | null; + "disableNotifications"?: boolean | null; + "lazyConnectionEnabled"?: boolean | null; + "blockInbound"?: boolean | null; + "networkMonitor"?: boolean | null; + "disableClientRoutes"?: boolean | null; + "disableServerRoutes"?: boolean | null; + "disableDns"?: boolean | null; + "disableFirewall"?: boolean | null; + "blockLanAccess"?: boolean | null; + "enableSshRoot"?: boolean | null; + "enableSshSftp"?: boolean | null; + "enableSshLocalPortForwarding"?: boolean | null; + "enableSshRemotePortForwarding"?: boolean | null; + "disableSshAuth"?: boolean | null; + "sshJwtCacheTtl"?: number | null; + + /** Creates a new SetConfigParams instance. */ + constructor($$source: Partial = {}) { + if (!("profileName" in $$source)) { + this["profileName"] = ""; + } + if (!("username" in $$source)) { + this["username"] = ""; + } + if (!("managementUrl" in $$source)) { + this["managementUrl"] = ""; + } + if (!("adminUrl" in $$source)) { + this["adminUrl"] = ""; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new SetConfigParams instance from a string or object. + */ + static createFrom($$source: any = {}): SetConfigParams { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new SetConfigParams($$parsedSource as Partial); + } +} + +/** + * Status is the snapshot the frontend renders on the dashboard. + */ +export class Status { + "status": string; + "daemonVersion": string; + "management": PeerLink; + "signal": PeerLink; + "local": LocalPeer; + "peers": PeerStatus[]; + "events": SystemEvent[]; + + /** Creates a new Status instance. */ + constructor($$source: Partial = {}) { + if (!("status" in $$source)) { + this["status"] = ""; + } + if (!("daemonVersion" in $$source)) { + this["daemonVersion"] = ""; + } + if (!("management" in $$source)) { + this["management"] = (new PeerLink()); + } + if (!("signal" in $$source)) { + this["signal"] = (new PeerLink()); + } + if (!("local" in $$source)) { + this["local"] = (new LocalPeer()); + } + if (!("peers" in $$source)) { + this["peers"] = []; + } + if (!("events" in $$source)) { + this["events"] = []; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new Status instance from a string or object. + */ + static createFrom($$source: any = {}): Status { + const $$createField2_0 = $$createType2; + const $$createField3_0 = $$createType2; + const $$createField4_0 = $$createType3; + const $$createField5_0 = $$createType5; + const $$createField6_0 = $$createType7; + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + if ("management" in $$parsedSource) { + $$parsedSource["management"] = $$createField2_0($$parsedSource["management"]); + } + if ("signal" in $$parsedSource) { + $$parsedSource["signal"] = $$createField3_0($$parsedSource["signal"]); + } + if ("local" in $$parsedSource) { + $$parsedSource["local"] = $$createField4_0($$parsedSource["local"]); + } + if ("peers" in $$parsedSource) { + $$parsedSource["peers"] = $$createField5_0($$parsedSource["peers"]); + } + if ("events" in $$parsedSource) { + $$parsedSource["events"] = $$createField6_0($$parsedSource["events"]); + } + return new Status($$parsedSource as Partial); + } +} + +/** + * SystemEvent is the frontend-facing shape of a daemon SystemEvent. + */ +export class SystemEvent { + "id": string; + "severity": string; + "category": string; + "message": string; + "userMessage": string; + "timestamp": number; + "metadata": { [_ in string]?: string }; + + /** Creates a new SystemEvent instance. */ + constructor($$source: Partial = {}) { + if (!("id" in $$source)) { + this["id"] = ""; + } + if (!("severity" in $$source)) { + this["severity"] = ""; + } + if (!("category" in $$source)) { + this["category"] = ""; + } + if (!("message" in $$source)) { + this["message"] = ""; + } + if (!("userMessage" in $$source)) { + this["userMessage"] = ""; + } + if (!("timestamp" in $$source)) { + this["timestamp"] = 0; + } + if (!("metadata" in $$source)) { + this["metadata"] = {}; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new SystemEvent instance from a string or object. + */ + static createFrom($$source: any = {}): SystemEvent { + const $$createField6_0 = $$createType8; + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + if ("metadata" in $$parsedSource) { + $$parsedSource["metadata"] = $$createField6_0($$parsedSource["metadata"]); + } + return new SystemEvent($$parsedSource as Partial); + } +} + +/** + * UpParams selects the profile the daemon should bring up. + */ +export class UpParams { + "profileName": string; + "username": string; + + /** Creates a new UpParams instance. */ + constructor($$source: Partial = {}) { + if (!("profileName" in $$source)) { + this["profileName"] = ""; + } + if (!("username" in $$source)) { + this["username"] = ""; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new UpParams instance from a string or object. + */ + static createFrom($$source: any = {}): UpParams { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new UpParams($$parsedSource as Partial); + } +} + +/** + * UpdateAvailable carries the new_version_available metadata. + */ +export class UpdateAvailable { + "version": string; + "enforced": boolean; + + /** Creates a new UpdateAvailable instance. */ + constructor($$source: Partial = {}) { + if (!("version" in $$source)) { + this["version"] = ""; + } + if (!("enforced" in $$source)) { + this["enforced"] = false; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new UpdateAvailable instance from a string or object. + */ + static createFrom($$source: any = {}): UpdateAvailable { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new UpdateAvailable($$parsedSource as Partial); + } +} + +/** + * UpdateProgress carries the progress_window metadata. + */ +export class UpdateProgress { + "action": string; + "version": string; + + /** Creates a new UpdateProgress instance. */ + constructor($$source: Partial = {}) { + if (!("action" in $$source)) { + this["action"] = ""; + } + if (!("version" in $$source)) { + this["version"] = ""; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new UpdateProgress instance from a string or object. + */ + static createFrom($$source: any = {}): UpdateProgress { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new UpdateProgress($$parsedSource as Partial); + } +} + +/** + * UpdateResult mirrors TriggerUpdateResponse: Success false carries an error + * message in ErrorMsg. + */ +export class UpdateResult { + "success": boolean; + "errorMsg": string; + + /** Creates a new UpdateResult instance. */ + constructor($$source: Partial = {}) { + if (!("success" in $$source)) { + this["success"] = false; + } + if (!("errorMsg" in $$source)) { + this["errorMsg"] = ""; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new UpdateResult instance from a string or object. + */ + static createFrom($$source: any = {}): UpdateResult { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new UpdateResult($$parsedSource as Partial); + } +} + +/** + * WaitSSOParams carries the fields the UI passes to WaitSSOLogin. + */ +export class WaitSSOParams { + "userCode": string; + "hostname": string; + + /** Creates a new WaitSSOParams instance. */ + constructor($$source: Partial = {}) { + if (!("userCode" in $$source)) { + this["userCode"] = ""; + } + if (!("hostname" in $$source)) { + this["hostname"] = ""; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new WaitSSOParams instance from a string or object. + */ + static createFrom($$source: any = {}): WaitSSOParams { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new WaitSSOParams($$parsedSource as Partial); + } +} + +// Private type creation functions +const $$createType0 = $Create.Array($Create.Any); +const $$createType1 = $Create.Map($Create.Any, $$createType0); +const $$createType2 = PeerLink.createFrom; +const $$createType3 = LocalPeer.createFrom; +const $$createType4 = PeerStatus.createFrom; +const $$createType5 = $Create.Array($$createType4); +const $$createType6 = SystemEvent.createFrom; +const $$createType7 = $Create.Array($$createType6); +const $$createType8 = $Create.Map($Create.Any, $Create.Any); diff --git a/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/networks.ts b/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/networks.ts new file mode 100644 index 000000000..37967ff58 --- /dev/null +++ b/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/networks.ts @@ -0,0 +1,33 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +/** + * Networks groups the daemon RPCs that read and toggle routed networks. + * @module + */ + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime"; + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import * as $models from "./models.js"; + +export function Deselect(p: $models.SelectNetworksParams): $CancellablePromise { + return $Call.ByID(2335193802, p); +} + +export function List(): $CancellablePromise<$models.Network[]> { + return $Call.ByID(719769457).then(($result: any) => { + return $$createType1($result); + }); +} + +export function Select(p: $models.SelectNetworksParams): $CancellablePromise { + return $Call.ByID(3714393053, p); +} + +// Private type creation functions +const $$createType0 = $models.Network.createFrom; +const $$createType1 = $Create.Array($$createType0); diff --git a/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/peers.ts b/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/peers.ts new file mode 100644 index 000000000..2d361d41b --- /dev/null +++ b/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/peers.ts @@ -0,0 +1,39 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +/** + * Peers serves the dashboard data: one polled Status RPC and a long-running + * SubscribeEvents stream that re-emits every event over the Wails event bus. + * @module + */ + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime"; + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import * as $models from "./models.js"; + +/** + * Get returns the current daemon status snapshot. + */ +export function Get(): $CancellablePromise<$models.Status> { + return $Call.ByID(196038193).then(($result: any) => { + return $$createType0($result); + }); +} + +/** + * Watch starts the background loops that feed the frontend: a status + * stream (push-driven on connection-state change) and an event stream + * (DNS / network / auth / connectivity / update notifications). + * Safe to call once at boot; both loops self-restart on stream errors + * via exponential backoff. + */ +export function Watch(): $CancellablePromise { + return $Call.ByID(741320382); +} + +// Private type creation functions +const $$createType0 = $models.Status.createFrom; diff --git a/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/profiles.ts b/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/profiles.ts new file mode 100644 index 000000000..f41cdba25 --- /dev/null +++ b/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/profiles.ts @@ -0,0 +1,52 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +/** + * Profiles groups the daemon RPCs that manage named profiles. + * @module + */ + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime"; + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import * as $models from "./models.js"; + +export function Add(p: $models.ProfileRef): $CancellablePromise { + return $Call.ByID(701512397, p); +} + +export function GetActive(): $CancellablePromise<$models.ActiveProfile> { + return $Call.ByID(2605259596).then(($result: any) => { + return $$createType0($result); + }); +} + +export function List(username: string): $CancellablePromise<$models.Profile[]> { + return $Call.ByID(1745269178, username).then(($result: any) => { + return $$createType2($result); + }); +} + +export function Remove(p: $models.ProfileRef): $CancellablePromise { + return $Call.ByID(2506403914, p); +} + +export function Switch(p: $models.ProfileRef): $CancellablePromise { + return $Call.ByID(3405248534, p); +} + +/** + * Username returns the OS username the daemon expects for profile lookups. + * The frontend calls this once at boot and reuses the result. + */ +export function Username(): $CancellablePromise { + return $Call.ByID(1939223418); +} + +// Private type creation functions +const $$createType0 = $models.ActiveProfile.createFrom; +const $$createType1 = $models.Profile.createFrom; +const $$createType2 = $Create.Array($$createType1); diff --git a/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/settings.ts b/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/settings.ts new file mode 100644 index 000000000..7dff9029f --- /dev/null +++ b/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/settings.ts @@ -0,0 +1,35 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +/** + * Settings groups the daemon RPCs that read and write the daemon config. + * @module + */ + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime"; + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import * as $models from "./models.js"; + +export function GetConfig(p: $models.ConfigParams): $CancellablePromise<$models.Config> { + return $Call.ByID(2849966711, p).then(($result: any) => { + return $$createType0($result); + }); +} + +export function GetFeatures(): $CancellablePromise<$models.Features> { + return $Call.ByID(376812026).then(($result: any) => { + return $$createType1($result); + }); +} + +export function SetConfig(p: $models.SetConfigParams): $CancellablePromise { + return $Call.ByID(565510651, p); +} + +// Private type creation functions +const $$createType0 = $models.Config.createFrom; +const $$createType1 = $models.Features.createFrom; diff --git a/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/update.ts b/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/update.ts new file mode 100644 index 000000000..2f4a04289 --- /dev/null +++ b/client/ui-wails/frontend/bindings/github.com/netbirdio/netbird/client/ui-wails/services/update.ts @@ -0,0 +1,30 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +/** + * Update groups the RPCs that drive the enforced-update install flow. + * @module + */ + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime"; + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import * as $models from "./models.js"; + +export function GetInstallerResult(): $CancellablePromise<$models.UpdateResult> { + return $Call.ByID(2190725314).then(($result: any) => { + return $$createType0($result); + }); +} + +export function Trigger(): $CancellablePromise<$models.UpdateResult> { + return $Call.ByID(2415339649).then(($result: any) => { + return $$createType0($result); + }); +} + +// Private type creation functions +const $$createType0 = $models.UpdateResult.createFrom; diff --git a/client/ui-wails/frontend/bindings/github.com/wailsapp/wails/v3/internal/eventcreate.ts b/client/ui-wails/frontend/bindings/github.com/wailsapp/wails/v3/internal/eventcreate.ts new file mode 100644 index 000000000..67cad2058 --- /dev/null +++ b/client/ui-wails/frontend/bindings/github.com/wailsapp/wails/v3/internal/eventcreate.ts @@ -0,0 +1,28 @@ +//@ts-check +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import { Create as $Create } from "@wailsio/runtime"; + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import * as services$0 from "../../../../netbirdio/netbird/client/ui-wails/services/models.js"; + +function configure() { + Object.freeze(Object.assign($Create.Events, { + "netbird:event": $$createType0, + "netbird:status": $$createType1, + "netbird:update:available": $$createType2, + "netbird:update:progress": $$createType3, + })); +} + +// Private type creation functions +const $$createType0 = services$0.SystemEvent.createFrom; +const $$createType1 = services$0.Status.createFrom; +const $$createType2 = services$0.UpdateAvailable.createFrom; +const $$createType3 = services$0.UpdateProgress.createFrom; + +configure(); diff --git a/client/ui-wails/frontend/bindings/github.com/wailsapp/wails/v3/internal/eventdata.d.ts b/client/ui-wails/frontend/bindings/github.com/wailsapp/wails/v3/internal/eventdata.d.ts new file mode 100644 index 000000000..063187544 --- /dev/null +++ b/client/ui-wails/frontend/bindings/github.com/wailsapp/wails/v3/internal/eventdata.d.ts @@ -0,0 +1,21 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import type { Events } from "@wailsio/runtime"; + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import type * as services$0 from "../../../../netbirdio/netbird/client/ui-wails/services/models.js"; + +declare module "@wailsio/runtime" { + namespace Events { + interface CustomEvents { + "netbird:event": services$0.SystemEvent; + "netbird:status": services$0.Status; + "netbird:update:available": services$0.UpdateAvailable; + "netbird:update:progress": services$0.UpdateProgress; + } + } +} diff --git a/client/ui-wails/frontend/bindings/github.com/wailsapp/wails/v3/pkg/services/notifications/index.ts b/client/ui-wails/frontend/bindings/github.com/wailsapp/wails/v3/pkg/services/notifications/index.ts new file mode 100644 index 000000000..71eda3bb9 --- /dev/null +++ b/client/ui-wails/frontend/bindings/github.com/wailsapp/wails/v3/pkg/services/notifications/index.ts @@ -0,0 +1,13 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import * as NotificationService from "./notificationservice.js"; +export { + NotificationService +}; + +export { + NotificationAction, + NotificationCategory, + NotificationOptions +} from "./models.js"; diff --git a/client/ui-wails/frontend/bindings/github.com/wailsapp/wails/v3/pkg/services/notifications/models.ts b/client/ui-wails/frontend/bindings/github.com/wailsapp/wails/v3/pkg/services/notifications/models.ts new file mode 100644 index 000000000..3fbcb8270 --- /dev/null +++ b/client/ui-wails/frontend/bindings/github.com/wailsapp/wails/v3/pkg/services/notifications/models.ts @@ -0,0 +1,107 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import { Create as $Create } from "@wailsio/runtime"; + +/** + * NotificationAction represents an action button for a notification. + */ +export class NotificationAction { + "id"?: string; + "title"?: string; + + /** + * (macOS-specific) + */ + "destructive"?: boolean; + + /** Creates a new NotificationAction instance. */ + constructor($$source: Partial = {}) { + + Object.assign(this, $$source); + } + + /** + * Creates a new NotificationAction instance from a string or object. + */ + static createFrom($$source: any = {}): NotificationAction { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new NotificationAction($$parsedSource as Partial); + } +} + +/** + * NotificationCategory groups actions for notifications. + */ +export class NotificationCategory { + "id"?: string; + "actions"?: NotificationAction[]; + "hasReplyField"?: boolean; + "replyPlaceholder"?: string; + "replyButtonTitle"?: string; + + /** Creates a new NotificationCategory instance. */ + constructor($$source: Partial = {}) { + + Object.assign(this, $$source); + } + + /** + * Creates a new NotificationCategory instance from a string or object. + */ + static createFrom($$source: any = {}): NotificationCategory { + const $$createField1_0 = $$createType1; + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + if ("actions" in $$parsedSource) { + $$parsedSource["actions"] = $$createField1_0($$parsedSource["actions"]); + } + return new NotificationCategory($$parsedSource as Partial); + } +} + +/** + * NotificationOptions contains configuration for a notification + */ +export class NotificationOptions { + "id": string; + "title": string; + + /** + * (macOS and Linux only) + */ + "subtitle"?: string; + "body"?: string; + "categoryId"?: string; + "data"?: { [_ in string]?: any }; + + /** Creates a new NotificationOptions instance. */ + constructor($$source: Partial = {}) { + if (!("id" in $$source)) { + this["id"] = ""; + } + if (!("title" in $$source)) { + this["title"] = ""; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new NotificationOptions instance from a string or object. + */ + static createFrom($$source: any = {}): NotificationOptions { + const $$createField5_0 = $$createType2; + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + if ("data" in $$parsedSource) { + $$parsedSource["data"] = $$createField5_0($$parsedSource["data"]); + } + return new NotificationOptions($$parsedSource as Partial); + } +} + +// Private type creation functions +const $$createType0 = NotificationAction.createFrom; +const $$createType1 = $Create.Array($$createType0); +const $$createType2 = $Create.Map($Create.Any, $Create.Any); diff --git a/client/ui-wails/frontend/bindings/github.com/wailsapp/wails/v3/pkg/services/notifications/notificationservice.ts b/client/ui-wails/frontend/bindings/github.com/wailsapp/wails/v3/pkg/services/notifications/notificationservice.ts new file mode 100644 index 000000000..859f3570f --- /dev/null +++ b/client/ui-wails/frontend/bindings/github.com/wailsapp/wails/v3/pkg/services/notifications/notificationservice.ts @@ -0,0 +1,62 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +/** + * Service represents the notifications service + * @module + */ + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime"; + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import * as $models from "./models.js"; + +export function CheckNotificationAuthorization(): $CancellablePromise { + return $Call.ByID(2216952893); +} + +export function RegisterNotificationCategory(category: $models.NotificationCategory): $CancellablePromise { + return $Call.ByID(2917562919, category); +} + +export function RemoveAllDeliveredNotifications(): $CancellablePromise { + return $Call.ByID(3956282340); +} + +export function RemoveAllPendingNotifications(): $CancellablePromise { + return $Call.ByID(108821341); +} + +export function RemoveDeliveredNotification(identifier: string): $CancellablePromise { + return $Call.ByID(975691940, identifier); +} + +export function RemoveNotification(identifier: string): $CancellablePromise { + return $Call.ByID(3966653866, identifier); +} + +export function RemoveNotificationCategory(categoryID: string): $CancellablePromise { + return $Call.ByID(2032615554, categoryID); +} + +export function RemovePendingNotification(identifier: string): $CancellablePromise { + return $Call.ByID(3729049703, identifier); +} + +/** + * Public methods that delegate to the implementation. + */ +export function RequestNotificationAuthorization(): $CancellablePromise { + return $Call.ByID(3933442950); +} + +export function SendNotification(options: $models.NotificationOptions): $CancellablePromise { + return $Call.ByID(3968228732, options); +} + +export function SendNotificationWithActions(options: $models.NotificationOptions): $CancellablePromise { + return $Call.ByID(1886542847, options); +}