sr-npm 1.7.370 → 1.7.372

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
@@ -4,7 +4,7 @@ const { createCollectionIfMissing } = require('@hisense-staging/velo-npm/backend
4
4
  const { COLLECTIONS, COLLECTIONS_FIELDS,JOBS_COLLECTION_FIELDS } = require('./collectionConsts');
5
5
  const { chunkedBulkOperation, countJobsPerGivenField, fillCityLocationAndLocationAddress ,prepareToSaveArray,normalizeCityName} = require('./utils');
6
6
  const { getAllPositions } = require('./queries');
7
- const { getCompanyIdFromCMS } = require('./fetchPositionsFromSRAPI');
7
+ const { getCompanyId } = require('./secretsData');
8
8
 
9
9
  function validatePosition(position) {
10
10
  if (!position.id) {
@@ -292,7 +292,7 @@ async function createCompanyIdCollectionAndFillIt() {
292
292
  console.log("Creating CompanyId collection and filling it with the company ID");
293
293
  await createCollectionIfMissing(COLLECTIONS.COMPANY_ID, COLLECTIONS_FIELDS.COMPANY_ID,null,'singleItem');
294
294
  console.log("Getting the company ID ");
295
- const companyId = await getCompanyIdFromCMS();
295
+ const companyId = await getCompanyId();
296
296
  console.log("companyId is : ", companyId);
297
297
  console.log("Inserting the company ID into the CompanyId collection");
298
298
  try {
@@ -42,7 +42,7 @@ async function fetchPositionsFromSRAPI() {
42
42
  page++;
43
43
 
44
44
  // Build the API path - first request has no page parameter, subsequent use nextPageId
45
- const apiPath = `/v1/companies/${companyId.value}/postings?offset=${offset}`;
45
+ const apiPath = `/v1/companies/${companyId}/postings?offset=${offset}`;
46
46
 
47
47
  console.log(`Fetching page ${page} with path: ${apiPath}`);
48
48
  const response = await makeSmartRecruitersRequest(apiPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.370",
3
+ "version": "1.7.372",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -7,7 +7,6 @@ describe('Job details fetch from SR API Tests', () => {
7
7
  const requestBody = `fetchPositionsFromSRAPI();`;
8
8
  const fetchJobsResponse = await executeApiRequest(requestBody);
9
9
  const randomPosition = getRandomPosition(fetchJobsResponse.data.result.content);
10
- console.log("randomPosition: ", randomPosition);
11
10
  expect(fetchJobsResponse.data.result.totalFound).toBeGreaterThan(0);
12
11
  expect(fetchJobsResponse.data.result.content.length).toBeGreaterThan(0);
13
12
  expect(randomPosition.id.length).toBeGreaterThan(0);
@@ -23,7 +22,6 @@ describe('Job details fetch from SR API Tests', () => {
23
22
  const randomPosition = getRandomPosition(positions.data.result.content);
24
23
  const fetchJobDescriptionRequestBody = `fetchJobDescription(${randomPosition.id});`;
25
24
  const jobFetchResponse = await executeApiRequest(fetchJobDescriptionRequestBody);
26
- console.log("jobFetchResponse: ", jobFetchResponse.data.result);
27
25
  expect(jobFetchResponse.data.result.id).toBe(randomPosition.id);
28
26
  expect(jobFetchResponse.data.result.jobAd.sections.jobDescription).toBeDefined();
29
27
  expect(jobFetchResponse.data.result.jobAd.sections.jobDescription.text.length).toBeGreaterThan(0);