Review comments and linting.

This commit is contained in:
mike12345567 2022-03-01 22:37:42 +00:00
parent 60acca5d95
commit a78b70799e
11 changed files with 430 additions and 528 deletions

View File

@ -497,23 +497,7 @@
"description": "The row to be created/updated, based on the table schema.",
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "string"
},
{
"type": "object"
},
{
"type": "integer"
},
{
"type": "array"
},
{
"type": "boolean"
}
]
"description": "Key value properties of any type, depending on the table schema."
}
},
"searchOutput": {
@ -553,23 +537,7 @@
"description": "The row to be created/updated, based on the table schema.",
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "string"
},
{
"type": "object"
},
{
"type": "integer"
},
{
"type": "array"
},
{
"type": "boolean"
}
]
"description": "Key value properties of any type, depending on the table schema."
},
"properties": {
"_id": {
@ -1006,23 +974,7 @@
"description": "The query body must contain the required parameters for the query, this depends on query type, setup and bindings.",
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "string"
},
{
"type": "object"
},
{
"type": "integer"
},
{
"type": "array"
},
{
"type": "boolean"
}
]
"description": "Key value properties of any type, depending on the query output schema."
}
},
"executeQueryOutput": {

View File

@ -356,12 +356,7 @@ components:
description: The row to be created/updated, based on the table schema.
type: object
additionalProperties:
oneOf:
- type: string
- type: object
- type: integer
- type: array
- type: boolean
description: Key value properties of any type, depending on the table schema.
searchOutput:
type: object
required:
@ -389,12 +384,7 @@ components:
description: The row to be created/updated, based on the table schema.
type: object
additionalProperties:
oneOf:
- type: string
- type: object
- type: integer
- type: array
- type: boolean
description: Key value properties of any type, depending on the table schema.
properties:
_id:
description: The ID of the row.
@ -737,12 +727,7 @@ components:
this depends on query type, setup and bindings.
type: object
additionalProperties:
oneOf:
- type: string
- type: object
- type: integer
- type: array
- type: boolean
description: Key value properties of any type, depending on the query output schema.
executeQueryOutput:
type: object
properties:

View File

@ -128,13 +128,8 @@ const executeQuerySchema = {
"The query body must contain the required parameters for the query, this depends on query type, setup and bindings.",
type: "object",
additionalProperties: {
oneOf: [
{ type: "string" },
{ type: "object" },
{ type: "integer" },
{ type: "array" },
{ type: "boolean" },
],
description:
"Key value properties of any type, depending on the query output schema.",
},
}

View File

@ -48,13 +48,8 @@ const rowSchema = {
description: "The row to be created/updated, based on the table schema.",
type: "object",
additionalProperties: {
oneOf: [
{ type: "string" },
{ type: "object" },
{ type: "integer" },
{ type: "array" },
{ type: "boolean" },
],
description:
"Key value properties of any type, depending on the table schema.",
},
}

View File

@ -1,4 +1,4 @@
import { Application, ApplicationOutput } from "./types"
import { Application } from "./types"
function application(body: any): Application {
let app = body?.application ? body.application : body
@ -15,7 +15,7 @@ function application(body: any): Application {
}
}
function mapApplication(ctx: any): ApplicationOutput {
function mapApplication(ctx: any): { data: Application } {
return {
data: application(ctx.body),
}

View File

@ -1,4 +1,4 @@
import { Query, ExecuteQueryOutput } from "./types"
import { Query, ExecuteQuery } from "./types"
function query(body: any): Query {
return {
@ -21,7 +21,7 @@ function mapQueries(ctx: any): { data: Query[] } {
}
}
function mapQueryExecution(ctx: any): ExecuteQueryOutput {
function mapQueryExecution(ctx: any): ExecuteQuery {
// very little we can map here, structure mostly unknown
return {
data: ctx.body.data,

View File

@ -1,4 +1,4 @@
import { Row, RowSearch, RowOutput } from "./types"
import { Row, RowSearch } from "./types"
function row(body: any): Row {
delete body._rev
@ -19,7 +19,7 @@ function mapRowSearch(ctx: any): RowSearch {
}
}
function mapRow(ctx: any): RowOutput {
function mapRow(ctx: any): { data: Row } {
return {
data: row(ctx.body),
}

View File

@ -1,4 +1,4 @@
import { Table, TableOutput } from "./types"
import { Table } from "./types"
function table(body: any): Table {
return {
@ -9,7 +9,7 @@ function table(body: any): Table {
}
}
function mapTable(ctx: any): TableOutput {
function mapTable(ctx: any): { data: Table } {
return {
data: table(ctx.body),
}

View File

@ -1,17 +1,13 @@
import { components } from "../../../../definitions/openapi"
export type Query = components["schemas"]["query"]
export type ExecuteQueryOutput = components["schemas"]["executeQueryOutput"]
export type ExecuteQuery = components["schemas"]["executeQueryOutput"]
export type Application = components["schemas"]["applicationOutput"]["data"]
export type ApplicationOutput = components["schemas"]["applicationOutput"]
export type Table = components["schemas"]["tableOutput"]["data"]
export type TableOutput = components["schemas"]["tableOutput"]
export type Row = components["schemas"]["rowOutput"]["data"]
export type RowOutput = components["schemas"]["rowOutput"]
export type RowSearch = components["schemas"]["searchOutput"]
export type User = components["schemas"]["userOutput"]["data"]
export type UserOutput = components["schemas"]["userOutput"]

View File

@ -1,4 +1,4 @@
import { User, UserOutput } from "./types"
import { User } from "./types"
function user(body: any): User {
return {
@ -15,7 +15,7 @@ function user(body: any): User {
}
}
function mapUser(ctx: any): UserOutput {
function mapUser(ctx: any): { data: User } {
return {
data: user(ctx.body),
}

File diff suppressed because it is too large Load Diff