Skip to content

Commit

Permalink
feat: Linear and Clickup ticketing apps integration (#388)
Browse files Browse the repository at this point in the history
* feat: oauth flow for linear and clickup ticketing apps
refactor: resolved conflicts

* feat: Add Trello OAuth and user task endpoints for testing in ClickUp and Linear

* feat: Implemented oauth for jira

* feat: Implement user task endpoint with static values

* feat: Implemented and unified get endpoints for task and users

* feat: Implement create task endpoint for linear and clickup

* feat: update seed file for linear and ClickUp integration

* feat: Implement get getAll and create task/ticket endpoint for linear and clickup

* feat: Implement update endpoint for linear and clickup

* feat: Implement pagination for Linear endpoints (task & user)

* fix: unification of task endpoint for ticketing apps via field mapping

* refactor: removed unreleased jira endpoint

* refactor: updated seed.ts structure for ticketing fields

* refactor: fixed console error message typos

* fix: linear priority label

* fix: added cloudinary links for images

* feat: Implement collection endpoint for linear and clickup

* feat: Implement users endpoint for clickup

* refactor: Implement Linear get endpoints via sdk

* feat: Implement comment endpoint for linear and clickup

* feat: Implement proxy endpoint for clickup and linear apps

* fix: check associations object before fetching listId

* feat: Unified Jira tasks via schema mapping

* feat: Unified Jira users via schema mapping

* fix: added missing jira scope for refresh token

* feat: implement create and update task endpoint for jira

* refactor: unification of ticketing objects

* feat: Implement comment endpoint for Jira

* Implement proxy endpoint for jira

* feat: Implement task endpoint for trello

* feat: Implement user endpoint for trello

* feat: Implement proxy endpoint for trello

* feat: Implement pagination on getTasks trello

* feat: Implement Pagination for Jira getTasks endpoint

* fix: clickup priorityId handling

* fix: Jira task preprocessing and disunification for status and priority fields

* refactor: Linear create & update task endpoints via sdk

* fix: status mapping for linear

* feat: Implement getComments and createComment for trello

* feat: Implement collections endpoint for Jira and Trello

* feat: Unification of comments for ticketing apps

* feat: Implement Update comment endpoint for all ticketing apps

* fix: disunification and pagination

* fix: Clickup dueDate issue

* refactor: Implement required listId param for the Get ALL tasks endpoint

* refactor: Implement listId as required for create ticket/task endpoint

* refactor: Error handling for trello auth

* refactor: Fixed comment listId unification

* fix: Implement listId as required parameter for getUsers endpoint

---------

Co-authored-by: Ashutosh Dhande <[email protected]>
  • Loading branch information
ashutoshdhande and ashutosh-revert authored Jan 16, 2024
1 parent d4d91b9 commit 1352bda
Show file tree
Hide file tree
Showing 48 changed files with 4,250 additions and 43 deletions.
12 changes: 12 additions & 0 deletions fern/definition/common/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,15 @@ types:
connectedApps: optional<list<ConnectedApps>>
recentConnections: optional<list<RecentConnections>>
recentApiCalls: optional<list<RecentApiCalls>>
TicketStatus:
enum:
- open
- close
- in_progress
TicketPriority:
enum:
- urgent
- high
- medium
- low
- lowest
49 changes: 49 additions & 0 deletions fern/definition/common/unified.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
imports:
associations: ./associations.yml
types: ./types.yml

types:
CommonUnifiedFields:
Expand Down Expand Up @@ -225,3 +226,51 @@ types:
channelId:
type: string
docs: Id of channel to which message was sent
TaskTicketWrite:
properties:
name:
type: string
docs: Name of the task.
assignees:
type: list<string>
docs: collection of IDs belonging to assignees.
description:
type: string
docs: Description of the task.
status:
type: types.TicketStatus
docs: Current status of the task.
priority:
type: types.TicketPriority
docs: Priority of the task.
creatorId:
type: string
docs: ID of the task creator.
dueDate:
type: string
docs: Due date for the given task.
completedDate:
type: string
docs: Date at which task was completed.
parentId:
type: string
docs: Id of the parent task.
listId:
type: string
docs: Id of the list
TaskTicket:
extends:
- CommonUnifiedFields
- TaskTicketWrite
CommentTicketWrite:
properties:
body:
type: string
docs: The contents of the comment in plain text or HTML format.
taskId:
type: string
docs: Task or Issue to which comment must belong
CommentTicket:
extends:
- CommonUnifiedFields
- CommentTicketWrite
43 changes: 43 additions & 0 deletions fern/definition/ticket/collection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
imports:
errors: ../common/errors.yml
types: ../common/types.yml

types:
GetCollectionsResponse:
properties:
status: types.ResponseStatus
next: optional<string>
previous: optional<string>
results: unknown

service:
base-path: /ticket/collections
auth: false
headers:
x-revert-api-token:
type: string
docs: Your official API key for accessing revert apis.
x-revert-t-id:
type: string
docs: The unique customer id used when the customer linked their account.
x-api-version:
type: optional<string>
docs: Optional Revert API version you're using. If missing we default to the latest version of the API.
audiences:
- external
endpoints:
getCollections:
docs: Get all the collections
method: GET
path: ''
request:
name: GetCollectionsRequest
query-parameters:
fields: optional<string>
pageSize: optional<string>
cursor: optional<string>
response: GetCollectionsResponse
errors:
- errors.UnAuthorizedError
- errors.InternalServerError
- errors.NotFoundError
96 changes: 96 additions & 0 deletions fern/definition/ticket/comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
imports:
errors: ../common/errors.yml
types: ../common/types.yml
unified: ../common/unified.yml
associations: ../common/associations.yml

types:
GetCommentResponse:
properties:
status: types.ResponseStatus
result: unknown
GetCommentsResponse:
properties:
status: types.ResponseStatus
next: optional<string>
previous: optional<string>
results: unknown
CreateOrUpdateCommentRequest: unified.CommentTicketWrite
CreateOrUpdateCommentResponse:
properties:
status: types.ResponseStatus
message: string
result: unknown

service:
base-path: /ticket/comments
auth: false
headers:
x-revert-api-token:
type: string
docs: Your official API key for accessing revert apis.
x-revert-t-id:
type: string
docs: The unique customer id used when the customer linked their account.
x-api-version:
type: optional<string>
docs: Optional Revert API version you're using. If missing we default to the latest version of the API.
audiences:
- external
endpoints:
getComment:
docs: Get details of a comment
method: GET
path: /{id}
path-parameters:
id: string
request:
name: GetCommentRequest
query-parameters:
fields: optional<string>
response: GetCommentResponse
errors:
- errors.UnAuthorizedError
- errors.InternalServerError
- errors.NotFoundError
getComments:
docs: Get all the comments
method: GET
path: ''
request:
name: GetCommentsRequest
query-parameters:
fields: optional<string>
pageSize: optional<string>
cursor: optional<string>
response: GetCommentsResponse
errors:
- errors.UnAuthorizedError
- errors.InternalServerError
- errors.NotFoundError
createComment:
docs: Post comment
method: POST
path: ''
request:
name: CreateCommentRequest
body: CreateOrUpdateCommentRequest
response: CreateOrUpdateCommentResponse
errors:
- errors.UnAuthorizedError
- errors.InternalServerError
- errors.NotFoundError
updateComment:
docs: Update comment
method: PATCH
path: /{id}
path-parameters:
id: string
request:
name: UpdateCommentRequest
body: CreateOrUpdateCommentRequest
response: CreateOrUpdateCommentResponse
errors:
- errors.UnAuthorizedError
- errors.InternalServerError
- errors.NotFoundError
43 changes: 43 additions & 0 deletions fern/definition/ticket/proxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
imports:
errors: ../common/errors.yml
types: ../common/types.yml

types:
ProxyResponse:
properties:
result: unknown
PostProxyRequestBody:
properties:
path: string
body: optional<unknown>
method: string
queryParams: optional<unknown>

service:
base-path: /ticket/proxy
auth: false
headers:
x-revert-api-token:
type: string
docs: Your official API key for accessing revert apis.
x-revert-t-id:
type: string
docs: The unique customer id used when the customer linked their account.
x-api-version:
type: optional<string>
docs: Optional Revert API version you're using. If missing we default to the latest version of the API.
audiences:
- external
endpoints:
tunnel:
docs: Call the native Ticketing app's api for a specific connection
method: POST
path: ''
request:
name: PostProxyRequest
body: PostProxyRequestBody
response: ProxyResponse
errors:
- errors.UnAuthorizedError
- errors.InternalServerError
- errors.NotFoundError
96 changes: 96 additions & 0 deletions fern/definition/ticket/task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
imports:
errors: ../common/errors.yml
types: ../common/types.yml
unified: ../common/unified.yml
associations: ../common/associations.yml

types:
GetTaskResponse:
properties:
status: types.ResponseStatus
result: unified.TaskTicket
GetTasksResponse:
properties:
status: types.ResponseStatus
next: optional<string>
previous: optional<string>
results: list<unified.TaskTicket>
CreateOrUpdateTaskRequest: unified.TaskTicketWrite
CreateOrUpdateTaskResponse:
properties:
status: types.ResponseStatus
message: string
result: unknown

service:
base-path: /ticket/tasks
auth: false
headers:
x-revert-api-token:
type: string
docs: Your official API key for accessing revert apis.
x-revert-t-id:
type: string
docs: The unique customer id used when the customer linked their account.
x-api-version:
type: optional<string>
docs: Optional Revert API version you're using. If missing we default to the latest version of the API.
audiences:
- external
endpoints:
getTask:
docs: Get details of a task
method: GET
path: /{id}
path-parameters:
id: string
request:
name: GetTaskRequest
query-parameters:
fields: optional<string>
response: GetTaskResponse
errors:
- errors.UnAuthorizedError
- errors.InternalServerError
- errors.NotFoundError
getTasks:
docs: Get all the tasks
method: GET
path: ''
request:
name: GetTasksRequest
query-parameters:
fields: optional<string>
pageSize: optional<string>
cursor: optional<string>
response: GetTasksResponse
errors:
- errors.UnAuthorizedError
- errors.InternalServerError
- errors.NotFoundError
createTask:
method: POST
path: ''
request:
name: CreateTaskRequest
body: CreateOrUpdateTaskRequest
response: CreateOrUpdateTaskResponse
errors:
- errors.UnAuthorizedError
- errors.InternalServerError
- errors.NotFoundError
updateTask:
docs: Update a task
method: PATCH
path: /{id}
path-parameters:
id: string
request:
name: UpdateTaskRequest
body: CreateOrUpdateTaskRequest
response: CreateOrUpdateTaskResponse
errors:
- errors.UnAuthorizedError
- errors.InternalServerError
- errors.NotFoundError
- errors.BadRequestError
Loading

1 comment on commit 1352bda

@vercel
Copy link

@vercel vercel bot commented on 1352bda Jan 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

revert-client – ./

revert-client-revertdev.vercel.app
app.revert.dev
revert-client-git-main-revertdev.vercel.app

Please sign in to comment.