-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathissue.js
61 lines (47 loc) · 1.77 KB
/
issue.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
57
58
59
60
61
/**!
* gitlab - lib/resources/issue.js
*
* Copyright(c) repo-utils and other contributors.
* MIT Licensed
*
* Authors:
* fengmk2 <[email protected]> (http://fengmk2.com)
*/
'use strict';
/**
* Module dependencies.
*/
var util = require('util');
var RESTFulResource = require('restful-client').RESTFulResource;
module.exports = Issue;
function Issue(client) {
this.constructor.super_.call(this, client, '/projects/:id/issues', 'issue_id');
}
util.inherits(Issue, RESTFulResource);
Issue.prototype.listNotes = function (params, callback) {
this.client.request('get', this.onePath + '/notes', params, callback);
};
Issue.prototype.createNote = function (params, callback) {
this.client.request('post', this.onePath + '/notes', params, callback);
};
Issue.prototype.getNote = function (params, callback) {
this.client.request('get', this.onePath + '/notes/:note_id', params, callback);
};
Issue.prototype.updateNote = function (params, callback) {
this.client.request('put', this.onePath + '/notes/:note_id', params, callback);
};
Issue.prototype.timeEstimate = function (params, callback) {
this.client.request('post', this.onePath + '/time_estimate', params, callback);
};
Issue.prototype.resetTimeEstimate = function (params, callback) {
this.client.request('post', this.onePath + '/reset_time_estimate', params, callback);
};
Issue.prototype.addSpentTime = function (params, callback) {
this.client.request('post', this.onePath + '/add_spent_time', params, callback);
};
Issue.prototype.resetSpentTime = function (params, callback) {
this.client.request('post', this.onePath + '/reset_spent_time', params, callback);
};
Issue.prototype.timeStats = function (params, callback) {
this.client.request('get', this.onePath + '/time_stats', params, callback);
};