-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.cjs
51 lines (48 loc) · 1.05 KB
/
test.cjs
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
const kitsu = require('./lib/index.js')
const client = kitsu.createClient('http://localhost:8080/api')
let project, taskType, taskStatus, asset, task
client.isLoggedIn()
.then(res => {
return client.login('[email protected]', 'cococo08')
})
.then(res => {
return client.isLoggedIn()
})
.then(res => {
return client.getOpenProductions()
})
.then(projects => {
return client.getTaskType('Modeling')
})
.then(type => {
taskType = type
return client.getTaskStatus('wip')
})
.then(tstatus => {
taskStatus = tstatus
return client.getProductionByName('Caminandes')
})
.then(prod => {
project = prod
return client.getAssetByName(project.id, 'Lama')
})
.then(entity => {
asset = entity
return client.getTask(asset.id, taskType.id)
})
.then(t => {
task = t
return client.addComment(
task.id,
taskStatus.id,
'test',
[],
[]
)
})
.then(comment => {
return client.publish(task.id, taskStatus.id, './v1.png')
})
.catch(err => {
console.log(err)
})