fix: complete marketplace client remediation
This commit is contained in:
@@ -85,6 +85,7 @@ export type PublicPluginInstallation = Readonly<{
|
||||
pluginId: string;
|
||||
releaseId?: string;
|
||||
version?: string;
|
||||
channel?: 'stable' | 'beta';
|
||||
reason?: string;
|
||||
}>;
|
||||
|
||||
@@ -122,6 +123,7 @@ function publicInstallation(snapshot: InstallationSnapshot): PublicPluginInstall
|
||||
pluginId: snapshot.pluginId,
|
||||
...(snapshot.releaseId ? { releaseId: snapshot.releaseId } : {}),
|
||||
...(snapshot.version ? { version: snapshot.version } : {}),
|
||||
...(snapshot.channel ? { channel: snapshot.channel } : {}),
|
||||
...(snapshot.reason ? { reason: snapshot.reason } : {}),
|
||||
};
|
||||
}
|
||||
@@ -134,10 +136,12 @@ async function publicLibrary(
|
||||
try {
|
||||
const record = await packageStore.getInstalled(pluginId);
|
||||
return record ? {
|
||||
status: 'installed' as const,
|
||||
status: record.unavailableReason ? 'unavailable' as const : 'installed' as const,
|
||||
pluginId: record.pluginId,
|
||||
releaseId: record.releaseId,
|
||||
version: record.version,
|
||||
...(record.channel === undefined ? {} : { channel: record.channel }),
|
||||
...(record.unavailableReason ? { reason: record.unavailableReason } : {}),
|
||||
} : null;
|
||||
} catch (error) {
|
||||
const candidate = error && typeof error === 'object' && 'code' in error
|
||||
|
||||
Reference in New Issue
Block a user