tigger 0.0.39 → 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/package.json +5 -1
- package/.aiignore +0 -11
- package/.swcrc +0 -8
- 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
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tigger",
|
|
3
3
|
"author": "James Smith",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.40",
|
|
5
5
|
"license": "MIT, Anti-996",
|
|
6
6
|
"homepage": "https://github.com/djalbat/tigger",
|
|
7
7
|
"description": "Tales the fun out of using the GitHub API.",
|
|
@@ -28,5 +28,9 @@
|
|
|
28
28
|
"watch": "npm run clean && npm run batch && npm run incremental",
|
|
29
29
|
"watch-debug": "npm run clean && npm run batch-debug && npm run incremental-debug"
|
|
30
30
|
},
|
|
31
|
+
"files": [
|
|
32
|
+
"src",
|
|
33
|
+
"lib"
|
|
34
|
+
],
|
|
31
35
|
"main": "./lib/index.js"
|
|
32
36
|
}
|
package/.aiignore
DELETED
package/.swcrc
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { asynchronousUtilities } = require("necessary");
|
|
4
|
-
|
|
5
|
-
const getIssueOperation = require("../operation/getIssue"),
|
|
6
|
-
alterIssueOperation = require("../operation/alterIssue"),
|
|
7
|
-
getCommentsOperation = require("../operation/getComments");
|
|
8
|
-
|
|
9
|
-
const { sequence } = asynchronousUtilities;
|
|
10
|
-
|
|
11
|
-
function alterIssueHandler(context) {
|
|
12
|
-
const operations = [
|
|
13
|
-
alterIssueOperation,
|
|
14
|
-
getIssueOperation,
|
|
15
|
-
getCommentsOperation
|
|
16
|
-
],
|
|
17
|
-
state = "closed",
|
|
18
|
-
issueNumber = 1;
|
|
19
|
-
|
|
20
|
-
Object.assign(context, {
|
|
21
|
-
state,
|
|
22
|
-
issueNumber
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
sequence(operations, () => {
|
|
26
|
-
///
|
|
27
|
-
}, context);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
module.exports = alterIssueHandler;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { asynchronousUtilities } = require("necessary");
|
|
4
|
-
|
|
5
|
-
const postCommitSHAOperation = require("../operation/postCommitSHA"),
|
|
6
|
-
getBaseTreeSHAOperation = require("../operation/getBaseTreeSHA"),
|
|
7
|
-
postUpdatedHeadOperation = require("../operation/postUpdatedHead"),
|
|
8
|
-
postCommitTreeSHAOperation = require("../operation/postCommitTreeSHA"),
|
|
9
|
-
getLatestCommitSHAOperation = require("../operation/getLatestCommitSHA"),
|
|
10
|
-
postReadmeFileContentOperation = require("../operation/postReadmeFileContent"),
|
|
11
|
-
postMetaJSONFileContentOperation = require("../operation/postMetaJSONFileContent");
|
|
12
|
-
|
|
13
|
-
const { sequence } = asynchronousUtilities;
|
|
14
|
-
|
|
15
|
-
function commitHandler(context) {
|
|
16
|
-
const commitMessage = "...",
|
|
17
|
-
readmeFilePath = "...",
|
|
18
|
-
metaJSONFilePath = "...",
|
|
19
|
-
readmeFileContent = "...",
|
|
20
|
-
metaJSONFileContent = "...",
|
|
21
|
-
operations = [
|
|
22
|
-
getLatestCommitSHAOperation,
|
|
23
|
-
getBaseTreeSHAOperation,
|
|
24
|
-
postReadmeFileContentOperation,
|
|
25
|
-
postMetaJSONFileContentOperation,
|
|
26
|
-
postCommitTreeSHAOperation,
|
|
27
|
-
postCommitSHAOperation,
|
|
28
|
-
postUpdatedHeadOperation
|
|
29
|
-
];
|
|
30
|
-
|
|
31
|
-
Object.assign(context, {
|
|
32
|
-
commitMessage,
|
|
33
|
-
readmeFilePath,
|
|
34
|
-
metaJSONFilePath,
|
|
35
|
-
readmeFileContent,
|
|
36
|
-
metaJSONFileContent
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
sequence(operations, () => {
|
|
40
|
-
///
|
|
41
|
-
}, context);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
module.exports = commitHandler;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { asynchronousUtilities } = require("necessary");
|
|
4
|
-
|
|
5
|
-
const getIssueOperation = require("../operation/getIssue"),
|
|
6
|
-
getCommentsOperation = require("../operation/getComments"),
|
|
7
|
-
createCommentOperation = require("../operation/createComment");
|
|
8
|
-
|
|
9
|
-
const { sequence } = asynchronousUtilities;
|
|
10
|
-
|
|
11
|
-
function createCommentHandler(context) {
|
|
12
|
-
const operations = [
|
|
13
|
-
createCommentOperation,
|
|
14
|
-
getIssueOperation,
|
|
15
|
-
getCommentsOperation
|
|
16
|
-
],
|
|
17
|
-
issueNumber = 1,
|
|
18
|
-
description = "...";
|
|
19
|
-
|
|
20
|
-
Object.assign(context, {
|
|
21
|
-
description,
|
|
22
|
-
issueNumber
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
sequence(operations, () => {
|
|
26
|
-
///
|
|
27
|
-
}, context);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
module.exports = createCommentHandler;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { asynchronousUtilities } = require("necessary");
|
|
4
|
-
|
|
5
|
-
const getIssueOperation = require("../operation/getIssue"),
|
|
6
|
-
createIssueOperation = require("../operation/createIssue");
|
|
7
|
-
|
|
8
|
-
const { sequence } = asynchronousUtilities;
|
|
9
|
-
|
|
10
|
-
function createIssueHandler(context) {
|
|
11
|
-
const operations = [
|
|
12
|
-
createIssueOperation,
|
|
13
|
-
getIssueOperation
|
|
14
|
-
],
|
|
15
|
-
title = "...",
|
|
16
|
-
description = "...";
|
|
17
|
-
|
|
18
|
-
Object.assign(context, {
|
|
19
|
-
title,
|
|
20
|
-
description
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
sequence(operations, () => {
|
|
24
|
-
///
|
|
25
|
-
}, context);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
module.exports = createIssueHandler;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { asynchronousUtilities } = require("necessary");
|
|
4
|
-
|
|
5
|
-
const getIssueOperation = require("../operation/getIssue"),
|
|
6
|
-
getCommentsOperation = require("../operation/getComments"),
|
|
7
|
-
editCommentOperation = require("../operation/editComment");
|
|
8
|
-
|
|
9
|
-
const { sequence } = asynchronousUtilities;
|
|
10
|
-
|
|
11
|
-
function editCommentHandler(context) {
|
|
12
|
-
const operations = [
|
|
13
|
-
editCommentOperation,
|
|
14
|
-
getIssueOperation,
|
|
15
|
-
getCommentsOperation
|
|
16
|
-
],
|
|
17
|
-
issueNumber = 1,
|
|
18
|
-
description = "...",
|
|
19
|
-
commentIdentifier = 123;
|
|
20
|
-
|
|
21
|
-
Object.assign(context, {
|
|
22
|
-
description,
|
|
23
|
-
issueNumber,
|
|
24
|
-
commentIdentifier
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
sequence(operations, () => {
|
|
28
|
-
debugger
|
|
29
|
-
}, context);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
module.exports = editCommentHandler;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { asynchronousUtilities } = require("necessary");
|
|
4
|
-
|
|
5
|
-
const getIssueOperation = require("../operation/getIssue"),
|
|
6
|
-
editIssueOperation = require("../operation/editIssue"),
|
|
7
|
-
getCommentsOperation = require("../operation/getComments");
|
|
8
|
-
|
|
9
|
-
const { sequence } = asynchronousUtilities;
|
|
10
|
-
|
|
11
|
-
function editIssueHandler(context) {
|
|
12
|
-
const operations = [
|
|
13
|
-
editIssueOperation,
|
|
14
|
-
getIssueOperation,
|
|
15
|
-
getCommentsOperation
|
|
16
|
-
],
|
|
17
|
-
title = "...",
|
|
18
|
-
issueNumber = 1,
|
|
19
|
-
description = "...";
|
|
20
|
-
|
|
21
|
-
Object.assign(context, {
|
|
22
|
-
title,
|
|
23
|
-
description,
|
|
24
|
-
issueNumber
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
sequence(operations, () => {
|
|
28
|
-
///
|
|
29
|
-
}, context);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
module.exports = editIssueHandler;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { asynchronousUtilities } = require("necessary");
|
|
4
|
-
|
|
5
|
-
const getIssueOperation = require("../operation/getIssue"),
|
|
6
|
-
getCommentsOperation = require("../operation/getComments");
|
|
7
|
-
|
|
8
|
-
const { sequence } = asynchronousUtilities;
|
|
9
|
-
|
|
10
|
-
function issueHandler(context) {
|
|
11
|
-
const operations = [
|
|
12
|
-
getIssueOperation,
|
|
13
|
-
getCommentsOperation
|
|
14
|
-
],
|
|
15
|
-
issueNumber = 1;
|
|
16
|
-
|
|
17
|
-
Object.assign(context, {
|
|
18
|
-
issueNumber
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
sequence(operations, () => {
|
|
22
|
-
///
|
|
23
|
-
}, context);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
module.exports = issueHandler;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { asynchronousUtilities } = require("necessary");
|
|
4
|
-
|
|
5
|
-
const getIssuesOperation = require("../operation/getIssues");
|
|
6
|
-
|
|
7
|
-
const { sequence } = asynchronousUtilities;
|
|
8
|
-
|
|
9
|
-
function issuesHandler(context) {
|
|
10
|
-
const operations = [
|
|
11
|
-
getIssuesOperation
|
|
12
|
-
],
|
|
13
|
-
state = "open";
|
|
14
|
-
|
|
15
|
-
Object.assign(context, {
|
|
16
|
-
state
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
sequence(operations, () => {
|
|
20
|
-
///
|
|
21
|
-
}, context);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
module.exports = issuesHandler;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { asynchronousUtilities } = require("necessary");
|
|
4
|
-
|
|
5
|
-
const getIssueOperation = require("../operation/getIssue"),
|
|
6
|
-
getCommentsOperation = require("../operation/getComments"),
|
|
7
|
-
removeCommentOperation = require("../operation/removeComment");
|
|
8
|
-
|
|
9
|
-
const { sequence } = asynchronousUtilities;
|
|
10
|
-
|
|
11
|
-
function removeCommentHandler(context) {
|
|
12
|
-
const operations = [
|
|
13
|
-
removeCommentOperation,
|
|
14
|
-
getIssueOperation,
|
|
15
|
-
getCommentsOperation
|
|
16
|
-
],
|
|
17
|
-
issueNumber = 1,
|
|
18
|
-
commentIdentifier = 123;
|
|
19
|
-
|
|
20
|
-
Object.assign(context, {
|
|
21
|
-
issueNumber,
|
|
22
|
-
commentIdentifier
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
sequence(operations, () => {
|
|
26
|
-
///
|
|
27
|
-
}, context);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
module.exports = removeCommentHandler;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { issueUtilities } = require("../../../lib"); ///
|
|
4
|
-
|
|
5
|
-
const { alterIssuePatchRequest } = issueUtilities;
|
|
6
|
-
|
|
7
|
-
function alterIssueOperation(next, done, context) {
|
|
8
|
-
const { repository, state, issueNumber, userAgent, gitHubAccessToken } = context;
|
|
9
|
-
|
|
10
|
-
alterIssuePatchRequest(repository, state, issueNumber, userAgent, gitHubAccessToken, (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
|
-
next();
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
module.exports = alterIssueOperation;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { commentUtilities } = require("../../../lib"); ///
|
|
4
|
-
|
|
5
|
-
const { createCommentPostRequest } = commentUtilities;
|
|
6
|
-
|
|
7
|
-
function createCommentOperation(next, done, context) {
|
|
8
|
-
const { repository, description, issueNumber, userAgent, gitHubAccessToken } = context;
|
|
9
|
-
|
|
10
|
-
createCommentPostRequest(repository, description, issueNumber, userAgent, gitHubAccessToken, (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
|
-
next();
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
module.exports = createCommentOperation;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { issueUtilities } = require("../../../lib"); ///
|
|
4
|
-
|
|
5
|
-
const { createIssuePostRequest } = issueUtilities
|
|
6
|
-
|
|
7
|
-
function createIssueOperation(next, done, context) {
|
|
8
|
-
const { repository, title, description, userAgent, gitHubAccessToken } = context;
|
|
9
|
-
|
|
10
|
-
createIssuePostRequest(repository, title, description, userAgent, gitHubAccessToken, (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 { number } = json,
|
|
26
|
-
issueNumber = number; ///
|
|
27
|
-
|
|
28
|
-
Object.assign(context, {
|
|
29
|
-
issueNumber
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
next();
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
module.exports = createIssueOperation;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { commentUtilities } = require("../../../lib"); ///
|
|
4
|
-
|
|
5
|
-
const { editCommentPatchRequest } = commentUtilities;
|
|
6
|
-
|
|
7
|
-
function editCommentOperation(next, done, context) {
|
|
8
|
-
const { repository, description, commentIdentifier, userAgent, gitHubAccessToken } = context;
|
|
9
|
-
|
|
10
|
-
editCommentPatchRequest(repository, description, commentIdentifier, userAgent, gitHubAccessToken, (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
|
-
next();
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
module.exports = editCommentOperation;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { issueUtilities } = require("../../../lib"); ///
|
|
4
|
-
|
|
5
|
-
const { editIssuePatchRequest } = issueUtilities;
|
|
6
|
-
|
|
7
|
-
function editIssueOperation(next, done, context) {
|
|
8
|
-
const { repository, title, description, issueNumber, userAgent, gitHubAccessToken } = context;
|
|
9
|
-
|
|
10
|
-
editIssuePatchRequest(repository, title, description, issueNumber, userAgent, gitHubAccessToken, (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
|
-
next();
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
module.exports = editIssueOperation;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { commitUtilities } = require("../../../lib"); ///
|
|
4
|
-
|
|
5
|
-
const { baseTreeSHAGetRequest } = commitUtilities
|
|
6
|
-
|
|
7
|
-
function getBaseTreeSHAOperation(next, done, context) {
|
|
8
|
-
const { repository, userAgent, clientId, clientSecret, latestCommitSHA } = context;
|
|
9
|
-
|
|
10
|
-
baseTreeSHAGetRequest(repository, latestCommitSHA, userAgent, clientId, clientSecret, (error, json) => {
|
|
11
|
-
if (error) {
|
|
12
|
-
done();
|
|
13
|
-
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const { tree = null } = json;
|
|
18
|
-
|
|
19
|
-
if (tree === null) {
|
|
20
|
-
done();
|
|
21
|
-
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const { sha } = tree,
|
|
26
|
-
baseTreeSHA = sha; ///
|
|
27
|
-
|
|
28
|
-
Object.assign(context, {
|
|
29
|
-
baseTreeSHA
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
next();
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
module.exports = getBaseTreeSHAOperation;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { commentUtilities } = require("../../../lib"); ///
|
|
4
|
-
|
|
5
|
-
const { commentsGetRequest } = commentUtilities;
|
|
6
|
-
|
|
7
|
-
function getCommentsOperation(next, done, context) {
|
|
8
|
-
const { repository, issueNumber, userAgent, clientId, clientSecret } = context;
|
|
9
|
-
|
|
10
|
-
commentsGetRequest(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 } = context,
|
|
26
|
-
comments = json; ///
|
|
27
|
-
|
|
28
|
-
Object.assign(issue, {
|
|
29
|
-
comments
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
next();
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
module.exports = getCommentsOperation;
|
|
@@ -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
|
-
};
|