Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Add Ticket Tags",
description: "Add tags to a ticket (appends to existing tags). [See the documentation](https://developer.zendesk.com/api-reference/ticketing/ticket-management/tags/#add-tags).",
type: "action",
version: "0.0.6",
version: "0.0.7",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/zendesk/actions/create-ticket/create-ticket.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Create Ticket",
description: "Creates a ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#create-ticket).",
type: "action",
version: "0.1.10",
version: "0.1.11",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/zendesk/actions/delete-ticket/delete-ticket.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Delete Ticket",
description: "Deletes a ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#delete-ticket).",
type: "action",
version: "0.1.10",
version: "0.1.11",
annotations: {
destructiveHint: true,
openWorldHint: true,
Expand Down
43 changes: 43 additions & 0 deletions components/zendesk/actions/get-article/get-article.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import zendesk from "../../zendesk.app.mjs";

export default {
key: "zendesk-get-article",
name: "Get Article",
description: "Retrieves an article by its ID. [See the documentation](https://developer.zendesk.com/api-reference/help_center/help-center-api/articles/#show-article).",
type: "action",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
zendesk,
locale: {
propDefinition: [
zendesk,
"locale",
],
optional: true,
},
articleId: {
propDefinition: [
zendesk,
"articleId",
({ locale }) => ({
locale,
}),
],
},
},
async run({ $ }) {
const article = await this.zendesk.getArticle({
$,
locale: this.locale,
articleId: this.articleId,
});

$.export("$summary", `Successfully retrieved article ${this.articleId}`);
return article;
},
};
32 changes: 32 additions & 0 deletions components/zendesk/actions/get-macro/get-macro.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import zendesk from "../../zendesk.app.mjs";

export default {
key: "zendesk-get-macro",
name: "Get Macro",
description: "Retrieves a macro by its ID. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#show-macro).",
type: "action",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
zendesk,
macroId: {
propDefinition: [
zendesk,
"macroId",
],
},
},
async run({ $ }) {
const macro = await this.zendesk.getMacro({
$,
macroId: this.macroId,
});

$.export("$summary", `Successfully retrieved macro with ID ${this.macroId}`);
return macro;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Get Ticket Info",
description: "Retrieves information about a specific ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#show-ticket).",
type: "action",
version: "0.0.8",
version: "0.0.9",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/zendesk/actions/get-user-info/get-user-info.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "zendesk-get-user-info",
name: "Get User Info",
description: "Retrieves information about a specific user. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/users/users/#show-user).",
version: "0.0.5",
version: "0.0.6",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import constants from "../../common/constants.mjs";
import zendesk from "../../zendesk.app.mjs";

export default {
key: "zendesk-list-active-macros",
name: "List Active Macros",
description: "Lists all active shared and personal macros available to the current user. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#list-active-macros).",
type: "action",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
zendesk,
access: {
type: "string",
label: "Access",
description: "Filter macros by access. The \"agents\" value returns all personal macros for the account's agents and is only available to admins.",
options: constants.ACCESS_OPTIONS,
optional: true,
},
categoryId: {
propDefinition: [
zendesk,
"macroCategory",
],
optional: true,
},
groupId: {
propDefinition: [
zendesk,
"groupId",
],
optional: true,
},
include: {
type: "string",
label: "Include",
description: "Additional fields to include in the response",
options: constants.INCLUDE_OPTIONS,
optional: true,
},
sortBy: {
type: "string",
label: "Sort By",
description: "The field to sort the results by",
options: constants.SORT_BY_OPTIONS,
optional: true,
},
sortOrder: {
propDefinition: [
zendesk,
"sortOrder",
],
},
},
async run({ $ }) {
const { macros } = await this.zendesk.listActiveMacros({
$,
params: {
access: this.access,
category: this.categoryId,
group_id: this.groupId,
include: this.include,
sort_by: this.sortBy,
sort_order: this.sortOrder,
},
});

$.export("$summary", `Successfully retrieved ${macros.length} macro${macros.length === 1
? ""
: "s"}`);
return macros;
},
};
105 changes: 105 additions & 0 deletions components/zendesk/actions/list-articles/list-articles.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import { ConfigurationError } from "@pipedream/platform";
import zendesk from "../../zendesk.app.mjs";

