Skip to content

Commit d7a0449

Browse files
committed
feat(rest-api-client): Lang type split into AppLang and PluginLocale
1 parent 51e8539 commit d7a0449

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

packages/rest-api-client/src/client/AppClient.ts

+12-11
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {
33
RecordID,
44
Revision,
55
Properties,
6-
Lang,
6+
AppLang,
77
Layout,
88
ViewForResponse,
99
ViewForParameter,
@@ -33,6 +33,7 @@ import type {
3333
ReportForResponse,
3434
AppActionsForParameter,
3535
AppActionsForResponse,
36+
PluginLocale,
3637
} from "./types";
3738
import { BaseClient } from "./BaseClient";
3839
import type { AppPlugin } from "./types/app/plugin";
@@ -69,7 +70,7 @@ type SpaceResponseParameters = {
6970
export class AppClient extends BaseClient {
7071
public getFormFields<T extends Properties>(params: {
7172
app: AppID;
72-
lang?: Lang;
73+
lang?: AppLang;
7374
preview?: boolean;
7475
}): Promise<{ properties: T; revision: string }> {
7576
const { preview, ...rest } = params;
@@ -142,7 +143,7 @@ export class AppClient extends BaseClient {
142143

143144
public getViews(params: {
144145
app: AppID;
145-
lang?: Lang;
146+
lang?: AppLang;
146147
preview?: boolean;
147148
}): Promise<{
148149
views: { [viewName: string]: ViewForResponse };
@@ -222,7 +223,7 @@ export class AppClient extends BaseClient {
222223

223224
public getAppSettings(params: {
224225
app: AppID;
225-
lang?: Lang;
226+
lang?: AppLang;
226227
preview?: boolean;
227228
}): Promise<{
228229
name: string;
@@ -293,7 +294,7 @@ export class AppClient extends BaseClient {
293294

294295
public getProcessManagement(params: {
295296
app: AppID;
296-
lang?: Lang;
297+
lang?: AppLang;
297298
preview?: boolean;
298299
}): Promise<{
299300
enable: boolean;
@@ -414,7 +415,7 @@ export class AppClient extends BaseClient {
414415

415416
public getRecordAcl(params: {
416417
app: AppID;
417-
lang?: Lang;
418+
lang?: AppLang;
418419
preview?: boolean;
419420
}): Promise<{ rights: RecordRightForResponse[]; revision: string }> {
420421
const { preview, ...rest } = params;
@@ -500,7 +501,7 @@ export class AppClient extends BaseClient {
500501

501502
public getPerRecordNotifications(params: {
502503
app: AppID;
503-
lang?: Lang;
504+
lang?: AppLang;
504505
preview?: boolean;
505506
}): Promise<{
506507
notifications: PerRecordNotificationForResponse[];
@@ -528,7 +529,7 @@ export class AppClient extends BaseClient {
528529

529530
public getReminderNotifications(params: {
530531
app: AppID;
531-
lang?: Lang;
532+
lang?: AppLang;
532533
preview?: boolean;
533534
}): Promise<{
534535
notifications: ReminderNotificationForResponse[];
@@ -558,7 +559,7 @@ export class AppClient extends BaseClient {
558559

559560
public getReports(params: {
560561
app: AppID;
561-
lang?: Lang;
562+
lang?: AppLang;
562563
preview?: boolean;
563564
}): Promise<{
564565
reports: { [reportName: string]: ReportForResponse };
@@ -589,7 +590,7 @@ export class AppClient extends BaseClient {
589590

590591
public getAppActions(params: {
591592
app: AppID;
592-
lang?: Lang;
593+
lang?: AppLang;
593594
preview?: boolean;
594595
}): Promise<{
595596
actions: AppActionsForResponse;
@@ -620,7 +621,7 @@ export class AppClient extends BaseClient {
620621

621622
public getPlugins(params: {
622623
app: AppID;
623-
lang?: Exclude<Lang, "default" | "user">;
624+
lang?: PluginLocale;
624625
preview?: boolean;
625626
}): Promise<{
626627
plugins: AppPlugin[];

packages/rest-api-client/src/client/types/app/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
export type Lang = "ja" | "en" | "zh" | "user" | "default";
1+
type Lang = "ja" | "en" | "zh";
2+
export type AppLang = Lang | "default" | "user";
3+
export type PluginLocale = Lang;
24
export type DeployStatus = "PROCESSING" | "SUCCESS" | "FAIL" | "CANCEL";
35

46
export type App = {

0 commit comments

Comments
 (0)