Skip to content

Commit

Permalink
feat(gorgias): [ext-251] gorgias ticket (#162)
Browse files Browse the repository at this point in the history
## Describe your changes
Clean up PR to add gorgias ticket #157 

## Issue ticket number and link

## Checklist before requesting a review (skip if just adding/editing
APIs & templates)

-   [ ] I added tests, otherwise the reason is:
-   [ ] External API requests have `retries`
-   [ ] Pagination is used where appropriate
- [ ] The built in `nango.paginate` call is used instead of a `while
(true)` loop
- [ ] Third party requests are NOT parallelized (this can cause issues
with rate limits)
- [ ] If a sync requires metadata the `nango.yaml` has `auto_start:
false`
-   [ ] If the sync is a `full` sync then `track_deletes: true` is set
- [ ] I followed the best practices and guidelines from the [Writing
Integration
Scripts](/NangoHQ/integration-templates/blob/main/WRITING_INTEGRATION_SCRIPTS.md)
doc
  • Loading branch information
khaliqgant authored Dec 18, 2024
1 parent cfeeae6 commit 7008080
Show file tree
Hide file tree
Showing 16 changed files with 776 additions and 119 deletions.
48 changes: 40 additions & 8 deletions flows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4302,6 +4302,23 @@ integrations:
endpoint:
method: GET
path: /tickets
group: Tickets
version: 1.0.1
actions:
create-ticket:
description: |
Creates a new ticket
input: CreateTicketInput
scopes:
- tickets:write
- account:read
- customers:write
- customers:read
endpoint:
method: POST
path: /ticket
group: Tickets
output: Ticket
models:
Ticket:
id: number
Expand All @@ -4314,15 +4331,15 @@ integrations:
sms | twitter | twitter-direct-message | whatsapp | yotpo-review
closed_datetime: string | null
created_datetime: string | null
excerpt: string
excerpt?: string | undefined
external_id: string | null
from_agent: boolean
integrations: array | null
integrations?: array | null | undefined
is_unread: boolean
language: string | null
last_message_datetime: string | null
last_received_message_datetime: string | null
messages_count: number
messages_count?: number | undefined
messages: Message[]
meta: object | null
opened_datetime: string | null
Expand All @@ -4335,7 +4352,7 @@ integrations:
uri: string | null
decoration: object | null
created_datetime: string | null
deleted_datetime: string | null
deleted_datetime?: string | null | undefined
spam: boolean | null
trashed_datetime: string | null
updated_datetime: string | null
Expand Down Expand Up @@ -4379,8 +4396,8 @@ integrations:
public: boolean
from_agent: boolean
sender: RecieverSender
receiver: RecieverSender
attachments: Attachment[]
receiver: RecieverSender | null
attachments: Attachment[] | null
meta: object | null
headers: object | null
actions: array | null
Expand All @@ -4390,8 +4407,8 @@ integrations:
failed_datetime: string | null
last_sending_error: object | null
deleted_datetime: string | null
replied_by: string | null
replied_to: string | null
replied_by?: string | null | undefined
replied_to?: string | null | undefined
AssigneeUser:
id: number
firstname: string
Expand Down Expand Up @@ -4419,6 +4436,21 @@ integrations:
content_type: string
public: boolean
extra: string | null
CreateTicketInput:
customer:
phone_number: string
email?: string | undefined
ticket:
messages: CreateTicketMessage[]
CreateTicketMessage:
attachments:
- url: string
name: string
size: number
content_type: string
body_html: string
body_text: string
id: string
greenhouse-basic:
syncs:
applications:
Expand Down
1 change: 0 additions & 1 deletion integrations/avalara-sandbox/schema.zod.ts

This file was deleted.

1 change: 0 additions & 1 deletion integrations/bill-sandbox/schema.zod.ts

This file was deleted.

1 change: 0 additions & 1 deletion integrations/docusign-sandbox/schema.zod.ts

This file was deleted.

114 changes: 114 additions & 0 deletions integrations/github-app/schema.zod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
// Generated by ts-to-zod
import { z } from 'zod';

