fix ts problem
This commit is contained in:
@@ -16,7 +16,7 @@ import {
|
||||
saveDownload,
|
||||
saveBackup,
|
||||
} from "./storage";
|
||||
import { KintoneClient, createKintoneClient } from "./kintone-api";
|
||||
import { SelfKintoneClient, createKintoneClient } from "./kintone-api";
|
||||
import type { Result } from "@shared/types/ipc";
|
||||
import type {
|
||||
CreateDomainParams,
|
||||
@@ -41,12 +41,12 @@ import type {
|
||||
} from "@shared/types/version";
|
||||
|
||||
// Cache for Kintone clients
|
||||
const clientCache = new Map<string, KintoneClient>();
|
||||
const clientCache = new Map<string, SelfKintoneClient>();
|
||||
|
||||
/**
|
||||
* Get or create a Kintone client for a domain
|
||||
*/
|
||||
async function getClient(domainId: string): Promise<KintoneClient> {
|
||||
async function getClient(domainId: string): Promise<SelfKintoneClient> {
|
||||
if (clientCache.has(domainId)) {
|
||||
return clientCache.get(domainId)!;
|
||||
}
|
||||
@@ -243,7 +243,7 @@ function registerTestDomainConnection(): void {
|
||||
function registerGetSpaces(): void {
|
||||
handleWithParams<
|
||||
GetSpacesParams,
|
||||
Awaited<ReturnType<KintoneClient["getSpaces"]>>
|
||||
Awaited<ReturnType<SelfKintoneClient["getSpaces"]>>
|
||||
>("getSpaces", async (params) => {
|
||||
const client = await getClient(params.domainId);
|
||||
return client.getSpaces();
|
||||
@@ -256,7 +256,7 @@ function registerGetSpaces(): void {
|
||||
function registerGetApps(): void {
|
||||
handleWithParams<
|
||||
GetAppsParams,
|
||||
Awaited<ReturnType<KintoneClient["getApps"]>>
|
||||
Awaited<ReturnType<SelfKintoneClient["getApps"]>>
|
||||
>("getApps", async (params) => {
|
||||
const client = await getClient(params.domainId);
|
||||
return client.getApps(params.spaceId);
|
||||
@@ -269,7 +269,7 @@ function registerGetApps(): void {
|
||||
function registerGetAppDetail(): void {
|
||||
handleWithParams<
|
||||
GetAppDetailParams,
|
||||
Awaited<ReturnType<KintoneClient["getAppDetail"]>>
|
||||
Awaited<ReturnType<SelfKintoneClient["getAppDetail"]>>
|
||||
>("getAppDetail", async (params) => {
|
||||
const client = await getClient(params.domainId);
|
||||
return client.getAppDetail(params.appId);
|
||||
@@ -282,7 +282,7 @@ function registerGetAppDetail(): void {
|
||||
function registerGetFileContent(): void {
|
||||
handleWithParams<
|
||||
GetFileContentParams,
|
||||
Awaited<ReturnType<KintoneClient["getFileContent"]>>
|
||||
Awaited<ReturnType<SelfKintoneClient["getFileContent"]>>
|
||||
>("getFileContent", async (params) => {
|
||||
const client = await getClient(params.domainId);
|
||||
return client.getFileContent(params.fileKey);
|
||||
|
||||
Reference in New Issue
Block a user