sr-npm 1.7.268 → 1.7.270

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;
@@ -3,11 +3,9 @@ const { items: wixData } = require('@wix/data');
3
3
  const { COLLECTIONS } = require('./collectionConsts');
4
4
  const secretsData = require('./secretsData');
5
5
  async function makeSmartRecruitersRequest(path,token) {
6
- const baseUrl = 'https://api.smartrecruiters.com'; // PROD
7
- // const baseUrl = 'https://bayank2.wixstudio.com/my-site-3//_functions'; // TEST
6
+ const baseUrl = 'https://api.smartrecruiters.com';
8
7
  const fullUrl = `${baseUrl}${path}`;
9
8
 
10
- //console.log(`Making request to: ${fullUrl}`);
11
9
  try {
12
10
  const response = await fetch(fullUrl, {
13
11
  method: 'GET',
@@ -34,7 +32,6 @@ async function makeSmartRecruitersRequest(path,token) {
34
32
  async function fetchPositionsFromSRAPI() {
35
33
  let allPositions = [];
36
34
  let totalFound = 0;
37
- let nextPageId = null; // Start with no page ID for the first request
38
35
  let page = 0;
39
36
  const MAX_PAGES = 30 // Safety limit to prevent infinite loops
40
37
  const token = await getSmartTokenFromCMS();
@@ -54,7 +51,6 @@ async function fetchPositionsFromSRAPI() {
54
51
 
55
52
  // Add positions from this page to our collection
56
53
  if (response.content && Array.isArray(response.content)) {
57
- // No filtering, just dump all the damn positions in
58
54
  allPositions = allPositions.concat(response.content);
59
55
  console.log(`Page ${page}: Found ${response.content.length} positions`);
60
56
  }
@@ -65,8 +61,6 @@ async function fetchPositionsFromSRAPI() {
65
61
  console.log(`Total positions available: ${totalFound}`);
66
62
  }
67
63
 
68
- // Get the nextPageId for the next iteration
69
- // nextPageId = response.nextPageId && response.nextPageId !== '' ? response.nextPageId : null;
70
64
  offset+=100;
71
65
 
72
66
  } catch (error) {
@@ -111,7 +105,7 @@ async function fetchJobDescription(jobId) {
111
105
  async function getSmartTokenFromCMS() {
112
106
  const result = await wixData.query(COLLECTIONS.API_KEY).limit(1).find();
113
107
  if (result.items.length > 0) {
114
- return result.items[0].token; // This is your string token
108
+ return result.items[0].token;
115
109
  } else {
116
110
  throw new Error('[getSmartTokenFromCMS], No token found');
117
111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.268",
3
+ "version": "1.7.270",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {