-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8461f8
commit 124ec9c
Showing
35 changed files
with
1,215 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Keq } from 'keq' | ||
import { request } from 'keq' | ||
import type { RequestParameters, ResponseMap, Operation } from "./types/create_plugin" | ||
|
||
|
||
|
||
export function createPlugin<STATUS extends keyof ResponseMap>(arg?: RequestParameters): Keq<ResponseMap[STATUS], Operation<STATUS>> { | ||
const req = request.post<ResponseMap[STATUS]>("/api/plugin") | ||
.option('module', { | ||
name: "backend", | ||
pathname: "/api/plugin", | ||
}) | ||
|
||
if (arg && "url" in arg) req.send({ "url": arg["url"] }) | ||
|
||
return req as unknown as Keq<ResponseMap[STATUS], Operation<STATUS>> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Keq } from 'keq' | ||
import { request } from 'keq' | ||
import type { RequestParameters, ResponseMap, Operation } from "./types/delete_plugin" | ||
|
||
|
||
|
||
export function deletePlugin<STATUS extends keyof ResponseMap>(arg?: RequestParameters): Keq<ResponseMap[STATUS], Operation<STATUS>> { | ||
const req = request.delete<ResponseMap[STATUS]>("/api/plugin/:pluginId") | ||
.option('module', { | ||
name: "backend", | ||
pathname: "/api/plugin/:pluginId", | ||
}) | ||
|
||
if (arg && "pluginId" in arg) req.params("pluginId", String(arg["pluginId"])) | ||
|
||
return req as unknown as Keq<ResponseMap[STATUS], Operation<STATUS>> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Keq } from 'keq' | ||
import { request } from 'keq' | ||
import type { RequestParameters, ResponseMap, Operation } from "./types/query_plugin" | ||
|
||
|
||
|
||
export function queryPlugin<STATUS extends keyof ResponseMap>(arg?: RequestParameters): Keq<ResponseMap[STATUS], Operation<STATUS>> { | ||
const req = request.get<ResponseMap[STATUS]>("/api/plugin/:pluginId") | ||
.option('module', { | ||
name: "backend", | ||
pathname: "/api/plugin/:pluginId", | ||
}) | ||
|
||
if (arg && "pluginId" in arg) req.params("pluginId", String(arg["pluginId"])) | ||
|
||
return req as unknown as Keq<ResponseMap[STATUS], Operation<STATUS>> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Keq } from 'keq' | ||
import { request } from 'keq' | ||
import type { RequestParameters, ResponseMap, Operation } from "./types/query_plugins" | ||
|
||
|
||
|
||
export function queryPlugins<STATUS extends keyof ResponseMap>(arg?: RequestParameters): Keq<ResponseMap[STATUS], Operation<STATUS>> { | ||
const req = request.get<ResponseMap[STATUS]>("/api/plugin") | ||
.option('module', { | ||
name: "backend", | ||
pathname: "/api/plugin", | ||
}) | ||
|
||
const queryWrap = (value: any) => typeof value === 'boolean' ? String(value) : value | ||
|
||
if (arg && "limit" in arg) req.query("limit", queryWrap(arg["limit"])) | ||
if (arg && "offset" in arg) req.query("offset", queryWrap(arg["offset"])) | ||
|
||
return req as unknown as Keq<ResponseMap[STATUS], Operation<STATUS>> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import type { KeqOperation } from 'keq' | ||
import type { Plugin } from "../components/schemas/plugin" | ||
import type { CreatePluginDTO } from "../components/schemas/create_plugin_dto" | ||
|
||
|
||
export interface ResponseMap { | ||
"201": Plugin | ||
} | ||
|
||
|
||
export type QueryParameters = { | ||
} | ||
|
||
export type RouteParameters = { | ||
} | ||
|
||
export type HeaderParameters = { | ||
} | ||
|
||
export type BodyParameters =(CreatePluginDTO) | ||
|
||
export type RequestParameters = QueryParameters & RouteParameters & HeaderParameters & BodyParameters | ||
|
||
|
||
export interface Operation<STATUS extends keyof ResponseMap> extends KeqOperation { | ||
requestParams: RouteParameters | ||
requestQuery: QueryParameters | ||
requestHeaders: HeaderParameters | ||
requestBody: BodyParameters | ||
responseBody: ResponseMap[STATUS] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import type { KeqOperation } from 'keq' | ||
import type { Plugin } from "../components/schemas/plugin" | ||
|
||
|
||
export interface ResponseMap { | ||
"200": Plugin | ||
} | ||
|
||
|
||
export type QueryParameters = { | ||
} | ||
|
||
export type RouteParameters = { | ||
"pluginId": string | ||
} | ||
|
||
export type HeaderParameters = { | ||
} | ||
|
||
export type BodyParameters ={} | ||
export type RequestParameters = QueryParameters & RouteParameters & HeaderParameters & BodyParameters | ||
|
||
|
||
export interface Operation<STATUS extends keyof ResponseMap> extends KeqOperation { | ||
requestParams: RouteParameters | ||
requestQuery: QueryParameters | ||
requestHeaders: HeaderParameters | ||
requestBody: BodyParameters | ||
responseBody: ResponseMap[STATUS] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import type { KeqOperation } from 'keq' | ||
import type { Plugin } from "../components/schemas/plugin" | ||
|
||
|
||
export interface ResponseMap { | ||
"200": Plugin | ||
} | ||
|
||
|
||
export type QueryParameters = { | ||
} | ||
|
||
export type RouteParameters = { | ||
"pluginId": string | ||
} | ||
|
||
export type HeaderParameters = { | ||
} | ||
|
||
export type BodyParameters ={} | ||
export type RequestParameters = QueryParameters & RouteParameters & HeaderParameters & BodyParameters | ||
|
||
|
||
export interface Operation<STATUS extends keyof ResponseMap> extends KeqOperation { | ||
requestParams: RouteParameters | ||
requestQuery: QueryParameters | ||
requestHeaders: HeaderParameters | ||
requestBody: BodyParameters | ||
responseBody: ResponseMap[STATUS] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import type { KeqOperation } from 'keq' | ||
import type { ResponseOfQueryPluginsDTO } from "../components/schemas/response_of_query_plugins_dto" | ||
|
||
|
||
export interface ResponseMap { | ||
"200": ResponseOfQueryPluginsDTO | ||
} | ||
|
||
|
||
export type QueryParameters = { | ||
"limit"?: number | ||
"offset"?: number | ||
} | ||
|
||
export type RouteParameters = { | ||
} | ||
|
||
export type HeaderParameters = { | ||
} | ||
|
||
export type BodyParameters ={} | ||
export type RequestParameters = QueryParameters & RouteParameters & HeaderParameters & BodyParameters | ||
|
||
|
||
export interface Operation<STATUS extends keyof ResponseMap> extends KeqOperation { | ||
requestParams: RouteParameters | ||
requestQuery: QueryParameters | ||
requestHeaders: HeaderParameters | ||
requestBody: BodyParameters | ||
responseBody: ResponseMap[STATUS] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import type { KeqOperation } from 'keq' | ||
import type { Plugin } from "../components/schemas/plugin" | ||
import type { UpdatePluginDTO } from "../components/schemas/update_plugin_dto" | ||
|
||
|
||
export interface ResponseMap { | ||
"200": Plugin | ||
} | ||
|
||
|
||
export type QueryParameters = { | ||
} | ||
|
||
export type RouteParameters = { | ||
"pluginId": string | ||
} | ||
|
||
export type HeaderParameters = { | ||
} | ||
|
||
export type BodyParameters =(UpdatePluginDTO) | ||
|
||
export type RequestParameters = QueryParameters & RouteParameters & HeaderParameters & BodyParameters | ||
|
||
|
||
export interface Operation<STATUS extends keyof ResponseMap> extends KeqOperation { | ||
requestParams: RouteParameters | ||
requestQuery: QueryParameters | ||
requestHeaders: HeaderParameters | ||
requestBody: BodyParameters | ||
responseBody: ResponseMap[STATUS] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Keq } from 'keq' | ||
import { request } from 'keq' | ||
import type { RequestParameters, ResponseMap, Operation } from "./types/update_plugin" | ||
|
||
|
||
|
||
export function updatePlugin<STATUS extends keyof ResponseMap>(arg?: RequestParameters): Keq<ResponseMap[STATUS], Operation<STATUS>> { | ||
const req = request.put<ResponseMap[STATUS]>("/api/plugin/:pluginId") | ||
.option('module', { | ||
name: "backend", | ||
pathname: "/api/plugin/:pluginId", | ||
}) | ||
|
||
if (arg && "pluginId" in arg) req.params("pluginId", String(arg["pluginId"])) | ||
if (arg && "status" in arg) req.send({ "status": arg["status"] }) | ||
if (arg && "options" in arg) req.send({ "options": arg["options"] }) | ||
|
||
return req as unknown as Keq<ResponseMap[STATUS], Operation<STATUS>> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.