mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
/**
|
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
*/
|
|
import { getInjectable } from "@ogre-tools/injectable";
|
|
import { urlBuilderFor } from "../../../utils/buildUrl";
|
|
import { apiBaseInjectionToken } from "../../api-base";
|
|
|
|
export interface HelmReleaseRevision {
|
|
revision: number;
|
|
updated: string;
|
|
status: string;
|
|
chart: string;
|
|
app_version: string;
|
|
description: string;
|
|
}
|
|
|
|
export type RequestHelmReleaseHistory = (name: string, namespace: string) => Promise<HelmReleaseRevision[]>;
|
|
|
|
const requestHistoryEnpoint = urlBuilderFor("/v2/releases/:namespace/:name/history");
|
|
|
|
const requestHelmReleaseHistoryInjectable = getInjectable({
|
|
id: "request-helm-release-history",
|
|
instantiate: (di): RequestHelmReleaseHistory => {
|
|
const apiBase = di.inject(apiBaseInjectionToken);
|
|
|
|
return (name, namespace) => apiBase.get(requestHistoryEnpoint.compile({ name, namespace }));
|
|
},
|
|
});
|
|
|
|
export default requestHelmReleaseHistoryInjectable;
|