export const repositorySchema = z.object({
allow_forking: z.boolean(),
archive_url: z.string(),
archived: z.boolean(),
assignees_url: z.string(),
blobs_url: z.string(),
branches_url: z.string(),
clone_url: z.string(),
collaborators_url: z.string(),
comments_url: z.string(),
commits_url: z.string(),
compare_url: z.string(),
contents_url: z.string(),
contributors_url: z.string(),
created_at: z.string(),
default_branch: z.string(),
deployments_url: z.string(),
description: z.string(),
disabled: z.boolean(),
downloads_url: z.string(),
events_url: z.string(),
fork: z.boolean(),
forks: z.number(),
forks_count: z.number(),
forks_url: z.string(),
full_name: z.string(),
git_commits_url: z.string(),
git_refs_url: z.string(),
git_tags_url: z.string(),
git_url: z.string(),
has_discussions: z.boolean(),
has_downloads: z.boolean(),
has_issues: z.boolean(),
has_pages: z.boolean(),
has_projects: z.boolean(),
has_wiki: z.boolean(),
homepage: z.string().nullable(),
hooks_url: z.string(),
html_url: z.string(),
id: z.number(),
is_template: z.boolean(),
issue_comment_url: z.string(),
issue_events_url: z.string(),
issues_url: z.string(),
keys_url: z.string(),
labels_url: z.string(),
language: z.string(),
languages_url: z.string(),
license: z.string().nullable(),
merges_url: z.string(),
milestones_url: z.string(),
mirror_url: z.string().nullable(),
name: z.string(),
node_id: z.string(),
notifications_url: z.string(),
open_issues: z.number(),
open_issues_count: z.number(),
owner: z.object({
avatar_url: z.string(),
events_url: z.string(),
followers_url: z.string(),
following_url: z.string(),
gists_url: z.string(),
gravatar_id: z.string(),
html_url: z.string(),
id: z.number(),
login: z.string(),
node_id: z.string(),
organizations_url: z.string(),
received_events_url: z.string(),
repos_url: z.string(),
site_admin: z.boolean(),
starred_url: z.string(),
subscriptions_url: z.string(),
type: z.string(),
url: z.string()
}),
permissions: z.object({
admin: z.boolean(),
maintain: z.boolean(),
pull: z.boolean(),
push: z.boolean(),
triage: z.boolean()
}),
private: z.boolean(),
pulls_url: z.string(),
pushed_at: z.string(),
releases_url: z.string(),
size: z.number(),
ssh_url: z.string(),
stargazers_count: z.number(),
stargazers_url: z.string(),
statuses_url: z.string(),
subscribers_url: z.string(),
subscription_url: z.string(),
svn_url: z.string(),
tags_url: z.string(),
teams_url: z.string(),
topics: z.array(z.string()),
trees_url: z.string(),
updated_at: z.string(),
url: z.string(),
visibility: z.string(),
watchers: z.number(),
watchers_count: z.number(),
web_commit_signoff_required: z.boolean()
});

export const repoResponseSchema = z.object({
repositories: z.array(repositorySchema)
});
142 changes: 142 additions & 0 deletions integrations/gorgias/actions/create-ticket.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
<!-- BEGIN GENERATED CONTENT -->
# Create Ticket

## General Information

- **Description:** Creates a new ticket

