mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Merge branch 'main' into poc/onboarding-setup
# Conflicts: # app/api/agent/[agentId]/status/helpers.ts
This commit is contained in:
+1
-1
@@ -33,5 +33,5 @@ keywords:
|
|||||||
- web-ui
|
- web-ui
|
||||||
- agent
|
- agent
|
||||||
license: Apache-2.0
|
license: Apache-2.0
|
||||||
version: 1.20.1
|
version: 1.20.2
|
||||||
date-released: '2026-03-02'
|
date-released: '2026-03-02'
|
||||||
|
|||||||
@@ -1,328 +1,278 @@
|
|||||||
import { NextResponse } from "next/server";
|
import {NextResponse} from "next/server";
|
||||||
import { Body } from "./route";
|
import {Body} from "./route";
|
||||||
import { Agent } from "@/db/schema/08_agent";
|
import {isUuidv4} from "@/utils/verify-uuid";
|
||||||
import { DatabaseWith } from "@/db/schema/07_database";
|
import {Agent} from "@/db/schema/08_agent";
|
||||||
|
import {DatabaseWith} from "@/db/schema/07_database";
|
||||||
import * as drizzleDb from "@/db";
|
import * as drizzleDb from "@/db";
|
||||||
import { db, db as dbClient } from "@/db";
|
import {db, db as dbClient} from "@/db";
|
||||||
import { and, eq, inArray } from "drizzle-orm";
|
import {and, eq, inArray} from "drizzle-orm";
|
||||||
import { dbmsEnumSchema, EDbmsSchema } from "@/db/schema/types";
|
import {dbmsEnumSchema, EDbmsSchema} from "@/db/schema/types";
|
||||||
import { withUpdatedAt } from "@/db/utils";
|
import {withUpdatedAt} from "@/db/utils";
|
||||||
import type { StorageInput } from "@/features/storages/types";
|
import type {StorageInput} from "@/features/storages/storages.types";
|
||||||
import { dispatchStorage } from "@/features/storages/utils/storages.dispatch";
|
import {dispatchStorage} from "@/features/storages/storages.dispatch";
|
||||||
import { Setting } from "@/db/schema/01_setting";
|
import {Setting} from "@/db/schema/01_setting";
|
||||||
import { logger } from "@/lib/logger";
|
import {logger} from "@/lib/logger";
|
||||||
import { isUUID } from "@/utils/text";
|
|
||||||
|
|
||||||
const log = logger.child({ module: "api/agent/status/helpers" });
|
const log = logger.child({module: "api/agent/status/helpers"});
|
||||||
|
|
||||||
export async function handleDatabases(
|
export async function handleDatabases(body: Body, agent: Agent, lastContact: Date, settings: Setting) {
|
||||||
body: Body,
|
const databasesResponse = [];
|
||||||
agent: Agent,
|
|
||||||
lastContact: Date,
|
|
||||||
settings: Setting,
|
|
||||||
) {
|
|
||||||
const databasesResponse = [];
|
|
||||||
|
|
||||||
const formatDatabase = (
|
const formatDatabase = (database: DatabaseWith, backupAction: boolean, restoreAction: boolean, UrlBackup: string | null, storages: PingDatabaseStorageChannels[], urlMeta: string | null, backupSize: number | null) => ({
|
||||||
database: DatabaseWith,
|
generatedId: database.agentDatabaseId,
|
||||||
backupAction: boolean,
|
dbms: database.dbms,
|
||||||
restoreAction: boolean,
|
storages: storages,
|
||||||
UrlBackup: string | null,
|
encrypt: settings.encryption,
|
||||||
storages: PingDatabaseStorageChannels[],
|
data: {
|
||||||
urlMeta: string | null,
|
backup: {
|
||||||
) => ({
|
action: backupAction,
|
||||||
generatedId: database.agentDatabaseId,
|
cron: database.backupPolicy,
|
||||||
dbms: database.dbms,
|
},
|
||||||
storages: storages,
|
restore: {
|
||||||
encrypt: settings.encryption,
|
action: restoreAction,
|
||||||
data: {
|
file: UrlBackup,
|
||||||
backup: {
|
metaFile: urlMeta,
|
||||||
action: backupAction,
|
size: backupSize
|
||||||
cron: database.backupPolicy,
|
},
|
||||||
},
|
},
|
||||||
restore: {
|
|
||||||
action: restoreAction,
|
|
||||||
file: UrlBackup,
|
|
||||||
metaFile: urlMeta,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
for (const db of body.databases) {
|
|
||||||
const existingDatabase = await dbClient.query.database.findFirst({
|
|
||||||
where: eq(drizzleDb.schemas.database.agentDatabaseId, db.generatedId),
|
|
||||||
with: {
|
|
||||||
project: true,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let backupAction: boolean = false;
|
for (const db of body.databases) {
|
||||||
let restoreAction: boolean = false;
|
|
||||||
let urlBackup: string | null = null;
|
|
||||||
let urlMeta: string | null = null;
|
|
||||||
|
|
||||||
if (!existingDatabase) {
|
const existingDatabase = await dbClient.query.database.findFirst({
|
||||||
if (!isUUID(db.generatedId)) {
|
where: eq(drizzleDb.schemas.database.agentDatabaseId, db.generatedId),
|
||||||
return NextResponse.json(
|
with: {
|
||||||
{ error: "generatedId is not a valid uuid" },
|
project: true
|
||||||
{ status: 500 },
|
}
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!dbmsEnumSchema.safeParse(db.dbms).success) {
|
|
||||||
log.error(
|
|
||||||
{ name: "handleDatabases" },
|
|
||||||
`Database type not available: ${db.dbms}`,
|
|
||||||
);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const [databaseCreated] = await dbClient
|
|
||||||
.insert(drizzleDb.schemas.database)
|
|
||||||
.values({
|
|
||||||
agentId: agent.id,
|
|
||||||
name: db.name,
|
|
||||||
dbms: db.dbms as EDbmsSchema,
|
|
||||||
agentDatabaseId: db.generatedId,
|
|
||||||
lastContact: db.pingStatus ? lastContact : null,
|
|
||||||
healthErrorCount: null,
|
|
||||||
})
|
|
||||||
.returning();
|
|
||||||
|
|
||||||
if (databaseCreated) {
|
|
||||||
await dbClient.insert(drizzleDb.schemas.healthcheckLog).values({
|
|
||||||
kind: "database",
|
|
||||||
status: db.pingStatus ? "success" : "failed",
|
|
||||||
objectId: databaseCreated.id,
|
|
||||||
date: lastContact,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const storages = await getDatabaseStorageChannels(databaseCreated.id);
|
let backupAction: boolean = false
|
||||||
|
let restoreAction: boolean = false
|
||||||
|
let urlBackup: string | null = null;
|
||||||
|
let urlMeta: string | null = null
|
||||||
|
let backupSize: number | null = null
|
||||||
|
|
||||||
databasesResponse.push(
|
if (!existingDatabase) {
|
||||||
formatDatabase(
|
if (!isUuidv4(db.generatedId)) {
|
||||||
databaseCreated,
|
return NextResponse.json(
|
||||||
backupAction,
|
{error: "generatedId is not a valid uuid"},
|
||||||
restoreAction,
|
{status: 500}
|
||||||
urlBackup,
|
);
|
||||||
storages,
|
}
|
||||||
null,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
const [databaseUpdated] = await dbClient
|
|
||||||
.update(drizzleDb.schemas.database)
|
|
||||||
.set(
|
|
||||||
withUpdatedAt({
|
|
||||||
name: db.name,
|
|
||||||
agentId: agent.id,
|
|
||||||
dbms: db.dbms as EDbmsSchema,
|
|
||||||
lastContact: db.pingStatus
|
|
||||||
? lastContact
|
|
||||||
: existingDatabase.lastContact,
|
|
||||||
healthErrorCount: db.pingStatus
|
|
||||||
? null
|
|
||||||
: existingDatabase.healthErrorCount,
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
.where(eq(drizzleDb.schemas.database.id, existingDatabase.id))
|
|
||||||
.returning();
|
|
||||||
|
|
||||||
await dbClient.insert(drizzleDb.schemas.healthcheckLog).values({
|
if (!dbmsEnumSchema.safeParse(db.dbms).success) {
|
||||||
kind: "database",
|
log.error({name: "handleDatabases"},`Database type not available: ${db.dbms}`);
|
||||||
status: db.pingStatus ? "success" : "failed",
|
continue;
|
||||||
objectId: databaseUpdated.id,
|
}
|
||||||
date: lastContact,
|
|
||||||
});
|
|
||||||
|
|
||||||
const activeBackup = await dbClient.query.backup.findFirst({
|
const [databaseCreated] = await dbClient
|
||||||
where: and(
|
.insert(drizzleDb.schemas.database)
|
||||||
eq(drizzleDb.schemas.backup.databaseId, databaseUpdated.id),
|
.values({
|
||||||
inArray(drizzleDb.schemas.backup.status, ["waiting", "ongoing"]),
|
agentId: agent.id,
|
||||||
),
|
name: db.name,
|
||||||
});
|
dbms: db.dbms as EDbmsSchema,
|
||||||
|
agentDatabaseId: db.generatedId,
|
||||||
|
lastContact: db.pingStatus ? lastContact : null,
|
||||||
|
healthErrorCount: null
|
||||||
|
})
|
||||||
|
.returning();
|
||||||
|
|
||||||
const restoration = await dbClient.query.restoration.findFirst({
|
|
||||||
where: and(
|
|
||||||
eq(drizzleDb.schemas.restoration.databaseId, databaseUpdated.id),
|
|
||||||
eq(drizzleDb.schemas.restoration.status, "waiting"),
|
|
||||||
),
|
|
||||||
with: {
|
|
||||||
backupStorage: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (activeBackup && activeBackup.status == "waiting") {
|
if (databaseCreated) {
|
||||||
backupAction = true;
|
|
||||||
|
|
||||||
await dbClient
|
|
||||||
.update(drizzleDb.schemas.backup)
|
|
||||||
.set(withUpdatedAt({ status: "ongoing" }))
|
|
||||||
.where(eq(drizzleDb.schemas.backup.id, activeBackup.id));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (restoration) {
|
await dbClient
|
||||||
restoreAction = true;
|
.insert(drizzleDb.schemas.healthcheckLog)
|
||||||
|
.values({
|
||||||
|
kind: "database",
|
||||||
|
status: db.pingStatus ? "success" : "failed",
|
||||||
|
objectId: databaseCreated.id,
|
||||||
|
date: lastContact
|
||||||
|
})
|
||||||
|
|
||||||
if (
|
const storages = await getDatabaseStorageChannels(databaseCreated.id)
|
||||||
!restoration.backupStorage ||
|
|
||||||
restoration.backupStorage.status != "success" ||
|
|
||||||
!restoration.backupStorage.path
|
|
||||||
) {
|
|
||||||
restoreAction = false;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const input: StorageInput = {
|
databasesResponse.push(formatDatabase(databaseCreated, backupAction, restoreAction, urlBackup, storages, null, null));
|
||||||
action: "get",
|
}
|
||||||
data: {
|
} else {
|
||||||
path: restoration.backupStorage.path,
|
|
||||||
signedUrl: true,
|
|
||||||
},
|
|
||||||
metadata: {
|
|
||||||
storageId: restoration.backupStorage.storageChannelId,
|
|
||||||
fileKind: "backups",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const inputMeta: StorageInput = {
|
const [databaseUpdated] = await dbClient
|
||||||
action: "get",
|
.update(drizzleDb.schemas.database)
|
||||||
data: {
|
.set(withUpdatedAt({
|
||||||
path: `${restoration.backupStorage.path}.meta`,
|
name: db.name,
|
||||||
signedUrl: true,
|
agentId: agent.id,
|
||||||
},
|
dbms: db.dbms as EDbmsSchema,
|
||||||
metadata: {
|
lastContact: db.pingStatus ? lastContact : existingDatabase.lastContact,
|
||||||
storageId: restoration.backupStorage.storageChannelId,
|
healthErrorCount: db.pingStatus ? null : existingDatabase.healthErrorCount,
|
||||||
fileKind: "backups",
|
}))
|
||||||
},
|
.where(eq(drizzleDb.schemas.database.id, existingDatabase.id))
|
||||||
};
|
.returning();
|
||||||
|
|
||||||
try {
|
|
||||||
const result = await dispatchStorage(
|
|
||||||
input,
|
|
||||||
undefined,
|
|
||||||
restoration.backupStorage.storageChannelId,
|
|
||||||
);
|
|
||||||
const resultMeta = await dispatchStorage(
|
|
||||||
inputMeta,
|
|
||||||
undefined,
|
|
||||||
restoration.backupStorage.storageChannelId,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (result.success) {
|
|
||||||
urlBackup = result.url ?? null;
|
|
||||||
urlMeta = resultMeta.url ?? null;
|
|
||||||
} else {
|
|
||||||
await dbClient
|
await dbClient
|
||||||
.update(drizzleDb.schemas.restoration)
|
.insert(drizzleDb.schemas.healthcheckLog)
|
||||||
.set(withUpdatedAt({ status: "failed" }))
|
.values({
|
||||||
.where(eq(drizzleDb.schemas.restoration.id, restoration.id));
|
kind: "database",
|
||||||
|
status: db.pingStatus ? "success" : "failed",
|
||||||
|
objectId: databaseUpdated.id,
|
||||||
|
date: lastContact
|
||||||
|
})
|
||||||
|
|
||||||
const errorMessage = "Failed to get backup URL";
|
|
||||||
log.error(
|
const activeBackup = await dbClient.query.backup.findFirst({
|
||||||
{ error: errorMessage, name: "handleDatabases" },
|
where: and(
|
||||||
"Restoration failed",
|
eq(drizzleDb.schemas.backup.databaseId, databaseUpdated.id),
|
||||||
);
|
inArray(drizzleDb.schemas.backup.status, ["waiting", "ongoing"])
|
||||||
continue;
|
)
|
||||||
}
|
})
|
||||||
} catch (err) {
|
|
||||||
log.error(
|
const restoration = await dbClient.query.restoration.findFirst({
|
||||||
{ error: err, name: "handleDatabases" },
|
where: and(eq(drizzleDb.schemas.restoration.databaseId, databaseUpdated.id), eq(drizzleDb.schemas.restoration.status, "waiting")),
|
||||||
"Restoration crashed unexpectedly",
|
with: {
|
||||||
);
|
backupStorage: true
|
||||||
await dbClient
|
}
|
||||||
.update(drizzleDb.schemas.restoration)
|
})
|
||||||
.set(withUpdatedAt({ status: "failed" }))
|
|
||||||
.where(eq(drizzleDb.schemas.restoration.id, restoration.id));
|
if (activeBackup && activeBackup.status == "waiting") {
|
||||||
continue;
|
backupAction = true
|
||||||
|
|
||||||
|
await dbClient
|
||||||
|
.update(drizzleDb.schemas.backup)
|
||||||
|
.set(withUpdatedAt({status: "ongoing"}))
|
||||||
|
.where(eq(drizzleDb.schemas.backup.id, activeBackup.id));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (restoration) {
|
||||||
|
restoreAction = true
|
||||||
|
|
||||||
|
if (!restoration.backupStorage || restoration.backupStorage.status != "success" || !restoration.backupStorage.path) {
|
||||||
|
restoreAction = false
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const input: StorageInput = {
|
||||||
|
action: "get",
|
||||||
|
data: {
|
||||||
|
path: restoration.backupStorage.path,
|
||||||
|
signedUrl: true,
|
||||||
|
},
|
||||||
|
metadata: {
|
||||||
|
storageId: restoration.backupStorage.storageChannelId,
|
||||||
|
fileKind: "backups"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const inputMeta: StorageInput = {
|
||||||
|
action: "get",
|
||||||
|
data: {
|
||||||
|
path: `${restoration.backupStorage.path}.meta`,
|
||||||
|
signedUrl: true,
|
||||||
|
},
|
||||||
|
metadata: {
|
||||||
|
storageId: restoration.backupStorage.storageChannelId,
|
||||||
|
fileKind: "backups"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
const result = await dispatchStorage(input, undefined, restoration.backupStorage.storageChannelId);
|
||||||
|
const resultMeta = await dispatchStorage(inputMeta, undefined, restoration.backupStorage.storageChannelId);
|
||||||
|
|
||||||
|
if (result.success) {
|
||||||
|
urlBackup = result.url ?? null;
|
||||||
|
urlMeta = resultMeta.url ?? null
|
||||||
|
backupSize = restoration.backupStorage.size
|
||||||
|
} else {
|
||||||
|
await dbClient
|
||||||
|
.update(drizzleDb.schemas.restoration)
|
||||||
|
.set(withUpdatedAt({status: "failed"}))
|
||||||
|
.where(eq(drizzleDb.schemas.restoration.id, restoration.id));
|
||||||
|
|
||||||
|
const errorMessage = "Failed to get backup URL";
|
||||||
|
log.error({error: errorMessage, name: "handleDatabases"}, "Restoration failed");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
log.error({error: err, name: "handleDatabases"}, "Restoration crashed unexpectedly");
|
||||||
|
await dbClient
|
||||||
|
.update(drizzleDb.schemas.restoration)
|
||||||
|
.set(withUpdatedAt({status: "failed"}))
|
||||||
|
.where(eq(drizzleDb.schemas.restoration.id, restoration.id));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
await dbClient
|
||||||
|
.update(drizzleDb.schemas.restoration)
|
||||||
|
.set(withUpdatedAt({status: "ongoing"}))
|
||||||
|
.where(eq(drizzleDb.schemas.restoration.id, restoration.id));
|
||||||
|
}
|
||||||
|
const storages = await getDatabaseStorageChannels(databaseUpdated.id)
|
||||||
|
databasesResponse.push(formatDatabase(databaseUpdated, backupAction, restoreAction, urlBackup, storages, urlMeta, backupSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
await dbClient
|
|
||||||
.update(drizzleDb.schemas.restoration)
|
|
||||||
.set(withUpdatedAt({ status: "ongoing" }))
|
|
||||||
.where(eq(drizzleDb.schemas.restoration.id, restoration.id));
|
|
||||||
}
|
|
||||||
const storages = await getDatabaseStorageChannels(databaseUpdated.id);
|
|
||||||
databasesResponse.push(
|
|
||||||
formatDatabase(
|
|
||||||
databaseUpdated,
|
|
||||||
backupAction,
|
|
||||||
restoreAction,
|
|
||||||
urlBackup,
|
|
||||||
storages,
|
|
||||||
urlMeta,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
return databasesResponse;
|
||||||
return databasesResponse;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type PingDatabaseStorageChannels = {
|
type PingDatabaseStorageChannels = {
|
||||||
id: string;
|
id: string;
|
||||||
config: any;
|
config: any
|
||||||
provider: string;
|
provider: string
|
||||||
};
|
}
|
||||||
|
|
||||||
async function getDatabaseStorageChannels(
|
async function getDatabaseStorageChannels(databaseId: string): Promise<PingDatabaseStorageChannels[]> {
|
||||||
databaseId: string,
|
|
||||||
): Promise<PingDatabaseStorageChannels[]> {
|
|
||||||
const database = await db.query.database.findFirst({
|
|
||||||
where: eq(drizzleDb.schemas.database.id, databaseId),
|
|
||||||
with: {
|
|
||||||
project: true,
|
|
||||||
retentionPolicy: true,
|
|
||||||
alertPolicies: true,
|
|
||||||
storagePolicies: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!database) {
|
const database = await db.query.database.findFirst({
|
||||||
return [];
|
where: eq(drizzleDb.schemas.database.id, databaseId),
|
||||||
}
|
with: {
|
||||||
|
project: true,
|
||||||
|
retentionPolicy: true,
|
||||||
|
alertPolicies: true,
|
||||||
|
storagePolicies: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const settings = await db.query.setting.findFirst({
|
if (!database) {
|
||||||
where: eq(drizzleDb.schemas.setting.name, "system"),
|
return []
|
||||||
with: { storageChannel: true },
|
}
|
||||||
});
|
|
||||||
|
|
||||||
const defaultStorageChannel: PingDatabaseStorageChannels[] =
|
const settings = await db.query.setting.findFirst({
|
||||||
settings?.storageChannel
|
where: eq(drizzleDb.schemas.setting.name, "system"),
|
||||||
? [
|
with: {storageChannel: true},
|
||||||
{
|
});
|
||||||
|
|
||||||
|
const defaultStorageChannel: PingDatabaseStorageChannels[] = settings?.storageChannel
|
||||||
|
? [{
|
||||||
id: settings.storageChannel.id,
|
id: settings.storageChannel.id,
|
||||||
provider: settings.storageChannel.provider,
|
provider: settings.storageChannel.provider,
|
||||||
config: settings.storageChannel.config,
|
config: settings.storageChannel.config,
|
||||||
},
|
}]
|
||||||
]
|
: [];
|
||||||
: [];
|
|
||||||
|
|
||||||
const enabledDatabaseStorageChannels = await Promise.all(
|
|
||||||
(database.storagePolicies ?? [])
|
|
||||||
.filter((p) => p.enabled)
|
|
||||||
.map(async (policy) => {
|
|
||||||
const storageChannel = await db.query.storageChannel.findFirst({
|
|
||||||
where: eq(
|
|
||||||
drizzleDb.schemas.storageChannel.id,
|
|
||||||
policy.storageChannelId,
|
|
||||||
),
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!storageChannel) return null;
|
const enabledDatabaseStorageChannels = await Promise.all(
|
||||||
|
(database.storagePolicies ?? [])
|
||||||
|
.filter(p => p.enabled)
|
||||||
|
.map(async policy => {
|
||||||
|
const storageChannel = await db.query.storageChannel.findFirst({
|
||||||
|
where: eq(drizzleDb.schemas.storageChannel.id, policy.storageChannelId),
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
if (!storageChannel) return null;
|
||||||
id: storageChannel.id,
|
|
||||||
config: storageChannel.config,
|
|
||||||
provider: storageChannel.provider,
|
|
||||||
} as PingDatabaseStorageChannels;
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
const filteredChannels: PingDatabaseStorageChannels[] =
|
return {
|
||||||
enabledDatabaseStorageChannels.filter(
|
id: storageChannel.id,
|
||||||
(c): c is PingDatabaseStorageChannels => c !== null,
|
config: storageChannel.config,
|
||||||
|
provider: storageChannel.provider,
|
||||||
|
} as PingDatabaseStorageChannels;
|
||||||
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
return filteredChannels.length > 0 ? filteredChannels : defaultStorageChannel;
|
const filteredChannels: PingDatabaseStorageChannels[] = enabledDatabaseStorageChannels.filter(
|
||||||
|
(c): c is PingDatabaseStorageChannels => c !== null
|
||||||
|
);
|
||||||
|
|
||||||
|
return filteredChannels.length > 0 ? filteredChannels : defaultStorageChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "portabase",
|
"name": "portabase",
|
||||||
"version": "1.20.1",
|
"version": "1.20.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev --turbopack -p 8887",
|
"dev": "next dev --turbopack -p 8887",
|
||||||
|
|||||||
Reference in New Issue
Block a user