BOSS 2.0 - Full TS and microservice rewrite. Still pulls from local until admin panel updates

This commit is contained in:
Jonathan Barrow
2023-08-25 21:11:44 -04:00
parent 8daf7ef041
commit 335439db7d
32 changed files with 6051 additions and 107 deletions

View File

@@ -1,14 +1,47 @@
import mongoose from 'mongoose';
export interface DisabledFeatures {
s3: boolean
}
export interface Config {
http: {
port: number;
};
crypto: {
wup: {
aes_key: Buffer;
hmac_key: Buffer;
aes_key: string;
hmac_key: string;
};
ctr: {
aes_key: Buffer;
};
};
grpc: {
boss: {
address: string;
port: number;
api_key: string;
};
account: {
address: string;
port: number;
api_key: string;
};
};
mongoose: {
connection_string: string;
options: mongoose.ConnectOptions;
};
cdn: {
download_url: string;
s3: {
endpoint: string;
region: string;
bucket: string;
key: string;
secret: string;
};
disk_path: string;
};
}

View File

@@ -0,0 +1,5 @@
export type UserAgentInfo = {
deviceID?: number;
localFriendCodeSeed?: number;
userPID: number;
};

10
src/types/express.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
import { GetUserDataResponse } from '@pretendonetwork/grpc/account/get_user_data_rpc';
declare global {
namespace Express {
interface Request {
pid: number;
pnid: GetUserDataResponse | null;
}
}
}

View File

@@ -0,0 +1,27 @@
import { Model, HydratedDocument } from 'mongoose';
export interface IFile {
deleted: boolean;
data_id: bigint;
task_id: string;
boss_app_id: string;
supported_countries: string[];
supported_languages: string[];
creator_pid: number;
name: string;
type: string;
hash: string;
size: bigint;
notify_on_new: string[];
notify_led: boolean;
created: bigint;
updated: bigint;
}
export interface IFileMethods {}
interface IFileQueryHelpers {}
export interface FileModel extends Model<IFile, IFileQueryHelpers, IFileMethods> {}
export type HydratedFileDocument = HydratedDocument<IFile, IFileMethods>

View File

@@ -0,0 +1,21 @@
import { Model, HydratedDocument } from 'mongoose';
export interface ITask {
deleted: boolean;
id: string;
boss_app_id: string;
creator_pid: number;
status: 'open'; // TODO - Make this a union. What else is there?
title_id: string;
description: string;
created: bigint;
updated: bigint;
}
export interface ITaskMethods {}
interface ITaskQueryHelpers {}
export interface TaskModel extends Model<ITask, ITaskQueryHelpers, ITaskMethods> {}
export type HydratedTaskDocument = HydratedDocument<ITask, ITaskMethods>