diff --git a/connectors/src/lib/data_sources.ts b/connectors/src/lib/data_sources.ts index 202c11a8ec55b..50beaecf0075a 100644 --- a/connectors/src/lib/data_sources.ts +++ b/connectors/src/lib/data_sources.ts @@ -9,6 +9,7 @@ import type { CoreAPIFolder, CoreAPITable, PostDataSourceDocumentRequestBody, + ProviderVisibility, } from "@dust-tt/types"; import { isValidDate, @@ -1249,7 +1250,7 @@ export async function _upsertDataSourceFolder({ parentId: string | null; title: string; mimeType: string; - providerVisibility?: string; + providerVisibility?: ProviderVisibility; }) { const now = new Date(); diff --git a/sdks/js/src/index.ts b/sdks/js/src/index.ts index 636ed3e35238a..64fbbcc3c9431 100644 --- a/sdks/js/src/index.ts +++ b/sdks/js/src/index.ts @@ -841,7 +841,7 @@ export class DustAPI { parentId: string | null; parents: string[]; mimeType: string; - providerVisibility: string | null; + providerVisibility: "public" | "private" | null; }) { const res = await this.request({ method: "POST", diff --git a/types/src/front/lib/connectors_api.ts b/types/src/front/lib/connectors_api.ts index 863598f6bbe0a..78ac41372b660 100644 --- a/types/src/front/lib/connectors_api.ts +++ b/types/src/front/lib/connectors_api.ts @@ -56,6 +56,7 @@ export type ConnectorType = { */ export type ConnectorPermission = "read" | "write" | "read_write" | "none"; export type ContentNodeType = "file" | "folder" | "database" | "channel"; +export type ProviderVisibility = "public" | "private"; /* * This constant defines the priority order for sorting content nodes by their type. @@ -107,7 +108,7 @@ export interface ContentNode { preventSelection?: boolean; permission: ConnectorPermission; lastUpdatedAt: number | null; - providerVisibility?: "public" | "private"; + providerVisibility?: ProviderVisibility; } export type ContentNodeWithParentIds = ContentNode & { diff --git a/types/src/front/lib/core_api.ts b/types/src/front/lib/core_api.ts index b240ea160f6eb..2a2239b6c2f72 100644 --- a/types/src/front/lib/core_api.ts +++ b/types/src/front/lib/core_api.ts @@ -26,6 +26,7 @@ import { import { LightWorkspaceType } from "../../front/user"; import { LoggerInterface } from "../../shared/logger"; import { Err, Ok, Result } from "../../shared/result"; +import { ProviderVisibility } from "./connectors_api"; export const MAX_CHUNK_SIZE = 512; @@ -1553,7 +1554,7 @@ export class CoreAPI { parents: string[]; title: string; mimeType: string; - providerVisibility: string | null | undefined; + providerVisibility: ProviderVisibility | null | undefined; }): Promise> { const response = await this._fetchWithError( `${this._url}/projects/${projectId}/data_sources/${encodeURIComponent(