Moving some types around - make sure app types are all correctly filed away.
This commit is contained in:
parent
a8ef736051
commit
fdb328aaa1
|
@ -1,13 +1,17 @@
|
|||
import nodeFetch from "node-fetch"
|
||||
import { downloadTemplate as dlTemplate } from "../../utilities/fileSystem"
|
||||
import env from "../../environment"
|
||||
import { BBContext } from "@budibase/types"
|
||||
import {
|
||||
DownloadTemplateResponse,
|
||||
FetchTemplateResponse,
|
||||
UserCtx,
|
||||
} from "@budibase/types"
|
||||
|
||||
// development flag, can be used to test against templates exported locally
|
||||
const DEFAULT_TEMPLATES_BUCKET =
|
||||
"prod-budi-templates.s3-eu-west-1.amazonaws.com"
|
||||
|
||||
export async function fetch(ctx: BBContext) {
|
||||
export async function fetch(ctx: UserCtx<void, FetchTemplateResponse>) {
|
||||
let type = env.TEMPLATE_REPOSITORY
|
||||
let response,
|
||||
error = false
|
||||
|
@ -32,7 +36,9 @@ export async function fetch(ctx: BBContext) {
|
|||
|
||||
// can't currently test this, have to ignore from coverage
|
||||
/* istanbul ignore next */
|
||||
export async function downloadTemplate(ctx: BBContext) {
|
||||
export async function downloadTemplate(
|
||||
ctx: UserCtx<void, DownloadTemplateResponse>
|
||||
) {
|
||||
const { type, name } = ctx.params
|
||||
|
||||
await dlTemplate(type, name)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { PlanType } from "../../sdk"
|
||||
import type { Layout, App, Screen } from "../../documents"
|
||||
import type { PlanType } from "../../../sdk"
|
||||
import type { Layout, App, Screen } from "../../../documents"
|
||||
import { ReadStream } from "fs"
|
||||
|
||||
export interface SyncAppResponse {
|
|
@ -1,9 +1,14 @@
|
|||
import {
|
||||
Automation,
|
||||
AutomationActionStepId,
|
||||
AutomationLogPage,
|
||||
AutomationStatus,
|
||||
AutomationStepDefinition,
|
||||
AutomationTriggerDefinition,
|
||||
AutomationTriggerStepId,
|
||||
Row,
|
||||
} from "../../../documents"
|
||||
import { DocumentDestroyResponse } from "@budibase/nano"
|
||||
|
||||
export type GetAutomationTriggerDefinitionsResponse = Record<
|
||||
keyof typeof AutomationTriggerStepId,
|
||||
|
@ -19,3 +24,54 @@ export interface GetAutomationStepDefinitionsResponse {
|
|||
trigger: GetAutomationTriggerDefinitionsResponse
|
||||
action: GetAutomationActionDefinitionsResponse
|
||||
}
|
||||
|
||||
export interface DeleteAutomationResponse extends DocumentDestroyResponse {}
|
||||
|
||||
export interface FetchAutomationResponse {
|
||||
automations: Automation[]
|
||||
}
|
||||
|
||||
export interface FindAutomationResponse extends Automation {}
|
||||
|
||||
export interface UpdateAutomationRequest extends Automation {}
|
||||
export interface UpdateAutomationResponse {
|
||||
message: string
|
||||
automation: Automation
|
||||
}
|
||||
|
||||
export interface CreateAutomationRequest extends Automation {}
|
||||
export interface CreateAutomationResponse {
|
||||
message: string
|
||||
automation: Automation
|
||||
}
|
||||
|
||||
export interface SearchAutomationLogsRequest {
|
||||
startDate?: string
|
||||
status?: AutomationStatus
|
||||
automationId?: string
|
||||
page?: string
|
||||
}
|
||||
export interface SearchAutomationLogsResponse extends AutomationLogPage {}
|
||||
|
||||
export interface ClearAutomationLogRequest {
|
||||
automationId: string
|
||||
appId: string
|
||||
}
|
||||
export interface ClearAutomationLogResponse {
|
||||
message: string
|
||||
}
|
||||
|
||||
export interface TriggerAutomationRequest {
|
||||
fields: Record<string, any>
|
||||
// time in seconds
|
||||
timeout: number
|
||||
}
|
||||
export type TriggerAutomationResponse = Record<string, any> | undefined
|
||||
|
||||
export interface TestAutomationRequest {
|
||||
id?: string
|
||||
revision?: string
|
||||
fields: Record<string, any>
|
||||
row?: Row
|
||||
}
|
||||
export interface TestAutomationResponse {}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { DeploymentDoc, DeploymentStatus } from "../../documents"
|
||||
import { DeploymentDoc, DeploymentStatus } from "../../../documents"
|
||||
|
||||
export interface PublishAppResponse extends DeploymentDoc {}
|
||||
|
|
@ -13,3 +13,7 @@ export * from "./integration"
|
|||
export * from "./metadata"
|
||||
export * from "./query"
|
||||
export * from "./screen"
|
||||
export * from "./application"
|
||||
export * from "./layout"
|
||||
export * from "./deployment"
|
||||
export * from "./role"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Layout } from "../../documents"
|
||||
import { Layout } from "../../../documents"
|
||||
|
||||
export interface SaveLayoutRequest extends Layout {}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Role, RoleUIMetadata } from "../../documents"
|
||||
import { PermissionLevel, BuiltinPermissionID } from "../../sdk"
|
||||
import { Role, RoleUIMetadata } from "../../../documents"
|
||||
import { PermissionLevel, BuiltinPermissionID } from "../../../sdk"
|
||||
|
||||
export interface SaveRoleRequest {
|
||||
_id?: string
|
|
@ -1,58 +0,0 @@
|
|||
import { DocumentDestroyResponse } from "@budibase/nano"
|
||||
import {
|
||||
Automation,
|
||||
AutomationLogPage,
|
||||
AutomationStatus,
|
||||
Row,
|
||||
} from "../../documents"
|
||||
|
||||
export interface DeleteAutomationResponse extends DocumentDestroyResponse {}
|
||||
|
||||
export interface FetchAutomationResponse {
|
||||
automations: Automation[]
|
||||
}
|
||||
|
||||
export interface FindAutomationResponse extends Automation {}
|
||||
|
||||
export interface UpdateAutomationRequest extends Automation {}
|
||||
export interface UpdateAutomationResponse {
|
||||
message: string
|
||||
automation: Automation
|
||||
}
|
||||
|
||||
export interface CreateAutomationRequest extends Automation {}
|
||||
export interface CreateAutomationResponse {
|
||||
message: string
|
||||
automation: Automation
|
||||
}
|
||||
|
||||
export interface SearchAutomationLogsRequest {
|
||||
startDate?: string
|
||||
status?: AutomationStatus
|
||||
automationId?: string
|
||||
page?: string
|
||||
}
|
||||
export interface SearchAutomationLogsResponse extends AutomationLogPage {}
|
||||
|
||||
export interface ClearAutomationLogRequest {
|
||||
automationId: string
|
||||
appId: string
|
||||
}
|
||||
export interface ClearAutomationLogResponse {
|
||||
message: string
|
||||
}
|
||||
|
||||
export interface TriggerAutomationRequest {
|
||||
fields: Record<string, any>
|
||||
// time in seconds
|
||||
timeout: number
|
||||
}
|
||||
export type TriggerAutomationResponse = Record<string, any> | undefined
|
||||
|
||||
export interface TestAutomationRequest {
|
||||
id?: string
|
||||
revision?: string
|
||||
fields: Record<string, any>
|
||||
row?: Row
|
||||
}
|
||||
export interface TestAutomationResponse {}
|
|
@ -1,4 +1,3 @@
|
|||
export * from "./application"
|
||||
export * from "./analytics"
|
||||
export * from "./auth"
|
||||
export * from "./user"
|
||||
|
@ -11,10 +10,7 @@ export * from "./global"
|
|||
export * from "./pagination"
|
||||
export * from "./searchFilter"
|
||||
export * from "./cookies"
|
||||
export * from "./automation"
|
||||
export * from "./layout"
|
||||
export * from "./role"
|
||||
export * from "./plugins"
|
||||
export * from "./apikeys"
|
||||
export * from "./deployment"
|
||||
export * from "./dev"
|
||||
export * from "./template"
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
export interface FetchTemplateResponse {}
|
||||
|
||||
export interface DownloadTemplateResponse {
|
||||
message: string
|
||||
}
|
Loading…
Reference in New Issue