Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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 @@ -7,7 +7,7 @@ export default {
name: "Add Ticket Attachment",
description: "Attaches a file to a ticket. [See the docs here](https://desk.zoho.com/DeskAPIDocument#TicketAttachments#TicketAttachments_CreateTicketattachment)",
type: "action",
version: "0.1.1",
version: "0.1.2",
props: {
zohoDesk,
orgId: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Add Ticket Comment",
description: "Adds a comment to a ticket. [See the docs here](https://desk.zoho.com/DeskAPIDocument#TicketsComments#TicketsComments_Createticketcomment)",
type: "action",
version: "0.0.2",
version: "0.0.3",
props: {
zohoDesk,
orgId: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Create Account",
description: "Creates an account in your help desk portal. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Accounts#Accounts_CreateAccount)",
type: "action",
version: "0.0.2",
version: "0.0.3",
props: {
zohoDesk,
orgId: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Create Contact",
description: "Creates a contact in your help desk portal. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Contacts#Contacts_CreateContact)",
type: "action",
version: "0.0.2",
version: "0.0.3",
props: {
zohoDesk,
orgId: {
Expand Down
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 in your helpdesk. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Tickets#Tickets_Createaticket)",
type: "action",
version: "0.0.2",
version: "0.0.3",
props: {
zohoDesk,
orgId: {
Expand Down
2 changes: 1 addition & 1 deletion components/zoho_desk/actions/find-contact/find-contact.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Find Contact",
description: "Searches for contacts in your help desk portal. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Search#Search_SearchContacts)",
type: "action",
version: "0.0.2",
version: "0.0.3",
props: {
zohoDesk,
orgId: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Find or Create Contact",
description: "Finds or create a contact. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Contacts#Contacts_CreateContact)",
type: "action",
version: "0.0.2",
version: "0.0.3",
props: {
zohoDesk,
orgId: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Search Ticket",
description: "Searches for tickets in your help desk. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Search_TicketsSearchAPI)",
type: "action",
version: "0.0.2",
version: "0.0.3",
props: {
zohoDesk,
orgId: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Send E-Mail Reply",
description: "Sends an email reply. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Threads#Threads_SendEmailReply)",
type: "action",
version: "0.0.2",
version: "0.0.3",
props: {
zohoDesk,
orgId: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Update Contact",
description: "Updates details of an existing contact. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Contacts#Contacts_Updateacontact)",
type: "action",
version: "0.0.2",
version: "0.0.3",
props: {
zohoDesk,
orgId: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Update Ticket",
description: "Updates an existing ticket. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Tickets#Tickets_Updateaticket)",
type: "action",
version: "0.0.2",
version: "0.0.3",
props: {
zohoDesk,
orgId: {
Expand Down
2 changes: 1 addition & 1 deletion components/zoho_desk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/zoho_desk",
"version": "0.1.1",
"version": "0.2.0",
"description": "Pipedream Zoho_desk Components",
"main": "zoho_desk.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import common from "../common.mjs";
import common from "../common/common-polling.mjs";

export default {
...common,
key: "zoho_desk-changed-ticket-status",
name: "New Ticket Status Change",
description: "Emit new event when a status ticket is changed. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Tickets#Tickets_Listalltickets)",
type: "source",
version: "0.0.3",
version: "0.0.4",
dedupe: "unique",
props: {
...common.props,
Expand Down
68 changes: 68 additions & 0 deletions components/zoho_desk/sources/common/common-webhook.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import zohoDesk from "../../zoho_desk.app.mjs";
import { ConfigurationError } from "@pipedream/platform";

export default {
props: {
zohoDesk,
db: "$.service.db",
http: {
type: "$.interface.http",
customResponse: true,
},
infoAlert: {

Check warning on line 12 in components/zoho_desk/sources/common/common-webhook.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop infoAlert must have a description. See https://pipedream.com/docs/components/guidelines/#props

Check warning on line 12 in components/zoho_desk/sources/common/common-webhook.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop infoAlert must have a label. See https://pipedream.com/docs/components/guidelines/#props
type: "alert",
alertType: "info",
content: "Webhooks are available for Professional and Enterprise plans only",
},
},
hooks: {
async activate() {
const { id } = await this.zohoDesk.createWebhook({
data: {
url: this.http.endpoint,
subscriptions: this.getSubscriptions(),
},
});
this._setWebhookId(id);
},
async deactivate() {
const webhookId = this._getWebhookId();
if (webhookId) {
await this.zohoDesk.deleteWebhook({
webhookId,
});
}
},
},
methods: {
_getWebhookId() {
return this.db.get("webhookId");
},
_setWebhookId(webhookId) {
this.db.set("webhookId", webhookId);
},
getSubscriptions() {
throw new ConfigurationError("getSubscriptions is not implemented");
},
generateMeta() {
throw new ConfigurationError("generateMeta is not implemented");
},
},
async run(event) {
this.http.respond({
status: 200,
});

const { body: events } = event;

if (!events || !Array.isArray(events)) {
return;
}

for (const event of events) {
const { payload } = event;
const meta = this.generateMeta(payload);
this.$emit(payload, meta);
}
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import common from "../common/common-webhook.mjs";
import sampleEmit from "./test-event.mjs";

export default {
...common,
key: "zoho_desk-deleted-article-instant",
name: "Deleted Article (Instant)",

Check warning on line 7 in components/zoho_desk/sources/deleted-article-instant/deleted-article-instant.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
description: "Emit new event when an article is deleted from the recycle bin",
type: "source",
version: "0.0.1",
dedupe: "unique",
methods: {
...common.methods,
getSubscriptions() {
return {
Article_Delete: null,
};
},
generateMeta(payload) {
return {
id: payload.id,
summary: `Article Deleted: ${payload.id}`,
ts: Date.now(),
};
},
},
sampleEmit,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
"id" : "123456789044"
}
4 changes: 2 additions & 2 deletions components/zoho_desk/sources/new-account/new-account.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import common from "../common.mjs";
import common from "../common/common-polling.mjs";

export default {
...common,
key: "zoho_desk-new-account",
name: "New Account",
description: "Emit new event when a new account is created. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Accounts#Accounts_Listaccounts)",
type: "source",
version: "0.0.3",
version: "0.0.4",
dedupe: "unique",
props: {
...common.props,
Expand Down
4 changes: 2 additions & 2 deletions components/zoho_desk/sources/new-agent/new-agent.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import common from "../common.mjs";
import common from "../common/common-polling.mjs";

export default {
...common,
key: "zoho_desk-new-agent",
name: "New Agent",
description: "Emit new event when a new agent is created. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Agents#Agents_Listagents)",
type: "source",
version: "0.0.3",
version: "0.0.4",
dedupe: "unique",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import common from "../common/common-webhook.mjs";
import sampleEmit from "./test-event.mjs";

export default {
...common,
key: "zoho_desk-new-article-instant",
name: "New Article (Instant)",
description: "Emit new event when a new article is created",
type: "source",
version: "0.0.1",
dedupe: "unique",
methods: {
...common.methods,
getSubscriptions() {
return {
Article_Add: null,
};
},
generateMeta(payload) {
return {
id: payload.id,
summary: `New Article Created: ${payload.title}`,
ts: Date.parse(payload.createdTime),
};
},
},
sampleEmit,
};
103 changes: 103 additions & 0 deletions components/zoho_desk/sources/new-article-instant/test-event.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
export default {
"modifiedTime" : "2020-09-02T07:53:28.000Z",
"attachments" : [ ],
"reviewedTime" : null,
"departmentId" : "112534000000394045",
"modifierId" : "112534000000192635",
"dislikeCount" : "0",
"creatorId" : "112534000000192635",
"likeCount" : "0",
"ownerId" : "112534000000192635",
"title" : "Zoho Desk - An Overview",
"locale" : "en",
"translationState" : "UP-TO-DATE",
"expiryDate" : null,
"isTrashed" : false,
"isLocked" : false,
"createdTime" : "2020-09-02T07:53:28.000Z",
"modifiedBy" : {
"photoURL" : "https://contacts.zoho.com/file?ID=53947797&t=user&API=true&fs=thumb",
"name" : "Zylker",
"id" : "112534000000192635",
"status" : "ACTIVE",
"zuid" : "53947797"
},
"id" : "112534000000396881",
"viewCount" : "0",
"translationSource" : null,
"seo" : {
"keywords" : null,
"description" : null,
"title" : null
},
"summary" : "Zoho Desk - An Overview",
"owner" : {
"photoURL" : "https://contacts.zoho.com/file?ID=53947797&t=user&API=true&fs=thumb",
"name" : "Zylker",
"id" : "112534000000192635",
"status" : "ACTIVE",
"zuid" : "53947797"
},
"latestVersionStatus" : "Published",
"author" : {
"photoURL" : "https://contacts.zoho.com/file?ID=53947797&t=user&API=true&fs=thumb",
"name" : "Zylker",
"id" : "112534000000192635",
"status" : "ACTIVE",
"zuid" : "53947797"
},
"permission" : "AGENTS",
"reviewedBy" : null,
"authorId" : "112534000000192635",
"usageCount" : "0",
"commentCount" : "0",
"tags" : [ ],
"rootCategoryId" : "112534000000397001",
"sourceLocale" : "en",
"translationId" : "112534000000396883",
"createdBy" : {
"photoURL" : "https://contacts.zoho.com/file?ID=53947797&t=user&API=true&fs=thumb",
"name" : "Zylker",
"id" : "112534000000192635",
"status" : "ACTIVE",
"zuid" : "53947797"
},
"latestVersion" : "1.0",
"webUrl" : "https://desk.zoho.com/support/zylker/ShowHomePage.do#Solutions/dv/112534000000396881/en",
"feedbackCount" : "0",
"portalUrl" : "https://desk.zoho.com/portal/zylker/en/kb/articles/asa",
"latestPublishedVersion" : "1.0",
"attachmentCount" : "0",
"metrics" : {
"feedbackCount" : "0",
"unlikeCount" : "0",
"dislikeCount" : "0",
"lastUsageTime" : null,
"likeCount" : "0",
"viewCount" : "0",
"lastActivityTime" : null,
"usageCount" : "0"
},
"position" : "3",
"availableLocaleTranslations" : [ {
"latestVersionStatus" : "Published",
"translationId" : "112534000000396883",
"isTrashed" : false,
"recycleBinEntityId" : "112534000000396881",
"latestVersion" : "1.0",
"latestPublishedVersion" : "1.0",
"href" : "https://desk.zoho.com/api/v1/articles/112534000000396881/translations/en?orgId=62366276",
"authorId" : "112534000000192635",
"locale" : "en",
"translationState" : "UP-TO-DATE",
"status" : "Published"
} ],
"permalink" : "zoho-desk-overview",
"category" : {
"name" : "General",
"id" : "112534000000397018",
"locale" : "en"
},
"categoryId" : "112534000000397018",
"status" : "Published"
}
Loading
Loading