mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
Merge branch 'master' into cleanup/config
This commit is contained in:
103 files changed
+3418
-1928
No files matched your search
@@ -33,4 +33,6 @@ export enum CallEvents {
|
||||
SET_CALLER = 'npwd:setCaller',
|
||||
SET_CALL_MODAL = 'npwd:callModal',
|
||||
SET_CALL_HISTORY = 'npwd:setCallHistory',
|
||||
ACTION_RESULT = 'npwd:callsActionResult',
|
||||
SEND_ALERT = 'npwd:callSetAlert',
|
||||
}
|
||||
+9
-1
@@ -17,12 +17,13 @@ interface MatchConfig {
|
||||
allowEditableProfileName: boolean;
|
||||
}
|
||||
interface Debug {
|
||||
level: 'error' | 'warn' | 'info' | 'verbose' | 'debug';
|
||||
level: 'error' | 'warn' | 'info' | 'verbose' | 'debug' | 'silly';
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
interface General {
|
||||
useDashNumber: boolean;
|
||||
enableMultiChar: boolean;
|
||||
}
|
||||
|
||||
interface NotificationConfig {
|
||||
@@ -34,7 +35,14 @@ interface BankConfig {
|
||||
showNotifications: boolean;
|
||||
}
|
||||
|
||||
|
||||
interface DatabaseConfig {
|
||||
playerTable: string;
|
||||
identifierColumn: string;
|
||||
}
|
||||
|
||||
export interface ResourceConfig {
|
||||
database: DatabaseConfig;
|
||||
Locale: string;
|
||||
KeyTogglePhone: number;
|
||||
KeyTakeCall: number;
|
||||
|
||||
+6
-2
@@ -11,13 +11,16 @@ export interface IContactAlert {
|
||||
setAlert: (type: string) => void;
|
||||
}
|
||||
|
||||
export interface Contact {
|
||||
id: number;
|
||||
export interface PreDBContact {
|
||||
display: string;
|
||||
number: string;
|
||||
avatar?: string;
|
||||
}
|
||||
|
||||
export interface Contact extends PreDBContact {
|
||||
id: number;
|
||||
}
|
||||
|
||||
export enum ContactEvents {
|
||||
SEND_CONTACTS = 'npwd:sendContacts',
|
||||
GET_CONTACTS = 'npwd:getContacts',
|
||||
@@ -29,4 +32,5 @@ export enum ContactEvents {
|
||||
UPDATE_CONTACT_SUCCESS = 'npwd:updateContactSuccess',
|
||||
ACTION_RESULT = 'npwd:contactActionResult',
|
||||
SEND_ALERT = 'npwd:contactSetAlert',
|
||||
MAIN_CLIENT_LISTER = 'npwd:contactMainListener',
|
||||
}
|
||||
@@ -23,6 +23,38 @@ export interface MessageGroup {
|
||||
participants: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for the raw npwd_messages_groups row responses
|
||||
*/
|
||||
export interface UnformattedMessageGroup {
|
||||
group_id: string;
|
||||
user_identifier: string;
|
||||
participant_identifier: string;
|
||||
phone_number: string;
|
||||
label?: string;
|
||||
avatar?: string;
|
||||
display?: string;
|
||||
updatedAt: string;
|
||||
unreadCount: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to help consolidate raw npwd_messages_groups rows into
|
||||
* a mapping of a single message group
|
||||
*/
|
||||
export interface MessageGroupMapping {
|
||||
[groupId: string]: {
|
||||
user_identifier: string;
|
||||
// Participant displays
|
||||
participants: string[];
|
||||
phoneNumbers: string[];
|
||||
label?: string;
|
||||
avatar?: string;
|
||||
updatedAt: string;
|
||||
unreadCount: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface CreateMessageGroupResult {
|
||||
error?: boolean;
|
||||
phoneNumber?: string;
|
||||
|
||||
+11
-4
@@ -1,3 +1,5 @@
|
||||
import { IAlertProps } from './alerts';
|
||||
|
||||
export type AlertCategory =
|
||||
| 'NOTES_ADD_SUCCESS'
|
||||
| 'NOTES_ADD_FAILED'
|
||||
@@ -17,10 +19,6 @@ export interface Note {
|
||||
content: string;
|
||||
}
|
||||
|
||||
export interface NoteId {
|
||||
id: number;
|
||||
}
|
||||
|
||||
export enum NotesEvents {
|
||||
ADD_NOTE = 'npwd:addNote',
|
||||
FETCH_ALL_NOTES = 'npwd:fetchAllNotes',
|
||||
@@ -33,4 +31,13 @@ export enum NotesEvents {
|
||||
UPDATE_NOTE_FAILURE = 'npwd:updateNoteFailure',
|
||||
ACTION_RESULT = 'npwd:notesActionResult',
|
||||
SEND_ALERT = 'npwd:notesSetAlert',
|
||||
SERVER_RESP = 'npwd:notesServerResp',
|
||||
}
|
||||
|
||||
export interface NoteServerResponse<T = unknown> {
|
||||
alert?: IAlertProps;
|
||||
action: 'SEND' | 'UPDATE' | 'DELETE' | 'ADD';
|
||||
suceeded: boolean;
|
||||
refetch?: boolean;
|
||||
data?: T;
|
||||
}
|
||||
+23
-1
@@ -6,7 +6,7 @@ export enum PhoneEvents {
|
||||
OPEN_APP_CONTACTS = 'npwd:app:CONTACTS',
|
||||
OPEN_APP_BANK = 'npwd:app:BANK',
|
||||
OPEN_APP_NOTES = 'npwd:app:NOTES',
|
||||
OPEN_APP_LISTINGS = 'npwd:app:SELLOUT',
|
||||
OPEN_APP_LISTINGS = 'npwd:app:MARKETPLACE',
|
||||
OPEN_APP_CAMERA = 'npwd:app:CAMERA',
|
||||
OPEN_APP_DAILER = 'npwd:app:DIALER',
|
||||
OPEN_PHONE = 'npwd:open',
|
||||
@@ -20,3 +20,25 @@ export enum PhoneEvents {
|
||||
SET_TIME = 'npwd:setGameTime',
|
||||
SEND_CREDENTIALS = 'npwd:sendCredentials',
|
||||
}
|
||||
|
||||
// Used to standardize the server response
|
||||
export enum ErrorStringKeys {
|
||||
SERVER_ERROR = 'GENERAL_SERVER_ERROR',
|
||||
DELETE_FAILED = 'DELETE_FAILED',
|
||||
ADD_FAILED = 'ADD_FAILED',
|
||||
UPDATE_FAILED = 'UPDATED_FAILED',
|
||||
FETCH_FAILED = 'FETCH_FAILED',
|
||||
}
|
||||
|
||||
export interface FxServerRespError {
|
||||
errorCode: ErrorStringKeys;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface FxServerResponse {
|
||||
data?: unknown;
|
||||
action: string;
|
||||
status: 'success' | 'failure';
|
||||
app: string;
|
||||
error?: FxServerRespError;
|
||||
}
|
||||
Reference in new issue
Block a user