cockpitApi: add worker config types

Create a few types to help stick to conventions and tidy up the code.
This commit is contained in:
Gianluca Zuccarelli 2025-04-16 09:16:52 +00:00 committed by Sanne Raymaekers
parent 87647f8854
commit d7945a458a
2 changed files with 16 additions and 8 deletions

View file

@ -1,15 +1,10 @@
import { PayloadAction, createSlice } from '@reduxjs/toolkit';
import type { CloudProviderConfigState } from './cockpit/types';
import type { RootState } from '.';
export type cloudProviderConfigState = {
aws: {
bucket?: string;
credentials?: string;
};
};
export const initialState: cloudProviderConfigState = {
export const initialState: CloudProviderConfigState = {
aws: {},
};

View file

@ -18,3 +18,16 @@ export type Package = {
version: string;
release: string;
};
export type AWSWorkerConfig = {
bucket?: string | undefined;
credentials?: string | undefined;
};
export type WorkerConfigResponse = {
aws?: AWSWorkerConfig;
};
export type CloudProviderConfigState = {
aws: AWSWorkerConfig;
};