From d7945a458a12ed0804596995be45e84baafaedf3 Mon Sep 17 00:00:00 2001 From: Gianluca Zuccarelli Date: Wed, 16 Apr 2025 09:16:52 +0000 Subject: [PATCH] cockpitApi: add worker config types Create a few types to help stick to conventions and tidy up the code. --- src/store/cloudProviderConfigSlice.ts | 11 +++-------- src/store/cockpit/types.ts | 13 +++++++++++++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/store/cloudProviderConfigSlice.ts b/src/store/cloudProviderConfigSlice.ts index 056b52b2..55ab5d66 100644 --- a/src/store/cloudProviderConfigSlice.ts +++ b/src/store/cloudProviderConfigSlice.ts @@ -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: {}, }; diff --git a/src/store/cockpit/types.ts b/src/store/cockpit/types.ts index cfebeb1b..5d7350fc 100644 --- a/src/store/cockpit/types.ts +++ b/src/store/cockpit/types.ts @@ -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; +};