Respond to PR feedback.
This commit is contained in:
parent
04e5699c9c
commit
c15554547b
|
@ -6,7 +6,7 @@ import { Plugin } from "@budibase/types"
|
|||
|
||||
// URLS
|
||||
|
||||
export function enrichPluginURLs(plugins: Plugin[]): Plugin[] {
|
||||
export function enrichPluginURLs(plugins: Plugin[] | undefined): Plugin[] {
|
||||
if (!plugins || !plugins.length) {
|
||||
return []
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ import {
|
|||
UserCtx,
|
||||
CreateAppRequest,
|
||||
FetchAppDefinitionResponse,
|
||||
type FetchAppPackageResponse,
|
||||
FetchAppPackageResponse,
|
||||
} from "@budibase/types"
|
||||
import { BASE_LAYOUT_PROP_IDS } from "../../constants/layouts"
|
||||
import sdk from "../../sdk"
|
||||
|
@ -177,7 +177,7 @@ export const addSampleData = async (ctx: UserCtx) => {
|
|||
ctx.status = 200
|
||||
}
|
||||
|
||||
export async function fetch(ctx: UserCtx<null, App[]>) {
|
||||
export async function fetch(ctx: UserCtx<void, App[]>) {
|
||||
ctx.body = await sdk.applications.fetch(
|
||||
ctx.query.status as AppStatus,
|
||||
ctx.user
|
||||
|
@ -185,7 +185,7 @@ export async function fetch(ctx: UserCtx<null, App[]>) {
|
|||
}
|
||||
|
||||
export async function fetchAppDefinition(
|
||||
ctx: UserCtx<null, FetchAppDefinitionResponse>
|
||||
ctx: UserCtx<void, FetchAppDefinitionResponse>
|
||||
) {
|
||||
const layouts = await getLayouts()
|
||||
const userRoleId = getUserRoleId(ctx)
|
||||
|
@ -202,7 +202,7 @@ export async function fetchAppDefinition(
|
|||
}
|
||||
|
||||
export async function fetchAppPackage(
|
||||
ctx: UserCtx<null, FetchAppPackageResponse>
|
||||
ctx: UserCtx<void, FetchAppPackageResponse>
|
||||
) {
|
||||
const db = context.getAppDB()
|
||||
const appId = context.getAppId()
|
||||
|
@ -213,7 +213,7 @@ export async function fetchAppPackage(
|
|||
|
||||
// Enrich plugin URLs
|
||||
application.usedPlugins = objectStore.enrichPluginURLs(
|
||||
application.usedPlugins || []
|
||||
application.usedPlugins
|
||||
)
|
||||
|
||||
// Only filter screens if the user is not a builder
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
import type { PlanType } from "../../sdk"
|
||||
import type { Layout, App } from "../../documents"
|
||||
|
||||
export interface CreateAppRequest {
|
||||
name: string
|
||||
url?: string
|
||||
useTemplate?: string
|
||||
templateName?: string
|
||||
templateKey?: string
|
||||
templateFile?: string
|
||||
includeSampleData?: boolean
|
||||
encryptionPassword?: string
|
||||
templateString?: string
|
||||
}
|
||||
|
||||
export interface FetchAppDefinitionResponse {
|
||||
layouts: Layout[]
|
||||
screens: Screen[]
|
||||
libraries: string[]
|
||||
}
|
||||
|
||||
export interface FetchAppPackageResponse {
|
||||
application: App
|
||||
licenseType: PlanType
|
||||
screens: Screen[]
|
||||
layouts: Layout[]
|
||||
clientLibPath: string
|
||||
hasLock: boolean
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
export * from "./application"
|
||||
export * from "./analytics"
|
||||
export * from "./auth"
|
||||
export * from "./user"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { User, Document, Layout, Screen, Plugin } from "../"
|
||||
import { SocketSession, PlanType } from "../../sdk"
|
||||
import { User, Document, Plugin } from "../"
|
||||
import { SocketSession } from "../../sdk"
|
||||
|
||||
export type AppMetadataErrors = { [key: string]: string[] }
|
||||
|
||||
|
@ -75,30 +75,3 @@ export interface AppFeatures {
|
|||
export interface AutomationSettings {
|
||||
chainAutomations?: boolean
|
||||
}
|
||||
|
||||
export interface CreateAppRequest {
|
||||
name: string
|
||||
url?: string
|
||||
useTemplate?: string
|
||||
templateName?: string
|
||||
templateKey?: string
|
||||
templateFile?: string
|
||||
includeSampleData?: boolean
|
||||
encryptionPassword?: string
|
||||
templateString?: string
|
||||
}
|
||||
|
||||
export interface FetchAppDefinitionResponse {
|
||||
layouts: Layout[]
|
||||
screens: Screen[]
|
||||
libraries: string[]
|
||||
}
|
||||
|
||||
export interface FetchAppPackageResponse {
|
||||
application: App
|
||||
licenseType: PlanType
|
||||
screens: Screen[]
|
||||
layouts: Layout[]
|
||||
clientLibPath: string
|
||||
hasLock: boolean
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue