Skip to content

Commit ff0c786

Browse files
committed
add a type for ProviderVisibility
1 parent 5e58d95 commit ff0c786

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

connectors/src/lib/data_sources.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type {
99
CoreAPIFolder,
1010
CoreAPITable,
1111
PostDataSourceDocumentRequestBody,
12+
ProviderVisibility,
1213
} from "@dust-tt/types";
1314
import {
1415
isValidDate,
@@ -1249,7 +1250,7 @@ export async function _upsertDataSourceFolder({
12491250
parentId: string | null;
12501251
title: string;
12511252
mimeType: string;
1252-
providerVisibility?: string;
1253+
providerVisibility?: ProviderVisibility;
12531254
}) {
12541255
const now = new Date();
12551256

sdks/js/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ export class DustAPI {
841841
parentId: string | null;
842842
parents: string[];
843843
mimeType: string;
844-
providerVisibility: string | null;
844+
providerVisibility: "public" | "private" | null;
845845
}) {
846846
const res = await this.request({
847847
method: "POST",

types/src/front/lib/connectors_api.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export type ConnectorType = {
5656
*/
5757
export type ConnectorPermission = "read" | "write" | "read_write" | "none";
5858
export type ContentNodeType = "file" | "folder" | "database" | "channel";
59+
export type ProviderVisibility = "public" | "private";
5960

6061
/*
6162
* This constant defines the priority order for sorting content nodes by their type.
@@ -107,7 +108,7 @@ export interface ContentNode {
107108
preventSelection?: boolean;
108109
permission: ConnectorPermission;
109110
lastUpdatedAt: number | null;
110-
providerVisibility?: "public" | "private";
111+
providerVisibility?: ProviderVisibility;
111112
}
112113

113114
export type ContentNodeWithParentIds = ContentNode & {

types/src/front/lib/core_api.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
import { LightWorkspaceType } from "../../front/user";
2727
import { LoggerInterface } from "../../shared/logger";
2828
import { Err, Ok, Result } from "../../shared/result";
29+
import { ProviderVisibility } from "./connectors_api";
2930

3031
export const MAX_CHUNK_SIZE = 512;
3132

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

0 commit comments

Comments
 (0)