-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathcreate.js
More file actions
69 lines (61 loc) · 1.24 KB
/
create.js
File metadata and controls
69 lines (61 loc) · 1.24 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
62
63
64
65
66
67
68
69
#!/usr/bin/env node
import { Site } from 'calibre'
const create = async () => {
const name = 'Calibre API TEST'
const teamName = 'calibre'
const agentSettings = {
location: 'Frankfurt', // location tag
scheduleAnchor: 6,
scheduleInterval: 'every_x_hours' // options: off, daily, hourly, every_x_hours. default: off
}
const pages = [
{
name: 'Home',
url: 'https://calibreapp.com/',
canonical: true
},
{
name: 'CLI Landing',
url: 'https://calibreapp.com/cli'
},
{
name: 'Pricing',
url: 'https://calibreapp.com/pricing'
}
]
const testProfiles = [
{
name: 'Chrome Desktop',
device: 'Desktop',
connection: 'cable',
cookies: [
{
name: 'app.sid',
value: 'sessionId',
domain: 'calibreapp.com',
path: '/',
secure: true,
httpOnly: true
}
]
},
{
name: 'iPhone 12, 3G',
device: 'iPhone12',
connection: 'LTE'
}
]
try {
const site = await Site.create({
name,
team: teamName,
agentSettings,
pages,
testProfiles
})
console.log('Created', site)
} catch (e) {
console.error(e)
}
}
create()