2021-01-12 04:17:28 +00:00
|
|
|
import { ApiActionConfig } from "entities/Action";
|
2020-06-04 13:49:22 +00:00
|
|
|
import { DEFAULT_ACTION_TIMEOUT } from "constants/ApiConstants";
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
import { zipObject } from "lodash";
|
2020-01-24 09:54:40 +00:00
|
|
|
|
2020-02-18 18:13:19 +00:00
|
|
|
export const HTTP_METHODS = ["GET", "POST", "PUT", "DELETE", "PATCH"];
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
const HTTP_METHOD_COLORS = [
|
|
|
|
|
"#457AE6",
|
|
|
|
|
"#EABB0C",
|
|
|
|
|
"#5BB749",
|
|
|
|
|
"#E22C2C",
|
|
|
|
|
"#6D6D6D",
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export const HTTP_METHOD_COLOR_MAP = zipObject(
|
|
|
|
|
HTTP_METHODS,
|
|
|
|
|
HTTP_METHOD_COLORS,
|
|
|
|
|
);
|
2019-10-21 15:12:45 +00:00
|
|
|
|
2020-12-24 04:32:25 +00:00
|
|
|
export const HTTP_METHOD_OPTIONS = HTTP_METHODS.map((method) => ({
|
2019-10-21 15:12:45 +00:00
|
|
|
value: method,
|
|
|
|
|
}));
|
|
|
|
|
|
2020-04-14 12:34:14 +00:00
|
|
|
export const REST_PLUGIN_PACKAGE_NAME = "restapi-plugin";
|
2020-04-28 06:52:53 +00:00
|
|
|
|
2021-01-12 04:17:28 +00:00
|
|
|
export const DEFAULT_API_ACTION_CONFIG: ApiActionConfig = {
|
|
|
|
|
timeoutInMillisecond: DEFAULT_ACTION_TIMEOUT,
|
2021-02-16 15:01:35 +00:00
|
|
|
encodeParamsToggle: true,
|
2021-01-12 04:17:28 +00:00
|
|
|
httpMethod: HTTP_METHODS[0],
|
|
|
|
|
headers: [
|
|
|
|
|
{ key: "", value: "" },
|
|
|
|
|
{ key: "", value: "" },
|
|
|
|
|
],
|
|
|
|
|
queryParameters: [
|
|
|
|
|
{ key: "", value: "" },
|
|
|
|
|
{ key: "", value: "" },
|
|
|
|
|
],
|
2020-01-24 09:54:40 +00:00
|
|
|
};
|
2020-04-14 12:34:14 +00:00
|
|
|
|
2020-07-03 08:58:58 +00:00
|
|
|
export const PLUGIN_TYPE_API = "API";
|
2020-04-14 12:34:14 +00:00
|
|
|
export const DEFAULT_PROVIDER_OPTION = "Business Software";
|
2020-05-13 18:20:53 +00:00
|
|
|
export const CONTENT_TYPE = "content-type";
|
2020-06-08 11:09:13 +00:00
|
|
|
|
|
|
|
|
export const POST_BODY_FORMAT_OPTIONS = [
|
|
|
|
|
{ label: "json", value: "application/json" },
|
|
|
|
|
{
|
|
|
|
|
label: "x-www-form-urlencoded",
|
|
|
|
|
value: "application/x-www-form-urlencoded",
|
|
|
|
|
},
|
|
|
|
|
{ label: "form-data", value: "multipart/form-data" },
|
|
|
|
|
{ label: "raw", value: "raw" },
|
2020-05-07 07:56:37 +00:00
|
|
|
];
|
2020-04-14 12:34:14 +00:00
|
|
|
|
2020-06-08 11:09:13 +00:00
|
|
|
export const POST_BODY_FORMAT_OPTIONS_NO_MULTI_PART = POST_BODY_FORMAT_OPTIONS.filter(
|
2020-12-24 04:32:25 +00:00
|
|
|
(option) => {
|
2020-06-08 11:09:13 +00:00
|
|
|
return option.value !== "multipart/form-data";
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
2020-12-24 04:32:25 +00:00
|
|
|
export const POST_BODY_FORMATS = POST_BODY_FORMAT_OPTIONS.map((option) => {
|
2020-06-08 11:09:13 +00:00
|
|
|
return option.value;
|
|
|
|
|
});
|
2021-02-11 12:54:00 +00:00
|
|
|
|
|
|
|
|
export const POST_BODY_FORMAT_TITLES_NO_MULTI_PART = POST_BODY_FORMAT_OPTIONS_NO_MULTI_PART.map(
|
|
|
|
|
(option) => {
|
|
|
|
|
return { title: option.label, key: option.value };
|
|
|
|
|
},
|
|
|
|
|
);
|