sr-npm 1.7.363 → 1.7.365

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/data.js CHANGED
@@ -340,7 +340,7 @@ async function referenceJobs() {
340
340
 
341
341
  async function syncJobsFast() {
342
342
  console.log("Syncing jobs fast");
343
- await createApiKeyCollectionAndFillIt();
343
+ //await createApiKeyCollectionAndFillIt();
344
344
  await createCollections();
345
345
  await clearCollections();
346
346
  console.log("saving jobs data to CMS");
@@ -2,7 +2,7 @@ const { fetch } = require('wix-fetch');
2
2
  const { items: wixData } = require('@wix/data');
3
3
  const { COLLECTIONS } = require('./collectionConsts');
4
4
  const secretsData = require('./secretsData');
5
- async function makeSmartRecruitersRequest(path,token) {
5
+ async function makeSmartRecruitersRequest(path) {
6
6
  const baseUrl = 'https://api.smartrecruiters.com';
7
7
  const fullUrl = `${baseUrl}${path}`;
8
8
 
@@ -12,7 +12,6 @@ async function makeSmartRecruitersRequest(path,token) {
12
12
  headers: {
13
13
  'Accept-Language': 'en',
14
14
  'accept': 'application/json',
15
- 'x-smarttoken': token,
16
15
  'Cookie': 'AWSALB=GYltFw3fLKortMxHR5vIOT1CuUROyhWNIX/qL8ZnPl1/8mhOcnIsBKYslzmNJPEzSy/jvNbO+6tXpH8yqcpQJagYt57MhbKlLqTSzoNq1G/w7TjOxPGR3UTdXW0d; AWSALBCORS=GYltFw3fLKortMxHR5vIOT1CuUROyhWNIX/qL8ZnPl1/8mhOcnIsBKYslzmNJPEzSy/jvNbO+6tXpH8yqcpQJagYt57MhbKlLqTSzoNq1G/w7TjOxPGR3UTdXW0d'
17
16
  }
18
17
  });
@@ -34,7 +33,6 @@ async function fetchPositionsFromSRAPI() {
34
33
  let totalFound = 0;
35
34
  let page = 0;
36
35
  const MAX_PAGES = 30 // Safety limit to prevent infinite loops
37
- const token = await getSmartTokenFromCMS();
38
36
  const companyId = await secretsData.getCompanyId();
39
37
  console.log('Starting to fetch all positions with pagination...');
40
38
  let offset=0;
@@ -47,7 +45,7 @@ async function fetchPositionsFromSRAPI() {
47
45
  const apiPath = `/v1/companies/${companyId.value}/postings?offset=${offset}`;
48
46
 
49
47
  console.log(`Fetching page ${page} with path: ${apiPath}`);
50
- const response = await makeSmartRecruitersRequest(apiPath,token);
48
+ const response = await makeSmartRecruitersRequest(apiPath);
51
49
 
52
50
  // Add positions from this page to our collection
53
51
  if (response.content && Array.isArray(response.content)) {
@@ -97,9 +95,8 @@ async function fetchPositionsFromSRAPI() {
97
95
  }
98
96
 
99
97
  async function fetchJobDescription(jobId) {
100
- const token = await getSmartTokenFromCMS();
101
98
  const companyId = await secretsData.getCompanyId();
102
- return await makeSmartRecruitersRequest(`/v1/companies/${companyId.value}/postings/${jobId}`,token);
99
+ return await makeSmartRecruitersRequest(`/v1/companies/${companyId.value}/postings/${jobId}`);
103
100
  }
104
101
 
105
102
  async function getSmartTokenFromCMS() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.363",
3
+ "version": "1.7.365",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,5 +1,4 @@
1
- const { generateUniqueId, generateBatchIds } = require('tests-utils');
2
- const { stringifyWithFunctions, executeApiRequest } = require('tests-utils');
1
+ const { executeApiRequest } = require('tests-utils');
3
2
 
4
3
 
5
4
  describe('Job details fetch from SR API Tests', () => {