feat(datasource-zendesk): add Zendesk datasource#1658
Open
christophebrun-forest wants to merge 5 commits into
Open
feat(datasource-zendesk): add Zendesk datasource#1658christophebrun-forest wants to merge 5 commits into
christophebrun-forest wants to merge 5 commits into
Conversation
New @forestadmin/datasource-zendesk package: collections for tickets, users and organizations over the Zendesk API, condition-tree translation, custom-field introspection, and plugins (close-ticket, create-ticket-with-notification). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Address correctness issues found in review of the Zendesk datasource:
- id-lookups combined with sibling conditions (scope/segment) are now
re-checked in memory, so list/update/delete/count never bypass the
caller's perimeter
- update/delete page through every match up to the Search cap instead of
silently affecting only the first 100, warning when the cap is exceeded
- In/NotIn dropped from Search-backed fields (Zendesk has no OR); kept on
the primary key, which is resolved by id lookup
- sort and pagination are applied in memory on the id-lookup path
- aggregateCount fetches and filters the referenced ids instead of trusting
their count blindly
- searchRecords fetches the pages covering a non-aligned window and slices,
instead of snapping skip to a page boundary
- description is ignored on update (Zendesk derives it from the first
comment and cannot edit it afterwards)
- schema made honest: id advertises {Equal, In}, booleans {Equal, NotEqual},
non-sortable foreign keys no longer claim isSortable
- operator sets extracted to a single shared module
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The multi-step "create ticket and notify" form resolved its requester
email default and message template against an empty record: getSingleRecord
called getRecord([]) with an empty projection, so {{record.x}} tokens and
record-based defaults always rendered blank on the second step.
Request the collection's column fields from the action context schema so the
record is populated before interpolation.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Removing In/NotIn from the string/number operator sets backfired: the operators-equivalence decorator re-advertises them (derivable from Equal / NotEqual) and rewrites incoming In into an Or tree, which the translator rejects — turning a common `status In [...]` filter into a 500 instead of the previous (empty) result. Advertise In/NotIn again so the decorator leaves them untouched and the translator handles them natively. Multi-value membership on Search-resolved fields keeps Zendesk's AND semantics (documented); only the primary key matches each value, via the id-lookup path. ID_OPS and the isSortable cleanup are kept. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
serializeRecord builds tickets with an empty email map, so re-applying a scope/segment condition on requester_email in memory (aggregateCount and resolveIds) always saw null and dropped every record — making count return 0 and update/delete no-op for tickets that legitimately matched. Add a serializeForFilter hook the ticket collection overrides to resolve requester_email before in-memory filtering. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
26 new issues
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
New
@forestadmin/datasource-zendeskpackage: a datasource exposing Zendesk tickets, users and organizations over the Zendesk API, with condition-tree translation, custom-field introspection, and two plugins (close-ticket,create-ticket-with-notification).What's included
ticket_fields/user_fields/organization_fields) mapped to Forest columnsclose-ticketandcreate-ticket-with-notification(multi-step form with email templates)Behavior & limitations
ORoperator: multi-valueIn/NotInmatches each value exactly only on the primary key; on other fields Zendesk ANDs the terms (documented in the README).UnsupportedOperatorError.Count(no groups), reflecting Zendesk Search capabilities.Correctness highlights (addressed during review)
list/update/delete/countnever bypass the caller's perimeter (including scopes on the derivedrequester_email).skip/limitby fetching the covering pages and slicing.descriptionis ignored on update (Zendesk derives it from the first comment and cannot edit it afterwards).requesterEmailDefaultand{{record.x}}template tokens are populated on the second step.Or.Testing
yarn workspace @forestadmin/datasource-zendesk test→ 133 tests passinglint+buildgreen🤖 Generated with Claude Code
Note
Add Zendesk datasource with ticket, user, and organization collections
@forestadmin/datasource-zendeskpackage exposing three collections (zendesk_ticket,zendesk_user,zendesk_organization) backed by the Zendesk Search and REST APIs via a newZendeskHttpClient.condition-tree-translator.ts.custom_<id>naming, user/organization fields use the Zendesk field key.closeTicketPlugin(mark tickets solved/closed with outcome classification) andcreateTicketWithNotificationPlugin(create a ticket with an optional public/private comment and writeback of the ticket id).MAX_TOTAL_RESULTS); bulk update/delete operations that match more than 1,000 records will silently stop after that cap with a logger warning.Macroscope summarized f9e1f86.