diff --git a/frontend/tests/wails-bindings-test.mjs b/frontend/tests/wails-bindings-test.mjs new file mode 100644 index 0000000..611012c --- /dev/null +++ b/frontend/tests/wails-bindings-test.mjs @@ -0,0 +1,13 @@ +import fs from 'node:fs'; +import path from 'node:path'; + +const bindingsPath = path.resolve('frontend/wailsjs/go/api/App.js'); +const bindings = fs.readFileSync(bindingsPath, 'utf8'); + +for (const method of ['ReplacePluginNotifications', 'ClearPluginNotifications']) { + if (!bindings.includes(`export function ${method}(`)) { + throw new Error(`Wails binding does not export ${method}`); + } +} + +console.log('Wails notification bindings are present'); diff --git a/frontend/wailsjs/go/api/App.d.ts b/frontend/wailsjs/go/api/App.d.ts index a7a790f..f254684 100755 --- a/frontend/wailsjs/go/api/App.d.ts +++ b/frontend/wailsjs/go/api/App.d.ts @@ -1,15 +1,19 @@ // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL // This file is automatically generated. DO NOT EDIT import {workspace} from '../models'; +import {context} from '../models'; import {workbench} from '../models'; import {capability} from '../models'; import {api} from '../models'; import {permissions} from '../models'; import {plugin} from '../models'; import {files} from '../models'; +import {notifications} from '../models'; export function ArchiveWorkspaceNode(arg1:string):Promise; +export function ClearPluginNotifications(arg1:string):Promise; + export function CloseVault():Promise; export function CreateVault(arg1:string):Promise; @@ -24,6 +28,8 @@ export function DeleteVaultTrash(arg1:string,arg2:string):Promise; export function DisablePlugin(arg1:string):Promise; +export function DomReady(arg1:context.Context):Promise; + export function EditWorkbenchResource(arg1:string,arg2:Record):Promise; export function EnablePlugin(arg1:string):Promise; @@ -72,22 +78,22 @@ export function ListVaultFiles(arg1:string,arg2:string):Promise|string>; -export function ListWorkspaces():Promise|string>; - export function ListWorkspaceIdentities():Promise|string>; export function ListWorkspaceTemplates():Promise|string>; +export function ListWorkspaces():Promise|string>; + export function MoveVaultPath(arg1:string,arg2:string,arg3:string,arg4:files.MoveOptions):Promise; export function MoveWorkspaceNode(arg1:string,arg2:string):Promise; +export function OpenExternalURL(arg1:string,arg2:string):Promise; + export function OpenVault(arg1:string):Promise; export function OpenVaultPathExternal(arg1:string,arg2:string):Promise; -export function OpenExternalURL(arg1:string,arg2:string):Promise; - export function OpenWorkbenchResource(arg1:string,arg2:Record):Promise; export function PluginBrowserReceiverPairing(arg1:string):Promise|string>; @@ -124,6 +130,10 @@ export function PluginSyncTestConnection(arg1:string,arg2:string,arg3:string,arg export function PublishPluginEvent(arg1:string,arg2:string,arg3:Record):Promise; +export function PurgeWorkspaceTrash(arg1:string):Promise; + +export function Quit():Promise; + export function ReadPluginDataJSON(arg1:string,arg2:string):Promise>; export function ReadPluginDataNDJSON(arg1:string,arg2:string):Promise>>; @@ -142,9 +152,11 @@ export function ReloadPlugins():Promise; export function RenameWorkspace(arg1:string,arg2:string):Promise; +export function RenameWorkspaceNode(arg1:string,arg2:string):Promise; + export function RepairWorkspaceIdentity(arg1:string,arg2:string):Promise; -export function RenameWorkspaceNode(arg1:string,arg2:string):Promise; +export function ReplacePluginNotifications(arg1:string,arg2:Array):Promise; export function RestoreVaultTrash(arg1:string,arg2:string,arg3:files.RestoreOptions):Promise; @@ -152,8 +164,6 @@ export function RestoreWorkspaceTrash(arg1:string,arg2:string):Promise; -export function PurgeWorkspaceTrash(arg1:string):Promise; - export function SelectVaultForOpen():Promise; export function SetCurrentVault(arg1:string):Promise; @@ -162,8 +172,14 @@ export function SetCurrentWorkspace(arg1:string):Promise; export function SetCurrentWorkspaceNode(arg1:string):Promise; +export function SetNotificationService(arg1:api.notificationService):Promise; + export function ShowVaultPathInFolder(arg1:string,arg2:string):Promise; +export function ShowWindow():Promise; + +export function Shutdown(arg1:context.Context):Promise; + export function SubscribePluginEvent(arg1:string,arg2:string):Promise; export function TrashVaultPath(arg1:string,arg2:string):Promise; diff --git a/frontend/wailsjs/go/api/App.js b/frontend/wailsjs/go/api/App.js index eaa6752..4848e10 100755 --- a/frontend/wailsjs/go/api/App.js +++ b/frontend/wailsjs/go/api/App.js @@ -6,6 +6,10 @@ export function ArchiveWorkspaceNode(arg1) { return window['go']['api']['App']['ArchiveWorkspaceNode'](arg1); } +export function ClearPluginNotifications(arg1) { + return window['go']['api']['App']['ClearPluginNotifications'](arg1); +} + export function CloseVault() { return window['go']['api']['App']['CloseVault'](); } @@ -34,6 +38,10 @@ export function DisablePlugin(arg1) { return window['go']['api']['App']['DisablePlugin'](arg1); } +export function DomReady(arg1) { + return window['go']['api']['App']['DomReady'](arg1); +} + export function EditWorkbenchResource(arg1, arg2) { return window['go']['api']['App']['EditWorkbenchResource'](arg1, arg2); } @@ -130,10 +138,6 @@ export function ListVaultTrash(arg1) { return window['go']['api']['App']['ListVaultTrash'](arg1); } -export function ListWorkspaces() { - return window['go']['api']['App']['ListWorkspaces'](); -} - export function ListWorkspaceIdentities() { return window['go']['api']['App']['ListWorkspaceIdentities'](); } @@ -142,6 +146,10 @@ export function ListWorkspaceTemplates() { return window['go']['api']['App']['ListWorkspaceTemplates'](); } +export function ListWorkspaces() { + return window['go']['api']['App']['ListWorkspaces'](); +} + export function MoveVaultPath(arg1, arg2, arg3, arg4) { return window['go']['api']['App']['MoveVaultPath'](arg1, arg2, arg3, arg4); } @@ -150,6 +158,10 @@ export function MoveWorkspaceNode(arg1, arg2) { return window['go']['api']['App']['MoveWorkspaceNode'](arg1, arg2); } +export function OpenExternalURL(arg1, arg2) { + return window['go']['api']['App']['OpenExternalURL'](arg1, arg2); +} + export function OpenVault(arg1) { return window['go']['api']['App']['OpenVault'](arg1); } @@ -158,10 +170,6 @@ export function OpenVaultPathExternal(arg1, arg2) { return window['go']['api']['App']['OpenVaultPathExternal'](arg1, arg2); } -export function OpenExternalURL(arg1, arg2) { - return window['go']['api']['App']['OpenExternalURL'](arg1, arg2); -} - export function OpenWorkbenchResource(arg1, arg2) { return window['go']['api']['App']['OpenWorkbenchResource'](arg1, arg2); } @@ -234,6 +242,14 @@ export function PublishPluginEvent(arg1, arg2, arg3) { return window['go']['api']['App']['PublishPluginEvent'](arg1, arg2, arg3); } +export function PurgeWorkspaceTrash(arg1) { + return window['go']['api']['App']['PurgeWorkspaceTrash'](arg1); +} + +export function Quit() { + return window['go']['api']['App']['Quit'](); +} + export function ReadPluginDataJSON(arg1, arg2) { return window['go']['api']['App']['ReadPluginDataJSON'](arg1, arg2); } @@ -270,12 +286,16 @@ export function RenameWorkspace(arg1, arg2) { return window['go']['api']['App']['RenameWorkspace'](arg1, arg2); } +export function RenameWorkspaceNode(arg1, arg2) { + return window['go']['api']['App']['RenameWorkspaceNode'](arg1, arg2); +} + export function RepairWorkspaceIdentity(arg1, arg2) { return window['go']['api']['App']['RepairWorkspaceIdentity'](arg1, arg2); } -export function RenameWorkspaceNode(arg1, arg2) { - return window['go']['api']['App']['RenameWorkspaceNode'](arg1, arg2); +export function ReplacePluginNotifications(arg1, arg2) { + return window['go']['api']['App']['ReplacePluginNotifications'](arg1, arg2); } export function RestoreVaultTrash(arg1, arg2, arg3) { @@ -290,10 +310,6 @@ export function SelectDirectory() { return window['go']['api']['App']['SelectDirectory'](); } -export function PurgeWorkspaceTrash(arg1) { - return window['go']['api']['App']['PurgeWorkspaceTrash'](arg1); -} - export function SelectVaultForOpen() { return window['go']['api']['App']['SelectVaultForOpen'](); } @@ -310,10 +326,22 @@ export function SetCurrentWorkspaceNode(arg1) { return window['go']['api']['App']['SetCurrentWorkspaceNode'](arg1); } +export function SetNotificationService(arg1) { + return window['go']['api']['App']['SetNotificationService'](arg1); +} + export function ShowVaultPathInFolder(arg1, arg2) { return window['go']['api']['App']['ShowVaultPathInFolder'](arg1, arg2); } +export function ShowWindow() { + return window['go']['api']['App']['ShowWindow'](); +} + +export function Shutdown(arg1) { + return window['go']['api']['App']['Shutdown'](arg1); +} + export function SubscribePluginEvent(arg1, arg2) { return window['go']['api']['App']['SubscribePluginEvent'](arg1, arg2); } diff --git a/frontend/wailsjs/go/models.ts b/frontend/wailsjs/go/models.ts index aee81c1..09d819e 100755 --- a/frontend/wailsjs/go/models.ts +++ b/frontend/wailsjs/go/models.ts @@ -1,5 +1,5 @@ export namespace api { - + export class FlatContextMenuEntry { pluginId: string; id: string; @@ -8,11 +8,11 @@ export namespace api { group?: string; capability?: string; handler?: string; - + static createFrom(source: any = {}) { return new FlatContextMenuEntry(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.pluginId = source["pluginId"]; @@ -31,11 +31,11 @@ export namespace api { icon?: string; capability?: string; handler?: string; - + static createFrom(source: any = {}) { return new FlatAction(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.pluginId = source["pluginId"]; @@ -52,11 +52,11 @@ export namespace api { title: string; icon?: string; component: string; - + static createFrom(source: any = {}) { return new FlatWorkspaceItem(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.pluginId = source["pluginId"]; @@ -72,11 +72,11 @@ export namespace api { extensions?: string[]; contexts?: string[]; modes?: string[]; - + static createFrom(source: any = {}) { return new FlatOpenProviderSupport(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.kind = source["kind"]; @@ -93,11 +93,11 @@ export namespace api { priority?: number; component: string; supports: FlatOpenProviderSupport[]; - + static createFrom(source: any = {}) { return new FlatOpenProvider(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.pluginId = source["pluginId"]; @@ -107,7 +107,7 @@ export namespace api { this.component = source["component"]; this.supports = this.convertValues(source["supports"], FlatOpenProviderSupport); } - + convertValues(a: any, classs: any, asMap: boolean = false): any { if (!a) { return a; @@ -132,11 +132,11 @@ export namespace api { label: string; position?: string; handler?: string; - + static createFrom(source: any = {}) { return new FlatStatusBarItem(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.pluginId = source["pluginId"]; @@ -153,11 +153,11 @@ export namespace api { icon?: string; view: string; position?: number; - + static createFrom(source: any = {}) { return new FlatSidebarItem(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.pluginId = source["pluginId"]; @@ -174,11 +174,11 @@ export namespace api { title: string; icon?: string; component: string; - + static createFrom(source: any = {}) { return new FlatSettingsPanel(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.pluginId = source["pluginId"]; @@ -193,11 +193,11 @@ export namespace api { id: string; label: string; handler: string; - + static createFrom(source: any = {}) { return new FlatSearchProvider(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.pluginId = source["pluginId"]; @@ -212,11 +212,11 @@ export namespace api { title: string; icon?: string; handler?: string; - + static createFrom(source: any = {}) { return new FlatCommand(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.pluginId = source["pluginId"]; @@ -232,11 +232,11 @@ export namespace api { title: string; icon?: string; component: string; - + static createFrom(source: any = {}) { return new FlatView(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.pluginId = source["pluginId"]; @@ -258,11 +258,11 @@ export namespace api { fileActions: FlatAction[]; noteActions: FlatAction[]; contextMenuEntries: FlatContextMenuEntry[]; - + static createFrom(source: any = {}) { return new ContributionSummary(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.views = this.convertValues(source["views"], FlatView); @@ -277,7 +277,7 @@ export namespace api { this.noteActions = this.convertValues(source["noteActions"], FlatAction); this.contextMenuEntries = this.convertValues(source["contextMenuEntries"], FlatContextMenuEntry); } - + convertValues(a: any, classs: any, asMap: boolean = false): any { if (!a) { return a; @@ -296,17 +296,17 @@ export namespace api { return a; } } - - - - - - - - - - - + + + + + + + + + + + export class SyncStatusDTO { configured: boolean; serverUrl: string; @@ -320,11 +320,11 @@ export namespace api { syncInterval: number; lastError: string; statusLabel: string; - + static createFrom(source: any = {}) { return new SyncStatusDTO(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.configured = source["configured"]; @@ -345,17 +345,17 @@ export namespace api { } export namespace capability { - + export class Entry { name: string; description?: string; pluginId: string; status: string; - + static createFrom(source: any = {}) { return new Entry(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.name = source["name"]; @@ -368,17 +368,17 @@ export namespace capability { } export namespace files { - + export class FileBytes { relativePath: string; size: number; mimeHint: string; dataBase64: string; - + static createFrom(source: any = {}) { return new FileBytes(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.relativePath = source["relativePath"]; @@ -398,11 +398,11 @@ export namespace files { isReserved: boolean; canRead: boolean; canWrite: boolean; - + static createFrom(source: any = {}) { return new FileEntry(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.name = source["name"]; @@ -430,11 +430,11 @@ export namespace files { isReserved: boolean; canRead: boolean; canWrite: boolean; - + static createFrom(source: any = {}) { return new FileMetadata(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.relativePath = source["relativePath"]; @@ -453,11 +453,11 @@ export namespace files { } export class MoveOptions { overwrite: boolean; - + static createFrom(source: any = {}) { return new MoveOptions(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.overwrite = source["overwrite"]; @@ -466,11 +466,11 @@ export namespace files { export class RestoreOptions { targetPath?: string; overwrite: boolean; - + static createFrom(source: any = {}) { return new RestoreOptions(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.targetPath = source["targetPath"]; @@ -485,11 +485,11 @@ export namespace files { originalType: string; basename: string; size: number; - + static createFrom(source: any = {}) { return new TrashEntry(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.originalPath = source["originalPath"]; @@ -507,11 +507,11 @@ export namespace files { trashId: string; deletedAt: string; size: number; - + static createFrom(source: any = {}) { return new TrashResult(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.originalPath = source["originalPath"]; @@ -524,11 +524,11 @@ export namespace files { export class WriteOptions { createIfMissing: boolean; overwrite: boolean; - + static createFrom(source: any = {}) { return new WriteOptions(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.createIfMissing = source["createIfMissing"]; @@ -538,17 +538,40 @@ export namespace files { } +export namespace notifications { + + export class Request { + id: string; + dueAt: string; + title: string; + body?: string; + + static createFrom(source: any = {}) { + return new Request(source); + } + + constructor(source: any = {}) { + if ('string' === typeof source) source = JSON.parse(source); + this.id = source["id"]; + this.dueAt = source["dueAt"]; + this.title = source["title"]; + this.body = source["body"]; + } + } + +} + export namespace permissions { - + export class Entry { name: string; description: string; dangerous: boolean; - + static createFrom(source: any = {}) { return new Entry(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.name = source["name"]; @@ -560,15 +583,15 @@ export namespace permissions { } export namespace plugin { - + export class HealthCheckConfig { type?: string; timeout?: number; - + static createFrom(source: any = {}) { return new HealthCheckConfig(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.type = source["type"]; @@ -579,18 +602,18 @@ export namespace plugin { type: string; entry: Record; healthCheck?: HealthCheckConfig; - + static createFrom(source: any = {}) { return new BackendConfig(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.type = source["type"]; this.entry = source["entry"]; this.healthCheck = this.convertValues(source["healthCheck"], HealthCheckConfig); } - + convertValues(a: any, classs: any, asMap: boolean = false): any { if (!a) { return a; @@ -615,11 +638,11 @@ export namespace plugin { icon?: string; capability?: string; handler?: string; - + static createFrom(source: any = {}) { return new ContributionAction(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; @@ -633,11 +656,11 @@ export namespace plugin { id: string; events?: string[]; handler: string; - + static createFrom(source: any = {}) { return new ContributionActivityProvider(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; @@ -651,11 +674,11 @@ export namespace plugin { keybinding?: string; icon?: string; handler?: string; - + static createFrom(source: any = {}) { return new ContributionCommand(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; @@ -672,11 +695,11 @@ export namespace plugin { group?: string; capability?: string; handler?: string; - + static createFrom(source: any = {}) { return new ContributionContextMenuEntry(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; @@ -693,11 +716,11 @@ export namespace plugin { extensions?: string[]; contexts?: string[]; modes?: string[]; - + static createFrom(source: any = {}) { return new OpenProviderSupport(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.kind = source["kind"]; @@ -713,11 +736,11 @@ export namespace plugin { priority?: number; component: string; supports: OpenProviderSupport[]; - + static createFrom(source: any = {}) { return new ContributionOpenProvider(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; @@ -726,7 +749,7 @@ export namespace plugin { this.component = source["component"]; this.supports = this.convertValues(source["supports"], OpenProviderSupport); } - + convertValues(a: any, classs: any, asMap: boolean = false): any { if (!a) { return a; @@ -749,11 +772,11 @@ export namespace plugin { id: string; label: string; handler: string; - + static createFrom(source: any = {}) { return new ContributionSearchProvider(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; @@ -766,11 +789,11 @@ export namespace plugin { title: string; component: string; icon?: string; - + static createFrom(source: any = {}) { return new ContributionSettingsPanel(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; @@ -785,11 +808,11 @@ export namespace plugin { icon?: string; view: string; position?: number; - + static createFrom(source: any = {}) { return new ContributionSidebarItem(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; @@ -804,11 +827,11 @@ export namespace plugin { label: string; position?: string; handler?: string; - + static createFrom(source: any = {}) { return new ContributionStatusBarItem(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; @@ -822,11 +845,11 @@ export namespace plugin { title: string; icon?: string; component: string; - + static createFrom(source: any = {}) { return new ContributionView(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; @@ -840,11 +863,11 @@ export namespace plugin { title: string; icon?: string; component: string; - + static createFrom(source: any = {}) { return new ContributionWorkspaceItem(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; @@ -866,11 +889,11 @@ export namespace plugin { statusBarItems?: ContributionStatusBarItem[]; openProviders?: ContributionOpenProvider[]; workspaceItems?: ContributionWorkspaceItem[]; - + static createFrom(source: any = {}) { return new Contributions(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.views = this.convertValues(source["views"], ContributionView); @@ -886,7 +909,7 @@ export namespace plugin { this.openProviders = this.convertValues(source["openProviders"], ContributionOpenProvider); this.workspaceItems = this.convertValues(source["workspaceItems"], ContributionWorkspaceItem); } - + convertValues(a: any, classs: any, asMap: boolean = false): any { if (!a) { return a; @@ -908,18 +931,18 @@ export namespace plugin { export class FrontendConfig { entry: string; style?: string; - + static createFrom(source: any = {}) { return new FrontendConfig(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.entry = source["entry"]; this.style = source["style"]; } } - + export class LocalizationConfig { defaultLocale: string; locales: Record; @@ -937,11 +960,11 @@ export namespace plugin { export class SyncConfig { namespaces?: string[]; participate?: boolean; - + static createFrom(source: any = {}) { return new SyncConfig(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.namespaces = source["namespaces"]; @@ -950,11 +973,11 @@ export namespace plugin { } export class MigrationConfig { path?: string; - + static createFrom(source: any = {}) { return new MigrationConfig(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.path = source["path"]; @@ -979,11 +1002,11 @@ export namespace plugin { migrations?: MigrationConfig; contributes?: Contributions; sync?: SyncConfig; - + static createFrom(source: any = {}) { return new Manifest(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.schemaVersion = source["schemaVersion"]; @@ -1005,7 +1028,7 @@ export namespace plugin { this.contributes = this.convertValues(source["contributes"], Contributions); this.sync = this.convertValues(source["sync"], SyncConfig); } - + convertValues(a: any, classs: any, asMap: boolean = false): any { if (!a) { return a; @@ -1024,19 +1047,19 @@ export namespace plugin { return a; } } - - + + export class Plugin { manifest: Manifest; status: string; error?: string; enabled: boolean; rootPath: string; - + static createFrom(source: any = {}) { return new Plugin(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.manifest = this.convertValues(source["manifest"], Manifest); @@ -1045,7 +1068,7 @@ export namespace plugin { this.enabled = source["enabled"]; this.rootPath = source["rootPath"]; } - + convertValues(a: any, classs: any, asMap: boolean = false): any { if (!a) { return a; @@ -1068,18 +1091,18 @@ export namespace plugin { } export namespace workbench { - + export class OpenResourceContext { sourcePluginId?: string; sourceView?: string; isInsideNotesFolder?: boolean; notesScopePath?: string; notesMode?: boolean; - + static createFrom(source: any = {}) { return new OpenResourceContext(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.sourcePluginId = source["sourcePluginId"]; @@ -1096,11 +1119,11 @@ export namespace workbench { mime?: string; extension?: string; context?: OpenResourceContext; - + static createFrom(source: any = {}) { return new OpenResourceRequest(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.kind = source["kind"]; @@ -1110,7 +1133,7 @@ export namespace workbench { this.extension = source["extension"]; this.context = this.convertValues(source["context"], OpenResourceContext); } - + convertValues(a: any, classs: any, asMap: boolean = false): any { if (!a) { return a; @@ -1136,11 +1159,11 @@ export namespace workbench { providerComponent?: string; request: OpenResourceRequest; message?: string; - + static createFrom(source: any = {}) { return new OpenResourceResult(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.status = source["status"]; @@ -1150,7 +1173,7 @@ export namespace workbench { this.request = this.convertValues(source["request"], OpenResourceRequest); this.message = source["message"]; } - + convertValues(a: any, classs: any, asMap: boolean = false): any { if (!a) { return a; @@ -1176,11 +1199,11 @@ export namespace workbench { providerComponent: string; request: OpenResourceRequest; openedAt: string; - + static createFrom(source: any = {}) { return new OpenedResource(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; @@ -1190,7 +1213,7 @@ export namespace workbench { this.request = this.convertValues(source["request"], OpenResourceRequest); this.openedAt = source["openedAt"]; } - + convertValues(a: any, classs: any, asMap: boolean = false): any { if (!a) { return a; @@ -1213,11 +1236,11 @@ export namespace workbench { defaultTextEditorProvider?: string; defaultMarkdownEditorProvider?: string; defaultNotesMarkdownEditorProvider?: string; - + static createFrom(source: any = {}) { return new Preferences(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.defaultTextEditorProvider = source["defaultTextEditorProvider"]; @@ -1230,38 +1253,17 @@ export namespace workbench { export namespace workspace { - export class WorkspaceTemplate { - id: string; - name: string; - description: string; - version: number; - workspaceTools: string[]; - - static createFrom(source: any = {}) { - return new WorkspaceTemplate(source); - } - - constructor(source: any = {}) { - if ('string' === typeof source) source = JSON.parse(source); - this.id = source["id"]; - this.name = source["name"]; - this.description = source["description"]; - this.version = source["version"]; - this.workspaceTools = source["workspaceTools"]; - } - } - export class TemplateSnapshot { templateId: string; templateName: string; templateVersion: number; appliedAt: string; workspaceTools?: string[]; - + static createFrom(source: any = {}) { return new TemplateSnapshot(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.templateId = source["templateId"]; @@ -1279,11 +1281,11 @@ export namespace workspace { folders?: Record; workspaceTools?: string[]; updatedAt?: string; - + static createFrom(source: any = {}) { return new Metadata(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.workspaceId = source["workspaceId"]; @@ -1294,7 +1296,7 @@ export namespace workspace { this.workspaceTools = source["workspaceTools"]; this.updatedAt = source["updatedAt"]; } - + convertValues(a: any, classs: any, asMap: boolean = false): any { if (!a) { return a; @@ -1316,29 +1318,29 @@ export namespace workspace { export class MetadataPatch { features?: Record; folders?: Record; - + static createFrom(source: any = {}) { return new MetadataPatch(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.features = source["features"]; this.folders = source["folders"]; } } - + export class TrashResult { workspaceId: string; originalPath: string; trashPath: string; trashId: string; deletedAt: string; - + static createFrom(source: any = {}) { return new TrashResult(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.workspaceId = source["workspaceId"]; @@ -1352,11 +1354,11 @@ export namespace workspace { id: string; name: string; rootPath: string; - + static createFrom(source: any = {}) { return new Workspace(source); } - + constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; @@ -1364,7 +1366,6 @@ export namespace workspace { this.rootPath = source["rootPath"]; } } - export class WorkspaceIdentity { workspaceId: string; rootPath: string; @@ -1381,5 +1382,25 @@ export namespace workspace { this.state = source["state"]; } } + export class WorkspaceTemplate { + id: string; + name: string; + description: string; + version: number; + workspaceTools: string[]; + + static createFrom(source: any = {}) { + return new WorkspaceTemplate(source); + } + + constructor(source: any = {}) { + if ('string' === typeof source) source = JSON.parse(source); + this.id = source["id"]; + this.name = source["name"]; + this.description = source["description"]; + this.version = source["version"]; + this.workspaceTools = source["workspaceTools"]; + } + } } diff --git a/scripts/test.sh b/scripts/test.sh index 3853a22..8a72ae1 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -39,6 +39,10 @@ OUTPUT=$(cd "$ROOT" && go test -count=1 -v ./... 2>&1) || GO_TEST_STATUS=$? echo "$OUTPUT" | grep -E '(FAIL|PASS|---)' || true report "go test" "$GO_TEST_STATUS" +WAILS_BINDINGS_STATUS=0 +(cd "$ROOT" && node frontend/tests/wails-bindings-test.mjs) || WAILS_BINDINGS_STATUS=$? +report "Wails notification bindings" "$WAILS_BINDINGS_STATUS" + # ── Frontend tests ── echo "[frontend]" if ensure_npm_deps "$ROOT/frontend"; then