From d55e29f9a6a4f5a8216551a2d52249e159331441 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 15 Jan 2025 10:42:37 +0100 Subject: [PATCH] Move type --- packages/client/src/components/app/DataProvider.svelte | 9 ++++++++- packages/frontend-core/src/fetch/index.ts | 7 ++----- packages/frontend-core/src/index.ts | 4 +++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/packages/client/src/components/app/DataProvider.svelte b/packages/client/src/components/app/DataProvider.svelte index 7b0dcb123b..99831ec65d 100644 --- a/packages/client/src/components/app/DataProvider.svelte +++ b/packages/client/src/components/app/DataProvider.svelte @@ -5,7 +5,9 @@ fetchData, QueryUtils, DataFetchOptions, - ProviderDatasource, + DataFetchDatasource, + UserDatasource, + GroupUserDatasource, } from "@budibase/frontend-core" import { LogicalOperator, @@ -16,6 +18,11 @@ } from "@budibase/types" import { SDK, Component } from "../../index" + type ProviderDatasource = Exclude< + DataFetchDatasource, + UserDatasource | GroupUserDatasource + > + export let dataSource: ProviderDatasource export let filter export let sortColumn diff --git a/packages/frontend-core/src/fetch/index.ts b/packages/frontend-core/src/fetch/index.ts index 32c5aa5b21..93ad79ec32 100644 --- a/packages/frontend-core/src/fetch/index.ts +++ b/packages/frontend-core/src/fetch/index.ts @@ -17,6 +17,8 @@ import { Table, ViewV2Enriched } from "@budibase/types" export type DataFetchType = keyof typeof DataFetchMap export type { DataFetchOptions } from "./DataFetch" +export type { UserDatasource } from "./UserFetch" +export type { GroupUserDatasource } from "./GroupUserFetch" export const DataFetchMap = { table: TableFetch, @@ -78,11 +80,6 @@ export type DataFetchDatasource = | NestedProviderDatasource | FieldDatasource<"field" | "queryarray" | "jsonarray"> -export type ProviderDatasource = Exclude< - DataFetchDatasource, - UserDatasource | GroupUserDatasource -> - export type DataFetchDefinition = | Table | ViewV2Enriched diff --git a/packages/frontend-core/src/index.ts b/packages/frontend-core/src/index.ts index 32eb532503..ba80bb3af6 100644 --- a/packages/frontend-core/src/index.ts +++ b/packages/frontend-core/src/index.ts @@ -4,7 +4,9 @@ export { fetchData, DataFetchMap } from "./fetch" export type { DataFetchType, DataFetchOptions, - ProviderDatasource, + DataFetchDatasource, + UserDatasource, + GroupUserDatasource, } from "./fetch" export * as Constants from "./constants" export * from "./stores"