Update package index on 3rd party URLs change.

Closes #637
Closes #906

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
Akos Kitta
2022-06-29 11:14:56 +02:00
committed by Akos Kitta
parent 1073c3fc7d
commit a36524e02a
43 changed files with 1052 additions and 704 deletions

View File

@@ -1,5 +1,5 @@
import { injectable } from '@theia/core/shared/inversify';
import {
import type {
NotificationServiceServer,
NotificationServiceClient,
AttachedBoardsChangeEvent,
@@ -7,52 +7,79 @@ import {
LibraryPackage,
Config,
Sketch,
ProgressMessage,
} from '../common/protocol';
@injectable()
export class NotificationServiceServerImpl
implements NotificationServiceServer
{
protected readonly clients: NotificationServiceClient[] = [];
private readonly clients: NotificationServiceClient[] = [];
notifyIndexUpdated(): void {
this.clients.forEach((client) => client.notifyIndexUpdated());
notifyIndexWillUpdate(progressId: string): void {
this.clients.forEach((client) => client.notifyIndexWillUpdate(progressId));
}
notifyDaemonStarted(port: string): void {
this.clients.forEach((client) => client.notifyDaemonStarted(port));
notifyIndexUpdateDidProgress(progressMessage: ProgressMessage): void {
this.clients.forEach((client) =>
client.notifyIndexUpdateDidProgress(progressMessage)
);
}
notifyDaemonStopped(): void {
this.clients.forEach((client) => client.notifyDaemonStopped());
notifyIndexDidUpdate(progressId: string): void {
this.clients.forEach((client) => client.notifyIndexDidUpdate(progressId));
}
notifyPlatformInstalled(event: { item: BoardsPackage }): void {
this.clients.forEach((client) => client.notifyPlatformInstalled(event));
notifyIndexUpdateDidFail({
progressId,
message,
}: {
progressId: string;
message: string;
}): void {
this.clients.forEach((client) =>
client.notifyIndexUpdateDidFail({ progressId, message })
);
}
notifyPlatformUninstalled(event: { item: BoardsPackage }): void {
this.clients.forEach((client) => client.notifyPlatformUninstalled(event));
notifyDaemonDidStart(port: string): void {
this.clients.forEach((client) => client.notifyDaemonDidStart(port));
}
notifyLibraryInstalled(event: { item: LibraryPackage }): void {
this.clients.forEach((client) => client.notifyLibraryInstalled(event));
notifyDaemonDidStop(): void {
this.clients.forEach((client) => client.notifyDaemonDidStop());
}
notifyLibraryUninstalled(event: { item: LibraryPackage }): void {
this.clients.forEach((client) => client.notifyLibraryUninstalled(event));
notifyPlatformDidInstall(event: { item: BoardsPackage }): void {
this.clients.forEach((client) => client.notifyPlatformDidInstall(event));
}
notifyAttachedBoardsChanged(event: AttachedBoardsChangeEvent): void {
this.clients.forEach((client) => client.notifyAttachedBoardsChanged(event));
notifyPlatformDidUninstall(event: { item: BoardsPackage }): void {
this.clients.forEach((client) => client.notifyPlatformDidUninstall(event));
}
notifyConfigChanged(event: { config: Config | undefined }): void {
this.clients.forEach((client) => client.notifyConfigChanged(event));
notifyLibraryDidInstall(event: { item: LibraryPackage }): void {
this.clients.forEach((client) => client.notifyLibraryDidInstall(event));
}
notifyRecentSketchesChanged(event: { sketches: Sketch[] }): void {
this.clients.forEach((client) => client.notifyRecentSketchesChanged(event));
notifyLibraryDidUninstall(event: { item: LibraryPackage }): void {
this.clients.forEach((client) => client.notifyLibraryDidUninstall(event));
}
notifyAttachedBoardsDidChange(event: AttachedBoardsChangeEvent): void {
this.clients.forEach((client) =>
client.notifyAttachedBoardsDidChange(event)
);
}
notifyConfigDidChange(event: { config: Config | undefined }): void {
this.clients.forEach((client) => client.notifyConfigDidChange(event));
}
notifyRecentSketchesDidChange(event: { sketches: Sketch[] }): void {
this.clients.forEach((client) =>
client.notifyRecentSketchesDidChange(event)
);
}
setClient(client: NotificationServiceClient): void {