Cleanup.
This commit is contained in:
parent
98de7e69d1
commit
d42c4118fe
|
@ -4,8 +4,8 @@ import {
|
||||||
UserCtx,
|
UserCtx,
|
||||||
ApiKeyDoc,
|
ApiKeyDoc,
|
||||||
ApiKeyFetchResponse,
|
ApiKeyFetchResponse,
|
||||||
ApiKeyUpdateRequest,
|
UpdateApiKeyRequest,
|
||||||
ApiKeyUpdateResponse,
|
UpdateApiKeyResponse,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
const KEYS_DOC = dbCore.StaticDatabases.GLOBAL.docs.apiKeys
|
const KEYS_DOC = dbCore.StaticDatabases.GLOBAL.docs.apiKeys
|
||||||
|
@ -40,7 +40,7 @@ export async function fetch(ctx: UserCtx<void, ApiKeyFetchResponse>) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function update(
|
export async function update(
|
||||||
ctx: UserCtx<ApiKeyUpdateRequest, ApiKeyUpdateResponse>
|
ctx: UserCtx<UpdateApiKeyRequest, UpdateApiKeyResponse>
|
||||||
) {
|
) {
|
||||||
const key = ctx.params.key
|
const key = ctx.params.key
|
||||||
const value = ctx.request.body.value
|
const value = ctx.request.body.value
|
||||||
|
|
|
@ -64,7 +64,7 @@ import {
|
||||||
FetchAppsResponse,
|
FetchAppsResponse,
|
||||||
UpdateAppClientResponse,
|
UpdateAppClientResponse,
|
||||||
RevertAppClientResponse,
|
RevertAppClientResponse,
|
||||||
DestroyAppResponse,
|
DeleteAppResponse,
|
||||||
ImportToUpdateAppRequest,
|
ImportToUpdateAppRequest,
|
||||||
ImportToUpdateAppResponse,
|
ImportToUpdateAppResponse,
|
||||||
SetRevertableAppVersionRequest,
|
SetRevertableAppVersionRequest,
|
||||||
|
@ -685,7 +685,7 @@ async function postDestroyApp(ctx: UserCtx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function destroy(ctx: UserCtx<void, DestroyAppResponse>) {
|
export async function destroy(ctx: UserCtx<void, DeleteAppResponse>) {
|
||||||
await preDestroyApp(ctx)
|
await preDestroyApp(ctx)
|
||||||
const result = await destroyApp(ctx)
|
const result = await destroyApp(ctx)
|
||||||
await postDestroyApp(ctx)
|
await postDestroyApp(ctx)
|
||||||
|
|
|
@ -25,7 +25,7 @@ import {
|
||||||
DynamicVariable,
|
DynamicVariable,
|
||||||
FetchDatasourcesResponse,
|
FetchDatasourcesResponse,
|
||||||
FindDatasourcesResponse,
|
FindDatasourcesResponse,
|
||||||
DestroyDatasourceResponse,
|
DeleteDatasourceResponse,
|
||||||
FetchExternalSchemaResponse,
|
FetchExternalSchemaResponse,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import sdk from "../../sdk"
|
import sdk from "../../sdk"
|
||||||
|
@ -264,7 +264,7 @@ async function destroyInternalTablesBySourceId(datasourceId: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function destroy(ctx: UserCtx<void, DestroyDatasourceResponse>) {
|
export async function destroy(ctx: UserCtx<void, DeleteDatasourceResponse>) {
|
||||||
const db = context.getAppDB()
|
const db = context.getAppDB()
|
||||||
const datasourceId = ctx.params.datasourceId
|
const datasourceId = ctx.params.datasourceId
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
export type ApiKeyFetchResponse = Record<string, string>
|
export type ApiKeyFetchResponse = Record<string, string>
|
||||||
|
|
||||||
export interface ApiKeyUpdateRequest {
|
export interface UpdateApiKeyRequest {
|
||||||
value: string
|
value: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ApiKeyUpdateResponse {
|
export interface UpdateApiKeyResponse {
|
||||||
_id: string
|
_id: string
|
||||||
_rev: string
|
_rev: string
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ export interface BuildSchemaFromSourceResponse {
|
||||||
export type FetchDatasourcesResponse = Datasource[]
|
export type FetchDatasourcesResponse = Datasource[]
|
||||||
export type FindDatasourcesResponse = Datasource
|
export type FindDatasourcesResponse = Datasource
|
||||||
|
|
||||||
export interface DestroyDatasourceResponse {
|
export interface DeleteDatasourceResponse {
|
||||||
message: string
|
message: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ export interface UpdateAppResponse extends App {}
|
||||||
export interface UpdateAppClientResponse extends App {}
|
export interface UpdateAppClientResponse extends App {}
|
||||||
export interface RevertAppClientResponse extends App {}
|
export interface RevertAppClientResponse extends App {}
|
||||||
|
|
||||||
export interface DestroyAppResponse {
|
export interface DeleteAppResponse {
|
||||||
ok: boolean
|
ok: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue