Type query fields
This commit is contained in:
parent
7d8476b7b0
commit
561add01c2
|
@ -764,7 +764,7 @@ if (descriptions.length) {
|
|||
const verbs = ["read", "create", "update", "delete"]
|
||||
for (const verb of verbs) {
|
||||
const query = await createQuery({
|
||||
fields: { json: {}, extra: { actionType: "invalid" } },
|
||||
fields: { json: {}, extra: { actionType: "invalid" as any } },
|
||||
queryVerb: verb,
|
||||
})
|
||||
await config.api.query.execute(query._id!, undefined, { status: 400 })
|
||||
|
|
|
@ -12,7 +12,7 @@ export interface Query extends Document {
|
|||
datasourceId: string
|
||||
name: string
|
||||
parameters: QueryParameter[]
|
||||
fields: RestQueryFields
|
||||
fields: RestQueryFields & SQLQueryFields & MongoQueryFields
|
||||
transformer: string | null
|
||||
schema: Record<string, QuerySchema | string>
|
||||
nestedSchemaFields?: Record<string, Record<string, QuerySchema | string>>
|
||||
|
@ -60,9 +60,29 @@ export interface RestQueryFields {
|
|||
authConfigType?: RestAuthType
|
||||
pagination?: PaginationConfig
|
||||
paginationValues?: PaginationValues
|
||||
}
|
||||
export interface SQLQueryFields {
|
||||
sql?: string
|
||||
}
|
||||
|
||||
export interface MongoQueryFields {
|
||||
extra?: {
|
||||
collection?: string
|
||||
actionType:
|
||||
| "findOne"
|
||||
| "find"
|
||||
| "updateOne"
|
||||
| "updateMany"
|
||||
| "findOneAndUpdate"
|
||||
| "count"
|
||||
| "distinct"
|
||||
| "insertOne"
|
||||
| "deleteOne"
|
||||
| "deleteMany"
|
||||
}
|
||||
json?: object | string
|
||||
}
|
||||
|
||||
export interface PaginationConfig {
|
||||
type: string
|
||||
location: string
|
||||
|
|
Loading…
Reference in New Issue