sr-npm 1.7.4 → 1.7.6

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/consts.js CHANGED
@@ -1,4 +1,4 @@
1
- import {saveDataJobsToCMS,saveJobsDescriptionsToCMS,aggregateJobsByFieldToCMS,referenceJobsToField} from './data';
1
+ const {saveDataJobsToCMS,saveJobsDescriptionsToCMS,aggregateJobsByFieldToCMS,referenceJobsToField} = require('./data');
2
2
  const { createCollectionIfMissing } = require('@hisense-staging/velo-npm/backend');
3
3
  const TASKS_NAMES = {
4
4
  SYNC_JOBS: 'syncJobsFromSRAPIToCMS',
package/backend/data.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const { items: wixData } = require('@wix/data');
2
- import { fetchPositionsFromSRAPI, fetchJobDescription } from './fetchPositionsFromSRAPI';
3
- import { chunkedBulkOperation } from './utils';
2
+ const { fetchPositionsFromSRAPI, fetchJobDescription } = require('./fetchPositionsFromSRAPI');
3
+ const { chunkedBulkOperation } = require('./utils');
4
4
 
5
5
  // Utility function to normalize city names
6
6
  function normalizeCityName(city) {
@@ -9,7 +9,7 @@ function normalizeCityName(city) {
9
9
  return city.normalize('NFD').replace(/\p{Diacritic}/gu, '').trim();
10
10
  }
11
11
 
12
- export async function saveDataJobsToCMS() {
12
+ async function saveDataJobsToCMS() {
13
13
  const positions = await fetchPositionsFromSRAPI();
14
14
  // bulk insert to jobs collection without descriptions first
15
15
  const jobsData = positions.content.map((position) => {
@@ -55,7 +55,7 @@ export async function saveDataJobsToCMS() {
55
55
 
56
56
  }
57
57
 
58
- export async function saveJobsDescriptionsToCMS() {
58
+ async function saveJobsDescriptionsToCMS() {
59
59
 
60
60
  console.log('🚀 Starting job descriptions update process for ALL jobs using pagination...');
61
61
 
@@ -157,7 +157,7 @@ export async function saveJobsDescriptionsToCMS() {
157
157
  }
158
158
  }
159
159
 
160
- export async function aggregateJobsByFieldToCMS({ field, collection }) {
160
+ async function aggregateJobsByFieldToCMS({ field, collection }) {
161
161
  console.log(`counting jobs per ${field}.`);
162
162
  let jobsPerField = {};
163
163
  let cityLocations = {};
@@ -233,7 +233,7 @@ async function getJobsWithNoDescriptions() {
233
233
  return jobswithoutdescriptionsQuery;
234
234
  }
235
235
 
236
- export async function referenceJobsToField({
236
+ async function referenceJobsToField({
237
237
  referenceField, // e.g., "city" or "department"
238
238
  sourceCollection, // e.g., "cities" or "departments"
239
239
  jobField, // e.g., "cityText" or "department"
@@ -286,3 +286,10 @@ export async function referenceJobsToField({
286
286
 
287
287
  return { success: true, updated: jobsToUpdate.length };
288
288
  }
289
+
290
+ module.exports = {
291
+ saveDataJobsToCMS,
292
+ saveJobsDescriptionsToCMS,
293
+ aggregateJobsByFieldToCMS,
294
+ referenceJobsToField,
295
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.4",
3
+ "version": "1.7.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {