forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelpers.ts
More file actions
138 lines (113 loc) · 4.58 KB
/
helpers.ts
File metadata and controls
138 lines (113 loc) · 4.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import {
CASE_DETAILS_URL,
INTERNAL_CASE_METRICS_DETAILS_URL,
CASE_COMMENTS_URL,
CASE_PUSH_URL,
CASE_CONFIGURE_DETAILS_URL,
CASE_ALERTS_URL,
CASE_COMMENT_DELETE_URL,
INTERNAL_CASE_FIND_USER_ACTIONS_URL,
INTERNAL_GET_CASE_USER_ACTIONS_STATS_URL,
INTERNAL_BULK_GET_ATTACHMENTS_URL,
INTERNAL_CONNECTORS_URL,
INTERNAL_CASE_USERS_URL,
INTERNAL_DELETE_FILE_ATTACHMENTS_URL,
CASE_FIND_ATTACHMENTS_URL,
INTERNAL_PUT_CUSTOM_FIELDS_URL,
INTERNAL_CASE_OBSERVABLES_URL,
INTERNAL_CASE_OBSERVABLES_PATCH_URL,
INTERNAL_CASE_SIMILAR_CASES_URL,
INTERNAL_CASE_OBSERVABLES_DELETE_URL,
INTERNAL_BULK_CREATE_CASE_OBSERVABLES_URL,
CASE_TASKS_URL,
CASE_TASK_DETAILS_URL,
CASE_TASKS_REORDER_URL,
CASE_TASKS_APPLY_TEMPLATE_URL,
} from '../constants';
export const getCaseDetailsUrl = (id: string): string => {
return CASE_DETAILS_URL.replace('{case_id}', id);
};
export const getCaseDetailsMetricsUrl = (id: string): string => {
return INTERNAL_CASE_METRICS_DETAILS_URL.replace('{case_id}', id);
};
export const getCaseCommentsUrl = (id: string): string => {
return CASE_COMMENTS_URL.replace('{case_id}', id);
};
export const getCaseFindAttachmentsUrl = (caseId: string): string => {
return CASE_FIND_ATTACHMENTS_URL.replace('{case_id}', caseId);
};
export const getCaseCommentDeleteUrl = (caseId: string, commentId: string): string => {
return CASE_COMMENT_DELETE_URL.replace('{case_id}', caseId).replace('{comment_id}', commentId);
};
export const getCaseUserActionStatsUrl = (id: string): string => {
return INTERNAL_GET_CASE_USER_ACTIONS_STATS_URL.replace('{case_id}', id);
};
export const getCaseFindUserActionsUrl = (id: string): string => {
return INTERNAL_CASE_FIND_USER_ACTIONS_URL.replace('{case_id}', id);
};
export const getCasePushUrl = (caseId: string, connectorId: string): string => {
return CASE_PUSH_URL.replace('{case_id}', caseId).replace('{connector_id}', connectorId);
};
export const getCaseConfigurationDetailsUrl = (configureID: string): string => {
return CASE_CONFIGURE_DETAILS_URL.replace('{configuration_id}', configureID);
};
export const getCasesFromAlertsUrl = (alertId: string): string => {
return CASE_ALERTS_URL.replace('{alert_id}', alertId);
};
export const getCaseBulkGetAttachmentsUrl = (id: string): string => {
return INTERNAL_BULK_GET_ATTACHMENTS_URL.replace('{case_id}', id);
};
export const getCaseConnectorsUrl = (id: string): string => {
return INTERNAL_CONNECTORS_URL.replace('{case_id}', id);
};
export const getCaseUsersUrl = (id: string): string => {
return INTERNAL_CASE_USERS_URL.replace('{case_id}', id);
};
export const getCasesDeleteFileAttachmentsUrl = (id: string): string => {
return INTERNAL_DELETE_FILE_ATTACHMENTS_URL.replace('{case_id}', id);
};
export const getCustomFieldReplaceUrl = (caseId: string, customFieldId: string): string => {
return INTERNAL_PUT_CUSTOM_FIELDS_URL.replace('{case_id}', caseId).replace(
'{custom_field_id}',
customFieldId
);
};
export const getCaseCreateObservableUrl = (id: string): string => {
return INTERNAL_CASE_OBSERVABLES_URL.replace('{case_id}', id);
};
export const getCaseUpdateObservableUrl = (id: string, observableId: string): string => {
return INTERNAL_CASE_OBSERVABLES_PATCH_URL.replace('{case_id}', id).replace(
'{observable_id}',
observableId
);
};
export const getCaseDeleteObservableUrl = (id: string, observableId: string): string => {
return INTERNAL_CASE_OBSERVABLES_DELETE_URL.replace('{case_id}', id).replace(
'{observable_id}',
observableId
);
};
export const getBulkCreateObservablesUrl = (id: string): string => {
return INTERNAL_BULK_CREATE_CASE_OBSERVABLES_URL.replace('{case_id}', id);
};
export const getCaseSimilarCasesUrl = (caseId: string) => {
return INTERNAL_CASE_SIMILAR_CASES_URL.replace('{case_id}', caseId);
};
export const getCaseTasksUrl = (caseId: string): string => {
return CASE_TASKS_URL.replace('{case_id}', caseId);
};
export const getCaseTaskDetailsUrl = (caseId: string, taskId: string): string => {
return CASE_TASK_DETAILS_URL.replace('{case_id}', caseId).replace('{task_id}', taskId);
};
export const getCaseTasksReorderUrl = (caseId: string): string => {
return CASE_TASKS_REORDER_URL.replace('{case_id}', caseId);
};
export const getCaseTasksApplyTemplateUrl = (caseId: string): string => {
return CASE_TASKS_APPLY_TEMPLATE_URL.replace('{case_id}', caseId);
};