@activepieces/piece-github 0.5.0 → 0.5.1
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 -5
- package/src/index.js +6 -0
- package/src/index.js.map +1 -1
- package/src/lib/actions/create-commit-comment.d.ts +13 -0
- package/src/lib/actions/create-commit-comment.js +60 -0
- package/src/lib/actions/create-commit-comment.js.map +1 -0
- package/src/lib/actions/create-discussion-comment.d.ts +11 -0
- package/src/lib/actions/create-discussion-comment.js +60 -0
- package/src/lib/actions/create-discussion-comment.js.map +1 -0
- package/src/lib/actions/create-pull-request-review-comment.d.ts +14 -0
- package/src/lib/actions/create-pull-request-review-comment.js +61 -0
- package/src/lib/actions/create-pull-request-review-comment.js.map +1 -0
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-github",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@anthropic-ai/sdk": "0.33.1",
|
|
6
6
|
"@sinclair/typebox": "0.34.11",
|
|
7
|
-
"axios": "1.
|
|
7
|
+
"axios": "1.8.3",
|
|
8
8
|
"axios-retry": "4.4.1",
|
|
9
9
|
"deepmerge-ts": "7.1.0",
|
|
10
10
|
"mime-types": "2.1.35",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"replicate": "0.34.1",
|
|
14
14
|
"semver": "7.6.0",
|
|
15
15
|
"zod": "3.23.8",
|
|
16
|
-
"@activepieces/pieces-common": "0.4.
|
|
17
|
-
"@activepieces/pieces-framework": "0.7.
|
|
18
|
-
"@activepieces/shared": "0.10.
|
|
16
|
+
"@activepieces/pieces-common": "0.4.4",
|
|
17
|
+
"@activepieces/pieces-framework": "0.7.46",
|
|
18
|
+
"@activepieces/shared": "0.10.169",
|
|
19
19
|
"tslib": "1.14.1"
|
|
20
20
|
},
|
|
21
21
|
"overrides": {
|
package/src/index.js
CHANGED
|
@@ -12,6 +12,9 @@ const get_issue_information_1 = require("./lib/actions/get-issue-information");
|
|
|
12
12
|
const create_comment_on_a_issue_1 = require("./lib/actions/create-comment-on-a-issue");
|
|
13
13
|
const lock_issue_1 = require("./lib/actions/lock-issue");
|
|
14
14
|
const raw_graphql_query_1 = require("./lib/actions/raw-graphql-query");
|
|
15
|
+
const create_pull_request_review_comment_1 = require("./lib/actions/create-pull-request-review-comment");
|
|
16
|
+
const create_commit_comment_1 = require("./lib/actions/create-commit-comment");
|
|
17
|
+
const create_discussion_comment_1 = require("./lib/actions/create-discussion-comment");
|
|
15
18
|
exports.githubAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
16
19
|
required: true,
|
|
17
20
|
authUrl: 'https://github.com/login/oauth/authorize',
|
|
@@ -32,6 +35,9 @@ exports.github = (0, pieces_framework_1.createPiece)({
|
|
|
32
35
|
lock_issue_1.githubLockIssueAction,
|
|
33
36
|
unlock_issue_1.githubUnlockIssueAction,
|
|
34
37
|
raw_graphql_query_1.githubRawGraphqlQuery,
|
|
38
|
+
create_pull_request_review_comment_1.githubCreatePullRequestReviewCommentAction,
|
|
39
|
+
create_commit_comment_1.githubCreateCommitCommentAction,
|
|
40
|
+
create_discussion_comment_1.githubCreateDiscussionCommentAction,
|
|
35
41
|
(0, pieces_common_1.createCustomApiCallAction)({
|
|
36
42
|
baseUrl: () => 'https://api.github.com',
|
|
37
43
|
auth: exports.githubAuth,
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/github/src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAIwC;AACxC,iDAAqD;AACrD,6DAAqE;AACrE,6DAAqE;AACrE,2CAA+C;AAC/C,+EAAgF;AAChF,uFAAsF;AACtF,yDAAiE;AACjE,uEAAwE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["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
|
|
|
1
|
+
export declare const githubCreateCommitCommentAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
repository: import("@activepieces/pieces-framework").DropdownProperty<{
|
|
3
|
+
repo: string;
|
|
4
|
+
owner: string;
|
|
5
|
+
}, false> | import("@activepieces/pieces-framework").DropdownProperty<{
|
|
6
|
+
repo: string;
|
|
7
|
+
owner: string;
|
|
8
|
+
}, true>;
|
|
9
|
+
sha: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
+
body: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
11
|
+
path: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
12
|
+
position: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.githubCreateCommitCommentAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const index_1 = require("../../index");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
+
exports.githubCreateCommitCommentAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: index_1.githubAuth,
|
|
11
|
+
name: 'github_create_commit_comment',
|
|
12
|
+
displayName: 'Create Commit Comment',
|
|
13
|
+
description: 'Creates a comment on a commit in a GitHub repository',
|
|
14
|
+
props: {
|
|
15
|
+
repository: common_1.githubCommon.repositoryDropdown,
|
|
16
|
+
sha: pieces_framework_1.Property.ShortText({
|
|
17
|
+
displayName: 'Commit SHA',
|
|
18
|
+
description: 'The SHA of the commit to comment on',
|
|
19
|
+
required: true,
|
|
20
|
+
}),
|
|
21
|
+
body: pieces_framework_1.Property.LongText({
|
|
22
|
+
displayName: 'Comment Body',
|
|
23
|
+
description: 'The content of the comment',
|
|
24
|
+
required: true,
|
|
25
|
+
}),
|
|
26
|
+
path: pieces_framework_1.Property.ShortText({
|
|
27
|
+
displayName: 'File Path',
|
|
28
|
+
description: 'The relative path to the file to comment on (optional)',
|
|
29
|
+
required: false,
|
|
30
|
+
}),
|
|
31
|
+
position: pieces_framework_1.Property.Number({
|
|
32
|
+
displayName: 'Position',
|
|
33
|
+
description: 'The line index in the diff to comment on (optional)',
|
|
34
|
+
required: false,
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
run(_a) {
|
|
38
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
39
|
+
const { sha, body, path, position } = propsValue;
|
|
40
|
+
const { owner, repo } = propsValue.repository;
|
|
41
|
+
const commentData = {
|
|
42
|
+
body,
|
|
43
|
+
};
|
|
44
|
+
if (path) {
|
|
45
|
+
commentData.path = path;
|
|
46
|
+
}
|
|
47
|
+
if (position !== undefined) {
|
|
48
|
+
commentData.position = position;
|
|
49
|
+
}
|
|
50
|
+
const response = yield (0, common_1.githubApiCall)({
|
|
51
|
+
accessToken: auth.access_token,
|
|
52
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
53
|
+
resourceUri: `/repos/${owner}/${repo}/commits/${sha}/comments`,
|
|
54
|
+
body: commentData,
|
|
55
|
+
});
|
|
56
|
+
return response;
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=create-commit-comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-commit-comment.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/github/src/lib/actions/create-commit-comment.ts"],"names":[],"mappings":";;;;AAAA,uCAAyC;AACzC,qEAAwE;AACxE,sCAAwD;AACxD,+DAAyD;AAE5C,QAAA,+BAA+B,GAAG,IAAA,+BAAY,EAAC;IAC3D,IAAI,EAAE,kBAAU;I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AI;gBACvB,WAAW,EAAE,UAAU,KAAK,IAAI,IAAI,YAAY,GAAG,WAAW;gBAC9D,IAAI,EAAE,WAAW;aACjB,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC;QACjB,CAAC;KAAA;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const githubCreateDiscussionCommentAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
repository: import("@activepieces/pieces-framework").DropdownProperty<{
|
|
3
|
+
repo: string;
|
|
4
|
+
owner: string;
|
|
5
|
+
}, false> | import("@activepieces/pieces-framework").DropdownProperty<{
|
|
6
|
+
repo: string;
|
|
7
|
+
owner: string;
|
|
8
|
+
}, true>;
|
|
9
|
+
discussion_number: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
10
|
+
body: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.githubCreateDiscussionCommentAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const index_1 = require("../../index");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
+
exports.githubCreateDiscussionCommentAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: index_1.githubAuth,
|
|
11
|
+
name: 'github_create_discussion_comment',
|
|
12
|
+
displayName: 'Create Discussion Comment',
|
|
13
|
+
description: 'Creates a comment on a discussion in a GitHub repository',
|
|
14
|
+
props: {
|
|
15
|
+
repository: common_1.githubCommon.repositoryDropdown,
|
|
16
|
+
discussion_number: pieces_framework_1.Property.Number({
|
|
17
|
+
displayName: 'Discussion Number',
|
|
18
|
+
description: 'The number of the discussion to comment on',
|
|
19
|
+
required: true,
|
|
20
|
+
}),
|
|
21
|
+
body: pieces_framework_1.Property.LongText({
|
|
22
|
+
displayName: 'Comment Body',
|
|
23
|
+
description: 'The content of the comment (supports markdown)',
|
|
24
|
+
required: true,
|
|
25
|
+
}),
|
|
26
|
+
},
|
|
27
|
+
run(_a) {
|
|
28
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
29
|
+
const { discussion_number, body } = propsValue;
|
|
30
|
+
const { owner, repo } = propsValue.repository;
|
|
31
|
+
// GitHub Discussions API requires GraphQL for most operations
|
|
32
|
+
const query = `
|
|
33
|
+
mutation AddDiscussionComment {
|
|
34
|
+
addDiscussionComment(input: {
|
|
35
|
+
discussionId: "${discussion_number}",
|
|
36
|
+
repositoryName: "${repo}",
|
|
37
|
+
repositoryOwner: "${owner}",
|
|
38
|
+
body: "${body.replace(/"/g, '\\"')}"
|
|
39
|
+
}) {
|
|
40
|
+
comment {
|
|
41
|
+
id
|
|
42
|
+
body
|
|
43
|
+
createdAt
|
|
44
|
+
url
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}`;
|
|
48
|
+
const response = yield (0, common_1.githubApiCall)({
|
|
49
|
+
accessToken: auth.access_token,
|
|
50
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
51
|
+
resourceUri: '/graphql',
|
|
52
|
+
body: {
|
|
53
|
+
query,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
return response;
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=create-discussion-comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-discussion-comment.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/github/src/lib/actions/create-discussion-comment.ts"],"names":[],"mappings":";;;;AAAA,uCAAyC;AACzC,qEAAwE;AACxE,sCAAwD;AACxD,+DAAyD;AAE5C,QAAA,mCAAmC,GAAG,IAAA,+BAAY,EAAC;IAC/D,IAAI,EAAE,kBAAU;IAChB,IAAI,EAAE,kCAAkC;IACxC,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,0DAA0D;IACvE,KAAK,EAAE;QACN,UAAU,EAAE,qBAAY,CAAC,kBAAkB;QAC3C,iBAAiB,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAClC,WAAW,EAAE,mBAAmB;YAChC,WAAW,EAAE,4CAA4C;YACzD,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACvB,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,gDAAgD;YAC7D,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC7B,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC;YAC/C,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,UAAW,CAAC;YAE/C,8DAA8D;YAC9D,MAAM,KAAK,GAAG;;;qBAGK,iBAAiB;uBACf,IAAI;wBACH,KAAK;aAChB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;;;;;;;;;IASlC,CAAC;YAEH,MAAM,QAAQ,GAAG,MAAM,IAAA,sBAAa,EAAC;gBACpC,WAAW,EAAE,IAAI,CAAC,YAAY;gBAC9B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE;oBACL,KAAK;iBACL;aACD,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC;QACjB,CAAC;KAAA;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const githubCreatePullRequestReviewCommentAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
repository: import("@activepieces/pieces-framework").DropdownProperty<{
|
|
3
|
+
repo: string;
|
|
4
|
+
owner: string;
|
|
5
|
+
}, false> | import("@activepieces/pieces-framework").DropdownProperty<{
|
|
6
|
+
repo: string;
|
|
7
|
+
owner: string;
|
|
8
|
+
}, true>;
|
|
9
|
+
pull_number: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
10
|
+
commit_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
11
|
+
path: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
12
|
+
body: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
13
|
+
position: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.githubCreatePullRequestReviewCommentAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const index_1 = require("../../index");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
+
exports.githubCreatePullRequestReviewCommentAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: index_1.githubAuth,
|
|
11
|
+
name: 'github_create_pull_request_review_comment',
|
|
12
|
+
displayName: 'Create Pull Request Review Comment',
|
|
13
|
+
description: 'Creates a review comment on a pull request in a GitHub repository',
|
|
14
|
+
props: {
|
|
15
|
+
repository: common_1.githubCommon.repositoryDropdown,
|
|
16
|
+
pull_number: pieces_framework_1.Property.Number({
|
|
17
|
+
displayName: 'Pull Request Number',
|
|
18
|
+
description: 'The number of the pull request',
|
|
19
|
+
required: true,
|
|
20
|
+
}),
|
|
21
|
+
commit_id: pieces_framework_1.Property.ShortText({
|
|
22
|
+
displayName: 'Commit SHA',
|
|
23
|
+
description: 'The SHA of the commit to comment on',
|
|
24
|
+
required: true,
|
|
25
|
+
}),
|
|
26
|
+
path: pieces_framework_1.Property.ShortText({
|
|
27
|
+
displayName: 'File Path',
|
|
28
|
+
description: 'The relative path to the file to comment on',
|
|
29
|
+
required: true,
|
|
30
|
+
}),
|
|
31
|
+
body: pieces_framework_1.Property.LongText({
|
|
32
|
+
displayName: 'Comment Body',
|
|
33
|
+
description: 'The content of the review comment',
|
|
34
|
+
required: true,
|
|
35
|
+
}),
|
|
36
|
+
position: pieces_framework_1.Property.Number({
|
|
37
|
+
displayName: 'Position',
|
|
38
|
+
description: 'The position in the diff where the comment should be placed',
|
|
39
|
+
required: true,
|
|
40
|
+
}),
|
|
41
|
+
},
|
|
42
|
+
run(_a) {
|
|
43
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
44
|
+
const { pull_number, commit_id, path, body, position } = propsValue;
|
|
45
|
+
const { owner, repo } = propsValue.repository;
|
|
46
|
+
const response = yield (0, common_1.githubApiCall)({
|
|
47
|
+
accessToken: auth.access_token,
|
|
48
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
49
|
+
resourceUri: `/repos/${owner}/${repo}/pulls/${pull_number}/comments`,
|
|
50
|
+
body: {
|
|
51
|
+
commit_id,
|
|
52
|
+
path,
|
|
53
|
+
body,
|
|
54
|
+
position,
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
return response;
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=create-pull-request-review-comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-pull-request-review-comment.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/github/src/lib/actions/create-pull-request-review-comment.ts"],"names":[],"mappings":";;;;AAAA,uCAAyC;AACzC,qEAAwE;AACxE,sCAAwD;AACxD,+DAAyD;AAE5C,QAAA,0CAA0C,GAAG,IAAA,+BAAY,EA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