Completed
Branch master (ee7956)
by Sand
01:05
created

examples/schedule-files.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 54
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 0
wmc 1
nc 1
mnd 0
bc 1
fnc 1
dl 0
loc 54
rs 10
bpm 1
cpm 1
noi 1
c 1
b 0
f 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A schedule-files.js ➔ ??? 0 3 1
1
/**
2
 * Created by vedi on 30/10/2016.
3
 */
4
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);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
58
  });