sr-npm 1.7.267 → 1.7.269
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.
|
@@ -8,7 +8,6 @@ const JOBS_COLLECTION_FIELDS = {
|
|
|
8
8
|
LOCATION: 'location',
|
|
9
9
|
TITLE: 'title',
|
|
10
10
|
LOCATION_ADDRESS: 'locationAddress',
|
|
11
|
-
POSTING_STATUS: 'postingStatus',
|
|
12
11
|
COUNTRY: 'country',
|
|
13
12
|
DEPARTMENT: 'department',
|
|
14
13
|
LANGUAGE: 'language',
|
|
@@ -49,7 +48,6 @@ const COLLECTIONS_FIELDS = {
|
|
|
49
48
|
{key:'location', type: 'OBJECT'},
|
|
50
49
|
{key:'title', type: 'TEXT'},
|
|
51
50
|
{key:'locationAddress', type: 'ADDRESS'},
|
|
52
|
-
{key:'postingStatus', type: 'TEXT'},
|
|
53
51
|
{key:'country', type: 'TEXT'},
|
|
54
52
|
{key:'department', type: 'TEXT'},
|
|
55
53
|
{key:'language', type: 'TEXT'},
|
package/backend/data.js
CHANGED
|
@@ -46,7 +46,6 @@ async function saveJobsDataToCMS() {
|
|
|
46
46
|
country: position.location?.country || '',
|
|
47
47
|
remote: position.location?.remote || false,
|
|
48
48
|
language: position.language?.label || '',
|
|
49
|
-
//postingStatus: position.postingStatus || '',
|
|
50
49
|
jobDescription: null, // Will be filled later
|
|
51
50
|
};
|
|
52
51
|
return basicJob;
|
|
@@ -127,7 +126,7 @@ async function saveJobsDescriptionsAndLocationApplyUrlToCMS() {
|
|
|
127
126
|
const updatedJob = {
|
|
128
127
|
...job,
|
|
129
128
|
locationAddress: jobLocation,
|
|
130
|
-
jobDescription: jobDetails.jobAd.sections,
|
|
129
|
+
jobDescription: jobDetails.jobAd.sections.jobDescription,
|
|
131
130
|
applyLink: applyLink,
|
|
132
131
|
};
|
|
133
132
|
await wixData.update(COLLECTIONS.JOBS, updatedJob);
|
|
@@ -260,7 +259,7 @@ async function referenceJobsToField({ referenceField, sourceCollection, jobField
|
|
|
260
259
|
}
|
|
261
260
|
|
|
262
261
|
function fetchApplyLink(jobDetails) {
|
|
263
|
-
return jobDetails.
|
|
262
|
+
return jobDetails.applyUrl;
|
|
264
263
|
}
|
|
265
264
|
|
|
266
265
|
function fetchJobLocation(jobDetails) {
|
|
@@ -34,7 +34,6 @@ async function makeSmartRecruitersRequest(path,token) {
|
|
|
34
34
|
async function fetchPositionsFromSRAPI() {
|
|
35
35
|
let allPositions = [];
|
|
36
36
|
let totalFound = 0;
|
|
37
|
-
let nextPageId = null; // Start with no page ID for the first request
|
|
38
37
|
let page = 0;
|
|
39
38
|
const MAX_PAGES = 30 // Safety limit to prevent infinite loops
|
|
40
39
|
const token = await getSmartTokenFromCMS();
|
|
@@ -47,14 +46,13 @@ async function fetchPositionsFromSRAPI() {
|
|
|
47
46
|
page++;
|
|
48
47
|
|
|
49
48
|
// Build the API path - first request has no page parameter, subsequent use nextPageId
|
|
50
|
-
let apiPath = `/v1/companies/${companyId.value}/postings?offset=${offset}
|
|
49
|
+
let apiPath = `/v1/companies/${companyId.value}/postings?offset=${offset}`;
|
|
51
50
|
|
|
52
51
|
console.log(`Fetching page ${page} with path: ${apiPath}`);
|
|
53
52
|
const response = await makeSmartRecruitersRequest(apiPath,token);
|
|
54
53
|
|
|
55
54
|
// Add positions from this page to our collection
|
|
56
55
|
if (response.content && Array.isArray(response.content)) {
|
|
57
|
-
// No filtering, just dump all the damn positions in
|
|
58
56
|
allPositions = allPositions.concat(response.content);
|
|
59
57
|
console.log(`Page ${page}: Found ${response.content.length} positions`);
|
|
60
58
|
}
|
|
@@ -67,7 +65,7 @@ async function fetchPositionsFromSRAPI() {
|
|
|
67
65
|
|
|
68
66
|
// Get the nextPageId for the next iteration
|
|
69
67
|
// nextPageId = response.nextPageId && response.nextPageId !== '' ? response.nextPageId : null;
|
|
70
|
-
offset+=
|
|
68
|
+
offset+=100;
|
|
71
69
|
|
|
72
70
|
} catch (error) {
|
|
73
71
|
console.error(`Error fetching page ${page}:`, error);
|
|
@@ -104,7 +102,8 @@ async function fetchPositionsFromSRAPI() {
|
|
|
104
102
|
|
|
105
103
|
async function fetchJobDescription(jobId) {
|
|
106
104
|
const token = await getSmartTokenFromCMS();
|
|
107
|
-
|
|
105
|
+
const companyId = await secretsData.getCompanyId();
|
|
106
|
+
return await makeSmartRecruitersRequest(`/v1/companies/${companyId.value}/postings/${jobId}`,token);
|
|
108
107
|
}
|
|
109
108
|
|
|
110
109
|
async function getSmartTokenFromCMS() {
|