Skip to content

Commit

Permalink
add a type for ProviderVisibility
Browse files Browse the repository at this point in the history
  • Loading branch information
aubin-tchoi committed Jan 14, 2025
1 parent 5e58d95 commit ff0c786
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion connectors/src/lib/data_sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type {
CoreAPIFolder,
CoreAPITable,
PostDataSourceDocumentRequestBody,
ProviderVisibility,
} from "@dust-tt/types";
import {
isValidDate,
Expand Down Expand Up @@ -1249,7 +1250,7 @@ export async function _upsertDataSourceFolder({
parentId: string | null;
title: string;
mimeType: string;
providerVisibility?: string;
providerVisibility?: ProviderVisibility;
}) {
const now = new Date();

Expand Down
2 changes: 1 addition & 1 deletion sdks/js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion types/src/front/lib/connectors_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -107,7 +108,7 @@ export interface ContentNode {
preventSelection?: boolean;
permission: ConnectorPermission;
lastUpdatedAt: number | null;
providerVisibility?: "public" | "private";
providerVisibility?: ProviderVisibility;
}

export type ContentNodeWithParentIds = ContentNode & {
Expand Down
3 changes: 2 additions & 1 deletion types/src/front/lib/core_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -1553,7 +1554,7 @@ export class CoreAPI {
parents: string[];
title: string;
mimeType: string;
providerVisibility: string | null | undefined;
providerVisibility: ProviderVisibility | null | undefined;
}): Promise<CoreAPIResponse<{ folder: CoreAPIFolder }>> {
const response = await this._fetchWithError(
`${this._url}/projects/${projectId}/data_sources/${encodeURIComponent(
Expand Down

0 comments on commit ff0c786

Please sign in to comment.