Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 54 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | /** |
||
5 | 'use strict'; |
||
6 | |||
7 | const Sandcage = require('..'); |
||
8 | |||
9 | const sandcage = new Sandcage('[YOUR SANDCAGE API KEY]'); |
||
10 | const payload = { |
||
11 | jobs: [ |
||
12 | { |
||
13 | url: 'http://cdn.sandcage.com/p/a/img/logo.jpg', |
||
14 | tasks: [ |
||
15 | { |
||
16 | actions: 'save' |
||
17 | }, |
||
18 | { |
||
19 | actions: 'resize', |
||
20 | filename: 'hello_world.jpg', |
||
21 | width: 200 |
||
22 | }, |
||
23 | { |
||
24 | actions: 'crop', |
||
25 | coords: '10,10,50,50' |
||
26 | }, |
||
27 | { |
||
28 | 'reference_id': '123456789', |
||
29 | actions: 'rotate', |
||
30 | degrees: 90 |
||
31 | }, |
||
32 | { |
||
33 | actions: 'cover', |
||
34 | width: 60, |
||
35 | height: 60, |
||
36 | cover: 'middle,center' |
||
37 | } |
||
38 | ] |
||
39 | }, |
||
40 | { |
||
41 | url: 'http://cdn.sandcage.com/p/a/img/header_404.png', |
||
42 | tasks: [ |
||
43 | { |
||
44 | actions: 'resize', |
||
45 | height: 30 |
||
46 | } |
||
47 | ] |
||
48 | } |
||
49 | ] |
||
50 | }; |
||
51 | |||
52 | const callbackUrl = ''; |
||
53 | |||
54 | sandcage |
||
55 | .scheduleFiles(payload, callbackUrl) |
||
56 | .then((result) => { |
||
57 | console.log(result); |
||
|
|||
58 | }); |