Skip to content

Commit

Permalink
move the functions getZendeskSyncWorkflowId and getZendeskGarbageColl…
Browse files Browse the repository at this point in the history
…ectionWorkflowId to types
  • Loading branch information
aubin-tchoi committed Jan 3, 2025
1 parent f4ae264 commit 56573aa
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
19 changes: 7 additions & 12 deletions connectors/src/connectors/zendesk/temporal/client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import type { ModelId, Result } from "@dust-tt/types";
import { Err, Ok } from "@dust-tt/types";
import type { Result } from "@dust-tt/types";
import {
Err,
getZendeskGarbageCollectionWorkflowId,
getZendeskSyncWorkflowId,
Ok,
} from "@dust-tt/types";
import type { WorkflowHandle } from "@temporalio/client";
import {
WorkflowExecutionAlreadyStartedError,
Expand All @@ -25,16 +30,6 @@ import {
ZendeskCategoryResource,
} from "@connectors/resources/zendesk_resources";

export function getZendeskSyncWorkflowId(connectorId: ModelId): string {
return `zendesk-sync-${connectorId}`;
}

export function getZendeskGarbageCollectionWorkflowId(
connectorId: ModelId
): string {
return `zendesk-gc-${connectorId}`;
}

export async function launchZendeskSyncWorkflow(
connector: ConnectorResource,
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ModelId } from "@dust-tt/types";
import { getZendeskGarbageCollectionWorkflowId } from "@dust-tt/types";

import {
getArticleInternalId,
Expand All @@ -16,7 +17,6 @@ import {
fetchZendeskArticle,
getZendeskBrandSubdomain,
} from "@connectors/connectors/zendesk/lib/zendesk_api";
import { getZendeskGarbageCollectionWorkflowId } from "@connectors/connectors/zendesk/temporal/client";
import { ZENDESK_BATCH_SIZE } from "@connectors/connectors/zendesk/temporal/config";
import { dataSourceConfigFromConnector } from "@connectors/lib/api/data_source_config";
import { concurrentExecutor } from "@connectors/lib/async_utils";
Expand Down
11 changes: 11 additions & 0 deletions types/src/connectors/zendesk.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { ModelId } from "../shared/model_id";

export function getZendeskSyncWorkflowId(connectorId: ModelId): string {
return `zendesk-sync-${connectorId}`;
}

export function getZendeskGarbageCollectionWorkflowId(
connectorId: ModelId
): string {
return `zendesk-gc-${connectorId}`;
}
1 change: 1 addition & 0 deletions types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export * from "./connectors/notion";
export * from "./connectors/slack";
export * from "./connectors/snowflake";
export * from "./connectors/webcrawler";
export * from "./connectors/zendesk";
export * from "./core/data_source";
export * from "./front/api_handlers/internal/agent_configuration";
export * from "./front/api_handlers/internal/assistant";
Expand Down

0 comments on commit 56573aa

Please sign in to comment.