-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthentication.js
More file actions
61 lines (57 loc) · 1.88 KB
/
authentication.js
File metadata and controls
61 lines (57 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const testAuth = (z, bundle) => {
const options = {
url: `https://${bundle.authData.domain}.applicantstack.com/o/api/hires/${
bundle.meta.page + 1
}`,
method: 'GET',
headers: {
Token: bundle.authData.Token,
Publisher: bundle.authData.Publisher,
},
params: {},
};
return z.request(options).then((response) => {
response.throwForStatus();
const results = response.json;
// You can do any parsing you need for results here before returning them
return results;
});
};
module.exports = {
type: 'custom',
test: testAuth,
fields: [
{
computed: false,
key: 'domain',
required: true,
label: 'Domain',
type: 'string',
helpText: 'The subdomain that ApplicantStack uses for your company. You can verify this information by going to [ApplicantStack Login](https://www.applicantstack.com/login/)',
inputFormat: 'https://{{input}}.applicantstack.com',
default: '{{process.env.DOMAIN}}',
},
{
computed: false,
key: 'Publisher',
required: true,
label: 'Publisher',
type: 'string',
helpText:
"A Publisher name should be passed in as well. This helps the ApplicantStack customer to see who is making the changes to their account through the API. This should be the name of your software so that the customer will recognize it. The Publisher's name is not configured anywhere, and you may use whatever you like. You will send the Publisher name through the Publisher parameter of the header.",
default: '{{process.env.PUBLISHER}}',
},
{
computed: false,
key: 'Token',
required: true,
label: 'API Token',
type: 'string',
helpText:
'Authentication Token found in DOMIAN.applicantstack.com/settings/show',
default: '{{process.env.TOKEN}}',
},
],
connectionLabel: 'Get Hires',
customConfig: {},
};