fix api reports
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
This commit is contained in:
committed by
Fredrik Adelöw
parent
99ecdbaf95
commit
3bdbba8c00
@@ -122,7 +122,11 @@ function createInstanceMetadataServiceFactory(
|
||||
modules: [],
|
||||
};
|
||||
}
|
||||
installedPlugins[feature.pluginId].modules.push({
|
||||
(
|
||||
installedPlugins[feature.pluginId].modules as Array<{
|
||||
moduleId: string;
|
||||
}>
|
||||
).push({
|
||||
moduleId: feature.moduleId,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -424,17 +424,19 @@ export interface HttpRouterServiceAuthPolicy {
|
||||
// @public (undocumented)
|
||||
export interface InstanceMetadataService {
|
||||
// (undocumented)
|
||||
getInstalledPlugins: () => readonly InstanceMetadataServicePluginInfo[];
|
||||
getInstalledPlugins: () => Promise<
|
||||
ReadonlyArray<InstanceMetadataServicePluginInfo>
|
||||
>;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface InstanceMetadataServicePluginInfo {
|
||||
// (undocumented)
|
||||
modules: {
|
||||
readonly modules: ReadonlyArray<{
|
||||
moduleId: string;
|
||||
}[];
|
||||
}>;
|
||||
// (undocumented)
|
||||
pluginId: string;
|
||||
readonly pluginId: string;
|
||||
}
|
||||
|
||||
export { isChildPath };
|
||||
|
||||
@@ -16,20 +16,15 @@
|
||||
|
||||
/** @public */
|
||||
export interface InstanceMetadataServicePluginInfo {
|
||||
pluginId: string;
|
||||
modules: {
|
||||
readonly pluginId: string;
|
||||
readonly modules: ReadonlyArray<{
|
||||
moduleId: string;
|
||||
}[];
|
||||
}>;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export type DeepReadonly<T> = {
|
||||
readonly [K in keyof T]: T[K] extends object ? DeepReadonly<T[K]> : T[K];
|
||||
};
|
||||
|
||||
/** @public */
|
||||
export interface InstanceMetadataService {
|
||||
getInstalledPlugins: () => Promise<
|
||||
ReadonlyArray<DeepReadonly<InstanceMetadataServicePluginInfo>>
|
||||
ReadonlyArray<InstanceMetadataServicePluginInfo>
|
||||
>;
|
||||
}
|
||||
|
||||
@@ -560,7 +560,7 @@ export namespace mockServices {
|
||||
|
||||
export function instanceMetadata(): InstanceMetadataService {
|
||||
return {
|
||||
getInstalledPlugins: () => [],
|
||||
getInstalledPlugins: () => Promise.resolve([]),
|
||||
};
|
||||
}
|
||||
export namespace instanceMetadata {
|
||||
|
||||
@@ -28,9 +28,9 @@ export default createBackendPlugin({
|
||||
logger: coreServices.logger,
|
||||
},
|
||||
async init({ instanceMetadata, logger }) {
|
||||
const plugins = await instanceMetadata.getInstalledPlugins();
|
||||
logger.info(
|
||||
`Installed plugins on this instance: ${instanceMetadata
|
||||
.getInstalledPlugins()
|
||||
`Installed plugins on this instance: ${plugins
|
||||
.map(e => e.pluginId)
|
||||
.join(', ')}`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user