Unify enums
This commit is contained in:
parent
daff1a46d8
commit
0202db3efe
|
@ -9,7 +9,10 @@ import { Constants } from "@budibase/frontend-core"
|
|||
|
||||
const { TypeIconMap } = Constants
|
||||
|
||||
export { RelationshipType } from "@budibase/types"
|
||||
export {
|
||||
RelationshipType,
|
||||
RowExportFormat as ROW_EXPORT_FORMATS,
|
||||
} from "@budibase/types"
|
||||
|
||||
export const AUTO_COLUMN_SUB_TYPES = AutoFieldSubType
|
||||
|
||||
|
@ -307,9 +310,3 @@ export const DatasourceTypes = {
|
|||
GRAPH: "Graph",
|
||||
API: "API",
|
||||
}
|
||||
|
||||
export const ROW_EXPORT_FORMATS = {
|
||||
CSV: "csv",
|
||||
JSON: "json",
|
||||
JSON_WITH_SCHEMA: "jsonWithSchema",
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import { Row, TableSchema } from "@budibase/types"
|
||||
import { Row, RowExportFormat, TableSchema } from "@budibase/types"
|
||||
|
||||
export { RowExportFormat as Format } from "@budibase/types"
|
||||
|
||||
function getHeaders(
|
||||
headers: string[],
|
||||
|
@ -46,14 +48,8 @@ export function jsonWithSchema(schema: TableSchema, rows: Row[]) {
|
|||
return JSON.stringify({ schema: newSchema, rows }, undefined, 2)
|
||||
}
|
||||
|
||||
export enum Format {
|
||||
CSV = "csv",
|
||||
JSON = "json",
|
||||
JSON_WITH_SCHEMA = "jsonWithSchema",
|
||||
}
|
||||
|
||||
export function isFormat(format: any): format is Format {
|
||||
return Object.values(Format).includes(format as Format)
|
||||
export function isFormat(format: any): format is RowExportFormat {
|
||||
return Object.values(RowExportFormat).includes(format as RowExportFormat)
|
||||
}
|
||||
|
||||
export function parseCsvExport<T>(value: string) {
|
||||
|
|
|
@ -30,3 +30,9 @@ export interface SearchResponse<T> {
|
|||
bookmark?: string | number
|
||||
totalRows?: number
|
||||
}
|
||||
|
||||
export enum RowExportFormat {
|
||||
CSV = "csv",
|
||||
JSON = "json",
|
||||
JSON_WITH_SCHEMA = "jsonWithSchema",
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue