1
0
Fork 0
mirror of synced 2024-06-20 19:30:28 +12:00

Fixing a typescript issue in server.

This commit is contained in:
Michael Drury 2022-02-01 20:29:12 +00:00
parent 7852960a03
commit 4b23a78bc9
6 changed files with 17 additions and 796 deletions

View file

@ -222,6 +222,7 @@ exports.getAllDbs = async () => {
/**
* Lots of different points in the system need to find the full list of apps, this will
* enumerate the entire CouchDB cluster and get the list of databases (every app).
*
* @return {Promise<object[]>} returns the app information document stored in each app database.
*/
exports.getAllApps = async ({ dev, all, idsOnly } = {}) => {

File diff suppressed because it is too large Load diff

View file

@ -1,12 +1,11 @@
// @ts-ignore
import { getGlobalDB, getTenantId } from "@budibase/backend-core/tenancy"
// @ts-ignore
import { getAllApps } from "@budibase/backend-core/db"
import { getUsageQuotaDoc } from "../../../utilities/usageQuota"
export const run = async () => {
const db = getGlobalDB()
// get app count
// @ts-ignore
const devApps = await getAllApps({ dev: true })
const appCount = devApps ? devApps.length : 0

View file

@ -1,6 +1,4 @@
// @ts-ignore
import { getGlobalDB, getTenantId } from "@budibase/backend-core/tenancy"
// @ts-ignore
import { getAllApps } from "@budibase/backend-core/db"
import { getUsageQuotaDoc } from "../../../utilities/usageQuota"
import { getUniqueRows } from "../../../utilities/usageQuota/rows"
@ -8,7 +6,9 @@ import { getUniqueRows } from "../../../utilities/usageQuota/rows"
export const run = async () => {
const db = getGlobalDB()
// get all rows in all apps
// @ts-ignore
const allApps = await getAllApps({ all: true })
// @ts-ignore
const appIds = allApps ? allApps.map((app: { appId: any }) => app.appId) : []
const rows = await getUniqueRows(appIds)
const rowCount = rows ? rows.length : 0

3
packages/server/src/module.d.ts vendored Normal file
View file

@ -0,0 +1,3 @@
declare module "@budibase/backend-core"
declare module "@budibase/backend-core/tenancy"
declare module "@budibase/backend-core/db"

View file

@ -12,7 +12,8 @@
"incremental": true
},
"include": [
"./src/**/*"
"./src/**/*",
"./src/module.d.ts"
],
"exclude": [
"node_modules",