Rename DataFetch to BaseDataFetch
This commit is contained in:
parent
30c942c852
commit
c1981aaa29
|
@ -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
|
||||
> {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
> {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
> {
|
||||
|
|
|
@ -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 =
|
||||
|
|
|
@ -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
|
||||
> {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
> {
|
||||
|
|
Loading…
Reference in New Issue