project-booster-vue 9.19.0 → 9.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -2
- package/src/services/api/appointmentQualificationsApi.ts +5 -5
- package/src/services/api/configApi.ts +2 -2
- package/src/services/api/configurationsApi.ts +4 -4
- package/src/services/api/consentApi.ts +2 -2
- package/src/services/api/documentsApi.ts +3 -3
- package/src/services/api/estimatesApi.ts +6 -6
- package/src/services/api/eventsApi.ts +9 -9
- package/src/services/api/inhabitantsApi.ts +2 -2
- package/src/services/api/mediaApi.ts +3 -3
- package/src/services/api/productsApi.ts +6 -6
- package/src/services/api/projectsApi.ts +8 -8
- package/src/services/api/toolsApi.ts +2 -2
- package/src/services/htmlEscape.ts +27 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "project-booster-vue",
|
|
3
|
-
"version": "9.19.
|
|
3
|
+
"version": "9.19.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"core-js": "3.21.1",
|
|
46
46
|
"date-fns": "2.22.1",
|
|
47
47
|
"firebase": "8.6.7",
|
|
48
|
-
"he": "1.2.0",
|
|
49
48
|
"hooper": "nicoinch/hooper#1.0.5",
|
|
50
49
|
"lodash.clonedeep": "4.5.0",
|
|
51
50
|
"lodash.debounce": "4.0.8",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import
|
|
2
|
+
import { escape } from '../../services/htmlEscape';
|
|
3
3
|
|
|
4
4
|
export const clientApi = axios.create({
|
|
5
5
|
baseURL: '/project-booster/api',
|
|
@@ -41,7 +41,7 @@ const saveAnswersByAppointmentQualificationId = async (appointmentQualificationI
|
|
|
41
41
|
|
|
42
42
|
return JSON.parse(
|
|
43
43
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
44
|
-
return `: "${
|
|
44
|
+
return `: "${escape($1)}"`;
|
|
45
45
|
}),
|
|
46
46
|
);
|
|
47
47
|
};
|
|
@@ -53,7 +53,7 @@ const declarationsWithAppointment = async (data: any) => {
|
|
|
53
53
|
|
|
54
54
|
return JSON.parse(
|
|
55
55
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
56
|
-
return `: "${
|
|
56
|
+
return `: "${escape($1)}"`;
|
|
57
57
|
}),
|
|
58
58
|
);
|
|
59
59
|
};
|
|
@@ -65,7 +65,7 @@ const declarationsWithoutAppointment = async (data: any) => {
|
|
|
65
65
|
|
|
66
66
|
return JSON.parse(
|
|
67
67
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
68
|
-
return `: "${
|
|
68
|
+
return `: "${escape($1)}"`;
|
|
69
69
|
}),
|
|
70
70
|
);
|
|
71
71
|
};
|
|
@@ -81,7 +81,7 @@ const linkInhabitantProjectToAppointmentQualification = async (data: any, inhabi
|
|
|
81
81
|
|
|
82
82
|
return JSON.parse(
|
|
83
83
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
84
|
-
return `: "${
|
|
84
|
+
return `: "${escape($1)}"`;
|
|
85
85
|
}),
|
|
86
86
|
);
|
|
87
87
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import
|
|
2
|
+
import { escape } from '../../services/htmlEscape';
|
|
3
3
|
|
|
4
4
|
export const clientApi = axios.create({
|
|
5
5
|
baseURL: '/project-booster/api',
|
|
@@ -23,7 +23,7 @@ const getConfiguration = async () => {
|
|
|
23
23
|
|
|
24
24
|
return JSON.parse(
|
|
25
25
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
26
|
-
return `: "${
|
|
26
|
+
return `: "${escape($1)}"`;
|
|
27
27
|
}),
|
|
28
28
|
);
|
|
29
29
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import
|
|
2
|
+
import { escape } from '../../services/htmlEscape';
|
|
3
3
|
|
|
4
4
|
export const clientApi = axios.create({
|
|
5
5
|
baseURL: '/project-booster/api',
|
|
@@ -39,7 +39,7 @@ const getProjectConfigurationsForProjectType = async (
|
|
|
39
39
|
|
|
40
40
|
return JSON.parse(
|
|
41
41
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
42
|
-
return `: "${
|
|
42
|
+
return `: "${escape($1)}"`;
|
|
43
43
|
}),
|
|
44
44
|
);
|
|
45
45
|
};
|
|
@@ -56,7 +56,7 @@ const getAllProjectConfigurations = async (inhabitantProjectId: string, forceNoP
|
|
|
56
56
|
|
|
57
57
|
return JSON.parse(
|
|
58
58
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
59
|
-
return `: "${
|
|
59
|
+
return `: "${escape($1)}"`;
|
|
60
60
|
}),
|
|
61
61
|
);
|
|
62
62
|
};
|
|
@@ -66,7 +66,7 @@ const linkConfiguration = async (id: string, inhabitantProjectId: string) => {
|
|
|
66
66
|
|
|
67
67
|
return JSON.parse(
|
|
68
68
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
69
|
-
return `: "${
|
|
69
|
+
return `: "${escape($1)}"`;
|
|
70
70
|
}),
|
|
71
71
|
);
|
|
72
72
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import
|
|
2
|
+
import { escape } from '../../services/htmlEscape';
|
|
3
3
|
|
|
4
4
|
export const clientApi = axios.create({
|
|
5
5
|
baseURL: '/project-booster/api',
|
|
@@ -23,7 +23,7 @@ export const getConsents = async () => {
|
|
|
23
23
|
|
|
24
24
|
return JSON.parse(
|
|
25
25
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
26
|
-
return `: "${
|
|
26
|
+
return `: "${escape($1)}"`;
|
|
27
27
|
}),
|
|
28
28
|
);
|
|
29
29
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import
|
|
2
|
+
import { escape } from '../../services/htmlEscape';
|
|
3
3
|
|
|
4
4
|
export const clientApi = axios.create({
|
|
5
5
|
baseURL: '/project-booster/api',
|
|
@@ -53,7 +53,7 @@ const getDocumentsByInhabitantProjectId = async (
|
|
|
53
53
|
|
|
54
54
|
return JSON.parse(
|
|
55
55
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
56
|
-
return `: "${
|
|
56
|
+
return `: "${escape($1)}"`;
|
|
57
57
|
}),
|
|
58
58
|
);
|
|
59
59
|
};
|
|
@@ -63,7 +63,7 @@ const getDocumentById = async (inhabitantProjectId: string, documentId: string)
|
|
|
63
63
|
|
|
64
64
|
return JSON.parse(
|
|
65
65
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
66
|
-
return `: "${
|
|
66
|
+
return `: "${escape($1)}"`;
|
|
67
67
|
}),
|
|
68
68
|
);
|
|
69
69
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import
|
|
2
|
+
import { escape } from '../../services/htmlEscape';
|
|
3
3
|
import { Estimate } from '@/types/pb/Estimate';
|
|
4
4
|
import { ScenarioAnswer } from '@/types/pb/Scenario';
|
|
5
5
|
|
|
@@ -31,7 +31,7 @@ export const getAllEstimates = async (
|
|
|
31
31
|
|
|
32
32
|
return JSON.parse(
|
|
33
33
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
34
|
-
return `: "${
|
|
34
|
+
return `: "${escape($1)}"`;
|
|
35
35
|
}),
|
|
36
36
|
);
|
|
37
37
|
};
|
|
@@ -41,7 +41,7 @@ export const getEstimateById = async (id: string) => {
|
|
|
41
41
|
|
|
42
42
|
return JSON.parse(
|
|
43
43
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
44
|
-
return `: "${
|
|
44
|
+
return `: "${escape($1)}"`;
|
|
45
45
|
}),
|
|
46
46
|
);
|
|
47
47
|
};
|
|
@@ -51,7 +51,7 @@ export const deleteEstimateById = async (id: string) => {
|
|
|
51
51
|
|
|
52
52
|
return JSON.parse(
|
|
53
53
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
54
|
-
return `: "${
|
|
54
|
+
return `: "${escape($1)}"`;
|
|
55
55
|
}),
|
|
56
56
|
);
|
|
57
57
|
};
|
|
@@ -65,7 +65,7 @@ export const saveEstimate = async (estimate: Estimate) => {
|
|
|
65
65
|
|
|
66
66
|
return JSON.parse(
|
|
67
67
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
68
|
-
return `: "${
|
|
68
|
+
return `: "${escape($1)}"`;
|
|
69
69
|
}),
|
|
70
70
|
);
|
|
71
71
|
};
|
|
@@ -80,7 +80,7 @@ export const estimate = async (
|
|
|
80
80
|
|
|
81
81
|
return JSON.parse(
|
|
82
82
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
83
|
-
return `: "${
|
|
83
|
+
return `: "${escape($1)}"`;
|
|
84
84
|
}),
|
|
85
85
|
);
|
|
86
86
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import
|
|
2
|
+
import { escape } from '../../services/htmlEscape';
|
|
3
3
|
|
|
4
4
|
export const clientApi = axios.create({
|
|
5
5
|
baseURL: '/project-booster/api',
|
|
@@ -25,7 +25,7 @@ export const buildEventApi = (target: string) => async (event: any) => {
|
|
|
25
25
|
|
|
26
26
|
return JSON.parse(
|
|
27
27
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
28
|
-
return `: "${
|
|
28
|
+
return `: "${escape($1)}"`;
|
|
29
29
|
}),
|
|
30
30
|
);
|
|
31
31
|
};
|
|
@@ -37,7 +37,7 @@ export const sendAppointmentQualificationEvent = async (event: any) => {
|
|
|
37
37
|
|
|
38
38
|
return JSON.parse(
|
|
39
39
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
40
|
-
return `: "${
|
|
40
|
+
return `: "${escape($1)}"`;
|
|
41
41
|
}),
|
|
42
42
|
);
|
|
43
43
|
};
|
|
@@ -49,7 +49,7 @@ export const sendAppointmentQualificationAnswers = async (event: any) => {
|
|
|
49
49
|
|
|
50
50
|
return JSON.parse(
|
|
51
51
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
52
|
-
return `: "${
|
|
52
|
+
return `: "${escape($1)}"`;
|
|
53
53
|
}),
|
|
54
54
|
);
|
|
55
55
|
};
|
|
@@ -76,7 +76,7 @@ export const sendDocumentsEvent = async (event: {
|
|
|
76
76
|
|
|
77
77
|
return JSON.parse(
|
|
78
78
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
79
|
-
return `: "${
|
|
79
|
+
return `: "${escape($1)}"`;
|
|
80
80
|
}),
|
|
81
81
|
);
|
|
82
82
|
};
|
|
@@ -100,7 +100,7 @@ export const sendMediaEvent = async (event: {
|
|
|
100
100
|
|
|
101
101
|
return JSON.parse(
|
|
102
102
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
103
|
-
return `: "${
|
|
103
|
+
return `: "${escape($1)}"`;
|
|
104
104
|
}),
|
|
105
105
|
);
|
|
106
106
|
};
|
|
@@ -112,7 +112,7 @@ export const sendCardClickEvent = async (event: any) => {
|
|
|
112
112
|
|
|
113
113
|
return JSON.parse(
|
|
114
114
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
115
|
-
return `: "${
|
|
115
|
+
return `: "${escape($1)}"`;
|
|
116
116
|
}),
|
|
117
117
|
);
|
|
118
118
|
};
|
|
@@ -124,7 +124,7 @@ export const sendDeclarationEvent = async (event: any) => {
|
|
|
124
124
|
|
|
125
125
|
return JSON.parse(
|
|
126
126
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
127
|
-
return `: "${
|
|
127
|
+
return `: "${escape($1)}"`;
|
|
128
128
|
}),
|
|
129
129
|
);
|
|
130
130
|
};
|
|
@@ -136,7 +136,7 @@ export const sendSimulationEvent = async (event: any) => {
|
|
|
136
136
|
|
|
137
137
|
return JSON.parse(
|
|
138
138
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
139
|
-
return `: "${
|
|
139
|
+
return `: "${escape($1)}"`;
|
|
140
140
|
}),
|
|
141
141
|
);
|
|
142
142
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import
|
|
2
|
+
import { escape } from '../../services/htmlEscape';
|
|
3
3
|
|
|
4
4
|
export const clientApi = axios.create({
|
|
5
5
|
baseURL: '/project-booster/api',
|
|
@@ -23,7 +23,7 @@ export const getInhabitantById = async (inhabitantId: string, buId = '001') => {
|
|
|
23
23
|
|
|
24
24
|
return JSON.parse(
|
|
25
25
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
26
|
-
return `: "${
|
|
26
|
+
return `: "${escape($1)}"`;
|
|
27
27
|
}),
|
|
28
28
|
);
|
|
29
29
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import
|
|
2
|
+
import { escape } from '../../services/htmlEscape';
|
|
3
3
|
|
|
4
4
|
export const clientApi = axios.create({
|
|
5
5
|
baseURL: '/project-booster/api',
|
|
@@ -23,7 +23,7 @@ const getAllMedia = async (start: number, end: number, inhabitantProjectId: stri
|
|
|
23
23
|
|
|
24
24
|
return JSON.parse(
|
|
25
25
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
26
|
-
return `: "${
|
|
26
|
+
return `: "${escape($1)}"`;
|
|
27
27
|
}),
|
|
28
28
|
);
|
|
29
29
|
};
|
|
@@ -33,7 +33,7 @@ const getMediumById = async (mediumId: string) => {
|
|
|
33
33
|
|
|
34
34
|
return JSON.parse(
|
|
35
35
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
36
|
-
return `: "${
|
|
36
|
+
return `: "${escape($1)}"`;
|
|
37
37
|
}),
|
|
38
38
|
);
|
|
39
39
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import
|
|
2
|
+
import { escape } from '../../services/htmlEscape';
|
|
3
3
|
|
|
4
4
|
export const clientApi = axios.create({
|
|
5
5
|
baseURL: '/project-booster/api',
|
|
@@ -24,7 +24,7 @@ export const getWorkKindsByProjectTypeId = async (projectTypeId: string) => {
|
|
|
24
24
|
|
|
25
25
|
return JSON.parse(
|
|
26
26
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
27
|
-
return `: "${
|
|
27
|
+
return `: "${escape($1)}"`;
|
|
28
28
|
}),
|
|
29
29
|
);
|
|
30
30
|
};
|
|
@@ -34,7 +34,7 @@ export const getProductsByWorkKind = async (workKindId: string, storeId: string)
|
|
|
34
34
|
|
|
35
35
|
return JSON.parse(
|
|
36
36
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
37
|
-
return `: "${
|
|
37
|
+
return `: "${escape($1)}"`;
|
|
38
38
|
}),
|
|
39
39
|
);
|
|
40
40
|
};
|
|
@@ -44,7 +44,7 @@ export const getProductsFeatureFlag = async (projectTypeId: string) => {
|
|
|
44
44
|
|
|
45
45
|
return JSON.parse(
|
|
46
46
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
47
|
-
return `: "${
|
|
47
|
+
return `: "${escape($1)}"`;
|
|
48
48
|
}),
|
|
49
49
|
);
|
|
50
50
|
};
|
|
@@ -56,7 +56,7 @@ export const saveWorkKinds = async (inhabitantProjectId: string, workKinds: any)
|
|
|
56
56
|
|
|
57
57
|
return JSON.parse(
|
|
58
58
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
59
|
-
return `: "${
|
|
59
|
+
return `: "${escape($1)}"`;
|
|
60
60
|
}),
|
|
61
61
|
);
|
|
62
62
|
};
|
|
@@ -66,7 +66,7 @@ export const getWorkKindsByProjectId = async (inhabitantProjectId: string) => {
|
|
|
66
66
|
|
|
67
67
|
return JSON.parse(
|
|
68
68
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
69
|
-
return `: "${
|
|
69
|
+
return `: "${escape($1)}"`;
|
|
70
70
|
}),
|
|
71
71
|
);
|
|
72
72
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import
|
|
2
|
+
import { escape } from '../../services/htmlEscape';
|
|
3
3
|
import { Project, ProjectToSave } from '@/types/pb/Project';
|
|
4
4
|
|
|
5
5
|
export const clientApi = axios.create({
|
|
@@ -26,7 +26,7 @@ export const getAllProjects = async (currentProjectsPage: number, projectsPerPag
|
|
|
26
26
|
|
|
27
27
|
return JSON.parse(
|
|
28
28
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
29
|
-
return `: "${
|
|
29
|
+
return `: "${escape($1)}"`;
|
|
30
30
|
}),
|
|
31
31
|
);
|
|
32
32
|
};
|
|
@@ -42,7 +42,7 @@ export const getAllProjectsForUserId = async (
|
|
|
42
42
|
|
|
43
43
|
return JSON.parse(
|
|
44
44
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
45
|
-
return `: "${
|
|
45
|
+
return `: "${escape($1)}"`;
|
|
46
46
|
}),
|
|
47
47
|
);
|
|
48
48
|
};
|
|
@@ -52,7 +52,7 @@ export const getProjectById = async (id: string) => {
|
|
|
52
52
|
|
|
53
53
|
return JSON.parse(
|
|
54
54
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
55
|
-
return `: "${
|
|
55
|
+
return `: "${escape($1)}"`;
|
|
56
56
|
}),
|
|
57
57
|
);
|
|
58
58
|
};
|
|
@@ -62,7 +62,7 @@ export const deleteProjectById = async (id: string) => {
|
|
|
62
62
|
|
|
63
63
|
return JSON.parse(
|
|
64
64
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
65
|
-
return `: "${
|
|
65
|
+
return `: "${escape($1)}"`;
|
|
66
66
|
}),
|
|
67
67
|
);
|
|
68
68
|
};
|
|
@@ -81,7 +81,7 @@ export const saveProjectDeclaration = async (projectDeclaration: ProjectToSave)
|
|
|
81
81
|
|
|
82
82
|
return JSON.parse(
|
|
83
83
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
84
|
-
return `: "${
|
|
84
|
+
return `: "${escape($1)}"`;
|
|
85
85
|
}),
|
|
86
86
|
);
|
|
87
87
|
};
|
|
@@ -91,7 +91,7 @@ export const getProjectAttributesById = async (id: string) => {
|
|
|
91
91
|
|
|
92
92
|
return JSON.parse(
|
|
93
93
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
94
|
-
return `: "${
|
|
94
|
+
return `: "${escape($1)}"`;
|
|
95
95
|
}),
|
|
96
96
|
);
|
|
97
97
|
};
|
|
@@ -101,7 +101,7 @@ export const getAppointmentById = async (id: string) => {
|
|
|
101
101
|
|
|
102
102
|
return JSON.parse(
|
|
103
103
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
104
|
-
return `: "${
|
|
104
|
+
return `: "${escape($1)}"`;
|
|
105
105
|
}),
|
|
106
106
|
);
|
|
107
107
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import
|
|
2
|
+
import { escape } from '../../services/htmlEscape';
|
|
3
3
|
|
|
4
4
|
export const clientApi = axios.create({});
|
|
5
5
|
|
|
@@ -17,7 +17,7 @@ export const getAllTools = async (projectType: string) => {
|
|
|
17
17
|
|
|
18
18
|
return JSON.parse(
|
|
19
19
|
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
20
|
-
return `: "${
|
|
20
|
+
return `: "${escape($1)}"`;
|
|
21
21
|
}),
|
|
22
22
|
);
|
|
23
23
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Issue with kobi rewriting the lib we extract the part that we need here
|
|
2
|
+
|
|
3
|
+
const regexEscape: RegExp = /["&'<>`]/g;
|
|
4
|
+
|
|
5
|
+
const escapeMap: Record<string, string> = {
|
|
6
|
+
'"': '"',
|
|
7
|
+
'&': '&',
|
|
8
|
+
"'": ''',
|
|
9
|
+
'<': '<',
|
|
10
|
+
// See https://mathiasbynens.be/notes/ambiguous-ampersands: in HTML, the
|
|
11
|
+
// following is not strictly necessary unless it’s part of a tag or an
|
|
12
|
+
// unquoted attribute value. We’re only escaping it to support those
|
|
13
|
+
// situations, and for XML support.
|
|
14
|
+
'>': '>',
|
|
15
|
+
// In Internet Explorer ≤ 8, the backtick character can be used
|
|
16
|
+
// to break out of (un)quoted attribute values or HTML comments.
|
|
17
|
+
// See http://html5sec.org/#102, http://html5sec.org/#108, and
|
|
18
|
+
// http://html5sec.org/#133.
|
|
19
|
+
'`': '`',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const escape = (string: string) => {
|
|
23
|
+
return string.replace(regexEscape, function ($0) {
|
|
24
|
+
// Note: there is no need to check `has(escapeMap, $0)` here.
|
|
25
|
+
return escapeMap[$0];
|
|
26
|
+
});
|
|
27
|
+
};
|