Rename DataFetch to BaseDataFetch

This commit is contained in:
Adria Navarro 2025-01-14 10:48:50 +01:00
parent 30c942c852
commit c1981aaa29
11 changed files with 21 additions and 21 deletions

View File

@ -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<string, any>
export default class CustomFetch extends DataFetch<
export default class CustomFetch extends BaseDataFetch<
CustomDatasource,
CustomDefinition
> {

View File

@ -71,7 +71,7 @@ export interface DataFetchOptions<TQuery = SearchFilters | undefined> {
* 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<string, any> | null

View File

@ -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<TType extends Types> extends DataFetch<
export default class FieldFetch<TType extends Types> extends BaseDataFetch<
FieldDatasource<TType>,
FieldDefinition
> {

View File

@ -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

View File

@ -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
> {

View File

@ -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<QueryDatasource, Query> {
export default class QueryFetch extends BaseDataFetch<QueryDatasource, Query> {
async determineFeatureFlags() {
const definition = await this.getDefinition()
const supportsPagination =

View File

@ -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
> {

View File

@ -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<TableDatasource, Table> {
export default class TableFetch extends BaseDataFetch<TableDatasource, Table> {
async determineFeatureFlags() {
return {
supportsSearch: true,

View File

@ -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

View File

@ -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<ViewV1Datasource, Table> {
export default class ViewFetch extends BaseDataFetch<ViewV1Datasource, Table> {
async getDefinition() {
const { datasource } = this.options

View File

@ -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
> {