@sharpapi/sharpapi-node-job-description 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 +329 -0
- package/package.json +40 -0
- package/src/Dto/JobDescriptionParameters.js +54 -0
- package/src/SharpApiJobDescriptionService.js +26 -0
- package/src/index.js +7 -0
package/README.md
ADDED
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# Job Description Generator API for Node.js
|
|
4
|
+
|
|
5
|
+
## 📋 Generate professional job descriptions with AI — powered by SharpAPI.
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@sharpapi/sharpapi-node-job-description)
|
|
8
|
+
[](https://github.com/sharpapi/sharpapi-node-client/blob/master/LICENSE.md)
|
|
9
|
+
|
|
10
|
+
**SharpAPI Job Description Generator** creates comprehensive, professional job descriptions based on position details, requirements, and company information. Perfect for HR departments, recruitment agencies, and job boards.
|
|
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-job-description
|
|
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 { SharpApiJobDescriptionService, JobDescriptionParameters } = require('@sharpapi/sharpapi-node-job-description');
|
|
51
|
+
|
|
52
|
+
const apiKey = process.env.SHARP_API_KEY;
|
|
53
|
+
const service = new SharpApiJobDescriptionService(apiKey);
|
|
54
|
+
|
|
55
|
+
const params = new JobDescriptionParameters(
|
|
56
|
+
'Senior Software Engineer', // name
|
|
57
|
+
'Tech Innovators Inc', // company_name
|
|
58
|
+
'5+ years', // minimum_work_experience
|
|
59
|
+
"Bachelor's Degree", // minimum_education
|
|
60
|
+
'Full-time', // employment_type
|
|
61
|
+
['JavaScript', 'Node.js', 'React'], // required_skills
|
|
62
|
+
['TypeScript', 'Docker'], // optional_skills
|
|
63
|
+
'United States', // country
|
|
64
|
+
true, // remote
|
|
65
|
+
false, // visa_sponsored
|
|
66
|
+
'Professional', // voice_tone
|
|
67
|
+
null, // context
|
|
68
|
+
'English' // language
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
async function generateJobDescription() {
|
|
72
|
+
try {
|
|
73
|
+
const statusUrl = await service.generateJobDescription(params);
|
|
74
|
+
console.log('Job submitted. Status URL:', statusUrl);
|
|
75
|
+
|
|
76
|
+
const result = await service.fetchResults(statusUrl);
|
|
77
|
+
console.log('Job description:', result.getResultJson());
|
|
78
|
+
} catch (error) {
|
|
79
|
+
console.error('Error:', error.message);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
generateJobDescription();
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## API Documentation
|
|
89
|
+
|
|
90
|
+
### Methods
|
|
91
|
+
|
|
92
|
+
#### `generateJobDescription(params: JobDescriptionParameters): Promise<string>`
|
|
93
|
+
|
|
94
|
+
Generates a comprehensive job description based on the provided parameters.
|
|
95
|
+
|
|
96
|
+
**Parameters (JobDescriptionParameters):**
|
|
97
|
+
- `name` (string, required): Job position name
|
|
98
|
+
- `company_name` (string, optional): Company name
|
|
99
|
+
- `minimum_work_experience` (string, optional): Required experience (e.g., "3-5 years")
|
|
100
|
+
- `minimum_education` (string, optional): Required education level
|
|
101
|
+
- `employment_type` (string, optional): Full-time, part-time, contract, etc.
|
|
102
|
+
- `required_skills` (array, optional): List of required skills
|
|
103
|
+
- `optional_skills` (array, optional): List of nice-to-have skills
|
|
104
|
+
- `country` (string, optional): Job location country
|
|
105
|
+
- `remote` (boolean, optional): Whether remote work is allowed
|
|
106
|
+
- `visa_sponsored` (boolean, optional): Whether visa sponsorship is available
|
|
107
|
+
- `voice_tone` (string, optional): Tone of the description (e.g., 'Professional', 'Casual')
|
|
108
|
+
- `context` (string, optional): Additional custom requirements
|
|
109
|
+
- `language` (string, optional): Output language (default: 'English')
|
|
110
|
+
|
|
111
|
+
**Returns:**
|
|
112
|
+
- Promise<string>: Status URL for polling the job result
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Response Format
|
|
117
|
+
|
|
118
|
+
The API returns a structured job description with three main sections:
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"data": {
|
|
123
|
+
"type": "api_job_result",
|
|
124
|
+
"id": "3c4e887a-0dfd-49b6-8edb-9280e468c210",
|
|
125
|
+
"attributes": {
|
|
126
|
+
"status": "success",
|
|
127
|
+
"type": "hr_job_description",
|
|
128
|
+
"result": {
|
|
129
|
+
"job_position": "Senior PHP Software Engineer",
|
|
130
|
+
"company_name": "Apple Inc",
|
|
131
|
+
"job_short_description": "We are seeking an experienced Senior PHP Software Engineer to join our dynamic team at Apple Inc. This is a full-time, remote position based in the United Kingdom with visa sponsorship available for qualified candidates.",
|
|
132
|
+
"job_requirements": [
|
|
133
|
+
"Bachelor's Degree in Computer Science or related field",
|
|
134
|
+
"Minimum 5 years of professional PHP development experience",
|
|
135
|
+
"Expert knowledge of PHP8 and modern PHP practices",
|
|
136
|
+
"Strong experience with Laravel framework",
|
|
137
|
+
"Proficiency in MySQL database design and optimization",
|
|
138
|
+
"Valid C-class driving license",
|
|
139
|
+
"Excellent problem-solving and analytical skills",
|
|
140
|
+
"Strong communication skills in English"
|
|
141
|
+
],
|
|
142
|
+
"job_responsibilities": [
|
|
143
|
+
"Design, develop, and maintain complex PHP applications using Laravel framework",
|
|
144
|
+
"Write clean, maintainable, and efficient code following best practices",
|
|
145
|
+
"Optimize database queries and ensure high performance of MySQL databases",
|
|
146
|
+
"Collaborate with cross-functional teams to define and implement new features",
|
|
147
|
+
"Participate in code reviews and provide constructive feedback",
|
|
148
|
+
"Mentor junior developers and share knowledge with the team",
|
|
149
|
+
"Stay updated with the latest PHP and Laravel developments",
|
|
150
|
+
"Troubleshoot and resolve technical issues in production environments"
|
|
151
|
+
],
|
|
152
|
+
"optional_skills": [
|
|
153
|
+
"Experience with AWS RDS and AWS Aurora",
|
|
154
|
+
"Familiarity with GitFlow workflow",
|
|
155
|
+
"Knowledge of microservices architecture",
|
|
156
|
+
"Experience with CI/CD pipelines"
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Examples
|
|
167
|
+
|
|
168
|
+
### Basic Job Description
|
|
169
|
+
|
|
170
|
+
```javascript
|
|
171
|
+
const { SharpApiJobDescriptionService, JobDescriptionParameters } = require('@sharpapi/sharpapi-node-job-description');
|
|
172
|
+
|
|
173
|
+
const service = new SharpApiJobDescriptionService(process.env.SHARP_API_KEY);
|
|
174
|
+
|
|
175
|
+
const params = new JobDescriptionParameters(
|
|
176
|
+
'Marketing Manager',
|
|
177
|
+
'Acme Corp',
|
|
178
|
+
'3-5 years',
|
|
179
|
+
"Bachelor's Degree in Marketing",
|
|
180
|
+
'Full-time',
|
|
181
|
+
['Digital Marketing', 'SEO', 'Content Strategy'],
|
|
182
|
+
['Google Analytics', 'HubSpot'],
|
|
183
|
+
'Canada',
|
|
184
|
+
false,
|
|
185
|
+
false,
|
|
186
|
+
'Professional',
|
|
187
|
+
null,
|
|
188
|
+
'English'
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
service.generateJobDescription(params)
|
|
192
|
+
.then(statusUrl => service.fetchResults(statusUrl))
|
|
193
|
+
.then(result => {
|
|
194
|
+
const jobDesc = result.getResultJson().result;
|
|
195
|
+
console.log('Position:', jobDesc.job_position);
|
|
196
|
+
console.log('\nDescription:', jobDesc.job_short_description);
|
|
197
|
+
console.log('\nRequirements:');
|
|
198
|
+
jobDesc.job_requirements.forEach((req, i) => console.log(`${i + 1}. ${req}`));
|
|
199
|
+
})
|
|
200
|
+
.catch(error => console.error('Generation failed:', error));
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Bulk Job Description Generation
|
|
204
|
+
|
|
205
|
+
```javascript
|
|
206
|
+
const service = new SharpApiJobDescriptionService(process.env.SHARP_API_KEY);
|
|
207
|
+
|
|
208
|
+
const positions = [
|
|
209
|
+
{ title: 'Frontend Developer', skills: ['React', 'TypeScript', 'CSS'] },
|
|
210
|
+
{ title: 'Backend Developer', skills: ['Node.js', 'PostgreSQL', 'Docker'] },
|
|
211
|
+
{ title: 'Full Stack Developer', skills: ['JavaScript', 'MongoDB', 'Express'] }
|
|
212
|
+
];
|
|
213
|
+
|
|
214
|
+
async function generateMultipleDescriptions(positions) {
|
|
215
|
+
const descriptions = [];
|
|
216
|
+
|
|
217
|
+
for (const position of positions) {
|
|
218
|
+
const params = new JobDescriptionParameters(
|
|
219
|
+
position.title,
|
|
220
|
+
'TechCorp',
|
|
221
|
+
'2+ years',
|
|
222
|
+
"Bachelor's Degree",
|
|
223
|
+
'Full-time',
|
|
224
|
+
position.skills,
|
|
225
|
+
[],
|
|
226
|
+
'United States',
|
|
227
|
+
true,
|
|
228
|
+
false,
|
|
229
|
+
'Professional',
|
|
230
|
+
null,
|
|
231
|
+
'English'
|
|
232
|
+
);
|
|
233
|
+
|
|
234
|
+
const statusUrl = await service.generateJobDescription(params);
|
|
235
|
+
const result = await service.fetchResults(statusUrl);
|
|
236
|
+
descriptions.push(result.getResultJson().result);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return descriptions;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const allDescriptions = await generateMultipleDescriptions(positions);
|
|
243
|
+
console.log(`Generated ${allDescriptions.length} job descriptions`);
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Customized Job Description with Context
|
|
247
|
+
|
|
248
|
+
```javascript
|
|
249
|
+
const service = new SharpApiJobDescriptionService(process.env.SHARP_API_KEY);
|
|
250
|
+
|
|
251
|
+
const params = new JobDescriptionParameters(
|
|
252
|
+
'DevOps Engineer',
|
|
253
|
+
'CloudTech Solutions',
|
|
254
|
+
'4+ years',
|
|
255
|
+
"Bachelor's in Computer Science",
|
|
256
|
+
'Full-time',
|
|
257
|
+
['Kubernetes', 'AWS', 'Terraform', 'CI/CD'],
|
|
258
|
+
['Prometheus', 'Grafana', 'Helm'],
|
|
259
|
+
'Germany',
|
|
260
|
+
true,
|
|
261
|
+
true,
|
|
262
|
+
'Professional',
|
|
263
|
+
'Must have experience with financial services industry and German language skills',
|
|
264
|
+
'English'
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
const statusUrl = await service.generateJobDescription(params);
|
|
268
|
+
const result = await service.fetchResults(statusUrl);
|
|
269
|
+
const jobDesc = result.getResultJson().result;
|
|
270
|
+
|
|
271
|
+
// Format for posting
|
|
272
|
+
console.log('='.repeat(60));
|
|
273
|
+
console.log(`${jobDesc.job_position} at ${jobDesc.company_name}`);
|
|
274
|
+
console.log('='.repeat(60));
|
|
275
|
+
console.log('\n' + jobDesc.job_short_description);
|
|
276
|
+
console.log('\n**Requirements:**');
|
|
277
|
+
jobDesc.job_requirements.forEach(req => console.log(`• ${req}`));
|
|
278
|
+
console.log('\n**Responsibilities:**');
|
|
279
|
+
jobDesc.job_responsibilities.forEach(resp => console.log(`• ${resp}`));
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Use Cases
|
|
285
|
+
|
|
286
|
+
- **Job Postings**: Create compelling job descriptions for job boards
|
|
287
|
+
- **Internal Recruitment**: Generate consistent job descriptions for internal positions
|
|
288
|
+
- **Recruitment Agencies**: Quickly create professional job specs for clients
|
|
289
|
+
- **Career Pages**: Populate company career sites with well-written descriptions
|
|
290
|
+
- **ATS Integration**: Generate descriptions for Applicant Tracking Systems
|
|
291
|
+
- **Job Description Templates**: Create standardized templates for similar roles
|
|
292
|
+
- **Multi-language Hiring**: Generate descriptions in multiple languages
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## API Endpoint
|
|
297
|
+
|
|
298
|
+
**POST** `/hr/job_description`
|
|
299
|
+
|
|
300
|
+
For detailed API specifications, refer to:
|
|
301
|
+
- [Postman Documentation](https://documenter.getpostman.com/view/31106842/2sBXVeGsVR)
|
|
302
|
+
- [Product Page](https://sharpapi.com/en/catalog/ai/hr-tech/job-description-generator)
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## Related Packages
|
|
307
|
+
|
|
308
|
+
- [@sharpapi/sharpapi-node-related-skills](https://www.npmjs.com/package/@sharpapi/sharpapi-node-related-skills) - Skills generation
|
|
309
|
+
- [@sharpapi/sharpapi-node-related-job-positions](https://www.npmjs.com/package/@sharpapi/sharpapi-node-related-job-positions) - Related positions
|
|
310
|
+
- [@sharpapi/sharpapi-node-parse-resume](https://www.npmjs.com/package/@sharpapi/sharpapi-node-parse-resume) - Resume parsing
|
|
311
|
+
- [@sharpapi/sharpapi-node-client](https://www.npmjs.com/package/@sharpapi/sharpapi-node-client) - Full SharpAPI SDK
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
## License
|
|
316
|
+
|
|
317
|
+
This project is licensed under the MIT License. See the [LICENSE.md](LICENSE.md) file for details.
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Support
|
|
322
|
+
|
|
323
|
+
- **Documentation**: [SharpAPI.com Documentation](https://sharpapi.com/documentation)
|
|
324
|
+
- **Issues**: [GitHub Issues](https://github.com/sharpapi/sharpapi-node-client/issues)
|
|
325
|
+
- **Email**: contact@sharpapi.com
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
**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-job-description",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "SharpAPI.com Node.js SDK for generating job descriptions",
|
|
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 description",
|
|
23
|
+
"job posting"
|
|
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-job-description.git"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JobDescriptionParameters DTO
|
|
3
|
+
*/
|
|
4
|
+
class JobDescriptionParameters {
|
|
5
|
+
constructor(
|
|
6
|
+
name,
|
|
7
|
+
company_name = null,
|
|
8
|
+
minimum_work_experience = null,
|
|
9
|
+
minimum_education = null,
|
|
10
|
+
employment_type = null,
|
|
11
|
+
required_skills = null,
|
|
12
|
+
optional_skills = null,
|
|
13
|
+
country = null,
|
|
14
|
+
remote = null,
|
|
15
|
+
visa_sponsored = null,
|
|
16
|
+
voice_tone = null,
|
|
17
|
+
context = null,
|
|
18
|
+
language = null,
|
|
19
|
+
) {
|
|
20
|
+
this.name = name;
|
|
21
|
+
this.company_name = company_name;
|
|
22
|
+
this.minimum_work_experience = minimum_work_experience;
|
|
23
|
+
this.minimum_education = minimum_education;
|
|
24
|
+
this.employment_type = employment_type;
|
|
25
|
+
this.required_skills = required_skills;
|
|
26
|
+
this.optional_skills = optional_skills;
|
|
27
|
+
this.country = country;
|
|
28
|
+
this.remote = remote;
|
|
29
|
+
this.visa_sponsored = visa_sponsored;
|
|
30
|
+
this.voice_tone = voice_tone;
|
|
31
|
+
this.context = context;
|
|
32
|
+
this.language = language;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
toJSON() {
|
|
36
|
+
return {
|
|
37
|
+
name: this.name,
|
|
38
|
+
company_name: this.company_name,
|
|
39
|
+
minimum_work_experience: this.minimum_work_experience,
|
|
40
|
+
minimum_education: this.minimum_education,
|
|
41
|
+
employment_type: this.employment_type,
|
|
42
|
+
required_skills: this.required_skills,
|
|
43
|
+
optional_skills: this.optional_skills,
|
|
44
|
+
country: this.country,
|
|
45
|
+
remote: this.remote,
|
|
46
|
+
visa_sponsored: this.visa_sponsored,
|
|
47
|
+
voice_tone: this.voice_tone,
|
|
48
|
+
context: this.context,
|
|
49
|
+
language: this.language,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
module.exports = { JobDescriptionParameters };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const { SharpApiCoreService, SharpApiJobTypeEnum } = require('@sharpapi/sharpapi-node-core');
|
|
2
|
+
const { JobDescriptionParameters } = require('./Dto/JobDescriptionParameters');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Service for generating job descriptions using SharpAPI.com
|
|
6
|
+
*/
|
|
7
|
+
class SharpApiJobDescriptionService extends SharpApiCoreService {
|
|
8
|
+
/**
|
|
9
|
+
* Generates a job description based on a set of parameters
|
|
10
|
+
* provided via JobDescriptionParameters DTO object.
|
|
11
|
+
* This endpoint provides concise job details in the response format,
|
|
12
|
+
* including the short description, job requirements, and job responsibilities.
|
|
13
|
+
*
|
|
14
|
+
* Only the job position `name` parameter is required inside jobDescriptionParameters.
|
|
15
|
+
*
|
|
16
|
+
* @param {JobDescriptionParameters} jobDescriptionParameters
|
|
17
|
+
* @returns {Promise<string>} - The status URL.
|
|
18
|
+
*/
|
|
19
|
+
async generateJobDescription(jobDescriptionParameters) {
|
|
20
|
+
const data = jobDescriptionParameters.toJSON();
|
|
21
|
+
const response = await this.makeRequest('POST', SharpApiJobTypeEnum.HR_JOB_DESCRIPTION.url, data);
|
|
22
|
+
return this.parseStatusUrl(response);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = { SharpApiJobDescriptionService, JobDescriptionParameters };
|
package/src/index.js
ADDED