Updates
This commit is contained in:
+62
-1
@@ -1,5 +1,6 @@
|
||||
import { MediaParadigms, MediaTypes } from "@/src/dict/media-dict";
|
||||
import { UserTypes } from "@/src/dict/user-types-dict";
|
||||
import { Variables } from "@/src/dict/variables-dict";
|
||||
import type { BUN_SQLITE_DatabaseSchemaType } from "@moduletrace/bun-sqlite/dist/types";
|
||||
|
||||
const schema: BUN_SQLITE_DatabaseSchemaType = {
|
||||
@@ -157,7 +158,67 @@ const schema: BUN_SQLITE_DatabaseSchemaType = {
|
||||
dataType: "INTEGER",
|
||||
},
|
||||
{
|
||||
fieldName: "ip_address",
|
||||
fieldName: "host_id",
|
||||
dataType: "INTEGER",
|
||||
defaultValue: 0,
|
||||
},
|
||||
{
|
||||
fieldName: "name",
|
||||
dataType: "TEXT",
|
||||
},
|
||||
{
|
||||
fieldName: "wg_ip_address",
|
||||
dataType: "TEXT",
|
||||
},
|
||||
{
|
||||
fieldName: "public_ip_address",
|
||||
dataType: "TEXT",
|
||||
},
|
||||
{
|
||||
fieldName: "private_key",
|
||||
dataType: "TEXT",
|
||||
},
|
||||
{
|
||||
fieldName: "public_key",
|
||||
dataType: "TEXT",
|
||||
},
|
||||
{
|
||||
fieldName: "allowed_ips",
|
||||
dataType: "TEXT",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
tableName: "hosts",
|
||||
fields: [
|
||||
{
|
||||
fieldName: "user_id",
|
||||
dataType: "INTEGER",
|
||||
},
|
||||
{
|
||||
fieldName: "wg_ip_address",
|
||||
dataType: "TEXT",
|
||||
},
|
||||
{
|
||||
fieldName: "private_key",
|
||||
dataType: "TEXT",
|
||||
},
|
||||
{
|
||||
fieldName: "public_key",
|
||||
dataType: "TEXT",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
tableName: "variables",
|
||||
fields: [
|
||||
{
|
||||
fieldName: "key",
|
||||
dataType: "TEXT",
|
||||
options: Variables.map((v) => v.value),
|
||||
},
|
||||
{
|
||||
fieldName: "value",
|
||||
dataType: "TEXT",
|
||||
},
|
||||
],
|
||||
|
||||
+63
-1
@@ -3,6 +3,9 @@ export const BunSQLiteTables = [
|
||||
"user_types",
|
||||
"media",
|
||||
"media_paradigms",
|
||||
"clients",
|
||||
"hosts",
|
||||
"variables",
|
||||
] as const
|
||||
|
||||
export type BUN_SQLITE_WGUI_USERS = {
|
||||
@@ -89,4 +92,63 @@ export type BUN_SQLITE_WGUI_MEDIA_PARADIGMS = {
|
||||
media_paradigm?: "user-profile-image" | "generic" | "event" | "";
|
||||
}
|
||||
|
||||
export type BUN_SQLITE_WGUI_ALL_TYPEDEFS = BUN_SQLITE_WGUI_USERS & BUN_SQLITE_WGUI_USER_TYPES & BUN_SQLITE_WGUI_MEDIA & BUN_SQLITE_WGUI_MEDIA_PARADIGMS
|
||||
export type BUN_SQLITE_WGUI_CLIENTS = {
|
||||
/**
|
||||
* The unique identifier of the record.
|
||||
*/
|
||||
id?: number | "";
|
||||
/**
|
||||
* The time when the record was created. (Unix Timestamp)
|
||||
*/
|
||||
created_at?: number | "";
|
||||
/**
|
||||
* The time when the record was updated. (Unix Timestamp)
|
||||
*/
|
||||
updated_at?: number | "";
|
||||
user_id?: number | "";
|
||||
host_id?: number | "";
|
||||
name?: string;
|
||||
wg_ip_address?: string;
|
||||
public_ip_address?: string;
|
||||
private_key?: string;
|
||||
public_key?: string;
|
||||
allowed_ips?: string;
|
||||
}
|
||||
|
||||
export type BUN_SQLITE_WGUI_HOSTS = {
|
||||
/**
|
||||
* The unique identifier of the record.
|
||||
*/
|
||||
id?: number | "";
|
||||
/**
|
||||
* The time when the record was created. (Unix Timestamp)
|
||||
*/
|
||||
created_at?: number | "";
|
||||
/**
|
||||
* The time when the record was updated. (Unix Timestamp)
|
||||
*/
|
||||
updated_at?: number | "";
|
||||
user_id?: number | "";
|
||||
wg_ip_address?: string;
|
||||
private_key?: string;
|
||||
public_key?: string;
|
||||
}
|
||||
|
||||
export type BUN_SQLITE_WGUI_VARIABLES = {
|
||||
/**
|
||||
* The unique identifier of the record.
|
||||
*/
|
||||
id?: number | "";
|
||||
/**
|
||||
* The time when the record was created. (Unix Timestamp)
|
||||
*/
|
||||
created_at?: number | "";
|
||||
/**
|
||||
* The time when the record was updated. (Unix Timestamp)
|
||||
*/
|
||||
updated_at?: number | "";
|
||||
key?: "main_host_wg_ip_address" | "";
|
||||
value?: string;
|
||||
}
|
||||
|
||||
export type BUN_SQLITE_WGUI_ALL_TYPEDEFS = BUN_SQLITE_WGUI_USERS & BUN_SQLITE_WGUI_USER_TYPES & BUN_SQLITE_WGUI_MEDIA & BUN_SQLITE_WGUI_MEDIA_PARADIGMS & BUN_SQLITE_WGUI_CLIENTS & BUN_SQLITE_WGUI_HOSTS & BUN_SQLITE_WGUI_VARIABLES
|
||||
Reference in New Issue
Block a user