sr-npm 1.7.2 → 1.7.3
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/backend/consts.js +11 -4
- package/backend/fetchPositionsFromSRAPI.js +9 -2
- package/backend/index.js +2 -0
- package/backend/utils.js +6 -1
- package/package.json +1 -1
package/backend/consts.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {saveDataJobsToCMS,saveJobsDescriptionsToCMS,aggregateJobsByFieldToCMS,referenceJobsToField} from './data';
|
|
2
2
|
const { createCollectionIfMissing } = require('@hisense-staging/velo-npm/backend');
|
|
3
|
-
|
|
3
|
+
const TASKS_NAMES = {
|
|
4
4
|
SYNC_JOBS: 'syncJobsFromSRAPIToCMS',
|
|
5
5
|
INSERT_JOBS_TO_CMS: 'insertJobsToCMS',
|
|
6
6
|
INSERT_JOBS_DESCRIPTIONS_TO_CMS: 'insertJobsDescriptionsToCMS',
|
|
@@ -14,7 +14,7 @@ export const TASKS_NAMES = {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
const TASKS = {
|
|
18
18
|
[TASKS_NAMES.SYNC_JOBS]: {
|
|
19
19
|
name: TASKS_NAMES.SYNC_JOBS,
|
|
20
20
|
childTasks: [
|
|
@@ -96,7 +96,7 @@ export const TASKS = {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
const COLLECTIONS = {
|
|
100
100
|
AMOUNT_OF_JOBS_PER_DEPARTMENT: 'AmountOfJobsPerDepartment',
|
|
101
101
|
CITIES: 'cities',
|
|
102
102
|
JOBS: 'Jobs',
|
|
@@ -136,7 +136,14 @@ const COLLECTIONS_FIELDS = {
|
|
|
136
136
|
};
|
|
137
137
|
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
const TASK_TYPE = {
|
|
140
140
|
SCHEDULED: 'scheduled',
|
|
141
141
|
EVENT: 'event',
|
|
142
142
|
};
|
|
143
|
+
|
|
144
|
+
module.exports = {
|
|
145
|
+
TASKS_NAMES,
|
|
146
|
+
TASK_TYPE,
|
|
147
|
+
TASKS,
|
|
148
|
+
COLLECTIONS,
|
|
149
|
+
};
|
|
@@ -28,7 +28,7 @@ async function makeSmartRecruitersRequest(path) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
async function fetchPositionsFromSRAPI() {
|
|
32
32
|
let allPositions = [];
|
|
33
33
|
let totalFound = 0;
|
|
34
34
|
let nextPageId = null; // Start with no page ID for the first request
|
|
@@ -104,6 +104,13 @@ export async function fetchPositionsFromSRAPI() {
|
|
|
104
104
|
return result;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
async function fetchJobDescription(jobId) {
|
|
108
108
|
return await makeSmartRecruitersRequest(`/jobs/${jobId}`);
|
|
109
109
|
}
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
module.exports = {
|
|
113
|
+
|
|
114
|
+
fetchPositionsFromSRAPI,
|
|
115
|
+
fetchJobDescription,
|
|
116
|
+
};
|
package/backend/index.js
CHANGED
package/backend/utils.js
CHANGED