АРХ - МЕЖПРОЕКТНАЯ КОММУНИКАЦИЯ: каркас Voice Tasker settings

This commit is contained in:
DCCONSTRUCTIONS
2026-04-24 16:47:16 +03:00
parent b3c6b37399
commit 237c7964cd
20 changed files with 2009 additions and 3 deletions
@@ -0,0 +1,46 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import { API_BASE_URL } from "@plane/constants";
import type {
TWorkspaceAIConnectionTestResult,
TWorkspaceAISettings,
TWorkspaceAISettingsPayload,
} from "@plane/types";
import { APIService } from "@/services/api.service";
export class WorkspaceAIService extends APIService {
constructor() {
super(API_BASE_URL);
}
async retrieveSettings(workspaceSlug: string): Promise<TWorkspaceAISettings> {
return this.get(`/api/workspaces/${workspaceSlug}/voice-tasker/settings/`)
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
});
}
async updateSettings(
workspaceSlug: string,
data: TWorkspaceAISettingsPayload
): Promise<TWorkspaceAISettings> {
return this.patch(`/api/workspaces/${workspaceSlug}/voice-tasker/settings/`, data)
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
});
}
async testConnection(workspaceSlug: string): Promise<TWorkspaceAIConnectionTestResult> {
return this.post(`/api/workspaces/${workspaceSlug}/voice-tasker/settings/test-connection/`)
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
});
}
}