-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New Components - freshdesk #17764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
New Components - freshdesk #17764
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
db76782
new components
michelle0927 8dd400e
pnpm-lock.yaml
michelle0927 c4112d3
versions
michelle0927 b002d4c
pnpm-lock.yaml
michelle0927 924eda3
pnpm-lock.yaml
michelle0927 c84aecd
pnpm-lock.yaml
michelle0927 21cc714
pnpm-lock.yaml
michelle0927 64f28e1
updates
michelle0927 e22b5f9
update type field
michelle0927 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
103 changes: 103 additions & 0 deletions
103
components/freshdesk/actions/create-agent/create-agent.mjs
This file contains hidden or 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 @@ | ||
| import freshdesk from "../../freshdesk.app.mjs"; | ||
| import constants from "../../common/constants.mjs"; | ||
|
|
||
| export default { | ||
| key: "freshdesk-create-agent", | ||
| name: "Create Agent", | ||
| description: "Create an agent in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#create_agent)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| freshdesk, | ||
| email: { | ||
| type: "string", | ||
| label: "Email", | ||
| description: "Email address of the Agent.", | ||
| }, | ||
| ticketScope: { | ||
| type: "integer", | ||
| label: "Ticket Scope", | ||
| description: "Ticket permission of the agent. Current logged in agent can't update his/her ticket_scope", | ||
| options: constants.TICKET_SCOPE, | ||
| }, | ||
| occasional: { | ||
| type: "boolean", | ||
| label: "Occasional", | ||
| description: "Set to true if this is an occasional agent (true => occasional, false => full-time)", | ||
| optional: true, | ||
| }, | ||
| signature: { | ||
| type: "string", | ||
| label: "Signature", | ||
| description: "Signature of the agent in HTML format", | ||
| optional: true, | ||
| }, | ||
| skillIds: { | ||
| propDefinition: [ | ||
| freshdesk, | ||
| "skillIds", | ||
| ], | ||
| }, | ||
| groupIds: { | ||
| propDefinition: [ | ||
| freshdesk, | ||
| "groupId", | ||
| ], | ||
| type: "string[]", | ||
| label: "Group IDs", | ||
| description: "Array of group IDs", | ||
| optional: true, | ||
| }, | ||
| roleIds: { | ||
| propDefinition: [ | ||
| freshdesk, | ||
| "roleIds", | ||
| ], | ||
| }, | ||
| agentType: { | ||
| type: "integer", | ||
| label: "Agent Type", | ||
| description: "Type of the agent", | ||
| options: constants.AGENT_TYPE, | ||
| optional: true, | ||
| }, | ||
| language: { | ||
| type: "string", | ||
| label: "Language", | ||
| description: " Language of the Agent. Default language is `en`", | ||
| optional: true, | ||
| }, | ||
| timeZone: { | ||
| type: "string", | ||
| label: "Time Zone", | ||
| description: "Time zone of the agent. Default value is time zone of the domain.", | ||
| optional: true, | ||
| }, | ||
| focusMode: { | ||
| type: "boolean", | ||
| label: "Focus Mode", | ||
| description: "Focus mode of the agent. Default value is `true`", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.freshdesk.createAgent({ | ||
| $, | ||
| data: { | ||
| email: this.email, | ||
| ticket_scope: this.ticketScope, | ||
| occasional: this.occasional, | ||
| signature: this.signature, | ||
| skill_ids: this.skillIds, | ||
| group_ids: this.groupIds, | ||
| role_ids: this.roleIds, | ||
| agent_type: this.agentType, | ||
| language: this.language, | ||
| time_zone: this.timeZone, | ||
| focus_mode: this.focusMode, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Agent ${this.email} created successfully`); | ||
| return response; | ||
| }, | ||
| }; |
This file contains hidden or 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 hidden or 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
72 changes: 72 additions & 0 deletions
72
components/freshdesk/actions/create-solution-article/create-solution-article.mjs
This file contains hidden or 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,72 @@ | ||
| import freshdesk from "../../freshdesk.app.mjs"; | ||
| import constants from "../../common/constants.mjs"; | ||
| import { parseObject } from "../../common/utils.mjs"; | ||
|
|
||
| export default { | ||
| key: "freshdesk-create-solution-article", | ||
| name: "Create Solution Article", | ||
| description: "Create a solution article in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#solution_article_attributes)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| freshdesk, | ||
| categoryId: { | ||
| propDefinition: [ | ||
| freshdesk, | ||
| "categoryId", | ||
| ], | ||
| }, | ||
| folderId: { | ||
| propDefinition: [ | ||
| freshdesk, | ||
| "folderId", | ||
| (c) => ({ | ||
| categoryId: c.categoryId, | ||
| }), | ||
| ], | ||
| }, | ||
| title: { | ||
| type: "string", | ||
| label: "Title", | ||
| description: "Title of the article", | ||
| }, | ||
| description: { | ||
| type: "string", | ||
| label: "Description", | ||
| description: "Description of the article", | ||
| }, | ||
| status: { | ||
| type: "integer", | ||
| label: "Status", | ||
| description: "Status of the article", | ||
| options: constants.ARTICLE_STATUS, | ||
| }, | ||
| seoData: { | ||
| type: "object", | ||
| label: "SEO Data", | ||
| description: "Meta data for search engine optimization. Allows meta_title, meta_description and meta_keywords", | ||
| optional: true, | ||
| }, | ||
| tags: { | ||
| type: "string[]", | ||
| label: "Tags", | ||
| description: "Tags for the article", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.freshdesk.createArticle({ | ||
| $, | ||
| folderId: this.folderId, | ||
| data: { | ||
| title: this.title, | ||
| description: this.description, | ||
| status: this.status, | ||
| seo_data: parseObject(this.seoData), | ||
| tags: this.tags, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully created solution article ${this.title}`); | ||
| return response; | ||
| }, | ||
| }; |
110 changes: 110 additions & 0 deletions
110
components/freshdesk/actions/create-ticket-field/create-ticket-field.mjs
This file contains hidden or 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,110 @@ | ||
| import freshdesk from "../../freshdesk.app.mjs"; | ||
| import { parseObject } from "../../common/utils.mjs"; | ||
| import { ConfigurationError } from "@pipedream/platform"; | ||
|
|
||
| export default { | ||
| key: "freshdesk-create-ticket-field", | ||
| name: "Create Ticket Field", | ||
| description: "Create a ticket field in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#create_ticket_field)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| freshdesk, | ||
| label: { | ||
| type: "string", | ||
| label: "Label", | ||
| description: "Display the name of the Ticket Field", | ||
| }, | ||
| labelForCustomers: { | ||
| type: "string", | ||
| label: "Label for Customers", | ||
| description: "The label for the field as seen by customers", | ||
| }, | ||
| customersCanEdit: { | ||
| type: "boolean", | ||
| label: "Customers Can Edit", | ||
| description: "Whether customers can edit the field", | ||
| optional: true, | ||
| }, | ||
| displayedToCustomers: { | ||
| type: "boolean", | ||
| label: "Displayed to Customers", | ||
| description: "Whether the field is displayed to customers", | ||
| optional: true, | ||
| }, | ||
| position: { | ||
| type: "integer", | ||
| label: "Position", | ||
| description: "The position of the fieldPosition in which the ticket field is displayed in the form. If not given, it will be displayed on top", | ||
| optional: true, | ||
| }, | ||
| type: { | ||
| type: "string", | ||
| label: "Type", | ||
| description: "The type of the field. Can be custom_dropdown, custom_checkbox, custom_text, etc...", | ||
| default: "custom_dropdown", | ||
| optional: true, | ||
| }, | ||
| requiredForClusure: { | ||
| type: "boolean", | ||
| label: "Required for Closure", | ||
| description: "Set to `true` if the field is mandatory for closing the ticket", | ||
| optional: true, | ||
| }, | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| requiredForAgents: { | ||
| type: "boolean", | ||
| label: "Required for Agents", | ||
| description: "Set to `true` if the field is mandatory for agents", | ||
| optional: true, | ||
| }, | ||
| requiredForCustomers: { | ||
| type: "boolean", | ||
| label: "Required for Customers", | ||
| description: "Set to `true` if the field is mandatory for customers", | ||
| optional: true, | ||
| }, | ||
| choices: { | ||
| type: "string[]", | ||
| label: "Choices", | ||
| description: "Array of key, value pairs containing the value and position of dropdown choices. Example: `[{ \"value\": \"Refund\", \"position\": 1 }, { \"value\": \"FaultyProduct\", \"position\": 2 }]`", | ||
| optional: true, | ||
| }, | ||
| dependentFields: { | ||
| type: "string[]", | ||
| label: "Dependent Fields", | ||
| description: "Applicable only for dependent fields, this contains details of nested fields Example: `[{ \"label\": \"District\", \"label_for_customers\": \"District\", \"level\": 2 }, { \"label\": \"Branch\", \"label_for_customers\": \"Branch\", \"level\": 3 }]`", | ||
| optional: true, | ||
| }, | ||
| sectionMappings: { | ||
| type: "string[]", | ||
| label: "Section Mappings", | ||
| description: "Applicable only if the field is part of a section. This contains the details of a section (ID, position) for which it is been a part of. Example: `[{ \"position\": 3, \"section_id\": 1 }]`", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| if (this.type === "custom_dropdown" && !this.choices) { | ||
| throw new ConfigurationError("Choices are required for custom_dropdown fields"); | ||
| } | ||
|
|
||
| const response = await this.freshdesk.createTicketField({ | ||
| $, | ||
| data: { | ||
| label: this.label, | ||
| customers_can_edit: this.customersCanEdit, | ||
| label_for_customers: this.labelForCustomers, | ||
| displayed_to_customers: this.displayedToCustomers, | ||
| position: this.position, | ||
| type: this.type, | ||
| required_for_closure: this.requiredForClusure, | ||
| required_for_agents: this.requiredForAgents, | ||
| required_for_customers: this.requiredForCustomers, | ||
| choices: parseObject(this.choices), | ||
| dependent_fields: parseObject(this.dependentFields), | ||
| section_mappings: parseObject(this.sectionMappings), | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully created ticket field: ${response.label}`); | ||
| return response; | ||
| }, | ||
| }; | ||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.