-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[connectors] Implement incremental sync for Zendesk tickets (#8617)
* feat: add a function that fetches the recently updated tickets * feat: add activities to update the recently updated tickets * feat: add an incremental sync workflow * perf: use the `show_many` endpoint instead of fetching all the users when updating the tickets * fix: prevent extra syncs of help centers/tickets when the whole brand is synced * fix: fix date conversions * fix: fix the structure of the response of the incremental endpoint * feat: implement ticket scrub * docs: add descriptions for a few functions * feat: add a log to the ticket deletion * fix: fix the use of the `show_many` endpoint * refactor: remove leading underscores in function names * refactor: move node-zendesk types to @connectors/@types (consistent with talisman) * refactor: remove an unnecessary import * refactor: inline getZendeskConnectorOrRaise and getZendeskCategoryOrRaise * refactor: inline syncBrandWithPermissions and fix incorrect permissions for brand * refactor: move sync_(article|ticket) from temporal to lib * fix: use the lastSyncSuccessfulTime as the start time instead of now - 5 min * fix: add a column lastSuccessfulSyncStartTs to the ZendeskConfiguration and use it * lint * fix: only sync solved tickets * feat: add a table to store workspace information * fix: update the type of ticket subjects and category descriptions from string to text * feat: add the migration file * feat: add ZendeskWorkspace to db.ts * feat: add the migration file * fix naming * fix: add the connectorId when creating a WorkspaceResource * refactor: renaming the table zendesk_workspaces into zendesk_timestamp_cursors, removing the Resource * fix migration file * fix: rename zendesk_workspaces * fix: add create the cursors upon saving * fix: recast cursor as date (received as a string) * fix: delete the cursor when deleting the connector * fix: fix how we handle StartTimeTooRecent errors
- Loading branch information
1 parent
73f7066
commit 16120c4
Showing
15 changed files
with
501 additions
and
167 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
-- Migration created on Nov 14, 2024 | ||
CREATE TABLE IF NOT EXISTS "zendesk_timestamp_cursors" | ||
( | ||
"id" SERIAL, | ||
"createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, | ||
"updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, | ||
"timestampCursor" TIMESTAMP WITH TIME ZONE DEFAULT NULL, | ||
"connectorId" INTEGER NOT NULL REFERENCES "connectors" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, | ||
PRIMARY KEY ("id") | ||
); | ||
CREATE UNIQUE INDEX "zendesk_timestamp_cursors_connector_id" ON "zendesk_timestamp_cursors" ("connectorId"); | ||
|
||
ALTER TABLE "public"."zendesk_categories" ALTER COLUMN "description" TYPE TEXT; | ||
ALTER TABLE "public"."zendesk_tickets" ALTER COLUMN "subject" TYPE TEXT; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
4 changes: 2 additions & 2 deletions
4
...nnectors/zendesk/temporal/sync_article.ts → ...rc/connectors/zendesk/lib/sync_article.ts
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.