@useairfoil/producer-zendesk 0.0.1 → 0.0.2

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.
Files changed (55) hide show
  1. package/README.md +81 -0
  2. package/dist/index.d.mts +2326 -0
  3. package/dist/index.mjs +3 -0
  4. package/dist/main.d.mts +1 -0
  5. package/dist/main.mjs +1246 -0
  6. package/dist/main.mjs.map +1 -0
  7. package/dist/manifest.d.mts +100 -0
  8. package/dist/manifest.mjs +140 -0
  9. package/dist/manifest.mjs.map +1 -0
  10. package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
  11. package/dist/src-DewlmEIy.mjs +1679 -0
  12. package/dist/src-DewlmEIy.mjs.map +1 -0
  13. package/package.json +45 -7
  14. package/src/client/auth.ts +104 -0
  15. package/src/client/client.ts +229 -0
  16. package/src/client/constants.ts +5 -0
  17. package/src/connector.ts +90 -0
  18. package/src/create-table.ts +5 -0
  19. package/src/demo/customers.ts +145 -0
  20. package/src/demo/help-center.ts +121 -0
  21. package/src/demo/index.ts +104 -0
  22. package/src/demo/setup.ts +425 -0
  23. package/src/demo/shared.ts +118 -0
  24. package/src/demo/tickets.ts +332 -0
  25. package/src/index.ts +48 -0
  26. package/src/main.ts +22 -0
  27. package/src/manifest.ts +56 -0
  28. package/src/resources/csat.ts +141 -0
  29. package/src/resources/exports.ts +126 -0
  30. package/src/resources/help-center.ts +126 -0
  31. package/src/resources/lists.ts +230 -0
  32. package/src/resources/memberships.ts +96 -0
  33. package/src/resources/organizations.ts +39 -0
  34. package/src/resources/pages.ts +78 -0
  35. package/src/resources/satisfaction-ratings.ts +69 -0
  36. package/src/resources/talk.ts +37 -0
  37. package/src/resources/ticket-comments.ts +75 -0
  38. package/src/resources/ticket-events.ts +129 -0
  39. package/src/resources/tickets.ts +49 -0
  40. package/src/resources/users.ts +52 -0
  41. package/src/sandbox.ts +35 -0
  42. package/src/schemas/comments.ts +57 -0
  43. package/src/schemas/csat.ts +126 -0
  44. package/src/schemas/help-center.ts +96 -0
  45. package/src/schemas/lists.ts +231 -0
  46. package/src/schemas/memberships.ts +47 -0
  47. package/src/schemas/organizations.ts +41 -0
  48. package/src/schemas/satisfaction.ts +34 -0
  49. package/src/schemas/shared.ts +110 -0
  50. package/src/schemas/talk.ts +45 -0
  51. package/src/schemas/ticket-events.ts +102 -0
  52. package/src/schemas/tickets.ts +98 -0
  53. package/src/schemas/users.ts +68 -0
  54. package/src/start.ts +47 -0
  55. package/src/tables.ts +62 -0
package/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # Zendesk producer
2
+
3
+ Syncs tickets, comments, field history, metric events, users, organizations,
4
+ satisfaction ratings and surveys, Help Center articles and community posts,
5
+ Talk lines, and the lists that name their IDs from one Zendesk account. It
6
+ backfills each resource and polls for changes. There are no webhooks.
7
+
8
+ ## Config
9
+
10
+ | Variable | Required | Default |
11
+ | ----------------------- | -------- | ------- |
12
+ | `ZENDESK_SUBDOMAIN` | yes | none |
13
+ | `ZENDESK_CLIENT_ID` | yes | none |
14
+ | `ZENDESK_CLIENT_SECRET` | yes | none |
15
+
16
+ ## Setup
17
+
18
+ As an admin, add an OAuth client in Admin Center under
19
+ Apps and integrations > APIs > OAuth clients:
20
+
21
+ - Client kind: Confidential.
22
+ - Scopes: leave empty, or allow `read`.
23
+ - No redirect URL is needed.
24
+
25
+ Use the Identifier as `ZENDESK_CLIENT_ID` and the secret as
26
+ `ZENDESK_CLIENT_SECRET`. Use `acme` for `acme.zendesk.com`; the full address
27
+ also works.
28
+
29
+ The token uses the permissions of the admin who made the client.
30
+
31
+ ## Data
32
+
33
+ - `tickets.metrics` holds reply, wait, and resolution times. `custom_fields`
34
+ maps field IDs to values, and `ticket_fields` names them.
35
+ - `ticket_comments` includes internal notes (`public` is false). It has the
36
+ text, not attachment files.
37
+ - Deleted tickets, users, and organizations get `_deleted`. Restored tickets
38
+ come back.
39
+ - Groups, brands, ticket fields, forms, and statuses keep deleted items, so
40
+ older tickets still have their names. So do the other lists, articles, and
41
+ Talk lines. Removed group and organization memberships get `_deleted`.
42
+ - `ticket_field_history` has one row per changed field. Custom fields use
43
+ their ID.
44
+ - `satisfaction_ratings` holds legacy CSAT ratings. A new score is a new row.
45
+ - `survey_responses` holds CSAT answers. `csat_surveys` names the questions
46
+ and options. Both need the new CSAT, on Support Professional or Suite Growth
47
+ and up. Unanswered surveys are skipped.
48
+ - Tables hold names, emails, and ticket text. Treat them as confidential.
49
+
50
+ ## Limits
51
+
52
+ - Incremental exports share a limit of 10 calls a minute per account, or 30
53
+ with the High Volume add-on. Large comment backfills can be slow.
54
+ - `ticket_comments` and `ticket_field_history` each read the ticket events
55
+ export, so both count toward that limit.
56
+ - Exports are polled every 5 minutes. Zendesk leaves out the latest minute.
57
+ - A comment made private later stays public in `ticket_comments`. Zendesk's
58
+ event for it has no details. A redacted comment or attachment is read again.
59
+
60
+ ## Demo data
61
+
62
+ `pnpm demo --size 128MiB` writes made-up Zendesk data without Zendesk
63
+ credentials. See the Connector Kit README for the flags and the variables it
64
+ needs.
65
+
66
+ Each customer has tickets with comments, field history, metric events, and
67
+ sometimes a satisfaction rating and survey response. The first 12 customers also
68
+ bring the 12 agents. The account setup is written once and doesn't grow with the
69
+ size: brands, groups and group memberships, statuses, fields, forms, roles, SLA
70
+ policies, business hours, macros, the Help Center and community, a Talk line,
71
+ the CSAT survey, and 40 organizations.
72
+
73
+ ## Local development
74
+
75
+ ```bash
76
+ cd connectors/producer-zendesk
77
+ pnpm sandbox
78
+ ```
79
+
80
+ `pnpm start` runs the hosted connector. It needs the Wings and PostgreSQL
81
+ variables from the [Connector Kit README](../../packages/connector-kit/README.md).