Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
import { handleApiResponse, axiosInstance } from 'utils/networkUtils';
import { CATALOGUE_SERVICE } from './constants';
const INGESTION_JOB_BASE_URL = `${CATALOGUE_SERVICE}/ingestionJob`;
const PICKLIST_SERVICE = `${CATALOGUE_SERVICE}/picklist`;
const getIngestionJobs = (params: {
connectionName: String;
page: number;
limit: number;
}) =>
axiosInstance
.get(`${INGESTION_JOB_BASE_URL}`, { params })
.then((res) => handleApiResponse(res))
.catch((err) => handleApiResponse(err));
const getAllIngestionJobs = (params: { page: number; limit: number }) =>
axiosInstance
.get(`${INGESTION_JOB_BASE_URL}/all`, { params })
.then((res) => handleApiResponse(res))
.catch((err) => handleApiResponse(err));
const getIngestionJobById = (ingestionJobId: String, connectionName: String) =>
axiosInstance
.get(`${INGESTION_JOB_BASE_URL}/${ingestionJobId}`, {
params: { connectionName },
})
.then((res) => handleApiResponse(res))
.catch((err) => handleApiResponse(err));
const searchIngestionJobs = (
connectionName: String,
ingestionJobName: String,
) =>
axiosInstance
.get(`${INGESTION_JOB_BASE_URL}/_search`, {
params: { query: ingestionJobName, connectionName },
})
.then((res) => handleApiResponse(res))
.catch((err) => handleApiResponse(err));
const mapUserToIngestionJob = (params: any) =>
axiosInstance
.post(`${INGESTION_JOB_BASE_URL}/map_user`, { subDataset: params })
.then((res) => handleApiResponse(res))
.catch((err) => handleApiResponse(err));
const unmapUserToIngestionJob = (params: any) =>
axiosInstance
.delete(`${INGESTION_JOB_BASE_URL}/delete_mapping`, {
data: { mapUserdata: params },
})
.then((res) => handleApiResponse(res))
.catch((err) => handleApiResponse(err));
const checkMilestones = (
dataSourceId: string | number,
objectId: string | number,
flowType: String,
) =>
axiosInstance
.get(
`${INGESTION_JOB_BASE_URL}/get_milestones/${flowType}/${dataSourceId}/${objectId}`,
)
.then((res) => handleApiResponse(res))
.catch((err) => handleApiResponse(err));
const deleteIngestionJob = (connectionId: String, ingestionJobId: String) =>
axiosInstance
.delete(`${INGESTION_JOB_BASE_URL}/${connectionId}/${ingestionJobId}`)
.then((res) => handleApiResponse(res))
.catch((err) => handleApiResponse(err));
const getPreviewData = (params: { ingestionJobId: Number }) =>
axiosInstance
.get(`${INGESTION_JOB_BASE_URL}/preview_data`, {
params,
})
.then((res) => handleApiResponse(res))
.catch((err) => handleApiResponse(err));
const getObjectField = (params: { ingestionJobId: Number }) =>
axiosInstance
.get(`${INGESTION_JOB_BASE_URL}/object_fields`, {
params,
})
.then((res) => handleApiResponse(res))
.catch((err) => handleApiResponse(err));
const deletePreviewCoulmns = (params: any) =>
axiosInstance
.delete(`${INGESTION_JOB_BASE_URL}/preview_columns/`, { data: params })
.then((res) => handleApiResponse(res))
.catch((err) => handleApiResponse(err));
const saveIngestionJob = (payload: any) =>
axiosInstance
.post(`${INGESTION_JOB_BASE_URL}/save`, { ingestionJob: payload })
.then((response) => handleApiResponse(response))
.catch((error) => handleApiResponse(error));
const downloadSampleTemplate = (objectId: any) =>
axios
.get(`${INGESTION_JOB_BASE_URL}/${objectId}/sampleTemplate.csv`, {
headers: {
'Content-Type': 'application/csv',
},
})
.then((response) => handleApiResponse(response))
.then((blob) => {
const url = window.URL.createObjectURL(new Blob([blob]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', `sampleTemplate.csv`);
document.body.appendChild(link);
link.click();
link?.parentNode?.removeChild(link);
})
.catch((error) => {
if (axios.isCancel(error)) {
return 'canceled';
}
return handleApiResponse(error);
});
const uploadHeaderFile = (formData: any) =>
axios
.post(`${INGESTION_JOB_BASE_URL}/upload`, formData, {
headers: { 'Content-Type': 'multipart/form-data' },
})
.then((response) => handleApiResponse(response))
.catch((error) => handleApiResponse(error));
const getHrcSoColumn = (objectId: any) =>
axios
.get(`${INGESTION_JOB_BASE_URL}/${objectId}/object_columns`)
.then((response) => handleApiResponse(response))
.catch((error) => handleApiResponse(error));
const getPicklistValues = () =>
axios
.get(`${PICKLIST_SERVICE}/input_date_format`)
.then((response) => handleApiResponse(response))
.catch((error) => handleApiResponse(error));
const editUserNotification = (ingestionJobId, userIds) =>
axios
.put(`${INGESTION_JOB_BASE_URL}/edit_user_notification`, {
ingestionJobUserNotification: { ingestionJobId, userIds },
})
.then((response) => handleApiResponse(response))
.catch((error) => handleApiResponse(error));
const editIngestionJobDescription = (ingestionJobId, description) =>
axios
.put(`${INGESTION_JOB_BASE_URL}/update_description`, null, {
params: { ingestionJobId, description },
})
.then((response) => handleApiResponse(response))
.catch((error) => handleApiResponse(error));
const checkDuplicateIngestionJob = (payload: any) =>
axiosInstance
.post(`${INGESTION_JOB_BASE_URL}/check_duplicate`, {
ingestionJob: payload,
})
.then((response) => handleApiResponse(response))
.catch((error) => handleApiResponse(error));
export default {
getIngestionJobs,
getAllIngestionJobs,
getIngestionJobById,
searchIngestionJobs,
mapUserToIngestionJob,
unmapUserToIngestionJob,
checkMilestones,
deleteIngestionJob,
getPreviewData,
getObjectField,
deletePreviewCoulmns,
saveIngestionJob,
downloadSampleTemplate,
uploadHeaderFile,
getHrcSoColumn,
getPicklistValues,
editUserNotification,
editIngestionJobDescription,
checkDuplicateIngestionJob,
};
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team