export default {
key: "zendesk-list-articles",
name: "List Articles",
description: "Retrieves a list of articles. [See the documentation](https://developer.zendesk.com/api-reference/help_center/help-center-api/articles/#list-articles).",
type: "action",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
zendesk,
locale: {
propDefinition: [
zendesk,
"locale",
],
optional: true,
},
categoryId: {
propDefinition: [
zendesk,
"articleCategoryId",
({ locale }) => ({
locale,
}),
],
optional: true,
},
sectionId: {
propDefinition: [
zendesk,
"sectionId",
({
locale, categoryId,
}) => ({
locale,
categoryId,
}),
],
optional: true,
},
userId: {
propDefinition: [
zendesk,
"userId",
],
optional: true,
reloadProps: true,
},
limit: {
propDefinition: [
zendesk,
"limit",
],
description: "Maximum number of articles to return",
},
},
async additionalProps(props) {
props.locale.hidden = false;
props.categoryId.hidden = false;
props.sectionId.hidden = false;
if (this.userId) {
props.locale.hidden = true;
props.categoryId.hidden = true;
props.sectionId.hidden = true;
}
return {};
},
async run({ $ }) {
if ((this.categoryId && this.userId) || (this.sectionId && this.userId)) {
throw new ConfigurationError("Providing a User ID, you cannot provide a Category ID or Section ID.");
}

const results = this.zendesk.paginate({
fn: this.zendesk.listArticles,
args: {
$,
categoryId: this.categoryId,
sectionId: this.sectionId,
userId: this.userId,
locale: this.userId
? null
: this.locale,
},
resourceKey: "articles",
max: this.limit,
});

const articles = [];
for await (const article of results) {
articles.push(article);
}

$.export("$summary", `Successfully retrieved ${articles.length} article${articles.length === 1
? ""
: "s"}`);

return articles;
},
};
2 changes: 1 addition & 1 deletion components/zendesk/actions/list-locales/list-locales.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "zendesk-list-locales",
name: "List Locales",
description: "Retrieves all locales. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/account-configuration/locales/).",
version: "0.0.5",
version: "0.0.6",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/zendesk/actions/list-macros/list-macros.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "zendesk-list-macros",
name: "List Macros",
description: "Retrieves all macros. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#list-macros).",
version: "0.0.5",
version: "0.0.6",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "zendesk-list-ticket-comments",
name: "List Ticket Comments",
description: "Retrieves all comments for a specific ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_comments/#list-comments).",
version: "0.0.5",
version: "0.0.6",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/zendesk/actions/list-tickets/list-tickets.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "List Tickets",
description: "Retrieves a list of tickets. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#list-tickets).",
type: "action",
version: "0.0.8",
version: "0.0.9",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Remove Ticket Tags",
description: "Remove specific tags from a ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/ticket-management/tags/#remove-tags).",
type: "action",
version: "0.0.6",
version: "0.0.7",
annotations: {
destructiveHint: true,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Search Tickets",
description: "Searches for tickets using Zendesk's search API. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/ticket-management/search/#search-tickets).",
type: "action",
version: "0.0.9",
version: "0.0.10",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import app from "../../zendesk.app.mjs";
import { parseObject } from "../../common/utils.mjs";
import { ConfigurationError } from "@pipedream/platform";
import { parseObject } from "../../common/utils.mjs";
import app from "../../zendesk.app.mjs";

export default {
key: "zendesk-set-custom-ticket-fields",
name: "Set Custom Ticket Fields",
description: "Sets one or more custom field values on a ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#update-ticket).",
type: "action",
version: "0.0.3",
version: "0.0.4",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Set Ticket Tags",
description: "Set tags on a ticket (replaces all existing tags). [See the documentation](https://developer.zendesk.com/api-reference/ticketing/ticket-management/tags/#set-tags).",
type: "action",
version: "0.0.6",
version: "0.0.7",
annotations: {
destructiveHint: true,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/zendesk/actions/update-ticket/update-ticket.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Update Ticket",
description: "Updates a ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#update-ticket).",
type: "action",
version: "0.2.3",
version: "0.2.4",
annotations: {
destructiveHint: true,
openWorldHint: true,
Expand Down
Loading
Loading