Renames
This commit is contained in:
parent
32b9d22ba0
commit
ca974cf2f5
|
@ -209,7 +209,7 @@ export async function fetchAppPackage(
|
||||||
ctx: UserCtx<void, FetchAppPackageResponse>
|
ctx: UserCtx<void, FetchAppPackageResponse>
|
||||||
) {
|
) {
|
||||||
const appId = context.getAppId()
|
const appId = context.getAppId()
|
||||||
const application = await sdk.appMetadata.get()
|
const application = await sdk.applications.metadata.get()
|
||||||
const layouts = await getLayouts()
|
const layouts = await getLayouts()
|
||||||
let screens = await getScreens()
|
let screens = await getScreens()
|
||||||
const license = await licensing.cache.getCachedLicense()
|
const license = await licensing.cache.getCachedLicense()
|
||||||
|
@ -318,7 +318,7 @@ async function performAppCreate(ctx: UserCtx<CreateAppRequest, App>) {
|
||||||
newApplication.creationVersion = envCore.VERSION
|
newApplication.creationVersion = envCore.VERSION
|
||||||
}
|
}
|
||||||
|
|
||||||
const existing = await sdk.appMetadata.tryGet()
|
const existing = await sdk.applications.metadata.tryGet()
|
||||||
// If we used a template or imported an app there will be an existing doc.
|
// If we used a template or imported an app there will be an existing doc.
|
||||||
// Fetch and migrate some metadata from the existing app.
|
// Fetch and migrate some metadata from the existing app.
|
||||||
if (existing) {
|
if (existing) {
|
||||||
|
@ -492,7 +492,7 @@ export async function update(
|
||||||
|
|
||||||
export async function updateClient(ctx: UserCtx) {
|
export async function updateClient(ctx: UserCtx) {
|
||||||
// Get current app version
|
// Get current app version
|
||||||
const application = await sdk.appMetadata.get()
|
const application = await sdk.applications.metadata.get()
|
||||||
const currentVersion = application.version
|
const currentVersion = application.version
|
||||||
|
|
||||||
let manifest
|
let manifest
|
||||||
|
@ -520,7 +520,7 @@ export async function updateClient(ctx: UserCtx) {
|
||||||
|
|
||||||
export async function revertClient(ctx: UserCtx) {
|
export async function revertClient(ctx: UserCtx) {
|
||||||
// Check app can be reverted
|
// Check app can be reverted
|
||||||
const application = await sdk.appMetadata.get()
|
const application = await sdk.applications.metadata.get()
|
||||||
if (!application.revertableVersion) {
|
if (!application.revertableVersion) {
|
||||||
ctx.throw(400, "There is no version to revert to")
|
ctx.throw(400, "There is no version to revert to")
|
||||||
}
|
}
|
||||||
|
@ -578,7 +578,7 @@ async function destroyApp(ctx: UserCtx) {
|
||||||
|
|
||||||
const db = dbCore.getDB(devAppId)
|
const db = dbCore.getDB(devAppId)
|
||||||
// standard app deletion flow
|
// standard app deletion flow
|
||||||
const app = await sdk.appMetadata.get()
|
const app = await sdk.applications.metadata.get()
|
||||||
const result = await db.destroy()
|
const result = await db.destroy()
|
||||||
await quotas.removeApp()
|
await quotas.removeApp()
|
||||||
await events.app.deleted(app)
|
await events.app.deleted(app)
|
||||||
|
@ -729,7 +729,7 @@ export async function updateAppPackage(
|
||||||
) {
|
) {
|
||||||
return context.doInAppContext(appId, async () => {
|
return context.doInAppContext(appId, async () => {
|
||||||
const db = context.getAppDB()
|
const db = context.getAppDB()
|
||||||
const application = await sdk.appMetadata.get()
|
const application = await sdk.applications.metadata.get()
|
||||||
|
|
||||||
const newAppPackage: App = { ...application, ...appPackage }
|
const newAppPackage: App = { ...application, ...appPackage }
|
||||||
if (appPackage._rev !== application._rev) {
|
if (appPackage._rev !== application._rev) {
|
||||||
|
@ -755,7 +755,7 @@ export async function setRevertableVersion(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const db = context.getAppDB()
|
const db = context.getAppDB()
|
||||||
const app = await sdk.appMetadata.get()
|
const app = await sdk.applications.metadata.get()
|
||||||
app.revertableVersion = ctx.request.body.revertableVersion
|
app.revertableVersion = ctx.request.body.revertableVersion
|
||||||
await db.put(app)
|
await db.put(app)
|
||||||
|
|
||||||
|
@ -764,7 +764,7 @@ export async function setRevertableVersion(
|
||||||
|
|
||||||
async function migrateAppNavigation() {
|
async function migrateAppNavigation() {
|
||||||
const db = context.getAppDB()
|
const db = context.getAppDB()
|
||||||
const existing = await sdk.appMetadata.get()
|
const existing = await sdk.applications.metadata.get()
|
||||||
const layouts: Layout[] = await getLayouts()
|
const layouts: Layout[] = await getLayouts()
|
||||||
const screens: Screen[] = await getScreens()
|
const screens: Screen[] = await getScreens()
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
import * as metadata from "./metadata"
|
|
||||||
|
|
||||||
export default {
|
|
||||||
...metadata,
|
|
||||||
}
|
|
|
@ -2,10 +2,12 @@ import * as sync from "./sync"
|
||||||
import * as utils from "./utils"
|
import * as utils from "./utils"
|
||||||
import * as applications from "./applications"
|
import * as applications from "./applications"
|
||||||
import * as imports from "./import"
|
import * as imports from "./import"
|
||||||
|
import * as metadata from "./metadata"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
...sync,
|
...sync,
|
||||||
...utils,
|
...utils,
|
||||||
...applications,
|
...applications,
|
||||||
...imports,
|
...imports,
|
||||||
|
metadata,
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ import { default as plugins } from "./plugins"
|
||||||
import * as views from "./app/views"
|
import * as views from "./app/views"
|
||||||
import * as permissions from "./app/permissions"
|
import * as permissions from "./app/permissions"
|
||||||
import * as rowActions from "./app/rowActions"
|
import * as rowActions from "./app/rowActions"
|
||||||
import { default as appMetadata } from "./app/appMetadata"
|
|
||||||
|
|
||||||
const sdk = {
|
const sdk = {
|
||||||
backups,
|
backups,
|
||||||
|
@ -27,7 +26,6 @@ const sdk = {
|
||||||
permissions,
|
permissions,
|
||||||
links,
|
links,
|
||||||
rowActions,
|
rowActions,
|
||||||
appMetadata,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// default export for TS
|
// default export for TS
|
||||||
|
|
Loading…
Reference in New Issue