- **Version:** 0.0.1
- **Group:** Others
- **Scopes:** `tickets:write, account:read, customers:write, customers:read`
- **Endpoint Type:** Action
- **Code:** [github.com](https://github.com/NangoHQ/integration-templates/tree/main/integrations/gorgias/actions/create-ticket.ts)


## Endpoint Reference

### Request Endpoint

`POST /ticket`

### Request Query Parameters

_No request parameters_

### Request Body

```json
{
"customer": {
"phone_number": "<string>",
"email?": "<string | undefined>"
},
"ticket": {
"messages": [
{
"attachments": {
"0": {
"url": "<string>",
"name": "<string>",
"size": "<number>",
"content_type": "<string>"
}
},
"body_html": "<string>",
"body_text": "<string>",
"id": "<string>"
}
]
}
}
```

### Request Response

```json
{
"id": "<number>",
"assignee_user": "<AssigneeUser | null>",
"channel": "<aircall | api | chat | contact_form | email | facebook | facebook-mention | facebook-messenger | facebook-recommendations | help-center | instagram-ad-comment | instagram-comment | instagram-direct-message | instagram-mention | internal-note | phone | sms | twitter | twitter-direct-message | whatsapp | yotpo-review>",
"closed_datetime": "<string | null>",
"created_datetime": "<string | null>",
"excerpt?": "<string | undefined>",
"external_id": "<string | null>",
"from_agent": "<boolean>",
"integrations?": "<array | null | undefined>",
"is_unread": "<boolean>",
"language": "<string | null>",
"last_message_datetime": "<string | null>",
"last_received_message_datetime": "<string | null>",
"messages_count?": "<number | undefined>",
"messages": [
{
"id": "<number>",
"uri": "<string>",
"message_id": "<string | null>",
"integration_id": "<number | null>",
"rule_id": "<number | null>",
"external_id": "<string | null>",
"ticket_id": "<number>",
"channel": "<aircall | api | chat | contact_form | email | facebook | facebook-mention | facebook-messenger | facebook-recommendations | help-center | instagram-ad-comment | instagram-comment | instagram-direct-message | instagram-mention | internal-note | phone | sms | twitter | twitter-direct-message | whatsapp | yotpo-review>",
"via": "<aircall | api | chat | contact_form | email | facebook | facebook-mention | facebook-messenger | facebook-recommendations | form | gorgias_chat | help-center | helpdesk | instagram | instagram-ad-comment | instagram-comment | instagram-direct-message | instagram-mention | internal-note | offline_capture | phone | rule | self_service | shopify | sms | twilio | twitter | twitter-direct-message | whatsapp | yotpo | yotpo-review | zendesk>",
"subject": "<string | null>",
"body_text": "<string | null>",
"body_html": "<string | null>",
"stripped_text": "<string | null>",
"stripped_html": "<string | null>",
"stripped_signature": "<string | null>",
"public": "<boolean>",
"from_agent": "<boolean>",
"sender": {
"id": "<number>",
"firstname": "<string>",
"lastname": "<string>",
"meta": "<object | null>",
"email": "<string | null>",
"name": "<string | null>"
},
"receiver": "<RecieverSender | null>",
"attachments": "<Attachment[] | null>",
"meta": "<object | null>",
"headers": "<object | null>",
"actions": "<array | null>",
"macros": "<array | null>",
"created_datetime": "<string | null>",
"opened_datetime": "<string | null>",
"failed_datetime": "<string | null>",
"last_sending_error": "<object | null>",
"deleted_datetime": "<string | null>",
"replied_by?": "<string | null | undefined>",
"replied_to?": "<string | null | undefined>"
}
],
"meta": "<object | null>",
"opened_datetime": "<string | null>",
"snooze_datetime": "<string | null>",
"status": "<open | closed>",
"subject": "<string | null>",
"tags": {
"0": {
"id": "<number>",
"name": "<string>",
"uri": "<string | null>",
"decoration": "<object | null>",
"created_datetime": "<string | null>",
"deleted_datetime?": "<string | null | undefined>"
}
},
"spam": "<boolean | null>",
"trashed_datetime": "<string | null>",
"updated_datetime": "<string | null>",
"via": "<aircall | api | chat | contact_form | email | facebook | facebook-mention | facebook-messenger | facebook-recommendations | form | gorgias_chat | help-center | helpdesk | instagram | instagram-ad-comment | instagram-comment | instagram-direct-message | instagram-mention | internal-note | offline_capture | phone | rule | self_service | shopify | sms | twilio | twitter | twitter-direct-message | whatsapp | yotpo | yotpo-review | zendesk>",
"uri": "<string>"
}
```

## Changelog

- [Script History](https://github.com/NangoHQ/integration-templates/commits/main/integrations/gorgias/actions/create-ticket.ts)
- [Documentation History](https://github.com/NangoHQ/integration-templates/commits/main/integrations/gorgias/actions/create-ticket.md)

<!-- END GENERATED CONTENT -->

Loading

0 comments on commit 7008080

Please sign in to comment.