sr-npm 1.7.1072 → 1.7.1074

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.
@@ -131,6 +131,7 @@ const COLLECTIONS_FIELDS = {
131
131
  COMPANY_ID: 'companyId',
132
132
  SMART_TOKEN: 'x-smarttoken',
133
133
  DESIRED_BRAND: 'desiredBrand',
134
+ RICH_CONTENT_CONVERTER_TOKEN: 'richContentConverterToken',
134
135
  }
135
136
 
136
137
 
package/backend/data.js CHANGED
@@ -260,7 +260,7 @@ async function saveJobsDescriptionsAndLocationApplyUrlReferencesToCMS() {
260
260
 
261
261
  const API_CHUNK_SIZE = 80;
262
262
  const pageChunks = Math.ceil(jobsWithNoDescriptions.items.length / API_CHUNK_SIZE);
263
-
263
+ const richContentConverterToken = await getTokenFromCMS(TOKEN_NAME.RICH_CONTENT_CONVERTER_TOKEN);
264
264
  await chunkedBulkOperation({
265
265
  items: jobsWithNoDescriptions.items,
266
266
  chunkSize: API_CHUNK_SIZE,
@@ -269,7 +269,7 @@ async function saveJobsDescriptionsAndLocationApplyUrlReferencesToCMS() {
269
269
  const chunkPromises = chunk.map(async job => {
270
270
  try {
271
271
  const jobDetails = await fetchJobDescription(job._id);
272
- const richContentDescription=await htmlRichContentConverter(jobDetails.jobAd.sections);
272
+ const richContentDescription=await htmlRichContentConverter(jobDetails.jobAd.sections,richContentConverterToken);
273
273
  const jobLocation = fetchJobLocation(jobDetails);
274
274
  const {applyLink , referFriendLink} = fetchApplyAndReferFriendLink(jobDetails);
275
275
  const updatedJob = {
@@ -113,8 +113,7 @@ async function fetchJobDescription(jobId,testObject=undefined) {
113
113
  return await makeSmartRecruitersRequest(`/v1/companies/${companyId}/postings/${jobId}`,templateType);
114
114
  }
115
115
 
116
- async function htmlRichContentConverter(sections) {
117
- console.log("sections: are ",sections);
116
+ async function htmlRichContentConverter(sections,richContentConverterToken) {
118
117
  const richContentObject = {}
119
118
  for (const [sectionTitle, sectionData] of Object.entries(sections)) {
120
119
  if (sectionData.text) {
@@ -126,7 +125,7 @@ async function htmlRichContentConverter(sections) {
126
125
  headers: {
127
126
  'Content-Type': 'application/json',
128
127
  Cookie: 'XSRF-TOKEN=1753949844|p--a7HsuVjR4',
129
- Authorization: 'Bearer 2e19efe5f44d29d74480f5b744a5a90f19ba6ca7012ced19e7b14edb1ad6a641',
128
+ Authorization: 'Bearer '+richContentConverterToken,
130
129
  },
131
130
  body: raw,
132
131
  };
@@ -143,7 +142,6 @@ async function htmlRichContentConverter(sections) {
143
142
  }
144
143
  }
145
144
  }
146
- console.log("richContentObject: are ",richContentObject);
147
145
  return richContentObject;
148
146
  }
149
147
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.1072",
3
+ "version": "1.7.1074",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -5,7 +5,6 @@ const { items: wixData } = require('@wix/data');
5
5
  const { location } = require("@wix/site-location");
6
6
  const{isElementExistOnPage} = require('psdev-utils');
7
7
  const {
8
- htmlToText,
9
8
  appendQueryParams
10
9
  } = require('../public/utils');
11
10
 
@@ -39,20 +38,13 @@ async function getCategoryValue(customValues) {
39
38
 
40
39
  handleReferFriendButton(_$w,item);
41
40
  handleApplyButton(_$w,item);
42
-
43
41
 
44
-
45
-
46
- //_$w('#companyDescriptionText').text = htmlToText(item.jobDescription.companyDescription.text);
47
42
  _$w('#companyDescriptionText').content = item.jobDescription.companyDescription;
48
- //_$w('#responsibilitiesText').text = htmlToText(item.jobDescription.jobDescription.text);
49
43
  _$w('#responsibilitiesText').content = item.jobDescription.jobDescription;
50
- //_$w('#qualificationsText').text = htmlToText(item.jobDescription.qualifications.text);
51
44
  _$w('#qualificationsText').content = item.jobDescription.qualifications;
52
45
  _$w('#relatedJobsTitleText').text = `More ${item.department} Positions`;
53
46
  if(isElementExistOnPage(_$w('#additionalInfoText')))
54
47
  {
55
- //_$w('#additionalInfoText').text = htmlToText(item.jobDescription.additionalInformation.text);
56
48
  _$w('#additionalInfoText').content = item.jobDescription.additionalInformation;
57
49
  }
58
50
  if(isElementExistOnPage(_$w('#relatedJobsRepNoDepartment'))) // when there is no department, we filter based on category