@orchesty/connector-zendesk 1.0.1 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,97 @@
1
+ # Zendesk Connector
2
+
3
+ [![npm](https://img.shields.io/npm/v/@orchesty/connector-zendesk?color=15ba68)](https://www.npmjs.com/package/@orchesty/connector-zendesk)
4
+ [![License](https://img.shields.io/badge/license-Apache--2.0-15ba68)](https://github.com/Orchesty/orchesty-nodejs-connectors/blob/master/LICENSE)
5
+
6
+ An [Orchesty](https://orchesty.io) connector for Zendesk, a customer support platform for managing tickets, users, and automation triggers.
7
+
8
+ ## Application Type
9
+
10
+ **OAuth 2.0**
11
+
12
+ This connector uses the Zendesk OAuth 2.0 authorization flow with subdomain-based auth and token URLs. After entering your credentials in Orchesty, you will be redirected to your Zendesk instance to authorize access.
13
+
14
+ | Field | Description |
15
+ |---|---|
16
+ | `subdomain` | Your Zendesk subdomain (e.g. `mycompany` from `mycompany.zendesk.com`) |
17
+ | `client_id` | Your Zendesk OAuth app Client ID |
18
+ | `client_secret` | Your Zendesk OAuth app Client Secret |
19
+
20
+ ## Components
21
+
22
+ | Class | Type | Description |
23
+ |---|---|---|
24
+ | `ZendeskCreateTicketConnector` | Connector | Creates a new support ticket via `POST /api/v2/tickets.json` |
25
+ | `ZendeskCreateTriggerConnector` | Connector | Creates an automation trigger via `POST /api/v2/triggers` |
26
+ | `ZendeskCreateUserConnector` | Connector | Creates a new user via `POST /api/v2/users.json` |
27
+ | `ZendeskDeleteTriggerConnector` | Connector | Deletes a trigger by ID via `DELETE /api/v2/triggers/{id}` |
28
+ | `ZendeskCreateWebhookConnector` | Batch | Registers webhook subscriptions via `POST /api/v2/webhooks` |
29
+ | `ZendeskDeleteWebhookConnector` | Batch | Deletes registered webhooks via `DELETE /api/v2/webhooks/{webhookId}` |
30
+ | `ZendeskListTicketsBatch` | Batch | Paginates through tickets (100 per page) via `GET /api/v2/tickets.json` |
31
+ | `ZendeskListUsersBatch` | Batch | Paginates through users (100 per page) via `GET /api/v2/users.json` |
32
+
33
+ ## Setup
34
+
35
+ ### Credentials
36
+
37
+ 1. Log in to your Zendesk admin panel and navigate to **Admin Center → Apps and integrations → OAuth clients**.
38
+ 2. Create a new OAuth client and note the **Client ID** and **Client Secret**.
39
+ 3. Add the Orchesty redirect URL to the **Redirect URLs** list.
40
+ 4. Your **subdomain** is the part before `.zendesk.com` in your Zendesk URL.
41
+ 5. In Orchesty, open the Zendesk application settings, enter all three values, and complete the OAuth authorization flow.
42
+
43
+ ### API Documentation
44
+
45
+ Zendesk API Reference: [https://developer.zendesk.com/api-reference/](https://developer.zendesk.com/api-reference/)
46
+
47
+ ## Installation & Usage
48
+
49
+ Install the package:
50
+
51
+ ```bash
52
+ npm install @orchesty/connector-zendesk @orchesty/nodejs-sdk
53
+ # or
54
+ pnpm add @orchesty/connector-zendesk @orchesty/nodejs-sdk
55
+ ```
56
+
57
+ Register the application and nodes in your Orchesty DI container:
58
+
59
+ ```typescript
60
+ import { container } from '@orchesty/nodejs-sdk';
61
+ import { OAuth2Provider } from '@orchesty/nodejs-sdk/dist/lib/Authorization/Provider/OAuth2/OAuth2Provider';
62
+ import ZendeskApplication from '@orchesty/connector-zendesk/dist/ZendeskApplication';
63
+ import ZendeskCreateTicketConnector from '@orchesty/connector-zendesk/dist/Connector/ZendeskCreateTicketConnector';
64
+ import ZendeskCreateUserConnector from '@orchesty/connector-zendesk/dist/Connector/ZendeskCreateUserConnector';
65
+ import ZendeskCreateTriggerConnector from '@orchesty/connector-zendesk/dist/Connector/ZendeskCreateTriggerConnector';
66
+ import ZendeskDeleteTriggerConnector from '@orchesty/connector-zendesk/dist/Connector/ZendeskDeleteTriggerConnector';
67
+ import ZendeskCreateWebhookConnector from '@orchesty/connector-zendesk/dist/Batch/ZendeskCreateWebhookConnector';
68
+ import ZendeskDeleteWebhookConnector from '@orchesty/connector-zendesk/dist/Batch/ZendeskDeleteWebhookConnector';
69
+ import ZendeskListTicketsBatch from '@orchesty/connector-zendesk/dist/Batch/ZendeskListTicketsBatch';
70
+ import ZendeskListUsersBatch from '@orchesty/connector-zendesk/dist/Batch/ZendeskListUsersBatch';
71
+
72
+ const app = new ZendeskApplication(container.get(OAuth2Provider));
73
+ container.setApplication(app);
74
+ container.setNode(new ZendeskCreateTicketConnector(), app);
75
+ container.setNode(new ZendeskCreateUserConnector(), app);
76
+ container.setNode(new ZendeskCreateTriggerConnector(), app);
77
+ container.setNode(new ZendeskDeleteTriggerConnector(), app);
78
+ container.setNode(new ZendeskCreateWebhookConnector(), app);
79
+ container.setNode(new ZendeskDeleteWebhookConnector(), app);
80
+ container.setNode(new ZendeskListTicketsBatch(), app);
81
+ container.setNode(new ZendeskListUsersBatch(), app);
82
+ ```
83
+
84
+ ## License
85
+
86
+ This connector is released under the **Apache License 2.0**. See the [LICENSE](https://github.com/Orchesty/orchesty-nodejs-connectors/blob/master/LICENSE) file for the full license text.
87
+
88
+ ## Contributing
89
+
90
+ Contributions are welcome! This connector is part of the open-source [Orchesty Node.js Connectors](https://github.com/Orchesty/orchesty-nodejs-connectors) monorepo.
91
+
92
+ For guidelines on how to create or update connectors — including project setup, coding conventions, and how to write tests — please refer to the **[Contributing to Connectors](https://orchesty.io/community/contributing-to-connectors)** guide.
93
+
94
+ All contributions should include:
95
+ - Source code in `src/` following the existing connector structure
96
+ - Tests in `src/**/__tests__/` with `input.json`, `mock.json`, and `output.json` fixtures
97
+ - An updated `CHANGELOG.md` entry
@@ -18,7 +18,11 @@ class ZendeskCreateWebhookConnector extends ABatchNode_1.default {
18
18
  const repo = this.getDbClient().getRepository(Webhook_1.default);
19
19
  const app = this.getApplication();
20
20
  const appInstall = await this.getApplicationInstallFromProcess(dto);
21
- const registered = await repo.findMany({ users: [appInstall.getUser()], apps: [appInstall.getName()] });
21
+ const registered = await repo.findMany({
22
+ users: [appInstall.getUser()],
23
+ apps: [appInstall.getName()],
24
+ sdks: [appInstall.getSdk()],
25
+ });
22
26
  const all = app.getWebhookSubscriptions().map((sub) => ({
23
27
  event: sub.getName(),
24
28
  token: this.getRandomToken(),
@@ -44,6 +48,7 @@ class ZendeskCreateWebhookConnector extends ABatchNode_1.default {
44
48
  await repo.insert(new Webhook_1.default()
45
49
  .setWebhookId(data.webhook.id)
46
50
  .setUser(appInstall.getUser())
51
+ .setSdk(appInstall.getSdk())
47
52
  .setNode(toRegister.node)
48
53
  .setToken(toRegister.token)
49
54
  .setApplication(app.getName())
@@ -18,7 +18,11 @@ class ZendeskDeleteWebhookConnector extends ABatchNode_1.default {
18
18
  const app = this.getApplication();
19
19
  const appInstall = await this.getApplicationInstallFromProcess(dto, null);
20
20
  const repo = this.getDbClient().getRepository(Webhook_1.default);
21
- const webhook = await repo.findOne({ users: [appInstall.getUser()], apps: [appInstall.getName()] });
21
+ const webhook = await repo.findOne({
22
+ users: [appInstall.getUser()],
23
+ apps: [appInstall.getName()],
24
+ sdks: [appInstall.getSdk()],
25
+ });
22
26
  if (webhook) {
23
27
  const url = `/webhooks/${webhook.getWebhookId()}`;
24
28
  const requestDto = await app.getRequestDto(dto, appInstall, HttpMethods_1.HttpMethods.DELETE, url);
@@ -108,7 +108,7 @@ class ZendeskApplication extends AOAuth2Application_1.default {
108
108
  }
109
109
  createDto(applicationInstall, redirectUrl) {
110
110
  const dto = new OAuth2Dto_1.default(applicationInstall, this.getAuthUrlWithSubdomain(applicationInstall), this.getTokenUrlWithSubdomain(applicationInstall));
111
- dto.setCustomAppDependencies(applicationInstall.getUser(), applicationInstall.getName());
111
+ dto.setCustomAppDependencies(applicationInstall.getUser(), applicationInstall.getName(), applicationInstall.getSdk());
112
112
  if (redirectUrl) {
113
113
  dto.setRedirectUrl(redirectUrl);
114
114
  }
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orchesty/connector-zendesk",
3
3
  "description": "",
4
- "version": "1.0.0",
4
+ "version": "2.0.0",
5
5
  "license": "Apache-2.0",
6
6
  "url": "https://github.com/Orchesty/orchesty-nodejs-connectors",
7
7
  "repository": "https://github.com/Orchesty/orchesty-nodejs-connectors",
@@ -17,7 +17,7 @@
17
17
  "keywords": [],
18
18
  "author": "info@hanaboso.com",
19
19
  "dependencies": {
20
- "@orchesty/nodejs-sdk": "^4.3.6",
20
+ "@orchesty/nodejs-sdk": "^5.0.13",
21
21
  "http-status-codes": "^2.3.0"
22
22
  },
23
23
  "engines": {
package/package.json CHANGED
@@ -1,17 +1,20 @@
1
1
  {
2
2
  "name": "@orchesty/connector-zendesk",
3
3
  "description": "",
4
- "version": "1.0.1",
4
+ "version": "2.0.1",
5
5
  "license": "Apache-2.0",
6
6
  "url": "https://github.com/Orchesty/orchesty-nodejs-connectors",
7
- "repository": "https://github.com/Orchesty/orchesty-nodejs-connectors",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/Orchesty/orchesty-nodejs-connectors"
10
+ },
8
11
  "files": [
9
12
  "dist"
10
13
  ],
11
14
  "keywords": [],
12
15
  "author": "info@hanaboso.com",
13
16
  "dependencies": {
14
- "@orchesty/nodejs-sdk": "^4.3.6",
17
+ "@orchesty/nodejs-sdk": "^5.0.13",
15
18
  "http-status-codes": "^2.3.0"
16
19
  },
17
20
  "engines": {