diff --git a/packages/frontend-core/src/fetch/CustomFetch.ts b/packages/frontend-core/src/fetch/CustomFetch.ts index dfd29c4a02..60ce1f50ec 100644 --- a/packages/frontend-core/src/fetch/CustomFetch.ts +++ b/packages/frontend-core/src/fetch/CustomFetch.ts @@ -1,4 +1,4 @@ -import DataFetch from "./DataFetch" +import BaseDataFetch from "./DataFetch" interface CustomDatasource { type: "custom" @@ -7,7 +7,7 @@ interface CustomDatasource { type CustomDefinition = Record -export default class CustomFetch extends DataFetch< +export default class CustomFetch extends BaseDataFetch< CustomDatasource, CustomDefinition > { diff --git a/packages/frontend-core/src/fetch/DataFetch.ts b/packages/frontend-core/src/fetch/DataFetch.ts index ad8a632480..75c454e2ac 100644 --- a/packages/frontend-core/src/fetch/DataFetch.ts +++ b/packages/frontend-core/src/fetch/DataFetch.ts @@ -71,7 +71,7 @@ export interface DataFetchOptions { * internal table or datasource plus. * For other types of datasource, this class is overridden and extended. */ -export default abstract class DataFetch< +export default abstract class BaseDataFetch< TDatasource extends { type: DataFetchType }, TDefinition extends { schema?: Record | null diff --git a/packages/frontend-core/src/fetch/FieldFetch.ts b/packages/frontend-core/src/fetch/FieldFetch.ts index 694443a5dc..5cc903d87e 100644 --- a/packages/frontend-core/src/fetch/FieldFetch.ts +++ b/packages/frontend-core/src/fetch/FieldFetch.ts @@ -1,5 +1,5 @@ import { Row } from "@budibase/types" -import DataFetch from "./DataFetch" +import BaseDataFetch from "./DataFetch" type Types = "field" | "queryarray" | "jsonarray" @@ -18,7 +18,7 @@ function isArrayOfStrings(value: string[] | Row[]): value is string[] { return Array.isArray(value) && !!value[0] && typeof value[0] !== "object" } -export default class FieldFetch extends DataFetch< +export default class FieldFetch extends BaseDataFetch< FieldDatasource, FieldDefinition > { diff --git a/packages/frontend-core/src/fetch/GroupUserFetch.ts b/packages/frontend-core/src/fetch/GroupUserFetch.ts index e07e5331d4..f3fdcf5ebb 100644 --- a/packages/frontend-core/src/fetch/GroupUserFetch.ts +++ b/packages/frontend-core/src/fetch/GroupUserFetch.ts @@ -1,5 +1,5 @@ import { get } from "svelte/store" -import DataFetch, { DataFetchParams } from "./DataFetch" +import BaseDataFetch, { DataFetchParams } from "./DataFetch" import { TableNames } from "../constants" interface GroupUserQuery { @@ -12,7 +12,7 @@ interface GroupUserDatasource { tableId: TableNames.USERS } -export default class GroupUserFetch extends DataFetch< +export default class GroupUserFetch extends BaseDataFetch< GroupUserDatasource, {}, GroupUserQuery diff --git a/packages/frontend-core/src/fetch/NestedProviderFetch.ts b/packages/frontend-core/src/fetch/NestedProviderFetch.ts index af121fcef8..b4274e690f 100644 --- a/packages/frontend-core/src/fetch/NestedProviderFetch.ts +++ b/packages/frontend-core/src/fetch/NestedProviderFetch.ts @@ -1,5 +1,5 @@ import { Row, TableSchema } from "@budibase/types" -import DataFetch from "./DataFetch" +import BaseDataFetch from "./DataFetch" interface NestedProviderDatasource { type: "provider" @@ -14,7 +14,7 @@ interface NestedProviderDefinition { schema?: TableSchema primaryDisplay?: string } -export default class NestedProviderFetch extends DataFetch< +export default class NestedProviderFetch extends BaseDataFetch< NestedProviderDatasource, NestedProviderDefinition > { diff --git a/packages/frontend-core/src/fetch/QueryFetch.ts b/packages/frontend-core/src/fetch/QueryFetch.ts index 09dde86cbd..179deb1a66 100644 --- a/packages/frontend-core/src/fetch/QueryFetch.ts +++ b/packages/frontend-core/src/fetch/QueryFetch.ts @@ -1,4 +1,4 @@ -import DataFetch from "./DataFetch" +import BaseDataFetch from "./DataFetch" import { Helpers } from "@budibase/bbui" import { ExecuteQueryRequest, Query } from "@budibase/types" import { get } from "svelte/store" @@ -17,7 +17,7 @@ interface QueryDatasource { parameters: { name: string; default: string }[] } -export default class QueryFetch extends DataFetch { +export default class QueryFetch extends BaseDataFetch { async determineFeatureFlags() { const definition = await this.getDefinition() const supportsPagination = diff --git a/packages/frontend-core/src/fetch/RelationshipFetch.ts b/packages/frontend-core/src/fetch/RelationshipFetch.ts index 89a85ab0e4..c84c38e77c 100644 --- a/packages/frontend-core/src/fetch/RelationshipFetch.ts +++ b/packages/frontend-core/src/fetch/RelationshipFetch.ts @@ -1,5 +1,5 @@ import { Table } from "@budibase/types" -import DataFetch from "./DataFetch" +import BaseDataFetch from "./DataFetch" interface RelationshipDatasource { type: "link" @@ -9,7 +9,7 @@ interface RelationshipDatasource { fieldName: string } -export default class RelationshipFetch extends DataFetch< +export default class RelationshipFetch extends BaseDataFetch< RelationshipDatasource, Table > { diff --git a/packages/frontend-core/src/fetch/TableFetch.ts b/packages/frontend-core/src/fetch/TableFetch.ts index 67cac6b6a7..c39c9341fc 100644 --- a/packages/frontend-core/src/fetch/TableFetch.ts +++ b/packages/frontend-core/src/fetch/TableFetch.ts @@ -1,5 +1,5 @@ import { get } from "svelte/store" -import DataFetch from "./DataFetch" +import BaseDataFetch from "./DataFetch" import { SortOrder, Table } from "@budibase/types" interface TableDatasource { @@ -7,7 +7,7 @@ interface TableDatasource { tableId: string } -export default class TableFetch extends DataFetch { +export default class TableFetch extends BaseDataFetch { async determineFeatureFlags() { return { supportsSearch: true, diff --git a/packages/frontend-core/src/fetch/UserFetch.ts b/packages/frontend-core/src/fetch/UserFetch.ts index 36aebac506..2632337d64 100644 --- a/packages/frontend-core/src/fetch/UserFetch.ts +++ b/packages/frontend-core/src/fetch/UserFetch.ts @@ -1,5 +1,5 @@ import { get } from "svelte/store" -import DataFetch, { DataFetchParams } from "./DataFetch" +import BaseDataFetch, { DataFetchParams } from "./DataFetch" import { TableNames } from "../constants" import { utils } from "@budibase/shared-core" import { SearchFilters, SearchUsersRequest } from "@budibase/types" @@ -16,7 +16,7 @@ interface UserDatasource { interface UserDefinition {} -export default class UserFetch extends DataFetch< +export default class UserFetch extends BaseDataFetch< UserDatasource, UserDefinition, UserFetchQuery diff --git a/packages/frontend-core/src/fetch/ViewFetch.ts b/packages/frontend-core/src/fetch/ViewFetch.ts index df00b9bbfc..219f17ee2c 100644 --- a/packages/frontend-core/src/fetch/ViewFetch.ts +++ b/packages/frontend-core/src/fetch/ViewFetch.ts @@ -1,5 +1,5 @@ import { Table } from "@budibase/types" -import DataFetch from "./DataFetch" +import BaseDataFetch from "./DataFetch" type ViewV1Datasource = { type: "view" @@ -10,7 +10,7 @@ type ViewV1Datasource = { groupBy: string } -export default class ViewFetch extends DataFetch { +export default class ViewFetch extends BaseDataFetch { async getDefinition() { const { datasource } = this.options diff --git a/packages/frontend-core/src/fetch/ViewV2Fetch.ts b/packages/frontend-core/src/fetch/ViewV2Fetch.ts index aa5fbd60a2..029047c5fb 100644 --- a/packages/frontend-core/src/fetch/ViewV2Fetch.ts +++ b/packages/frontend-core/src/fetch/ViewV2Fetch.ts @@ -1,5 +1,5 @@ import { SortOrder, ViewV2Enriched, ViewV2Type } from "@budibase/types" -import DataFetch from "./DataFetch" +import BaseDataFetch from "./DataFetch" import { get } from "svelte/store" import { helpers } from "@budibase/shared-core" @@ -8,7 +8,7 @@ interface ViewDatasource { id: string } -export default class ViewV2Fetch extends DataFetch< +export default class ViewV2Fetch extends BaseDataFetch< ViewDatasource, ViewV2Enriched > {