-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
45 lines (37 loc) · 1.09 KB
/
index.js
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
const search = require('./searches/reportDetailed');
const authentication = {
type: 'custom',
test: {
url:
'https://app.tmetric.com/api/version',
},
fields: [
{
key: 'api_token',
type: 'string',
required: true,
helpText: 'Found on your profile page.',
},
],
};
const addApiTokenToHeader = (request, z, bundle) => {
request.headers.Authorization = `Bearer ${bundle.authData.api_token}`;
return request;
};
module.exports = {
// This is just shorthand to reference the installed dependencies you have.
// Zapier will need to know these before we can upload.
version: require('./package.json').version,
platformVersion: require('zapier-platform-core').version,
authentication: authentication,
beforeRequest: [addApiTokenToHeader],
// If you want your trigger to show up, you better include it here!
triggers: {},
// If you want your searches to show up, you better include it here!
searches: {
[search.key]: search
},
// If you want your creates to show up, you better include it here!
creates: {},
resources: {},
};