sr-npm 1.0.11 → 1.0.13
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/.prettierrc +16 -0
- package/backend/collectionConsts.js +76 -0
- package/backend/consts.js +55 -110
- package/backend/data.js +354 -264
- package/backend/fetchPositionsFromSRAPI.js +47 -40
- package/backend/index.js +5 -4
- package/backend/queries.js +15 -14
- package/backend/secretsData.js +14 -0
- package/backend/utils.js +81 -4
- package/index.js +4 -5
- package/package.json +14 -3
- package/pages/careersPage.js +457 -0
- package/pages/homePage.js +136 -0
- package/pages/index.js +6 -0
- package/pages/positionPage.js +34 -0
- package/public/filterUtils.js +39 -0
- package/public/index.js +6 -0
- package/public/mapUtils.js +16 -0
- package/public/utils.js +45 -0
- package/tests/fetchPositionsFromSRApiTest.spec.js +35 -0
- package/tests/testsUtils.js +7 -0
- package/.wix/debug.log +0 -111
package/public/utils.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
function htmlToText(html) {
|
|
3
|
+
if (!html) return '';
|
|
4
|
+
|
|
5
|
+
// Remove HTML tags and decode entities
|
|
6
|
+
let text = html
|
|
7
|
+
.replace(/<br\s*\/?>/gi, '\n')
|
|
8
|
+
.replace(/<\/?(p|div|h[1-6])\s*\/?>/gi, '\n')
|
|
9
|
+
.replace(/<li[^>]*>/gi, '• ')
|
|
10
|
+
.replace(/<\/li>/gi, '\n')
|
|
11
|
+
.replace(/<[^>]*>/g, '')
|
|
12
|
+
.replace(/&/g, '&')
|
|
13
|
+
.replace(/</g, '<')
|
|
14
|
+
.replace(/>/g, '>')
|
|
15
|
+
.replace(/"/g, '"')
|
|
16
|
+
.replace(/'/g, "'")
|
|
17
|
+
.replace(/ /g, ' ');
|
|
18
|
+
|
|
19
|
+
// Clean up whitespace
|
|
20
|
+
return text.replace(/\n\s*\n+/g, '\n\n').replace(/[ \t]+\n/g, '\n').trim();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
function filterBrokenMarkers(items) {
|
|
26
|
+
return items
|
|
27
|
+
.filter(item => {
|
|
28
|
+
const locationAddress = item.locationAddress;
|
|
29
|
+
const location = locationAddress && locationAddress.location;
|
|
30
|
+
return (
|
|
31
|
+
location !== undefined &&
|
|
32
|
+
location !== null &&
|
|
33
|
+
location.latitude !== undefined &&
|
|
34
|
+
location.latitude !== null &&
|
|
35
|
+
location.longitude !== undefined &&
|
|
36
|
+
location.longitude !== null
|
|
37
|
+
);
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
module.exports = {
|
|
43
|
+
htmlToText,
|
|
44
|
+
filterBrokenMarkers
|
|
45
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const { executeApiRequest } = require('tests-utils');
|
|
2
|
+
const { getRandomPosition } = require('./testsUtils');
|
|
3
|
+
|
|
4
|
+
describe('Job details fetch from SR API Tests', () => {
|
|
5
|
+
|
|
6
|
+
let positions;
|
|
7
|
+
beforeAll(async () => {
|
|
8
|
+
const requestBody = `fetchPositionsFromSRAPI();`;
|
|
9
|
+
positions = await executeApiRequest(requestBody);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test('should successfully fetch job details from SR API', async () => {
|
|
13
|
+
const randomPosition = getRandomPosition(positions.data.result.content);
|
|
14
|
+
expect(positions.data.result.totalFound).toBeGreaterThan(0);
|
|
15
|
+
expect(positions.data.result.content.length).toBeGreaterThan(0);
|
|
16
|
+
expect(randomPosition.id.length).toBeGreaterThan(0);
|
|
17
|
+
expect(randomPosition.name.length).toBeGreaterThan(0);
|
|
18
|
+
expect(randomPosition.jobAdId.length).toBeGreaterThan(0);
|
|
19
|
+
expect(randomPosition.location).toBeDefined();
|
|
20
|
+
expect(randomPosition.department).toBeDefined();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test('should successfully fetch job description from SR API', async () => {
|
|
24
|
+
const randomPosition = getRandomPosition(positions.data.result.content);
|
|
25
|
+
const fetchJobDescriptionRequestBody = `fetchJobDescription(${randomPosition.id});`;
|
|
26
|
+
const jobFetchResponse = await executeApiRequest(fetchJobDescriptionRequestBody);
|
|
27
|
+
expect(jobFetchResponse.data.result.id).toBe(randomPosition.id);
|
|
28
|
+
expect(jobFetchResponse.data.result.jobAd.sections.jobDescription).toBeDefined();
|
|
29
|
+
expect(jobFetchResponse.data.result.jobAd.sections.jobDescription.text.length).toBeGreaterThan(0);
|
|
30
|
+
expect(jobFetchResponse.data.result.applyUrl.length).toBeGreaterThan(0);
|
|
31
|
+
expect(jobFetchResponse.data.result.location).toBeDefined();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
});
|
package/.wix/debug.log
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
----- CLI crash report at 2025-07-04T08:24:57.754Z
|
|
2
|
-
Error Trace
|
|
3
|
-
FailedToFetchPackageDetails: FailedToFetchPackageDetails
|
|
4
|
-
at fetchPackageDetails (/usr/local/lib/node_modules/@wix/cli-version-manager/src/package-details-reader.ts:54:11)
|
|
5
|
-
at async versionNotifier (/usr/local/lib/node_modules/@wix/cli-version-manager/src/version-notifier.tsx:8:26)
|
|
6
|
-
at async <anonymous> (/usr/local/lib/node_modules/@wix/cli/src/index.tsx:56:26)
|
|
7
|
-
caused by: FailedToWriteCache: FailedToWriteCache
|
|
8
|
-
at Object.set (/usr/local/lib/node_modules/@wix/cli-fs-cache/src/index.ts:75:13)
|
|
9
|
-
at async fetchPackageDetails (/usr/local/lib/node_modules/@wix/cli-version-manager/src/package-details-reader.ts:49:7)
|
|
10
|
-
at async versionNotifier (/usr/local/lib/node_modules/@wix/cli-version-manager/src/version-notifier.tsx:8:26)
|
|
11
|
-
at async <anonymous> (/usr/local/lib/node_modules/@wix/cli/src/index.tsx:56:26)
|
|
12
|
-
caused by: FailedToWriteJson: FailedToWriteJson
|
|
13
|
-
at writeJson (/usr/local/lib/node_modules/@wix/cli-fs/src/index.ts:29:11)
|
|
14
|
-
at async Object.set (/usr/local/lib/node_modules/@wix/cli-fs-cache/src/index.ts:69:7)
|
|
15
|
-
at async fetchPackageDetails (/usr/local/lib/node_modules/@wix/cli-version-manager/src/package-details-reader.ts:49:7)
|
|
16
|
-
at async versionNotifier (/usr/local/lib/node_modules/@wix/cli-version-manager/src/version-notifier.tsx:8:26)
|
|
17
|
-
at async <anonymous> (/usr/local/lib/node_modules/@wix/cli/src/index.tsx:56:26)
|
|
18
|
-
caused by: Error: EACCES: permission denied, open '/usr/local/lib/node_modules/@wix/cli/version.cache.json'
|
|
19
|
-
at async open (node:internal/fs/promises:633:25)
|
|
20
|
-
at async writeFile (node:internal/fs/promises:1207:14)
|
|
21
|
-
at async writeJson (/usr/local/lib/node_modules/@wix/cli-fs/src/index.ts:27:5)
|
|
22
|
-
at async Object.set (/usr/local/lib/node_modules/@wix/cli-fs-cache/src/index.ts:69:7)
|
|
23
|
-
at async fetchPackageDetails (/usr/local/lib/node_modules/@wix/cli-version-manager/src/package-details-reader.ts:49:7)
|
|
24
|
-
at async versionNotifier (/usr/local/lib/node_modules/@wix/cli-version-manager/src/version-notifier.tsx:8:26)
|
|
25
|
-
at async <anonymous> (/usr/local/lib/node_modules/@wix/cli/src/index.tsx:56:26)
|
|
26
|
-
Error Info
|
|
27
|
-
{}
|
|
28
|
-
----- CLI crash report at 2025-07-04T08:24:57.801Z
|
|
29
|
-
Error Trace
|
|
30
|
-
FailedToIdentifyProgramFlow: FailedToIdentifyProgramFlow
|
|
31
|
-
at _Command.<anonymous> (/usr/local/lib/node_modules/@wix/cli/src/program.ts:72:15)
|
|
32
|
-
at _Command.emit (node:events:518:28)
|
|
33
|
-
at _Command._parseCommand (/usr/local/lib/node_modules/node_modules/commander/lib/command.js:1607:14)
|
|
34
|
-
at _Command.parseAsync (/usr/local/lib/node_modules/node_modules/commander/lib/command.js:1104:16)
|
|
35
|
-
at <anonymous> (/usr/local/lib/node_modules/@wix/cli/src/index.tsx:80:39)
|
|
36
|
-
Error Info
|
|
37
|
-
{}
|
|
38
|
-
----- CLI crash report at 2025-07-04T08:24:59.930Z
|
|
39
|
-
Error Trace
|
|
40
|
-
FailedToFetchPackageDetails: FailedToFetchPackageDetails
|
|
41
|
-
at fetchPackageDetails (/usr/local/lib/node_modules/@wix/cli-version-manager/src/package-details-reader.ts:54:11)
|
|
42
|
-
at async versionNotifier (/usr/local/lib/node_modules/@wix/cli-version-manager/src/version-notifier.tsx:8:26)
|
|
43
|
-
at async <anonymous> (/usr/local/lib/node_modules/@wix/cli/src/index.tsx:56:26)
|
|
44
|
-
caused by: FailedToWriteCache: FailedToWriteCache
|
|
45
|
-
at Object.set (/usr/local/lib/node_modules/@wix/cli-fs-cache/src/index.ts:75:13)
|
|
46
|
-
at async fetchPackageDetails (/usr/local/lib/node_modules/@wix/cli-version-manager/src/package-details-reader.ts:49:7)
|
|
47
|
-
at async versionNotifier (/usr/local/lib/node_modules/@wix/cli-version-manager/src/version-notifier.tsx:8:26)
|
|
48
|
-
at async <anonymous> (/usr/local/lib/node_modules/@wix/cli/src/index.tsx:56:26)
|
|
49
|
-
caused by: FailedToWriteJson: FailedToWriteJson
|
|
50
|
-
at writeJson (/usr/local/lib/node_modules/@wix/cli-fs/src/index.ts:29:11)
|
|
51
|
-
at async Object.set (/usr/local/lib/node_modules/@wix/cli-fs-cache/src/index.ts:69:7)
|
|
52
|
-
at async fetchPackageDetails (/usr/local/lib/node_modules/@wix/cli-version-manager/src/package-details-reader.ts:49:7)
|
|
53
|
-
at async versionNotifier (/usr/local/lib/node_modules/@wix/cli-version-manager/src/version-notifier.tsx:8:26)
|
|
54
|
-
at async <anonymous> (/usr/local/lib/node_modules/@wix/cli/src/index.tsx:56:26)
|
|
55
|
-
caused by: Error: EACCES: permission denied, open '/usr/local/lib/node_modules/@wix/cli/version.cache.json'
|
|
56
|
-
at async open (node:internal/fs/promises:633:25)
|
|
57
|
-
at async writeFile (node:internal/fs/promises:1207:14)
|
|
58
|
-
at async writeJson (/usr/local/lib/node_modules/@wix/cli-fs/src/index.ts:27:5)
|
|
59
|
-
at async Object.set (/usr/local/lib/node_modules/@wix/cli-fs-cache/src/index.ts:69:7)
|
|
60
|
-
at async fetchPackageDetails (/usr/local/lib/node_modules/@wix/cli-version-manager/src/package-details-reader.ts:49:7)
|
|
61
|
-
at async versionNotifier (/usr/local/lib/node_modules/@wix/cli-version-manager/src/version-notifier.tsx:8:26)
|
|
62
|
-
at async <anonymous> (/usr/local/lib/node_modules/@wix/cli/src/index.tsx:56:26)
|
|
63
|
-
Error Info
|
|
64
|
-
{}
|
|
65
|
-
----- CLI crash report at 2025-07-04T08:24:59.969Z
|
|
66
|
-
Error Trace
|
|
67
|
-
FailedToIdentifyProgramFlow: FailedToIdentifyProgramFlow
|
|
68
|
-
at _Command.<anonymous> (/usr/local/lib/node_modules/@wix/cli/src/program.ts:72:15)
|
|
69
|
-
at _Command.emit (node:events:518:28)
|
|
70
|
-
at _Command._parseCommand (/usr/local/lib/node_modules/node_modules/commander/lib/command.js:1607:14)
|
|
71
|
-
at _Command.parseAsync (/usr/local/lib/node_modules/node_modules/commander/lib/command.js:1104:16)
|
|
72
|
-
at <anonymous> (/usr/local/lib/node_modules/@wix/cli/src/index.tsx:80:39)
|
|
73
|
-
Error Info
|
|
74
|
-
{}
|
|
75
|
-
----- CLI crash report at 2025-07-04T08:43:49.027Z
|
|
76
|
-
Error Trace
|
|
77
|
-
FailedToFetchPackageDetails: FailedToFetchPackageDetails
|
|
78
|
-
at fetchPackageDetails (/usr/local/lib/node_modules/@wix/cli-version-manager/src/package-details-reader.ts:54:11)
|
|
79
|
-
at async versionNotifier (/usr/local/lib/node_modules/@wix/cli-version-manager/src/version-notifier.tsx:8:26)
|
|
80
|
-
at async <anonymous> (/usr/local/lib/node_modules/@wix/cli/src/index.tsx:56:26)
|
|
81
|
-
caused by: FailedToWriteCache: FailedToWriteCache
|
|
82
|
-
at Object.set (/usr/local/lib/node_modules/@wix/cli-fs-cache/src/index.ts:75:13)
|
|
83
|
-
at async fetchPackageDetails (/usr/local/lib/node_modules/@wix/cli-version-manager/src/package-details-reader.ts:49:7)
|
|
84
|
-
at async versionNotifier (/usr/local/lib/node_modules/@wix/cli-version-manager/src/version-notifier.tsx:8:26)
|
|
85
|
-
at async <anonymous> (/usr/local/lib/node_modules/@wix/cli/src/index.tsx:56:26)
|
|
86
|
-
caused by: FailedToWriteJson: FailedToWriteJson
|
|
87
|
-
at writeJson (/usr/local/lib/node_modules/@wix/cli-fs/src/index.ts:29:11)
|
|
88
|
-
at async Object.set (/usr/local/lib/node_modules/@wix/cli-fs-cache/src/index.ts:69:7)
|
|
89
|
-
at async fetchPackageDetails (/usr/local/lib/node_modules/@wix/cli-version-manager/src/package-details-reader.ts:49:7)
|
|
90
|
-
at async versionNotifier (/usr/local/lib/node_modules/@wix/cli-version-manager/src/version-notifier.tsx:8:26)
|
|
91
|
-
at async <anonymous> (/usr/local/lib/node_modules/@wix/cli/src/index.tsx:56:26)
|
|
92
|
-
caused by: Error: EACCES: permission denied, open '/usr/local/lib/node_modules/@wix/cli/version.cache.json'
|
|
93
|
-
at async open (node:internal/fs/promises:633:25)
|
|
94
|
-
at async writeFile (node:internal/fs/promises:1207:14)
|
|
95
|
-
at async writeJson (/usr/local/lib/node_modules/@wix/cli-fs/src/index.ts:27:5)
|
|
96
|
-
at async Object.set (/usr/local/lib/node_modules/@wix/cli-fs-cache/src/index.ts:69:7)
|
|
97
|
-
at async fetchPackageDetails (/usr/local/lib/node_modules/@wix/cli-version-manager/src/package-details-reader.ts:49:7)
|
|
98
|
-
at async versionNotifier (/usr/local/lib/node_modules/@wix/cli-version-manager/src/version-notifier.tsx:8:26)
|
|
99
|
-
at async <anonymous> (/usr/local/lib/node_modules/@wix/cli/src/index.tsx:56:26)
|
|
100
|
-
Error Info
|
|
101
|
-
{}
|
|
102
|
-
----- CLI crash report at 2025-07-04T08:43:49.081Z
|
|
103
|
-
Error Trace
|
|
104
|
-
FailedToIdentifyProgramFlow: FailedToIdentifyProgramFlow
|
|
105
|
-
at _Command.<anonymous> (/usr/local/lib/node_modules/@wix/cli/src/program.ts:72:15)
|
|
106
|
-
at _Command.emit (node:events:518:28)
|
|
107
|
-
at _Command._parseCommand (/usr/local/lib/node_modules/node_modules/commander/lib/command.js:1607:14)
|
|
108
|
-
at _Command.parseAsync (/usr/local/lib/node_modules/node_modules/commander/lib/command.js:1104:16)
|
|
109
|
-
at <anonymous> (/usr/local/lib/node_modules/@wix/cli/src/index.tsx:80:39)
|
|
110
|
-
Error Info
|
|
111
|
-
{}
|