-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
56 lines (48 loc) · 1.65 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
46
47
48
49
50
51
52
53
54
55
56
const uploadAsset = require('./actions/upload-asset');
const schedulePlaylistItem = require('./actions/schedule-playlist-item');
const assignScreenToPlaylist = require('./actions/assign-screen-to-playlist');
const completeWorkflow = require('./actions/complete-workflow');
const cleanupZapierContent = require('./actions/cleanup-zapier-content');
const { getScreens } = require('./triggers/get-screens');
const { getPlaylists } = require('./triggers/get-playlists');
const { getAssets } = require('./triggers/get-assets');
// Authentication setup
const authentication = {
type: 'custom',
test: {
headers: {
Authorization: 'Token {{bundle.authData.api_key}}',
},
url: 'https://api.screenlyapp.com/api/v4/assets/',
method: 'GET',
},
fields: [
{
key: 'api_key',
type: 'string',
required: true,
label: 'API Key',
helpText: 'See [this page](https://support.screenly.io/hc/en-us/articles/35897560148371-How-to-Generate-a-Screenly-API-Token) for a guide on how to generate an API key for your Screenly account.',
},
],
};
// Export the app definition
module.exports = {
version: require('./package.json').version,
platformVersion: require('zapier-platform-core').version,
authentication,
triggers: {
[getScreens.key]: getScreens,
[getPlaylists.key]: getPlaylists,
[getAssets.key]: getAssets,
},
creates: {
[uploadAsset.key]: uploadAsset,
[schedulePlaylistItem.key]: schedulePlaylistItem,
[assignScreenToPlaylist.key]: assignScreenToPlaylist,
[completeWorkflow.key]: completeWorkflow,
[cleanupZapierContent.key]: cleanupZapierContent,
},
searches: {},
resources: {},
};