-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rest-api-client): Support App Action Settings API (#833)
* feat(rest-api-client): implement `getAppActions` and `updateAppActions` * chore(examples/rest-api-client-demo): add demo scripts for App Action Settings - demo scripts for `getAppActions` - demo script for `updateAppActions` * test(rest-api-client): add test for getAppActions * test(rest-api-client): add test for updateAppActions * docs: add getAppActions and updateAppActions * feat: fix action types * refactor: report types * test(data-loader): fix test description Update packages/rest-api-client/src/client/__tests__/AppClient.test.ts Co-authored-by: Shingo Yamazaki <shingoyamazaki00@gmail.com> * refactor(data-loader): inline ActionProps into ActionPropertyForParameter Co-authored-by: nakajmg <nakajima.jmg@gmail.com> Co-authored-by: Shingo Yamazaki <shingoyamazaki00@gmail.com>
- Loading branch information
1 parent
bcfe7ba
commit bca0d98
Showing
7 changed files
with
302 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { Entity } from "../entity"; | ||
import { AppID } from "../index"; | ||
|
||
// --- Types for request --- | ||
|
||
export type AppActionsForParameter = { | ||
[actionName: string]: ActionPropertyForParameter; | ||
}; | ||
|
||
type ActionPropertyForParameter = ( | ||
| { | ||
destApp: DestAppForParameter; | ||
mappings: Mapping[]; | ||
} | ||
| { | ||
mappings?: Mapping[]; | ||
} | ||
) & { | ||
name?: string; | ||
index: string | number; | ||
entities?: Entity[]; | ||
}; | ||
|
||
type DestAppForParameter = | ||
| { | ||
app: AppID; | ||
code?: string; | ||
} | ||
| { app?: AppID; code: string }; | ||
|
||
// --- Types for response --- | ||
|
||
export type AppActionsForResponse = { | ||
[actionName: string]: ActionPropertyForResponse; | ||
}; | ||
|
||
type ActionPropertyForResponse = { | ||
name: string; | ||
id: string; | ||
index: string; | ||
destApp: DestAppForResponse; | ||
mappings: Mapping[]; | ||
entities: Entity[]; | ||
}; | ||
|
||
type DestAppForResponse = { | ||
app: string; | ||
code: string; | ||
}; | ||
|
||
// --- Common types for both request and response --- | ||
|
||
type Mapping = | ||
| { | ||
srcType: "FIELD"; | ||
srcField: string; | ||
destField: string; | ||
} | ||
| { | ||
srcType: "RECORD_URL"; | ||
destField: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters