1
0
Fork 0
mirror of synced 2024-06-29 11:31:06 +12:00

Moving Typescript definitions around a bit.

This commit is contained in:
mike12345567 2021-12-13 13:50:15 +00:00
parent 9412b38c9b
commit b19fcb5d50
5 changed files with 56 additions and 60 deletions

View file

@ -1,5 +1,4 @@
import { Query, QueryParameter } from "../../../../../../definitions/common"
import { Query, QueryParameter } from "../../../../../../definitions/datasource"
export interface ImportInfo {
url: string

View file

@ -1,5 +1,5 @@
import { ImportInfo } from "./base"
import { Query, QueryParameter } from "../../../../../definitions/common"
import { Query, QueryParameter } from "../../../../../definitions/datasource"
import { OpenAPIV2 } from "openapi-types"
import { OpenAPISource } from "./base/openapi"

View file

@ -1,6 +1,6 @@
import { SourceNames } from "./datasource"
export { Query, Datasource } from "./datasource"
interface Base {
export interface Base {
_id?: string
_rev?: string
}
@ -93,39 +93,3 @@ export interface Automation extends Base {
trigger?: AutomationStep
}
}
export interface Datasource extends Base {
type: string
name: string
source: SourceNames
// the config is defined by the schema
config: {
[key: string]: string | number | boolean
}
plus: boolean
entities?: {
[key: string]: Table
}
}
export interface QueryParameter {
name: string
default: string
}
export interface Query {
_id?: string
datasourceId: string
name: string
parameters: QueryParameter[]
fields: {
headers: object
queryString: string | null
path: string
requestBody: string | undefined
}
transformer: string | null
schema: any
readable: boolean
queryVerb: string
}

View file

@ -1,4 +1,4 @@
import { Row, Table } from "./common"
import { Row, Table, Base } from "./common"
export enum Operation {
CREATE = "CREATE",
@ -181,3 +181,52 @@ export interface SqlQuery {
export interface QueryOptions {
disableReturning?: boolean
}
export interface Datasource extends Base {
type: string
name: string
source: SourceNames
// the config is defined by the schema
config: {
[key: string]: string | number | boolean
}
plus: boolean
entities?: {
[key: string]: Table
}
}
export interface QueryParameter {
name: string
default: string
}
export interface RestQueryFields {
path: string
queryString?: string
headers: { [key: string]: any }
disabledHeaders: { [key: string]: any }
requestBody: any
bodyType: string
json: object
method: string
}
export interface RestConfig {
url: string
defaultHeaders: {
[key: string]: any
}
}
export interface Query {
_id?: string
datasourceId: string
name: string
parameters: QueryParameter[]
fields: RestQueryFields | any
transformer: string | null
schema: any
readable: boolean
queryVerb: string
}

View file

@ -2,6 +2,8 @@ import {
Integration,
DatasourceFieldTypes,
QueryTypes,
RestConfig,
RestQueryFields as RestQuery,
} from "../definitions/datasource"
import { IntegrationBase } from "./base/IntegrationBase"
@ -41,24 +43,6 @@ module RestModule {
const { formatBytes } = require("../utilities")
const { performance } = require("perf_hooks")
interface RestQuery {
path: string
queryString?: string
headers: { [key: string]: any }
disabledHeaders: { [key: string]: any }
requestBody: any
bodyType: string
json: object
method: string
}
interface RestConfig {
url: string
defaultHeaders: {
[key: string]: any
}
}
const SCHEMA: Integration = {
docs: "https://github.com/node-fetch/node-fetch",
description: