Files
api/app/core/modules/services/get-unraid-api.ts
T
2020-12-11 16:30:00 +10:30

25 lines
588 B
TypeScript

/*!
* Copyright 2019-2020 Lime Technology Inc. All rights reserved.
* Written by: Alexis Tyler
*/
import { getNodeService, NodeService } from '../../utils';
import { CoreContext, CoreResult } from '../../types';
const namespace = 'unraid-api';
interface Result extends CoreResult {
json: NodeService
}
/**
* Get Unraid api service info.
*/
export const getUnraidApiService = async(context: CoreContext): Promise<Result> => {
const service = await getNodeService(context.user, namespace);
return {
text: `Service: ${JSON.stringify(service, null, 2)}`,
json: service
};
};