tigger 0.0.38 → 0.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/constants.js +8 -8
- package/lib/index.js +5 -5
- package/lib/uris.js +9 -9
- package/lib/utilities/comment.js +21 -21
- package/lib/utilities/commit.js +35 -35
- package/lib/utilities/headers.js +17 -23
- package/lib/utilities/issue.js +28 -28
- package/lib/utilities/repository.js +11 -11
- package/lib/utilities/request.js +21 -21
- package/package.json +5 -1
- package/.swcrc +0 -5
- package/bin/example/handler/alterIssue.js +0 -30
- package/bin/example/handler/commit.js +0 -44
- package/bin/example/handler/createComment.js +0 -30
- package/bin/example/handler/createIssue.js +0 -28
- package/bin/example/handler/editComment.js +0 -32
- package/bin/example/handler/editIssue.js +0 -32
- package/bin/example/handler/issue.js +0 -26
- package/bin/example/handler/issues.js +0 -24
- package/bin/example/handler/removeComment.js +0 -30
- package/bin/example/operation/alterIssue.js +0 -29
- package/bin/example/operation/createComment.js +0 -29
- package/bin/example/operation/createIssue.js +0 -36
- package/bin/example/operation/editComment.js +0 -29
- package/bin/example/operation/editIssue.js +0 -29
- package/bin/example/operation/getBaseTreeSHA.js +0 -36
- package/bin/example/operation/getComments.js +0 -36
- package/bin/example/operation/getIssue.js +0 -35
- package/bin/example/operation/getIssues.js +0 -35
- package/bin/example/operation/getLatestCommitSHA.js +0 -36
- package/bin/example/operation/postCommitSHA.js +0 -35
- package/bin/example/operation/postCommitTreeSHA.js +0 -43
- package/bin/example/operation/postMetaJSONFileContent.js +0 -36
- package/bin/example/operation/postReadmeFileContent.js +0 -36
- package/bin/example/operation/postUpdatedHead.js +0 -29
- package/bin/example/operation/removeComment.js +0 -27
- package/bin/example.js +0 -24
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { issueUtilities } = require("../../../lib"); ///
|
|
4
|
-
|
|
5
|
-
const { issueGetRequest } = issueUtilities;
|
|
6
|
-
|
|
7
|
-
function getIssueOperation(next, done, context) {
|
|
8
|
-
const { repository, issueNumber, userAgent, clientId, clientSecret } = context;
|
|
9
|
-
|
|
10
|
-
issueGetRequest(repository, issueNumber, userAgent, clientId, clientSecret, (error, json) => {
|
|
11
|
-
if (error) {
|
|
12
|
-
done();
|
|
13
|
-
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const { message = null } = json;
|
|
18
|
-
|
|
19
|
-
if (message !== null) {
|
|
20
|
-
done();
|
|
21
|
-
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const issue = json; ///
|
|
26
|
-
|
|
27
|
-
Object.assign(context, {
|
|
28
|
-
issue
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
next();
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
module.exports = getIssueOperation;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { issueUtilities } = require("../../../lib"); ///
|
|
4
|
-
|
|
5
|
-
const { issuesGetRequest } = issueUtilities;
|
|
6
|
-
|
|
7
|
-
function getIssuesOperation(next, done, context) {
|
|
8
|
-
const { repository, state, userAgent, clientId, clientSecret } = context;
|
|
9
|
-
|
|
10
|
-
issuesGetRequest(repository, state, userAgent, clientId, clientSecret, (error, json) => {
|
|
11
|
-
if (error) {
|
|
12
|
-
done();
|
|
13
|
-
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const { message = null } = json;
|
|
18
|
-
|
|
19
|
-
if (message !== null) {
|
|
20
|
-
done();
|
|
21
|
-
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const issues = json; ///
|
|
26
|
-
|
|
27
|
-
Object.assign(context, {
|
|
28
|
-
issues
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
next();
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
module.exports = getIssuesOperation;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { commitUtilities } = require("../../../lib"); ///
|
|
4
|
-
|
|
5
|
-
const { latestCommitSHAGetRequest } = commitUtilities;
|
|
6
|
-
|
|
7
|
-
function getLatestCommitSHAOperation(next, done, context) {
|
|
8
|
-
const { repository, userAgent, clientId, clientSecret } = context;
|
|
9
|
-
|
|
10
|
-
latestCommitSHAGetRequest(repository, userAgent, clientId, clientSecret, (error, json) => {
|
|
11
|
-
if (error) {
|
|
12
|
-
done();
|
|
13
|
-
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const { object = null } = json;
|
|
18
|
-
|
|
19
|
-
if (object === null) {
|
|
20
|
-
done();
|
|
21
|
-
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const { sha } = object,
|
|
26
|
-
latestCommitSHA = sha; ///
|
|
27
|
-
|
|
28
|
-
Object.assign(context, {
|
|
29
|
-
latestCommitSHA
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
next();
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
module.exports = getLatestCommitSHAOperation;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { commitUtilities } = require("../../../lib"); ///
|
|
4
|
-
|
|
5
|
-
const { commitSHAPostRequest } = commitUtilities;
|
|
6
|
-
|
|
7
|
-
function postCommitSHAOperation(next, done, context) {
|
|
8
|
-
const { repository, commitMessage, commitTreeSHA, latestCommitSHA, userAgent, gitHubAccessToken } = context;
|
|
9
|
-
|
|
10
|
-
commitSHAPostRequest(repository, commitMessage, commitTreeSHA, latestCommitSHA, userAgent, gitHubAccessToken, (error, json) => {
|
|
11
|
-
if (error) {
|
|
12
|
-
done();
|
|
13
|
-
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const { sha = null } = json;
|
|
18
|
-
|
|
19
|
-
if (sha === null) {
|
|
20
|
-
done();
|
|
21
|
-
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const commitSHA = sha; ///
|
|
26
|
-
|
|
27
|
-
Object.assign(context, {
|
|
28
|
-
commitSHA
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
next();
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
module.exports = postCommitSHAOperation;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { commitUtilities } = require("../../../lib"); ///
|
|
4
|
-
|
|
5
|
-
const { commitTreeSHAPostRequest } = commitUtilities;
|
|
6
|
-
|
|
7
|
-
function postCommitTreeSHAOperation(next, done, context) {
|
|
8
|
-
const { repository, baseTreeSHA, readmeFileSHA, readmeFilePath, metaJSONFileSHA, metaJSONFilePath, userAgent, gitHubAccessToken } = context,
|
|
9
|
-
fileShAs = [
|
|
10
|
-
readmeFileSHA,
|
|
11
|
-
metaJSONFileSHA
|
|
12
|
-
],
|
|
13
|
-
filePaths = [
|
|
14
|
-
readmeFilePath,
|
|
15
|
-
metaJSONFilePath
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
commitTreeSHAPostRequest(repository, baseTreeSHA, fileShAs, filePaths, userAgent, gitHubAccessToken, (error, json) => {
|
|
19
|
-
if (error) {
|
|
20
|
-
done();
|
|
21
|
-
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const { sha = null } = json;
|
|
26
|
-
|
|
27
|
-
if (sha === null) {
|
|
28
|
-
done();
|
|
29
|
-
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const commitTreeSHA = sha; ///
|
|
34
|
-
|
|
35
|
-
Object.assign(context, {
|
|
36
|
-
commitTreeSHA
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
next();
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
module.exports = postCommitTreeSHAOperation;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { commitUtilities } = require("../../../lib"); ///
|
|
4
|
-
|
|
5
|
-
const { contentBlobSHAPostRequest } = commitUtilities;
|
|
6
|
-
|
|
7
|
-
function postMetaJSONFileContentOperation(next, done, context) {
|
|
8
|
-
const { repository, userAgent, gitHubAccessToken, metaJSONFileContent } = context,
|
|
9
|
-
content = metaJSONFileContent; ///
|
|
10
|
-
|
|
11
|
-
contentBlobSHAPostRequest(repository, content, userAgent, gitHubAccessToken, (error, json) => {
|
|
12
|
-
if (error) {
|
|
13
|
-
done();
|
|
14
|
-
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const { sha = null } = json;
|
|
19
|
-
|
|
20
|
-
if (sha === null) {
|
|
21
|
-
done();
|
|
22
|
-
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const metaJSONFileSHA = sha;
|
|
27
|
-
|
|
28
|
-
Object.assign(context, {
|
|
29
|
-
metaJSONFileSHA
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
next();
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
module.exports = postMetaJSONFileContentOperation;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { commitUtilities } = require("../../../lib"); ///
|
|
4
|
-
|
|
5
|
-
const { contentBlobSHAPostRequest } = commitUtilities;
|
|
6
|
-
|
|
7
|
-
function postReadmeFileContentOperation(next, done, context) {
|
|
8
|
-
const { repository, userAgent, gitHubAccessToken, readmeFileContent } = context,
|
|
9
|
-
content = readmeFileContent; ///
|
|
10
|
-
|
|
11
|
-
contentBlobSHAPostRequest(repository, content, userAgent, gitHubAccessToken, (error, json) => {
|
|
12
|
-
if (error) {
|
|
13
|
-
done();
|
|
14
|
-
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const { sha = null } = json;
|
|
19
|
-
|
|
20
|
-
if (sha === null) {
|
|
21
|
-
done();
|
|
22
|
-
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const readmeFileSHA = sha; ///
|
|
27
|
-
|
|
28
|
-
Object.assign(context, {
|
|
29
|
-
readmeFileSHA
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
next();
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
module.exports = postReadmeFileContentOperation;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { commitUtilities } = require("../../../lib"); ///
|
|
4
|
-
|
|
5
|
-
const { updatedHeadPostRequest } = commitUtilities;
|
|
6
|
-
|
|
7
|
-
function postUpdatedHeadOperation(next, done, context) {
|
|
8
|
-
const { repository, commitSHA, userAgent, gitHubAccessToken } = context;
|
|
9
|
-
|
|
10
|
-
updatedHeadPostRequest(repository, commitSHA, userAgent, gitHubAccessToken, (error, json) => {
|
|
11
|
-
if (error) {
|
|
12
|
-
done();
|
|
13
|
-
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const { object = null } = json;
|
|
18
|
-
|
|
19
|
-
if (object === null) {
|
|
20
|
-
done();
|
|
21
|
-
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
next();
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
module.exports = postUpdatedHeadOperation;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { commentUtilities } = require("../../../lib"); ///
|
|
4
|
-
|
|
5
|
-
const { removeCommentDeleteRequest } = commentUtilities;
|
|
6
|
-
|
|
7
|
-
function removeCommentOperation(next, done, context) {
|
|
8
|
-
const { repository, commentIdentifier, userAgent, gitHubAccessToken } = context;
|
|
9
|
-
|
|
10
|
-
removeCommentDeleteRequest(repository, commentIdentifier, userAgent, gitHubAccessToken, (error, string) => {
|
|
11
|
-
if (error) {
|
|
12
|
-
done();
|
|
13
|
-
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (string !== "") {
|
|
18
|
-
done();
|
|
19
|
-
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
next();
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
module.exports = removeCommentOperation;
|
package/bin/example.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const issueHandler = require("./example/handler/issue"),
|
|
4
|
-
issuesHandler = require("./example/handler/issues"),
|
|
5
|
-
commitHandler = require("./example/handler/commit"),
|
|
6
|
-
editIssueHandler = require("./example/handler/editIssue"),
|
|
7
|
-
alterIssueHandler = require("./example/handler/alterIssue"),
|
|
8
|
-
createIssueHandler = require("./example/handler/createIssue"),
|
|
9
|
-
editCommentHandler = require("./example/handler/editComment"),
|
|
10
|
-
createCommentHandler = require("./example/handler/createComment"),
|
|
11
|
-
removeCommentHandler = require("./example/handler/removeComment");
|
|
12
|
-
|
|
13
|
-
const clientId = "...",
|
|
14
|
-
userAgent = "...",
|
|
15
|
-
repository = "...",
|
|
16
|
-
clientSecret = "...",
|
|
17
|
-
gitHubAccessToken = "...",
|
|
18
|
-
context = {
|
|
19
|
-
clientId,
|
|
20
|
-
userAgent,
|
|
21
|
-
repository,
|
|
22
|
-
clientSecret,
|
|
23
|
-
gitHubAccessToken
|
|
24
|
-
};
|