@sharpapi/sharpapi-node-related-job-positions 1.0.0

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/README.md ADDED
@@ -0,0 +1,356 @@
1
+ ![SharpAPI GitHub cover](https://sharpapi.com/sharpapi-github-php-bg.jpg "SharpAPI Node.js Client")
2
+
3
+ # Related Job Positions Generator API for Node.js
4
+
5
+ ## 💼 Generate related job positions with AI — powered by SharpAPI.
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@sharpapi/sharpapi-node-related-job-positions.svg)](https://www.npmjs.com/package/@sharpapi/sharpapi-node-related-job-positions)
8
+ [![License](https://img.shields.io/npm/l/@sharpapi/sharpapi-node-related-job-positions.svg)](https://github.com/sharpapi/sharpapi-node-client/blob/master/LICENSE.md)
9
+
10
+ **SharpAPI Related Job Positions Generator** uses AI to generate a list of related job positions based on the provided position name. Perfect for HR tech, job boards, recruitment platforms, and career development tools.
11
+
12
+ ---
13
+
14
+ ## 📋 Table of Contents
15
+
16
+ 1. [Requirements](#requirements)
17
+ 2. [Installation](#installation)
18
+ 3. [Usage](#usage)
19
+ 4. [API Documentation](#api-documentation)
20
+ 5. [Response Format](#response-format)
21
+ 6. [Examples](#examples)
22
+ 7. [License](#license)
23
+
24
+ ---
25
+
26
+ ## Requirements
27
+
28
+ - Node.js >= 16.x
29
+ - npm or yarn
30
+
31
+ ---
32
+
33
+ ## Installation
34
+
35
+ ### Step 1. Install the package via npm:
36
+
37
+ ```bash
38
+ npm install @sharpapi/sharpapi-node-related-job-positions
39
+ ```
40
+
41
+ ### Step 2. Get your API key
42
+
43
+ Visit [SharpAPI.com](https://sharpapi.com/) to get your API key.
44
+
45
+ ---
46
+
47
+ ## Usage
48
+
49
+ ```javascript
50
+ const { SharpApiRelatedJobPositionsService } = require('@sharpapi/sharpapi-node-related-job-positions');
51
+
52
+ const apiKey = process.env.SHARP_API_KEY; // Store your API key in environment variables
53
+ const service = new SharpApiRelatedJobPositionsService(apiKey);
54
+
55
+ const jobPosition = 'Frontend Developer';
56
+
57
+ async function generateRelatedPositions() {
58
+ try {
59
+ // Submit related job positions generation job
60
+ const statusUrl = await service.generateRelatedJobPositions(jobPosition, 'English', 10);
61
+ console.log('Job submitted. Status URL:', statusUrl);
62
+
63
+ // Fetch results (polls automatically until complete)
64
+ const result = await service.fetchResults(statusUrl);
65
+ console.log('Related positions:', result.getResultJson());
66
+ } catch (error) {
67
+ console.error('Error:', error.message);
68
+ }
69
+ }
70
+
71
+ generateRelatedPositions();
72
+ ```
73
+
74
+ ---
75
+
76
+ ## API Documentation
77
+
78
+ ### Methods
79
+
80
+ #### `generateRelatedJobPositions(jobPositionName: string, language?: string, maxQuantity?: number, voiceTone?: string, context?: string): Promise<string>`
81
+
82
+ Generates a list of related job positions based on the provided position name.
83
+
84
+ **Parameters:**
85
+ - `jobPositionName` (string, required): The job position name to find related positions for
86
+ - `language` (string, optional): Output language (default: 'English')
87
+ - `maxQuantity` (number, optional): Maximum number of related positions to return (default: 10)
88
+ - `voiceTone` (string, optional): Tone of the response (e.g., 'Professional', 'Casual')
89
+ - `context` (string, optional): Additional context for the AI
90
+
91
+ **Returns:**
92
+ - Promise<string>: Status URL for polling the job result
93
+
94
+ **Example:**
95
+ ```javascript
96
+ const statusUrl = await service.generateRelatedJobPositions(
97
+ 'Data Scientist',
98
+ 'English',
99
+ 8,
100
+ 'Professional',
101
+ 'Focus on senior-level positions in tech companies'
102
+ );
103
+ const result = await service.fetchResults(statusUrl);
104
+ ```
105
+
106
+ ---
107
+
108
+ ## Response Format
109
+
110
+ The API returns related job positions with relevance scores (weight: 0-10, where 10 is the highest relevance):
111
+
112
+ ```json
113
+ {
114
+ "data": {
115
+ "type": "api_job_result",
116
+ "id": "80d0a822-0e2a-40e1-97fd-e7fd62ec9eb0",
117
+ "attributes": {
118
+ "status": "success",
119
+ "type": "hr_related_job_positions",
120
+ "result": {
121
+ "job_position": "Flutter Mobile Developer",
122
+ "related_job_positions": [
123
+ {
124
+ "name": "Android Developer",
125
+ "weight": 8
126
+ },
127
+ {
128
+ "name": "iOS Developer",
129
+ "weight": 8.5
130
+ },
131
+ {
132
+ "name": "Mobile App Developer",
133
+ "weight": 9.5
134
+ },
135
+ {
136
+ "name": "React Native Developer",
137
+ "weight": 7.5
138
+ },
139
+ {
140
+ "name": "Flutter Developer",
141
+ "weight": 10
142
+ },
143
+ {
144
+ "name": "Cross-Platform Mobile Developer",
145
+ "weight": 7
146
+ },
147
+ {
148
+ "name": "Mobile Software Engineer",
149
+ "weight": 9
150
+ },
151
+ {
152
+ "name": "App Developer",
153
+ "weight": 7
154
+ }
155
+ ]
156
+ }
157
+ }
158
+ }
159
+ }
160
+ ```
161
+
162
+ **Weight Scale:**
163
+ - `10.0` - Exact match or extremely similar position
164
+ - `8.0-9.9` - Highly related (very similar responsibilities)
165
+ - `6.0-7.9` - Moderately related (overlapping skills and duties)
166
+ - `4.0-5.9` - Somewhat related (some transferable skills)
167
+ - `1.0-3.9` - Loosely related (adjacent career paths)
168
+
169
+ ---
170
+
171
+ ## Examples
172
+
173
+ ### Basic Related Positions Generation
174
+
175
+ ```javascript
176
+ const { SharpApiRelatedJobPositionsService } = require('@sharpapi/sharpapi-node-related-job-positions');
177
+
178
+ const service = new SharpApiRelatedJobPositionsService(process.env.SHARP_API_KEY);
179
+
180
+ service.generateRelatedJobPositions('DevOps Engineer', 'English', 6)
181
+ .then(statusUrl => service.fetchResults(statusUrl))
182
+ .then(result => {
183
+ const data = result.getResultJson();
184
+ console.log(`Related positions for ${data.result.job_position}:`);
185
+
186
+ data.result.related_job_positions
187
+ .sort((a, b) => b.weight - a.weight)
188
+ .forEach((position, index) => {
189
+ console.log(`${index + 1}. ${position.name} (relevance: ${position.weight}/10)`);
190
+ });
191
+ })
192
+ .catch(error => console.error('Generation failed:', error));
193
+ ```
194
+
195
+ ### Job Recommendation System
196
+
197
+ ```javascript
198
+ const service = new SharpApiRelatedJobPositionsService(process.env.SHARP_API_KEY);
199
+
200
+ async function recommendCareerPaths(currentPosition) {
201
+ const statusUrl = await service.generateRelatedJobPositions(
202
+ currentPosition,
203
+ 'English',
204
+ 15
205
+ );
206
+
207
+ const result = await service.fetchResults(statusUrl);
208
+ const data = result.getResultJson();
209
+
210
+ // Categorize by relevance
211
+ const exactMatch = data.result.related_job_positions.filter(p => p.weight === 10);
212
+ const highlyRelated = data.result.related_job_positions.filter(p => p.weight >= 8 && p.weight < 10);
213
+ const related = data.result.related_job_positions.filter(p => p.weight >= 6 && p.weight < 8);
214
+
215
+ return {
216
+ current: currentPosition,
217
+ exactMatches: exactMatch.map(p => p.name),
218
+ lateralMoves: highlyRelated.map(p => p.name),
219
+ careerPivots: related.map(p => p.name)
220
+ };
221
+ }
222
+
223
+ const recommendations = await recommendCareerPaths('Product Manager');
224
+
225
+ console.log('Career Path Recommendations:');
226
+ console.log('\nLateral Moves (Similar Roles):');
227
+ recommendations.lateralMoves.forEach(job => console.log(` - ${job}`));
228
+
229
+ console.log('\nCareer Pivot Options:');
230
+ recommendations.careerPivots.forEach(job => console.log(` - ${job}`));
231
+ ```
232
+
233
+ ### Job Board Enhancement
234
+
235
+ ```javascript
236
+ const service = new SharpApiRelatedJobPositionsService(process.env.SHARP_API_KEY);
237
+
238
+ async function expandJobSearch(userSearchTerm) {
239
+ const statusUrl = await service.generateRelatedJobPositions(
240
+ userSearchTerm,
241
+ 'English',
242
+ 20
243
+ );
244
+
245
+ const result = await service.fetchResults(statusUrl);
246
+ const data = result.getResultJson();
247
+
248
+ // Filter high-relevance positions for expanded search
249
+ const expandedSearchTerms = data.result.related_job_positions
250
+ .filter(position => position.weight >= 7)
251
+ .map(position => position.name);
252
+
253
+ return {
254
+ original: userSearchTerm,
255
+ expanded: [userSearchTerm, ...expandedSearchTerms],
256
+ message: `Searching for ${expandedSearchTerms.length + 1} related positions`
257
+ };
258
+ }
259
+
260
+ const expandedSearch = await expandJobSearch('Full Stack Developer');
261
+
262
+ console.log(expandedSearch.message);
263
+ console.log('Search terms:', expandedSearch.expanded.join(', '));
264
+ ```
265
+
266
+ ### Talent Pool Mapping
267
+
268
+ ```javascript
269
+ const service = new SharpApiRelatedJobPositionsService(process.env.SHARP_API_KEY);
270
+
271
+ async function mapTalentPool(targetPosition) {
272
+ const statusUrl = await service.generateRelatedJobPositions(
273
+ targetPosition,
274
+ 'English',
275
+ 12
276
+ );
277
+
278
+ const result = await service.fetchResults(statusUrl);
279
+ const data = result.getResultJson();
280
+
281
+ // Identify candidates with transferable experience
282
+ const transferablePositions = data.result.related_job_positions
283
+ .filter(position => position.weight >= 6)
284
+ .map(position => ({
285
+ title: position.name,
286
+ relevance: position.weight,
287
+ trainingRequired: position.weight < 8 ? 'Moderate' : 'Minimal'
288
+ }));
289
+
290
+ return {
291
+ targetRole: targetPosition,
292
+ candidates: transferablePositions,
293
+ totalPool: transferablePositions.length
294
+ };
295
+ }
296
+
297
+ const talentMap = await mapTalentPool('Machine Learning Engineer');
298
+
299
+ console.log(`Talent Pool for ${talentMap.targetRole}:`);
300
+ console.log(`Total candidate sources: ${talentMap.totalPool}`);
301
+
302
+ talentMap.candidates.forEach(candidate => {
303
+ console.log(`\n${candidate.title}`);
304
+ console.log(` Relevance: ${candidate.relevance}/10`);
305
+ console.log(` Training: ${candidate.trainingRequired}`);
306
+ });
307
+ ```
308
+
309
+ ---
310
+
311
+ ## Use Cases
312
+
313
+ - **Job Recommendations**: Suggest related positions to job seekers
314
+ - **Career Pathing**: Guide professionals on potential career moves
315
+ - **Recruitment Expansion**: Broaden candidate search beyond exact title matches
316
+ - **Job Board Search**: Enhance search with related position suggestions
317
+ - **Internal Mobility**: Help HR identify lateral move opportunities
318
+ - **Talent Mapping**: Identify candidates with transferable experience
319
+ - **Job Description Writing**: Suggest alternative titles for positions
320
+
321
+ ---
322
+
323
+ ## API Endpoint
324
+
325
+ **POST** `/hr/related_job_positions`
326
+
327
+ For detailed API specifications, refer to:
328
+ - [Postman Documentation](https://documenter.getpostman.com/view/31106842/2sBXVeGsVT)
329
+ - [Product Page](https://sharpapi.com/en/catalog/ai/hr-tech/related-job-positions-generator)
330
+
331
+ ---
332
+
333
+ ## Related Packages
334
+
335
+ - [@sharpapi/sharpapi-node-related-skills](https://www.npmjs.com/package/@sharpapi/sharpapi-node-related-skills) - Related skills generator
336
+ - [@sharpapi/sharpapi-node-job-description](https://www.npmjs.com/package/@sharpapi/sharpapi-node-job-description) - Job descriptions
337
+ - [@sharpapi/sharpapi-node-parse-resume](https://www.npmjs.com/package/@sharpapi/sharpapi-node-parse-resume) - Resume parsing
338
+ - [@sharpapi/sharpapi-node-client](https://www.npmjs.com/package/@sharpapi/sharpapi-node-client) - Full SharpAPI SDK
339
+
340
+ ---
341
+
342
+ ## License
343
+
344
+ This project is licensed under the MIT License. See the [LICENSE.md](LICENSE.md) file for details.
345
+
346
+ ---
347
+
348
+ ## Support
349
+
350
+ - **Documentation**: [SharpAPI.com Documentation](https://sharpapi.com/documentation)
351
+ - **Issues**: [GitHub Issues](https://github.com/sharpapi/sharpapi-node-client/issues)
352
+ - **Email**: contact@sharpapi.com
353
+
354
+ ---
355
+
356
+ **Powered by [SharpAPI](https://sharpapi.com/) - AI-Powered API Workflow Automation**
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@sharpapi/sharpapi-node-related-job-positions",
3
+ "version": "1.0.0",
4
+ "description": "SharpAPI.com Node.js SDK for finding related job positions",
5
+ "main": "src/index.js",
6
+ "scripts": {
7
+ "test": "jest"
8
+ },
9
+ "keywords": [
10
+ "sharpapi",
11
+ "ai-powered",
12
+ "ai capabilities",
13
+ "api",
14
+ "ai api",
15
+ "api integration",
16
+ "artificial intelligence",
17
+ "natural language processing",
18
+ "restful api",
19
+ "nodejs",
20
+ "software development",
21
+ "hr tech",
22
+ "job positions",
23
+ "related job positions"
24
+ ],
25
+ "author": "Dawid Makowski <contact@sharpapi.com>",
26
+ "license": "MIT",
27
+ "dependencies": {
28
+ "@sharpapi/sharpapi-node-core": "file:../sharpapi-node-core"
29
+ },
30
+ "devDependencies": {
31
+ "jest": "^29.7.0"
32
+ },
33
+ "publishConfig": {
34
+ "access": "public"
35
+ },
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "https://github.com/sharpapi/sharpapi-node-related-job-positions.git"
39
+ }
40
+ }
@@ -0,0 +1,26 @@
1
+ const { SharpApiCoreService, SharpApiJobTypeEnum } = require('@sharpapi/sharpapi-node-core');
2
+
3
+ /**
4
+ * Service for finding related job positions using SharpAPI.com
5
+ */
6
+ class SharpApiRelatedJobPositionsService extends SharpApiCoreService {
7
+ /**
8
+ * Generates a list of related job positions with their weights as float value (1.0-10.0)
9
+ * where 10 equals 100%, the highest relevance score.
10
+ *
11
+ * @param {string} jobPositionName
12
+ * @param {string|null} language
13
+ * @param {number|null} maxQuantity
14
+ * @returns {Promise<string>} - The status URL.
15
+ */
16
+ async relatedJobPositions(jobPositionName, language = null, maxQuantity = null) {
17
+ const data = { content: jobPositionName };
18
+ if (language) data.language = language;
19
+ if (maxQuantity) data.max_quantity = maxQuantity;
20
+
21
+ const response = await this.makeRequest('POST', SharpApiJobTypeEnum.HR_RELATED_JOB_POSITIONS.url, data);
22
+ return this.parseStatusUrl(response);
23
+ }
24
+ }
25
+
26
+ module.exports = { SharpApiRelatedJobPositionsService };
package/src/index.js ADDED
@@ -0,0 +1,6 @@
1
+ // sharpapi-node-related-job-positions/src/index.js
2
+ const { SharpApiRelatedJobPositionsService } = require('./SharpApiRelatedJobPositionsService');
3
+
4
+ module.exports = {
5
+ SharpApiRelatedJobPositionsService,
6
+ };