Review comments and linting.

This commit is contained in:
mike12345567 2022-03-01 22:37:42 +00:00
parent 2603024792
commit dadf3fef02
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.", "description": "The row to be created/updated, based on the table schema.",
"type": "object", "type": "object",
"additionalProperties": { "additionalProperties": {
"oneOf": [ "description": "Key value properties of any type, depending on the table schema."
{
"type": "string"
},
{
"type": "object"
},
{
"type": "integer"
},
{
"type": "array"
},
{
"type": "boolean"
}
]
} }
}, },
"searchOutput": { "searchOutput": {
@ -553,23 +537,7 @@
"description": "The row to be created/updated, based on the table schema.", "description": "The row to be created/updated, based on the table schema.",
"type": "object", "type": "object",
"additionalProperties": { "additionalProperties": {
"oneOf": [ "description": "Key value properties of any type, depending on the table schema."
{
"type": "string"
},
{
"type": "object"
},
{
"type": "integer"
},
{
"type": "array"
},
{
"type": "boolean"
}
]
}, },
"properties": { "properties": {
"_id": { "_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.", "description": "The query body must contain the required parameters for the query, this depends on query type, setup and bindings.",
"type": "object", "type": "object",
"additionalProperties": { "additionalProperties": {
"oneOf": [ "description": "Key value properties of any type, depending on the query output schema."
{
"type": "string"
},
{
"type": "object"
},
{
"type": "integer"
},
{
"type": "array"
},
{
"type": "boolean"
}
]
} }
}, },
"executeQueryOutput": { "executeQueryOutput": {

View File

@ -356,12 +356,7 @@ components:
description: The row to be created/updated, based on the table schema. description: The row to be created/updated, based on the table schema.
type: object type: object
additionalProperties: additionalProperties:
oneOf: description: Key value properties of any type, depending on the table schema.
- type: string
- type: object
- type: integer
- type: array
- type: boolean
searchOutput: searchOutput:
type: object type: object
required: required:
@ -389,12 +384,7 @@ components:
description: The row to be created/updated, based on the table schema. description: The row to be created/updated, based on the table schema.
type: object type: object
additionalProperties: additionalProperties:
oneOf: description: Key value properties of any type, depending on the table schema.
- type: string
- type: object
- type: integer
- type: array
- type: boolean
properties: properties:
_id: _id:
description: The ID of the row. description: The ID of the row.
@ -737,12 +727,7 @@ components:
this depends on query type, setup and bindings. this depends on query type, setup and bindings.
type: object type: object
additionalProperties: additionalProperties:
oneOf: description: Key value properties of any type, depending on the query output schema.
- type: string
- type: object
- type: integer
- type: array
- type: boolean
executeQueryOutput: executeQueryOutput:
type: object type: object
properties: 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.", "The query body must contain the required parameters for the query, this depends on query type, setup and bindings.",
type: "object", type: "object",
additionalProperties: { additionalProperties: {
oneOf: [ description:
{ type: "string" }, "Key value properties of any type, depending on the query output schema.",
{ type: "object" },
{ type: "integer" },
{ type: "array" },
{ type: "boolean" },
],
}, },
} }

View File

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

View File

@ -1,4 +1,4 @@
import { Application, ApplicationOutput } from "./types" import { Application } from "./types"
function application(body: any): Application { function application(body: any): Application {
let app = body?.application ? body.application : body 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 { return {
data: application(ctx.body), 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 { function query(body: any): Query {
return { 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 // very little we can map here, structure mostly unknown
return { return {
data: ctx.body.data, 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 { function row(body: any): Row {
delete body._rev delete body._rev
@ -19,7 +19,7 @@ function mapRowSearch(ctx: any): RowSearch {
} }
} }
function mapRow(ctx: any): RowOutput { function mapRow(ctx: any): { data: Row } {
return { return {
data: row(ctx.body), data: row(ctx.body),
} }

View File

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

View File

@ -1,17 +1,13 @@
import { components } from "../../../../definitions/openapi" import { components } from "../../../../definitions/openapi"
export type Query = components["schemas"]["query"] 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 Application = components["schemas"]["applicationOutput"]["data"]
export type ApplicationOutput = components["schemas"]["applicationOutput"]
export type Table = components["schemas"]["tableOutput"]["data"] export type Table = components["schemas"]["tableOutput"]["data"]
export type TableOutput = components["schemas"]["tableOutput"]
export type Row = components["schemas"]["rowOutput"]["data"] export type Row = components["schemas"]["rowOutput"]["data"]
export type RowOutput = components["schemas"]["rowOutput"]
export type RowSearch = components["schemas"]["searchOutput"] export type RowSearch = components["schemas"]["searchOutput"]
export type User = components["schemas"]["userOutput"]["data"] 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 { function user(body: any): User {
return { return {
@ -15,7 +15,7 @@ function user(body: any): User {
} }
} }
function mapUser(ctx: any): UserOutput { function mapUser(ctx: any): { data: User } {
return { return {
data: user(ctx.body), data: user(ctx.body),
} }

File diff suppressed because it is too large Load Diff