myinterview
Advanced tools
Comparing version 1.1.12 to 1.2.1
@@ -6,8 +6,19 @@ import { IApiResponseObj, IJobUpdateBody, IJob, ICandidate, IGlobalApiSdkConfig, IJobCreateWithCandidatesBody, IJobCreateBody, IUpdateIntelligenceBody } from './utils'; | ||
static getJobsByIds(ids: string[], instanceConfig?: IGlobalApiSdkConfig): Promise<IApiResponseObj<IJob[]>>; | ||
static getJob(id: string, instanceConfig?: IGlobalApiSdkConfig): Promise<IApiResponseObj<IJob>>; | ||
static createJob(body: IJobCreateBody, instanceConfig?: IGlobalApiSdkConfig): Promise<IApiResponseObj<IJob>>; | ||
static getJob(id: string, options?: { | ||
getUpdateUrl?: boolean; | ||
}, instanceConfig?: IGlobalApiSdkConfig): Promise<IApiResponseObj<IJob & { | ||
direct_link?: string; | ||
update_url?: string; | ||
}>>; | ||
static createJob(body: IJobCreateBody, instanceConfig?: IGlobalApiSdkConfig): Promise<IApiResponseObj<IJob & { | ||
direct_link?: string; | ||
update_url?: string; | ||
}>>; | ||
static createJobWithCandidates(body: IJobCreateWithCandidatesBody, instanceConfig?: IGlobalApiSdkConfig): Promise<IApiResponseObj<{ | ||
candidates: ICandidate[]; | ||
message: string; | ||
job: IJob; | ||
job: IJob & { | ||
direct_link?: string; | ||
update_url?: string; | ||
}; | ||
}>>; | ||
@@ -25,2 +36,5 @@ static updateJob(body: IJobUpdateBody, instanceConfig?: IGlobalApiSdkConfig): Promise<IApiResponseObj<IJob>>; | ||
}>>; | ||
static getJobUpdateUrl(id: string, instanceConfig?: IGlobalApiSdkConfig): Promise<IApiResponseObj<{ | ||
url: string; | ||
}>>; | ||
} |
@@ -39,5 +39,5 @@ "use strict"; | ||
} | ||
static getJob(id, instanceConfig) { | ||
static getJob(id, options = {}, instanceConfig) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return (yield (0, axios_1.default)(new this(instanceConfig).makeApiCall('getJob', { id }))).data; | ||
return (yield (0, axios_1.default)(new this(instanceConfig).makeApiCall('getJob', Object.assign({ id }, options)))).data; | ||
}); | ||
@@ -65,2 +65,7 @@ } | ||
} | ||
static getJobUpdateUrl(id, instanceConfig) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return (yield (0, axios_1.default)(new this(instanceConfig).makeApiCall('getJobUpdateUrl', { id }))).data; | ||
}); | ||
} | ||
} | ||
@@ -82,3 +87,3 @@ __decorate([ | ||
__metadata("design:type", Function), | ||
__metadata("design:paramtypes", [String, Object]), | ||
__metadata("design:paramtypes", [String, Object, Object]), | ||
__metadata("design:returntype", Promise) | ||
@@ -85,0 +90,0 @@ ], Jobs, "getJob", null); |
@@ -7,2 +7,14 @@ "use strict"; | ||
class MyInterviewApi { | ||
static populateHeaders(config) { | ||
const timestamp = Date.now(); | ||
const token = (0, utils_1.makeApiToken)(config.secret, config.companyId, config.accessKey, timestamp); | ||
return { | ||
'x-myinterview-timestamp': timestamp.toString(), | ||
'x-myinterview-key': config.accessKey, | ||
'x-myinterview-signed': token, | ||
}; | ||
} | ||
static setConfig(config) { | ||
this.config = config; | ||
} | ||
constructor(instanceConfig) { | ||
@@ -20,14 +32,2 @@ this.instanceConfig = instanceConfig; | ||
} | ||
static populateHeaders(config) { | ||
const timestamp = Date.now(); | ||
const token = (0, utils_1.makeApiToken)(config.secret, config.companyId, config.accessKey, timestamp); | ||
return { | ||
'x-myinterview-timestamp': timestamp.toString(), | ||
'x-myinterview-key': config.accessKey, | ||
'x-myinterview-signed': token, | ||
}; | ||
} | ||
static setConfig(config) { | ||
this.config = config; | ||
} | ||
makeApiCall(action, data) { | ||
@@ -90,3 +90,3 @@ var _a, _b, _c, _d, _e, _f, _g; | ||
method: 'get', | ||
url: Helpers_1.Helpers.cleanURL(`${baseURL}/jobs/${data.id}`), | ||
url: Helpers_1.Helpers.cleanURL(`${baseURL}/jobs/${data.id}?${(data === null || data === void 0 ? void 0 : data.getUpdateUrl) ? 'update_url=1' : ''}`), | ||
headers, | ||
@@ -128,2 +128,8 @@ }; | ||
}; | ||
case 'getJobUpdateUrl': | ||
return { | ||
method: 'get', | ||
url: Helpers_1.Helpers.cleanURL(`${baseURL}/jobs/${data.id}/update_url`), | ||
headers, | ||
}; | ||
// Intelligence | ||
@@ -130,0 +136,0 @@ case 'updateJobIntelligence': { |
@@ -246,3 +246,3 @@ import { AxiosRequestConfig, Method } from 'axios'; | ||
} | ||
export declare type TraitNameTypes = 'Creative' | 'Strategic' | 'Disciplined' | 'Driven' | 'Friendly' | 'Outgoing' | 'Assertive' | 'Persuasive' | 'Stress Tolerant' | 'Optimistic'; | ||
export type TraitNameTypes = 'Creative' | 'Strategic' | 'Disciplined' | 'Driven' | 'Friendly' | 'Outgoing' | 'Assertive' | 'Persuasive' | 'Stress Tolerant' | 'Optimistic'; | ||
export interface IUpdateIntelligenceBody { | ||
@@ -249,0 +249,0 @@ job_id: string; |
{ | ||
"name": "myinterview", | ||
"version": "1.1.012", | ||
"version": "1.2.001", | ||
"description": "Build and integrate myInterview with ease via our node.js npm package and connect to the myInterview API.", | ||
@@ -43,3 +43,3 @@ "main": "dist/index.js", | ||
"eslint-config-standard": "^16.0.3", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-node": "^11.1.0", | ||
@@ -51,5 +51,5 @@ "eslint-plugin-prettier": "^3.4.0", | ||
"lint-staged": "^11.2.6", | ||
"prettier": "^2.7.1", | ||
"prettier": "^2.8.4", | ||
"ts-jest": "^27.1.5", | ||
"typescript": "^4.8.4" | ||
"typescript": "^4.9.5" | ||
}, | ||
@@ -59,4 +59,4 @@ "dependencies": { | ||
"dotenv": "^10.0.0", | ||
"express-validator": "^6.14.2" | ||
"express-validator": "^6.15.0" | ||
} | ||
} |
@@ -320,4 +320,10 @@ # MyInterview-node # | ||
You can obtain the new update URL to access a sleek and user-friendly interface in myInterview, which makes it easy to update your created job. | ||
If you add the options object with the flag getUpdateUrl. | ||
![Job Service](https://app-service-upload.s3.amazonaws.com/uploads/update-job.gif) | ||
```ts | ||
const id = "job_id" | ||
const options = { getUpdateUrl: true }; | ||
@@ -581,2 +587,16 @@ const res = await Jobs.getJob(id); | ||
### getJobUpdateUrl | ||
You can obtain the new update URL to access a sleek and user-friendly interface in myInterview, which makes it easy to update your created job. | ||
![Job Service](https://app-service-upload.s3.amazonaws.com/uploads/update-job.gif) | ||
```ts | ||
const id = "job_id" | ||
const res = await Jobs.getJobUpdateUrl(id); | ||
const url = res.data.url; | ||
``` | ||
## Videos | ||
@@ -583,0 +603,0 @@ ```js |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
104836
1830
863
Updatedexpress-validator@^6.15.0