2019-09-18 10:48:56 +00:00
|
|
|
export type APIResponseError = {
|
2023-02-18 12:55:46 +00:00
|
|
|
code: string | number;
|
2019-09-18 10:48:56 +00:00
|
|
|
message: string;
|
|
|
|
|
};
|
2019-03-26 15:28:24 +00:00
|
|
|
|
2019-09-18 10:48:56 +00:00
|
|
|
export type ResponseMeta = {
|
|
|
|
|
status: number;
|
|
|
|
|
success: boolean;
|
|
|
|
|
error?: APIResponseError;
|
|
|
|
|
};
|
2019-03-26 15:28:24 +00:00
|
|
|
|
2022-06-21 13:57:34 +00:00
|
|
|
export type ApiResponse<T = unknown> = {
|
2019-09-09 09:08:54 +00:00
|
|
|
responseMeta: ResponseMeta;
|
2022-03-25 10:43:26 +00:00
|
|
|
data: T;
|
2021-10-14 13:08:24 +00:00
|
|
|
code?: string;
|
2019-09-18 10:48:56 +00:00
|
|
|
};
|
|
|
|
|
|
2019-11-07 09:32:38 +00:00
|
|
|
// NO_DATASOURCES_FOUND, 1000, "Unable to find {0} with id {1}"
|
2019-09-18 10:48:56 +00:00
|
|
|
// INVALID_PARAMTER, 4000, "Invalid parameter {0} provided in the input"
|
|
|
|
|
// PLUGIN_NOT_INSTALLED, 4001, "Plugin {0} not installed"
|
|
|
|
|
// MISSING_PLUGIN_ID, 4002, "Missing plugin id. Please input correct plugin id"
|
2019-11-07 09:32:38 +00:00
|
|
|
// MISSING_DATASOURCES_ID, 4003, "Missing datasource id. Please input correct datasource id"
|
2019-09-18 10:48:56 +00:00
|
|
|
// MISSING_PAGE_ID, 4004, "Missing page id. Pleaes input correct page id"
|
2022-06-15 15:37:41 +00:00
|
|
|
// PAGE_DOES_NOT_EXIST_IN_WORKSPACE, 4006, "Page {0} does not belong to the current user {1} workspace."
|
2019-09-18 10:48:56 +00:00
|
|
|
// UNAUTHORIZED_DOMAIN, 4001, "Invalid email domain provided. Please sign in with a valid work email ID"
|
|
|
|
|
// INTERNAL_SERVER_ERROR, 5000, "Internal server error while processing request"
|
|
|
|
|
// REPOSITORY_SAVE_FAILED, 5001, "Repository save failed."
|