Skip to content

Commit c46f810

Browse files
committed
pass the provider_visibility when upserting folders
1 parent ce51288 commit c46f810

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

connectors/src/lib/data_sources.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,7 @@ export async function _upsertDataSourceFolder({
12401240
parentId,
12411241
title,
12421242
mimeType,
1243+
providerVisibility,
12431244
}: {
12441245
dataSourceConfig: DataSourceConfig;
12451246
folderId: string;
@@ -1248,6 +1249,7 @@ export async function _upsertDataSourceFolder({
12481249
parentId: string | null;
12491250
title: string;
12501251
mimeType: string;
1252+
providerVisibility?: string;
12511253
}) {
12521254
const now = new Date();
12531255

@@ -1259,6 +1261,7 @@ export async function _upsertDataSourceFolder({
12591261
parentId,
12601262
parents,
12611263
mimeType,
1264+
providerVisibility: providerVisibility || null,
12621265
});
12631266

12641267
if (r.isErr()) {

front/pages/api/v1/w/[wId]/spaces/[spaceId]/data_sources/[dsId]/folders/[fId].ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ async function handler(
120120
parents,
121121
title,
122122
mime_type,
123+
provider_visibility,
123124
} = r.data;
124125
if (parentId && parents && parents[1] !== parentId) {
125126
return apiError(req, res, {
@@ -153,6 +154,7 @@ async function handler(
153154
parents: parents || [fId],
154155
title: title,
155156
mimeType: mime_type,
157+
providerVisibility: provider_visibility,
156158
});
157159

158160
if (upsertRes.isErr()) {

sdks/js/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,7 @@ export class DustAPI {
829829
parentId,
830830
parents,
831831
mimeType,
832+
providerVisibility,
832833
}: {
833834
dataSourceId: string;
834835
folderId: string;
@@ -837,6 +838,7 @@ export class DustAPI {
837838
parentId: string | null;
838839
parents: string[];
839840
mimeType: string;
841+
providerVisibility: string | null;
840842
}) {
841843
const res = await this.request({
842844
method: "POST",
@@ -849,6 +851,7 @@ export class DustAPI {
849851
parent_id: parentId,
850852
parents,
851853
mime_type: mimeType,
854+
provider_visibility: providerVisibility,
852855
},
853856
});
854857

sdks/js/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,6 +2120,7 @@ export const UpsertDataSourceFolderRequestSchema = z.object({
21202120
parent_id: z.string().nullable().optional(),
21212121
title: z.string(),
21222122
mime_type: z.string(),
2123+
provider_visibility: z.string().nullable().optional(),
21232124
});
21242125
export type UpsertDataSourceFolderRequestType = z.infer<
21252126
typeof UpsertDataSourceFolderRequestSchema

types/src/front/lib/core_api.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,6 +1543,7 @@ export class CoreAPI {
15431543
parents,
15441544
title,
15451545
mimeType,
1546+
providerVisibility,
15461547
}: {
15471548
projectId: string;
15481549
dataSourceId: string;
@@ -1552,6 +1553,7 @@ export class CoreAPI {
15521553
parents: string[];
15531554
title: string;
15541555
mimeType: string;
1556+
providerVisibility: string | null | undefined;
15551557
}): Promise<CoreAPIResponse<{ folder: CoreAPIFolder }>> {
15561558
const response = await this._fetchWithError(
15571559
`${this._url}/projects/${projectId}/data_sources/${encodeURIComponent(
@@ -1569,6 +1571,7 @@ export class CoreAPI {
15691571
parent_id: parentId,
15701572
parents,
15711573
mime_type: mimeType,
1574+
provider_visibility: providerVisibility,
15721575
}),
15731576
}
15741577
);

0 commit comments

Comments
 (0)