-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
874 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
const { getConfig } = require("./common"); | ||
|
||
const outputFields = [ | ||
{ key: "createdAt" }, | ||
{ key: "description" }, | ||
{ key: "divergedFromBranchId" }, | ||
{ key: "head" }, | ||
{ key: "id" }, | ||
{ key: "mergeSha" }, | ||
{ key: "mergedIntoBranchId" }, | ||
{ key: "name" }, | ||
{ key: "parent" }, | ||
{ key: "projectId" }, | ||
{ key: "startedAtSha" }, | ||
{ key: "status" }, | ||
{ key: "updatedAt" }, | ||
{ key: "user__avatarUrl", label: "user.avatarUrl" }, | ||
{ key: "user__createdAt", label: "user.createdAt" }, | ||
{ key: "user__id", label: "user.id" }, | ||
{ key: "user__name", label: "user.name" }, | ||
{ key: "user__primaryEmailId", label: "user.primaryEmailId" }, | ||
{ key: "user__updatedAt", label: "user.updatedAt" }, | ||
{ key: "user__username", label: "user.username" } | ||
]; | ||
|
||
const sample = { | ||
createdAt: "2019-10-29T17:59:30.000Z", | ||
description: "A test description", | ||
divergedFromBranchId: "", | ||
head: "201f5c4ceaf95a1589efa55e2b1a372a94d42aee", | ||
id: "71547de2-6d7a-437e-89ae-7aec672c2c2b", | ||
mergeSha: "", | ||
mergedIntoBranchId: "", | ||
name: "test-branch", | ||
objectType: "branch", | ||
parent: "master", | ||
projectId: "003a1ae0-a4b3-11e9-807c-a35b74e69da5", | ||
startedAtSha: "a23af8045784c10e9cf66602a5bcdb7605ca117b", | ||
status: "active", | ||
updatedAt: "2019-11-01T17:31:20.000Z", | ||
user: { | ||
avatarUrl: | ||
"https://avatars.goabstract.com/avatars/4010bed7-9ada-4eb4-9d9a-09c8b095d0a2", | ||
createdAt: "2018-11-04T18:28:19.027Z", | ||
id: "e5954a04-26ea-4600-a41b-1f74350be974", | ||
name: "Test User", | ||
primaryEmailId: "f649461e-2f6c-4de1-8f72-55f81f068ee5", | ||
updatedAt: "2019-06-17T16:12:47.915Z", | ||
username: "test-user" | ||
} | ||
}; | ||
|
||
const commonConfig = getConfig({ | ||
events: ["branch.statusUpdated"] | ||
}); | ||
|
||
module.exports = { | ||
display: { | ||
description: "Triggers when a branch status is updated.", | ||
hidden: false, | ||
label: "Branch status updated" | ||
}, | ||
key: "branchStatusUpdated", | ||
noun: "Branch status", | ||
operation: { | ||
...commonConfig.operation, | ||
outputFields, | ||
performList: () => [sample], | ||
sample | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
const { getConfig } = require("./common"); | ||
|
||
const outputFields = [ | ||
{ key: "createdAt" }, | ||
{ key: "description" }, | ||
{ key: "divergedFromBranchId" }, | ||
{ key: "head" }, | ||
{ key: "id" }, | ||
{ key: "mergeSha" }, | ||
{ key: "mergedIntoBranchId" }, | ||
{ key: "name" }, | ||
{ key: "parent" }, | ||
{ key: "projectId" }, | ||
{ key: "startedAtSha" }, | ||
{ key: "status" }, | ||
{ key: "updatedAt" }, | ||
{ key: "user__avatarUrl", label: "user.avatarUrl" }, | ||
{ key: "user__createdAt", label: "user.createdAt" }, | ||
{ key: "user__id", label: "user.id" }, | ||
{ key: "user__name", label: "user.name" }, | ||
{ key: "user__primaryEmailId", label: "user.primaryEmailId" }, | ||
{ key: "user__updatedAt", label: "user.updatedAt" }, | ||
{ key: "user__username", label: "user.username" } | ||
]; | ||
|
||
const sample = { | ||
createdAt: "2019-10-29T17:59:30.000Z", | ||
description: "A test description", | ||
divergedFromBranchId: "", | ||
head: "201f5c4ceaf95a1589efa55e2b1a372a94d42aee", | ||
id: "71547de2-6d7a-437e-89ae-7aec672c2c2b", | ||
mergeSha: "", | ||
mergedIntoBranchId: "", | ||
name: "test-branch", | ||
objectType: "branch", | ||
parent: "master", | ||
projectId: "003a1ae0-a4b3-11e9-807c-a35b74e69da5", | ||
startedAtSha: "a23af8045784c10e9cf66602a5bcdb7605ca117b", | ||
status: "active", | ||
updatedAt: "2019-11-01T17:31:20.000Z", | ||
user: { | ||
avatarUrl: | ||
"https://avatars.goabstract.com/avatars/4010bed7-9ada-4eb4-9d9a-09c8b095d0a2", | ||
createdAt: "2018-11-04T18:28:19.027Z", | ||
id: "e5954a04-26ea-4600-a41b-1f74350be974", | ||
name: "Test User", | ||
primaryEmailId: "f649461e-2f6c-4de1-8f72-55f81f068ee5", | ||
updatedAt: "2019-06-17T16:12:47.915Z", | ||
username: "test-user" | ||
} | ||
}; | ||
|
||
const commonConfig = getConfig({ | ||
events: ["branch.updated"] | ||
}); | ||
|
||
module.exports = { | ||
display: { | ||
description: "Triggers when a branch is updated.", | ||
hidden: false, | ||
label: "Branch updated" | ||
}, | ||
key: "branchUpdated", | ||
noun: "Branch", | ||
operation: { | ||
...commonConfig.operation, | ||
outputFields, | ||
performList: () => [sample], | ||
sample | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
const { getConfig } = require("./common"); | ||
|
||
const commitFields = [ | ||
{ key: "annotation" }, | ||
{ key: "body" }, | ||
{ key: "branchId" }, | ||
{ key: "branchName" }, | ||
{ key: "commenter__avatarUrl", label: "comment.qvatarUrl" }, | ||
{ key: "commenter__createdAt", label: "comment.createdAt" }, | ||
{ key: "commenter__id", label: "comment.id" }, | ||
{ key: "commenter__name", label: "comment.name" }, | ||
{ key: "commenter__objectType", label: "comment.objectType" }, | ||
{ key: "commenter__updatedAt", label: "comment.updatedAt" }, | ||
{ key: "commenter__username", label: "comment.username" }, | ||
{ key: "commitSha" }, | ||
{ key: "createdAt" }, | ||
{ key: "deletedAt" }, | ||
{ key: "editedAt" }, | ||
{ key: "fileId" }, | ||
{ key: "fileName" }, | ||
{ key: "file_type" }, | ||
{ key: "id" }, | ||
{ key: "layerId" }, | ||
{ key: "layerName" }, | ||
{ key: "objectType" }, | ||
{ key: "pageId" }, | ||
{ key: "page_name" }, | ||
{ key: "projectId" }, | ||
{ key: "publishedAt" }, | ||
{ key: "replyIds[]" }, | ||
{ key: "reviewId" }, | ||
{ key: "reviewStatus" }, | ||
{ key: "updatedAt" } | ||
]; | ||
|
||
const outputFields = [ | ||
...commitFields, | ||
...commitFields.map(field => ({ | ||
...field, | ||
key: `parent__${field.key}` | ||
})) | ||
]; | ||
|
||
const commit = { | ||
annotation: "", | ||
body: "test comment", | ||
branchId: "master", | ||
branchName: "Master", | ||
commenter: { | ||
avatarUrl: | ||
"https://avatars.goabstract.com/avatars/4010bed7-9ada-4eb4-9d9a-09c8b095d0a2.", | ||
createdAt: "2018-11-04T18:28:19Z", | ||
id: "e5954a04-26ea-4600-a41b-1f74350be974", | ||
name: "Test User", | ||
objectType: "user", | ||
updatedAt: "2019-06-17T16:12:47Z", | ||
username: "test-user" | ||
}, | ||
commitSha: "", | ||
createdAt: "2019-12-09T00:09:36Z", | ||
deletedAt: "", | ||
editedAt: "", | ||
fileId: "", | ||
fileName: "", | ||
file_type: "", | ||
id: "ab6341b0-8527-47d3-a0cc-5f526eb9c0bc", | ||
layerId: "", | ||
layerName: "", | ||
objectType: "comment", | ||
pageId: "", | ||
page_name: "", | ||
projectId: "003a1ae0-a4b3-11e9-807c-a35b74e69da5", | ||
publishedAt: "2019-12-09T00:09:36Z", | ||
replyIds: ["003a1ae0-a4b3-11e9-807c-a35b74e69da"], | ||
reviewId: "", | ||
reviewStatus: "", | ||
updatedAt: "2019-12-09T00:09:36Z" | ||
}; | ||
|
||
const sample = { | ||
...commit, | ||
parent: commit | ||
}; | ||
|
||
const commonConfig = getConfig({ | ||
events: ["comment.created"] | ||
}); | ||
|
||
module.exports = { | ||
display: { | ||
description: "Triggers when a new comment is created.", | ||
hidden: false, | ||
label: "Comment created" | ||
}, | ||
key: "commentCreated", | ||
noun: "Comment", | ||
operation: { | ||
...commonConfig.operation, | ||
outputFields, | ||
performList: () => [sample], | ||
sample | ||
} | ||
}; |
Oops, something went wrong.