diff --git a/config.default.json b/config.default.json deleted file mode 100644 index 00fc7d7e8..000000000 --- a/config.default.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "PhoneAsItem": { - "enabled": false, - "exportResource": "my-core-resource", - "exportFunction": "myCheckerFunction" - }, - "customPhoneNumber": { - "enabled": false, - "exportResource": "number-generator-resource", - "exportFunction": "generateNumber" - }, - "general": { - "useResourceIntegration": false, - "toggleKey": "f1", - "toggleCommand": "phone", - "defaultLanguage": "en", - "showId": false - }, - "contacts": { - "frameworkPay": false, - "payResource": "my-core-resource", - "payFunction": "myCheckerFunction" - }, - "database": { - "useIdentifierPrefix": false, - "playerTable": "users", - "identifierColumn": "identifier", - "identifierType": "license", - "profileQueries": true, - "phoneNumberColumn": "phone_number" - }, - "images": { - "url": "https://api.fivemanage.com/api/image", - "type": "image", - "imageEncoding": "webp", - "contentType": "multipart/form-data", - "useContentType": false, - "authorizationHeader": "Authorization", - "authorizationPrefix": "", - "useAuthorization": true, - "returnedDataIndexes": ["url"] - }, - "imageSafety": { - "filterUnsafeImageUrls": true, - "embedUnsafeImages": false, - "embedUrl": "https://i.example.com/embed", - "safeImageUrls": [ - "i.imgur.com", - "i.file.glass", - "dropbox.com", - "c.tenor.com", - "discord.com", - "cdn.discordapp.com", - "media.discordapp.com", - "media.discordapp.net", - "upload.wikipedia.org", - "i.projecterror.dev", - "upcdn.io", - "i.fivemanage.com", - "api.fivemanage.com", - "r2.fivemanage.com" - ] - }, - "profanityFilter": { - "enabled": false, - "badWords": ["esx"] - }, - "twitter": { - "showNotifications": true, - "generateProfileNameFromUsers": true, - "allowEditableProfileName": true, - "allowDeleteTweets": true, - "allowReportTweets": true, - "allowRetweet": true, - "characterLimit": 160, - "newLineLimit": 10, - "enableAvatars": true, - "enableEmojis": true, - "enableImages": true, - "maxImages": 1, - "resultsLimit": 25 - }, - "match": { - "generateProfileNameFromUsers": true, - "allowEditableProfileName": true - }, - "marketplace": { - "persistListings": false - }, - "browser": { - "homepageUrl": "https://docs.projecterror.dev" - }, - "debug": { - "level": "error", - "enabled": true, - "sentryEnabled": true - }, - "defaultContacts": [], - "disabledApps": [], - "apps": [], - "voiceMessage": { - "enabled": false, - "authorizationHeader": "Authorization", - "url": "https://api.fivemange/api/audio", - "returnedDataIndexes": ["url"] - } -} diff --git a/config.json b/config.json deleted file mode 100644 index b607e25e9..000000000 --- a/config.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "PhoneAsItem": { - "enabled": false, - "exportResource": "my-core-resource", - "exportFunction": "myCheckerFunction" - }, - "customPhoneNumber": { - "enabled": false, - "exportResource": "number-generator-resource", - "exportFunction": "generateNumber" - }, - "general": { - "useResourceIntegration": false, - "toggleKey": "f1", - "toggleCommand": "phone", - "defaultLanguage": "en", - "showId": false, - "phoneNumberFormat": "/(\\d{3})(\\d{3})(\\d{4})/" - }, - "contacts": { - "frameworkPay": false, - "payResource": "my-core-resource", - "payFunction": "myCheckerFunction" - }, - "database": { - "useIdentifierPrefix": false, - "playerTable": "users", - "identifierColumn": "identifier", - "identifierType": "license", - "profileQueries": true, - "phoneNumberColumn": "phone_number" - }, - "images": { - "url": "https://api.fivemanage.com/api/image", - "type": "image", - "imageEncoding": "webp", - "contentType": "multipart/form-data", - "useContentType": false, - "authorizationHeader": "Authorization", - "authorizationPrefix": "", - "useAuthorization": true, - "returnedDataIndexes": ["url"] - }, - "imageSafety": { - "filterUnsafeImageUrls": true, - "embedUnsafeImages": false, - "embedUrl": "https://i.example.com/embed", - "safeImageUrls": [ - "i.imgur.com", - "i.file.glass", - "dropbox.com", - "c.tenor.com", - "discord.com", - "cdn.discordapp.com", - "media.discordapp.com", - "media.discordapp.net", - "upload.wikipedia.org", - "i.projecterror.dev", - "upcdn.io", - "i.fivemanage.com", - "api.fivemanage.com", - "r2.fivemanage.com" - ] - }, - "profanityFilter": { - "enabled": false, - "badWords": ["esx"] - }, - "twitter": { - "showNotifications": true, - "generateProfileNameFromUsers": true, - "allowEditableProfileName": true, - "allowDeleteTweets": true, - "allowReportTweets": true, - "allowRetweet": true, - "characterLimit": 160, - "newLineLimit": 10, - "enableAvatars": true, - "enableEmojis": true, - "enableImages": true, - "maxImages": 1, - "resultsLimit": 25 - }, - "match": { - "generateProfileNameFromUsers": true, - "allowEditableProfileName": true - }, - "marketplace": { - "persistListings": false - }, - "browser": { - "homepageUrl": "https://docs.fivemanage.com" - }, - "debug": { - "level": "error", - "enabled": true, - "sentryEnabled": true - }, - "defaultContacts": [], - "disabledApps": [], - "apps": [], - "voiceMessage": { - "enabled": false, - "authorizationHeader": "Authorization", - "url": "https://api.fivemanage/api/audio", - "returnedDataIndexes": ["url"] - } -} diff --git a/core/query/package.json b/core/query/package.json deleted file mode 100644 index 91c45b5e9..000000000 --- a/core/query/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "@core/query", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC" -} diff --git a/core/router/.eslintrc b/core/router/.eslintrc deleted file mode 100644 index 1303a451a..000000000 --- a/core/router/.eslintrc +++ /dev/null @@ -1,20 +0,0 @@ -{ - "root": true, - "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint"], - "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], - "rules": { - "no-undef": 0, - "@typescript-eslint/ban-types": [ - "error", - { - "types": { - "Function": false - } - } - ], - "@typescript-eslint/no-var-requires": 0, - "@typescript-eslint/no-explicit-any": 0, - "@typescript-eslint/explicit-module-boundary-types": 0 - } -} diff --git a/core/router/package.json b/core/router/package.json deleted file mode 100644 index a445ee43f..000000000 --- a/core/router/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@core/router", - "version": "1.0.0", - "description": "", - "main": "./dist/index.js", - "module": "./dist/index.mjs", - "types": "./dist/index.d.ts", - "scripts": { - "build": "tsup src/index.ts --format cjs,esm --dts --minify --clean --sourcemap" - }, - "keywords": [], - "author": "", - "license": "ISC", - "devDependencies": { - "@citizenfx/client": "^2.0.4170-1", - "@citizenfx/server": "2.0.7359-1", - "@types/node": "^20.11.7", - "@typescript-eslint/eslint-plugin": "^4.33.0", - "@typescript-eslint/parser": "^4.33.0", - "eslint": "^7.32.0", - "tsup": "^6.6.3", - "typescript": "^4.9.5" - } -} diff --git a/core/router/src/example.ts b/core/router/src/example.ts deleted file mode 100644 index 95d1f72cf..000000000 --- a/core/router/src/example.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { initRouter } from '.'; - -const t = initRouter.create(); -const router = t.router; - -const eventProcedure = t.eventProcedure; - -type PlayerData = { - playerId: number; - amount: number; -}; - -const playerRouter = router({ - giveMoney: eventProcedure('giveMoney', async (data: PlayerData) => { - console.log('Giving money to player: ', data.playerId, data.amount); - }), -}); - -const appRouter = router({ - player: playerRouter, -}); - -export type AppRouter = typeof appRouter; diff --git a/core/router/src/example_client.ts b/core/router/src/example_client.ts deleted file mode 100644 index feebe0847..000000000 --- a/core/router/src/example_client.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { createClient } from '.'; -import { AppRouter } from './example'; - -const client = createClient(); - -client.player.giveMoney.emit({ playerId: 1, amount: 100 }); -client.player.giveMoney.emitNet({ playerId: 1, amount: 100 }); diff --git a/core/router/src/index.ts b/core/router/src/index.ts deleted file mode 100644 index d00c75ab8..000000000 --- a/core/router/src/index.ts +++ /dev/null @@ -1,60 +0,0 @@ -type RouterFunction = (...args: any[]) => Promise; -type FunctionWithEmit = { - emit: T; - emitNet: T; -}; -type NestedRouter = Record>; -type RouterFunctions = Record | NestedRouter>; - -function createdFunctionWithEmit(fn: T): FunctionWithEmit { - return { - emit: ((...args: Parameters): Promise> => { - console.log('emit', args); - return fn(...args); - }) as T, - emitNet: ((...args: Parameters): Promise> => { - console.log('emitNet', args); - return fn(...args); - }) as T, - }; -} - -function eventProcedure(event: string, callback: T): FunctionWithEmit { - // uhh what to do here - onNet(event, callback); - return createdFunctionWithEmit(callback); -} - -function createRouter() { - return function (routes: T): T { - const processedRoutes: Partial = {}; - - for (const key in routes) { - const route = routes[key]; - if (typeof route === 'function') { - processedRoutes[key] = route; - } else { - Object.assign(processedRoutes, route); - } - } - - return processedRoutes as T; - }; -} - -class RouterBuilder { - create() { - return { - router: createRouter(), - eventProcedure: eventProcedure, - }; - } -} - -export const initRouter = new RouterBuilder(); - -export function createClient< - T extends Record Promise> | NestedRouter>, ->(): T { - return {} as T; -} diff --git a/core/router/tsconfig.json b/core/router/tsconfig.json deleted file mode 100644 index e770f7fa9..000000000 --- a/core/router/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "*": ["./types/*"], - "@shared/*": ["../../../shared/*"], - "@typings/*": ["../../../typings/*"] - }, - "outDir": "./", - "noImplicitAny": true, - "module": "commonjs", - "target": "ES2018", - "allowJs": false, - "lib": ["es2018"], - "types": ["@citizenfx/server", "@citizenfx/client", "@types/node"], - "moduleResolution": "node", - "sourceMap": true, - "resolveJsonModule": true, - "esModuleInterop": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true - }, - "include": ["./**/*", "../../shared/*"], - "exclude": ["**/node_modules"] -} diff --git a/examples/qbcore/ambulance_alert.lua b/examples/qbcore/ambulance_alert.lua deleted file mode 100644 index 842360234..000000000 --- a/examples/qbcore/ambulance_alert.lua +++ /dev/null @@ -1,22 +0,0 @@ -local QBCore = exports["qb-core"]:GetCoreObject() - -RegisterNetEvent("hospital:server:ambulanceAlert", function(text) - local src = source - local ped = GetPlayerPed(src) - local coords = GetEntityCoords(ped) - local players = QBCore.Functions.GetQBPlayers() - for _, v in pairs(players) do - if v.PlayerData.job.name == "ambulance" and v.PlayerData.job.onduty then - exports.npwd:emitMessage({ - senderNumber = "911", - targetNumber = v.PlayerData.charinfo.phone, - message = "Person is dead.", - embed = { - type = "location", - coords = { coords.x, coords.y, coords.z }, - phoneNumber = "911", - }, - }) - end - end -end) diff --git a/import.sql b/import.sql deleted file mode 100644 index ec28387aa..000000000 --- a/import.sql +++ /dev/null @@ -1,240 +0,0 @@ -# comment this out if your server has a different table/location for phone_number -# or if it already exists in the users table -# ALTER TABLE `users` ADD COLUMN `phone_number` VARCHAR(20) DEFAULT NULL; - -# if you already have the npwd_message table without `is_embed` and `embed`, run this query in your sql console -# ALTER TABLE npwd_messages ADD COLUMN `is_embed` tinyint(4) NOT NULL DEFAULT 0; -# ALTER TABLE npwd_messages ADD COLUMN `embed` varchar(512) NOT NULL DEFAULT ''; - -# ALTER TABLE npwd_calls ADD COLUMN `isAnonymous` tinyint(4) NOT NULL DEFAULT 0; - -#match voice messages update -# ALTER TABLE npwd_match_profiles ADD COLUMN `voiceMessage` varchar(512) DEFAULT NULL; - -CREATE TABLE IF NOT EXISTS `npwd_twitter_profiles` -( - `id` int NOT NULL AUTO_INCREMENT, - `profile_name` varchar(90) NOT NULL, - `identifier` varchar(48) NOT NULL COLLATE 'utf8mb4_general_ci', -# Default Profile avatar can be set here - `avatar_url` varchar(255) DEFAULT 'https://i.fivemanage.com/images/3ClWwmpwkFhL.png', - `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - UNIQUE KEY `profile_name_UNIQUE` (`profile_name`), - INDEX `identifier` (`identifier`) -); - -CREATE TABLE IF NOT EXISTS `npwd_phone_contacts` -( - `id` int(11) NOT NULL AUTO_INCREMENT, - `identifier` varchar(48) DEFAULT NULL COLLATE 'utf8mb4_general_ci', - `avatar` varchar(255) DEFAULT NULL, - `number` varchar(20) DEFAULT NULL, - `display` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`id`), - INDEX `identifier` (`identifier`) -); - -CREATE TABLE `npwd_twitter_tweets` -( - `id` INT(11) NOT NULL AUTO_INCREMENT, - `message` VARCHAR(1000) NOT NULL COLLATE 'utf8mb4_general_ci', - `createdAt` TIMESTAMP NOT NULL DEFAULT current_timestamp(), - `updatedAt` TIMESTAMP NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `likes` INT(11) NOT NULL DEFAULT '0', - `identifier` VARCHAR(48) NOT NULL COLLATE 'utf8mb4_general_ci', - `visible` TINYINT(4) NOT NULL DEFAULT '1', - `images` VARCHAR(1000) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', - `retweet` INT(11) NULL DEFAULT NULL, - `profile_id` INT(11) NOT NULL, - PRIMARY KEY (`id`) USING BTREE, - INDEX `npwd_twitter_tweets_npwd_twitter_profiles_id_fk` (`profile_id`) USING BTREE, - CONSTRAINT `npwd_twitter_tweets_npwd_twitter_profiles_id_fk` FOREIGN KEY (`profile_id`) REFERENCES `npwd_twitter_profiles` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT -); - -CREATE TABLE IF NOT EXISTS `npwd_twitter_likes` -( - `id` int NOT NULL AUTO_INCREMENT, - `profile_id` int NOT NULL, - `tweet_id` int NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `unique_combination` (`profile_id`, `tweet_id`), - KEY `profile_idx` (`profile_id`), - KEY `tweet_idx` (`tweet_id`), - CONSTRAINT `profile` FOREIGN KEY (`profile_id`) REFERENCES `npwd_twitter_profiles` (`id`), - CONSTRAINT `tweet` FOREIGN KEY (`tweet_id`) REFERENCES `npwd_twitter_tweets` (`id`) ON DELETE CASCADE -); - -CREATE TABLE IF NOT EXISTS `npwd_match_profiles` -( - `id` int NOT NULL AUTO_INCREMENT, - `identifier` varchar(48) NOT NULL COLLATE 'utf8mb4_general_ci', - `name` varchar(90) NOT NULL, - `image` varchar(255) NOT NULL, - `bio` varchar(512) DEFAULT NULL, - `location` varchar(45) DEFAULT NULL, - `job` varchar(45) DEFAULT NULL, - `tags` varchar(255) NOT NULL DEFAULT '', - `voiceMessage` varchar(512) DEFAULT NULL, - `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - UNIQUE KEY `identifier_UNIQUE` (`identifier`) -); - -CREATE TABLE IF NOT EXISTS `npwd_match_views` -( - `id` int NOT NULL AUTO_INCREMENT, - `identifier` varchar(48) NOT NULL COLLATE 'utf8mb4_general_ci', - `profile` int NOT NULL, - `liked` tinyint DEFAULT '0', - `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - KEY `match_profile_idx` (`profile`), - CONSTRAINT `match_profile` FOREIGN KEY (`profile`) REFERENCES `npwd_match_profiles` (`id`), - INDEX `identifier` (`identifier`) -); - -CREATE TABLE IF NOT EXISTS `npwd_notes` -( - `id` int(11) NOT NULL AUTO_INCREMENT, - `identifier` varchar(48) NOT NULL COLLATE 'utf8mb4_general_ci', - `title` varchar(255) NOT NULL, - `content` varchar(255) NOT NULL, - PRIMARY KEY (id), - INDEX `identifier` (`identifier`) -); - -CREATE TABLE IF NOT EXISTS `npwd_marketplace_listings` -( - `id` int(11) NOT NULL AUTO_INCREMENT, - `identifier` varchar(48) DEFAULT NULL COLLATE 'utf8mb4_general_ci', - `username` varchar(255) DEFAULT NULL, - `name` varchar(50) DEFAULT NULL, - `number` varchar(255) NOT NULL, - `title` varchar(255) DEFAULT NULL, - `url` varchar(255) DEFAULT NULL, - `description` varchar(255) NOT NULL, - `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `reported` tinyint NOT NULL DEFAULT 0, - PRIMARY KEY (id), - INDEX `identifier` (`identifier`) -); - -CREATE TABLE IF NOT EXISTS `npwd_twitter_reports` -( - `id` int NOT NULL AUTO_INCREMENT, - `profile_id` int NOT NULL, - `tweet_id` int NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `unique_combination` (`profile_id`, `tweet_id`), - KEY `profile_idx` (`profile_id`), - KEY `tweet_idx` (`tweet_id`), - CONSTRAINT `report_profile` FOREIGN KEY (`profile_id`) REFERENCES `npwd_twitter_profiles` (`id`), - CONSTRAINT `report_tweet` FOREIGN KEY (`tweet_id`) REFERENCES `npwd_twitter_tweets` (`id`) ON DELETE CASCADE -); - -CREATE TABLE IF NOT EXISTS `npwd_messages` -( - `id` int(11) NOT NULL AUTO_INCREMENT, - `message` varchar(512) NOT NULL COLLATE 'utf8mb4_general_ci', - `user_identifier` varchar(48) NOT NULL COLLATE 'utf8mb4_general_ci', - `conversation_id` varchar(512) NOT NULL, - `isRead` tinyint(4) NOT NULL DEFAULT 0, - `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP(), - `updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP, - `visible` tinyint(4) NOT NULL DEFAULT 1, - `author` varchar(255) NOT NULL, - `is_embed` tinyint(4) NOT NULL default 0, - `embed` varchar(512) NOT NULL DEFAULT '', - PRIMARY KEY (id), - INDEX `user_identifier` (`user_identifier`) -); - -CREATE TABLE `npwd_messages_conversations` -( - `id` INT(11) NOT NULL AUTO_INCREMENT, - `conversation_list` VARCHAR(225) NOT NULL COLLATE 'utf8mb4_general_ci', - `label` VARCHAR(60) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', - `createdAt` TIMESTAMP NOT NULL DEFAULT current_timestamp(), - `updatedAt` TIMESTAMP NOT NULL DEFAULT current_timestamp(), - `last_message_id` INT(11) NULL DEFAULT NULL, - `is_group_chat` TINYINT(4) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) USING BTREE -); - -CREATE TABLE `npwd_messages_participants` -( - `id` INT(11) NOT NULL AUTO_INCREMENT, - `conversation_id` INT(11) NOT NULL, - `participant` VARCHAR(225) NOT NULL COLLATE 'utf8mb4_general_ci', - `unread_count` INT(11) NULL DEFAULT '0', - PRIMARY KEY (`id`) USING BTREE, - INDEX `message_participants_npwd_messages_conversations_id_fk` (`conversation_id`) USING BTREE, - CONSTRAINT `message_participants_npwd_messages_conversations_id_fk` FOREIGN KEY (`conversation_id`) REFERENCES `npwd_messages_conversations` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT -); - -CREATE TABLE IF NOT EXISTS `npwd_calls` -( - `id` int(11) NOT NULL AUTO_INCREMENT, - `identifier` varchar(48) DEFAULT NULL COLLATE 'utf8mb4_general_ci', - `transmitter` varchar(255) NOT NULL, - `receiver` varchar(255) NOT NULL, - `is_accepted` tinyint(4) DEFAULT 0, - `isAnonymous` tinyint(4) NOT NULL DEFAULT 0, - `start` varchar(255) DEFAULT NULL, - end varchar(255) DEFAULT NULL, - PRIMARY KEY (id), - INDEX `identifier` (`identifier`) -); - -CREATE TABLE IF NOT EXISTS `npwd_phone_gallery` -( - `id` int(11) NOT NULL AUTO_INCREMENT, - `identifier` varchar(48) DEFAULT NULL COLLATE 'utf8mb4_general_ci', - `image` varchar(255) NOT NULL, - PRIMARY KEY (id), - INDEX `identifier` (`identifier`) -); - -CREATE TABLE `npwd_darkchat_channels` ( - `id` INT(11) NOT NULL AUTO_INCREMENT, - `channel_identifier` VARCHAR(191) NOT NULL COLLATE 'utf8mb4_general_ci', - `label` VARCHAR(255) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `darkchat_channels_channel_identifier_uindex` (`channel_identifier`) USING BTREE -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -AUTO_INCREMENT=20 -; - -CREATE TABLE `npwd_darkchat_channel_members` ( - `channel_id` INT(11) NOT NULL, - `user_identifier` VARCHAR(255) NOT NULL COLLATE 'utf8mb4_general_ci', - `is_owner` TINYINT(4) NOT NULL DEFAULT '0', - INDEX `npwd_darkchat_channel_members_npwd_darkchat_channels_id_fk` (`channel_id`) USING BTREE, - CONSTRAINT `npwd_darkchat_channel_members_npwd_darkchat_channels_id_fk` FOREIGN KEY (`channel_id`) REFERENCES `npwd_darkchat_channels` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -; - -CREATE TABLE `npwd_darkchat_messages` ( - `id` INT(11) NOT NULL AUTO_INCREMENT, - `channel_id` INT(11) NOT NULL, - `message` VARCHAR(255) NOT NULL COLLATE 'utf8mb4_general_ci', - `user_identifier` VARCHAR(255) NOT NULL COLLATE 'utf8mb4_general_ci', - `createdAt` TIMESTAMP NOT NULL DEFAULT current_timestamp(), - `is_image` TINYINT(4) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) USING BTREE, - INDEX `darkchat_messages_darkchat_channels_id_fk` (`channel_id`) USING BTREE, - CONSTRAINT `darkchat_messages_darkchat_channels_id_fk` FOREIGN KEY (`channel_id`) REFERENCES `npwd_darkchat_channels` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -AUTO_INCREMENT=31 -; diff --git a/shared/deepMergeObjects.ts b/shared/deepMergeObjects.ts deleted file mode 100644 index 7cc3d1037..000000000 --- a/shared/deepMergeObjects.ts +++ /dev/null @@ -1,21 +0,0 @@ -export function isObject(item: any): boolean { - return item && typeof item === 'object' && !Array.isArray(item); -} - -export function deepMergeObjects(target: any, ...sources: any): T { - if (!sources.length) return target; - const source = sources.shift(); - - if (isObject(target) && isObject(source)) { - for (const key in source) { - if (isObject(source[key])) { - if (!target[key]) Object.assign(target, { [key]: {} }); - deepMergeObjects(target[key], source[key]); - } else { - Object.assign(target, { [key]: source[key] }); - } - } - } - - return deepMergeObjects(target, ...sources); -} diff --git a/typings/alerts.ts b/typings/alerts.ts deleted file mode 100644 index aa090f3a5..000000000 --- a/typings/alerts.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface IAlertProps { - message: string; - type: 'success' | 'error' | 'info' | 'warning'; -} - -export enum AlertEvents { - PLAY_ALERT = 'npwd:playAlert', -} diff --git a/typings/audio.ts b/typings/audio.ts deleted file mode 100644 index 44f7f1c79..000000000 --- a/typings/audio.ts +++ /dev/null @@ -1,12 +0,0 @@ -export enum AudioEvents { - UPLOAD_AUDIO = 'npwd:audio:uploadAudio', -} - -export type AudioRequest = { - file: any; - size: number; -}; - -export type AudioResponse = { - url: string; -}; diff --git a/typings/bank.ts b/typings/bank.ts deleted file mode 100644 index 328ca9af3..000000000 --- a/typings/bank.ts +++ /dev/null @@ -1,32 +0,0 @@ -export interface IBankCredentials { - name: string; - balance: number; -} - -export interface Transfer { - id: number; - targetID: number; - source: string; - type: string; - transferAmount: number; - message: string; -} - -export interface ITransactions { - source: number; - type: string; - amount: number; -} - -export enum BankEvents { - ADD_TRANSFER = 'npwd:addTransfer', - ADD_TRANSFER_SUCCESS = 'npwd:addTransferSuccess', - FETCH_TRANSACTIONS = 'npwd:fetchAllTransactions', - SEND_TRANSFERS = 'npwd:sendTransfers', - TRANSACTION_ALERT = 'npwd:bankTransactionAlert', - TRANSACTION_NOTIFICATION = 'npwd:bankTransactionNotification', - SEND_CREDENTIALS = 'npwd:sendBankCredentials', - GET_CREDENTIALS = 'npwd:getBankCredentials', - SEND_ALERT = 'npwd:sendBankAlert', - SEND_NOTIFICATION = 'npwd:sendBankNotification', -} diff --git a/typings/call.ts b/typings/call.ts deleted file mode 100644 index 071248d0c..000000000 --- a/typings/call.ts +++ /dev/null @@ -1,106 +0,0 @@ -export interface ActiveCall { - is_accepted: boolean; - isTransmitter: boolean; - transmitter: string; - receiver: string; - channelId?: number; - isUnavailable?: boolean; - start?: string; - isAnonymous?: boolean; -} - -export interface InitializeCallDTO { - receiverNumber: string; - isAnonymous: boolean; -} - -export interface StartCallEventData { - transmitter: string; - receiver: string; - isTransmitter: boolean; - isUnavailable?: boolean; -} - -export interface EndCallDTO { - transmitterNumber: string; - isTransmitter: boolean; - isUnavailable: boolean; -} - -export interface TransmitterNumDTO { - transmitterNumber: string; -} - -export interface CallWasAcceptedEvent { - channelId: number; - currentCall: CallHistoryItem; - isTransmitter: boolean; -} - -export interface ActiveCallRaw { - identifier: string; - transmitter: string; - transmitterSource: number; - receiver: string; - receiverSource: number; - start: string; - is_accepted: boolean; - isAnonymous: boolean; -} - -export interface CallHistoryItem { - id?: number | string; - identifier?: string; - transmitter: string; - transmitterSource?: number; - receiver: string; - receiverSource?: number; - start: string; - end?: number; - is_accepted: boolean; - isAnonymous?: boolean; -} - -export enum CallRejectReasons { - DECLINED, - BUSY_LINE, -} - -export enum CallEvents { - INITIALIZE_CALL = 'npwd:beginCall', - START_CALL = 'npwd:startCall', - ACCEPT_CALL = 'npwd:acceptCall', - END_CALL = 'npwd:endCall', - WAS_ENDED = 'npwd:callEnded', - WAS_ACCEPTED = 'npwd:callAccepted', - REJECTED = 'npwd:rejectCall', - WAS_REJECTED = 'npwd:callRejected', - FETCH_CALLS = 'npwd:fetchCalls', - SET_CALL_INFO = 'npwd:setCaller', - SET_CALL_MODAL = 'npwd:callModal', - SEND_ALERT = 'npwd:callSetAlert', - SAVE_CALL = 'npwd:saveCall', - TOGGLE_MUTE_CALL = 'npwd:toggleMuteCall', -} - -export interface IncomingCallerCtx { - source: number; - number: string; - name: string; -} - -export interface OnCallExportCtx { - incomingCaller: IncomingCallerCtx; - receiverNumber: string - exit: () => void; - next: () => void; - reply: (msg: string) => void; - forward: (tgt: string) => void; -} - -export type CallMiddlewareInvokable = (ctx: OnCallExportCtx) => void; - -export enum OnCallStatus { - NEXT, - FORWARD -} \ No newline at end of file diff --git a/typings/common.ts b/typings/common.ts deleted file mode 100644 index d7d32bf32..000000000 --- a/typings/common.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface ServerPromiseResp { - errorMsg?: string; - status: 'ok' | 'error'; - data?: T; -} - -export type Spread = { [K in Exclude]: T1[K] } & T2; diff --git a/typings/config.ts b/typings/config.ts deleted file mode 100644 index d21e049cd..000000000 --- a/typings/config.ts +++ /dev/null @@ -1,143 +0,0 @@ -interface TwitterConfig { - showNotifications: boolean; - generateProfileNameFromUsers: boolean; - allowEditableProfileName: boolean; - allowDeleteTweets: boolean; - allowReportTweets: boolean; - allowRetweet: boolean; - characterLimit: number; - newLineLimit: number; - enableAvatars: boolean; - enableEmojis: boolean; - enableImages: boolean; - maxImages: number; - resultsLimit: number; -} - -interface MatchConfig { - generateProfileNameFromUsers: boolean; - allowEditableProfileName: boolean; -} - -interface MarketplaceConfig { - persistListings: boolean; -} - -interface Debug { - level: 'error' | 'warn' | 'info' | 'verbose' | 'debug' | 'silly'; - enabled: boolean; - sentryEnabled: true; -} - -interface General { - useResourceIntegration: boolean; - toggleKey: string; - toggleCommand: string; - defaultLanguage: string; - showId: boolean; - phoneNumberFormat: string; -} - -interface Contacts { - frameworkPay: boolean; - payResource: string; - payFunction: string; -} - -interface NotificationConfig { - horizontal: 'left' | 'center' | 'right'; - vertical: 'bottom' | 'top'; -} - -interface BankConfig { - showNotifications: boolean; -} - -interface DatabaseConfig { - playerTable: string; - identifierColumn: string; - identifierType: string; - useIdentifierPrefix: boolean; - profileQueries: boolean; - phoneNumberColumn: string; -} - -interface ImageSafety { - filterUnsafeImageUrls: boolean; - embedUnsafeImages: boolean; - embedUrl: string; - safeImageUrls: string[]; -} - -interface ImageConfig { - url: string; - type: string; - imageEncoding: 'png' | 'jpg' | 'webp'; - contentType: string; - useContentType: boolean; - useWebhook: boolean; - authorizationHeader: string; - authorizationPrefix: string; - useAuthorization: boolean; - returnedDataIndexes: Array; -} - -interface PhoneAsItemConfig { - enabled: boolean; - exportResource: string; - exportFunction: string; -} - -interface CustomNumberConfig { - enabled: boolean; - exportResource: string; - exportFunction: string; -} - -interface ProfanityFilter { - enabled: boolean; - badWords: string[]; -} - -interface VoiceMessageConfig { - enabled: boolean; - token: string; - url: string; - authorizationHeader: string; - authorizationPrefix: string; - returnedDataIndexes: Array; -} - -export interface DefaultContact { - display: string; - number: string; - avatar?: string; -} - -export interface BrowserConfig { - homepageUrl: string; -} - -export interface ResourceConfig { - database: DatabaseConfig; - Locale: string; - PhoneAsItem: PhoneAsItemConfig; - customPhoneNumber: CustomNumberConfig; - RunRate: number; - twitter: TwitterConfig; - match: MatchConfig; - marketplace: MarketplaceConfig; - bank: BankConfig; - notificationPosition: NotificationConfig; - defaultContacts: DefaultContact[]; - general: General; - browser: BrowserConfig; - debug: Debug; - images: ImageConfig; - imageSafety: ImageSafety; - disabledApps: string[]; - profanityFilter: ProfanityFilter; - apps: string[]; - voiceMessage: VoiceMessageConfig; - contacts: Contacts; -} diff --git a/typings/contact.ts b/typings/contact.ts deleted file mode 100644 index 554c7ca63..000000000 --- a/typings/contact.ts +++ /dev/null @@ -1,55 +0,0 @@ -export type AlertCategory = - | 'CONTACT_ADD_SUCCESS' - | 'CONTACT_ADD_FAILED' - | 'CONTACT_UPDATE_SUCCESS' - | 'CONTACT_UPDATE_FAILED' - | 'CONTACT_DELETE_SUCCESS' - | 'CONTACT_DELETE_FAILED'; - -export interface PreDBContact { - display: string; - number: string; - avatar?: string; -} - -export interface Contact extends PreDBContact { - id: number | string; -} - -export interface ContactPay { - number: string; - amount: number; -} - -export interface ContactDeleteDTO { - id: number; -} - -export enum ContactResp { - ADD_FAILED = 'CONTACT.FEEDBACK.ADD_FAILED', - UPDATE_FAILED = 'CONTACT.FEEDBACK.UPDATE_FAILED', - INVALID_HOST = 'GENERIC_INVALID_IMAGE_HOST', -} - -export enum ContactsDatabaseLimits { - avatar = 255, - number = 20, - display = 255, -} - -export enum ContactEvents { - PAY_CONTACT = 'npwd-contact-pay', - GET_CONTACTS = 'npwd-contact-getAll', - ADD_CONTACT = 'npwd-contact-add', - UPDATE_CONTACT = 'npwd:updateContact', - DELETE_CONTACT = 'npwd:deleteContact', - // Used to fill in information through an export event - ADD_CONTACT_EXPORT = 'npwd:addContactExport', - LOCAL_SHARE = 'npwd:localShareContact' -} - -export interface AddContactExportData { - name?: string; - number: string; - avatar?: string; -} diff --git a/typings/darkchat.ts b/typings/darkchat.ts deleted file mode 100644 index c494141b0..000000000 --- a/typings/darkchat.ts +++ /dev/null @@ -1,76 +0,0 @@ -export interface ChannelItemProps { - id: number; - label: string; - identifier: string; - lastMessage?: string; - owner?: string; -} - -// TODO: images -export interface RawChannelMessageProps { - id: number; - message: string; - identifier: string; - createdAt: string; -} - -export interface ChannelMessageProps { - id: number; - message: string; - identifier: string; - createdAt: number; - isMine: boolean; - channelId?: number; - isImage: boolean; -} - -export type JoinChannelDTO = { - channelIdentifier: string; - label?: string; -}; - -export type MessageDTO = { - channelId: number; - phoneNumber: string; - message: string; - type: string; -}; - -export type ChannelMember = { - isOwner?: boolean; - channelId: number; - identifier: string; - phoneNumber?: string; -}; - -export type OwnerTransferReq = { - userIdentifier: string; - channelId: number; - newOwnerPhoneNumber; -}; - -export type OwnerTransferResp = { - ownerPhoneNumber: string; - channelId: number; -}; - -export type UpdateLabelDto = { - channelId: number; - label: string; -}; - -export enum DarkchatEvents { - ADD_CHANNEL = 'npwd:darkchatAddChannel', - LEAVE_CHANNEL = 'npwd:darkchatLeaveChannel', - DELETE_CHANNEL = 'npwd:darkchatDeleteChannel', - DELETE_CHANNEL_SUCCESS = 'npwd:darkchatDeleteChannelSuccess', - FETCH_MEMBERS = 'npwd:darkchatFetchMembers', - TRANSFER_OWNERSHIP = 'npwd:darkchatTransferOwnership', - TRANSFER_OWNERSHIP_SUCCESS = 'npwd:darkchatTransferOwnershipSuccess', - FETCH_MESSAGES = 'npwd:darkchatFetchMessages', - FETCH_CHANNELS = 'npwd:darkchatFetchChannels', - BROADCAST_MESSAGE = 'npwd:darkchatBroadcastMessage', - BROADCAST_LABEL_UPDATE = 'npwd:darkchatBroadcastLabelUpdate', - SEND_MESSAGE = 'npwd:darkchatSendMessage', - UPDATE_CHANNEL_LABEL = 'npwd:darkchatUpdateChannelLabel', -} diff --git a/typings/index.ts b/typings/index.ts deleted file mode 100644 index 04210eb4d..000000000 --- a/typings/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -export * from './alerts'; -export * from './bank'; -export * from './call'; -export * from './common'; -export * from './config'; -export * from './contact'; -export * from './marketplace'; -export * from './match'; -export * from './messages'; -export * from './notes'; -export * from './phone'; -export * from './photo'; -export * from './settings'; -export * from './twitter'; diff --git a/typings/marketplace.ts b/typings/marketplace.ts deleted file mode 100644 index f353dd20a..000000000 --- a/typings/marketplace.ts +++ /dev/null @@ -1,54 +0,0 @@ -export interface MarketplaceListing extends MarketplaceListingBase { - id: number; - identifier?: string; - username: string; - name: string; - number: string; -} - -export interface MarketplaceListingBase { - title: string; - url: string; - description: string; -} - -export enum MarketplaceDatabaseLimits { - title = 255, - description = 255, - url = 255, -} - -export enum MarketplaceResp { - CREATE_FAILED = "MARKETPLACE.FEEDBACK.CREATE_LISTING_FAILED", - DUPLICATE = "MARKETPLACE.FEEDBACK.DUPLICATE_LISTING", - INVALID_IMAGE_HOST = "GENERIC_INVALID_IMAGE_HOST", -} - -export enum MarketplaceEvents { - ADD_LISTING = "npwd:addListing", - FETCH_LISTING = "npwd:fetchAllListings", - DELETE_LISTING = "npwd:marketplaceDeleteListing", - DELETE_LISTINGS_ON_DROP = "npwd:marketplaceDeleteListingsOnDrop", - REPORT_LISTING = "npwd:reportListing", - BROADCAST_ADD = "npwd:sendMarketplaceBroadcastAdd", - BROADCAST_DELETE = "npwd:sendMarketplaceBroadcastDelete", -} - -export interface MarketplaceBroadcastAddDTO { - listing: MarketplaceListing; -} - -export interface MarketplaceDeleteDTO { - id: number; -} - -export interface MarketplaceReportDTO { - id: number; -} - -export type ReportListingDTO = { - id: number; - title: string; - description: string; - url: string; -}; diff --git a/typings/match.ts b/typings/match.ts deleted file mode 100644 index f35876739..000000000 --- a/typings/match.ts +++ /dev/null @@ -1,57 +0,0 @@ -export interface NewProfile { - name: string; - image: string; - bio: string; - job: string; - location: string; - tags: string; - voiceMessage?: string | null; -} - -export interface Profile extends NewProfile { - id: number; - identifier: string; - phoneNumber: string; - viewed: boolean; - createdAt: number; - updatedAt: number; - lastActive: number; -} - -export interface FormattedProfile extends Profile { - lastActiveFormatted: string; - tagList: string[]; -} - -export interface Match extends Profile { - matchedAt: number; -} - -export interface FormattedMatch extends FormattedProfile { - matchedAtFormatted: string; -} - -export interface Like { - id: number; // profile id - liked: boolean; -} - -export interface CreateMatchBroadcast { - name: string; -} - -export enum MatchResp { - UPDATE_FAILED = 'MATCH.FEEDBACK.UPDATE_PROFILE_FAILED', -} - -export enum MatchEvents { - INITIALIZE = 'phone:initializeMatch', - GET_PROFILES = 'phone:getMatchProfiles', - CREATE_MY_PROFILE = 'phone:createMyProfile', - GET_MY_PROFILE = 'phone:getMyProfile', - UPDATE_MY_PROFILE = 'phone:updateMyProfile', - GET_MATCHES = 'phone:getMatches', - SAVE_LIKES = 'phone:saveLikes', - SAVE_LIKES_BROADCAST = 'phone:saveLikesBroadcast', - CREATE_MATCH_ACCOUNT_BROADCAST = 'phone:matchAccountBroadcast', -} diff --git a/typings/messages.ts b/typings/messages.ts deleted file mode 100644 index e4ce94c0e..000000000 --- a/typings/messages.ts +++ /dev/null @@ -1,160 +0,0 @@ -export interface Message { - id: number; - message: string; - conversation_id?: number; - author: string; - is_embed?: boolean; - embed?: any; - createdAt: number; -} - -export interface PreDBMessage { - conversationId: number; - conversationList: string; - tgtPhoneNumber: string; - sourcePhoneNumber?: string; - message?: string; - is_embed?: boolean; - embed?: any; -} - -export interface CreateMessageDTO { - userIdentifier: string; - authorPhoneNumber: string; - conversationId: number; - message: string; - is_embed: boolean; - embed: any; -} - -export interface MessageConversation { - id: number; - conversationList: string; - label: string; - participant?: string; - isGroupChat: boolean; - unread?: number; - unreadCount?: number; - updatedAt?: number; -} - -export interface PreDBConversation { - participants: string[]; - conversationLabel: string; - isGroupChat: boolean; -} - -export interface MessagesRequest { - conversationId: string; - page: number; -} - -export interface DeleteConversationRequest { - conversationsId: number[]; -} - -/** - * Used for the raw npwd_messages_groups row responses - */ -export interface UnformattedMessageConversation { - conversation_id: string; - user_identifier: string; - participant_identifier: string; - phone_number: string; - avatar?: string; - display?: string; - updatedAt?: string; - unread: 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; - duplicate?: boolean; - conversationId?: string; - mine?: boolean; - participant: string; - identifiers: string[]; - doesExist: UnformattedMessageConversation | null; -} - -export interface CreateMessageBroadcast { - message: string; - groupName: string; - groupId: string; -} - -export interface SetMessageRead { - groupId: string; -} - -export interface MessageConversationResponse { - conversation_id: number; - phoneNumber: string; - updatedAt: number; - conversationList: string; - label: string; -} - -export interface OnMessageExportCtx { - /** - * The incoming message object - */ - data: PreDBMessage; - - source: number; -} - -export interface EmitMessageExportCtx { - senderNumber: string; - targetNumber: string; - message: string; - embed?: any; -} - -export enum MessageEvents { - FETCH_MESSAGE_CONVERSATIONS = 'npwd:fetchMessageGroups', - FETCH_MESSAGE_GROUPS_SUCCESS = 'npwd:fetchMessageGroupsSuccess', - FETCH_MESSAGE_GROUPS_FAILED = 'npwd:fetchMessageGroupsFailed', - CREATE_MESSAGE_CONVERSATION = 'npwd:createMessageGroup', - CREATE_MESSAGE_CONVERSATION_SUCCESS = 'npwd:createMessageConversationSuccess', - CREATE_MESSAGE_GROUP_SUCCESS = 'npwd:createMessageGroupSuccess', - CREATE_MESSAGE_GROUP_FAILED = 'npwd:createMessageGroupFailed', - SEND_MESSAGE = 'npwd:sendMessage', - SEND_EMBED_MESSAGE = 'npwd:sendEmbedMessage', - SEND_MESSAGE_SUCCESS = 'npwd:sendMessageSuccess', - SEND_MESSAGE_FAILED = 'npwd:sendMessageFailed', - DELETE_MESSAGE = 'npwd:deleteMessage', - FETCH_MESSAGES = 'npwd:fetchMessages', - FETCH_MESSAGES_SUCCESS = 'npwd:fetchMessagesSuccess', - FETCH_MESSAGES_FAILED = 'npwd:fetchMessagesFailed', - FETCH_INITIAL_MESSAGES = 'npwd:fetchInitialMessages', - ACTION_RESULT = 'npwd:setMessagesAlert', - CREATE_MESSAGE_BROADCAST = 'npwd:createMessagesBroadcast', - SET_MESSAGE_READ = 'npwd:setReadMessages', - DELETE_CONVERSATION = 'nwpd:deleteConversation', - GET_MESSAGE_LOCATION = 'npwd:getMessageLocation', - MESSAGES_SET_WAYPOINT = 'npwd:setWaypoint', -} - -export interface Location { - phoneNumber: string; - coords: number[]; -} diff --git a/typings/notes.ts b/typings/notes.ts deleted file mode 100644 index c6bce9f19..000000000 --- a/typings/notes.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { IAlertProps } from './alerts'; - -export type NotesAlertCategory = - | 'NOTES_ADD_SUCCESS' - | 'NOTES_ADD_FAILED' - | 'NOTES_UPDATE_SUCCESS' - | 'NOTES_UPDATE_FAILED' - | 'NOTES_DELETE_SUCCESS' - | 'NOTES_DELETE_FAILED'; - -export interface INotesAlert { - alert: NotesAlertCategory; - setAlert: (type: NotesAlertCategory) => void; -} - -export interface BeforeDBNote { - title: string; - content: string; -} - -export interface NoteItem extends BeforeDBNote { - id: number; - title: string; - content: string; -} - -export interface DeleteNoteDTO { - id: number; -} - -export enum NotesEvents { - ADD_NOTE = 'npwd:addNote', - FETCH_ALL_NOTES = 'npwd:fetchAllNotes', - DELETE_NOTE = 'npwd:deleteNote', - UPDATE_NOTE = 'npwd:updateNote', - ADD_NOTE_EXPORT = 'npwd:addNoteExport', -} - -export interface AddNoteExportData { - title?: string; - content?: string; -} diff --git a/typings/notifications.ts b/typings/notifications.ts deleted file mode 100644 index 4e7bc6b65..000000000 --- a/typings/notifications.ts +++ /dev/null @@ -1,46 +0,0 @@ -export enum NotificationEvents { - CREATE_NOTIFICATION = 'npwd:createNotification', - REMOVE_NOTIFICATOIN = 'npwd:removeNotification', - CREATE_SYSTEM_NOTIFICATION = 'npwd:createSystemNotification', - REMOVE_SYSTEM_NOTIFICATION = 'npwd:removeSystemNotification', -} - -export type NPWDNotification = { - appId: string; - secondaryTitle?: string; - content: HTMLElement | string; - path?: string; - onClick?: () => void; - isRead: boolean; - isActive: boolean; - keepOpen: boolean; - duration: number; - id: string; -}; - -export type UnreadNotificationBarProps = { - id: string; - appId: string; -}; - -export type CreateNotificationDTO = { - appId: string; - content: string; - secondaryTitle: string; - duration: number; - keepOpen: boolean; - path: string; - notisId: string; - onClick: () => void | null; -}; - -export type SystemNotificationDTO = { - uniqId: string; - content: string; - secondaryTitle: string; - keepOpen: boolean; - duration: number; - onConfirm?: () => void; - onCancel?: () => void; - controls?: boolean; -}; diff --git a/typings/phone.ts b/typings/phone.ts deleted file mode 100644 index 998f43b88..000000000 --- a/typings/phone.ts +++ /dev/null @@ -1,49 +0,0 @@ -export const PHONE_NUMBER_REGEX = /^([0-9]{3}-[0-9]{4})|([0-9]{7})$/; -export interface ScriptMessage { - method: string; - app: string; - data: T; -} - -export enum PhoneEvents { - OPEN_APP = 'npwd:openApp', - OPEN_PHONE = 'npwd:open', - CLOSE_PHONE = 'npwd:close', - UNLOAD_CHARACTER = 'npwd:unloadCharacter', - SET_VISIBILITY = 'npwd:setVisibility', - ADD_SNACKBAR_ALERT = 'npwd:setSnackarAlert', - SET_NUMBER = 'npwd:setNumber', - SET_PHONE_READY = 'npwd:phoneReady', - SET_CONFIG = 'npwd:setPhoneConfig', - SET_TIME = 'npwd:setGameTime', - SEND_CREDENTIALS = 'npwd:sendCredentials', - FETCH_CREDENTIALS = 'npwd:getCredentials', - TOGGLE_KEYS = 'npwd:toggleAllControls', - SET_PLAYER_LOADED = 'npwd:setPlayerLoaded', - IS_PHONE_DISABLED = 'npwd:isPhoneDisabled', - SEND_PLAYER_SOURCE = 'npwd:sendPlayerSource', - SEND_PLAYER_IDENTIFIER = 'npwd:sendPlayerIdentifier', - GET_PHONE_NUMBER = 'npwd:getPhoneNumber', -} - -// 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; -} diff --git a/typings/photo.ts b/typings/photo.ts deleted file mode 100644 index dee3983b0..000000000 --- a/typings/photo.ts +++ /dev/null @@ -1,23 +0,0 @@ -export interface GalleryPhoto { - image: string; - id: number; -} - -export enum PhotoResp { - GENERIC = 'CAMERA.FAILED_TO_TAKE_PHOTO', - INVALID_IMAGE_HOST = 'GENERIC_INVALID_IMAGE_HOST', -} - -export enum PhotoEvents { - TAKE_PHOTO = 'npwd:TakePhoto', - CAMERA_EXITED = 'npwd:cameraExited', - NPWD_PHOTO_MODE_STARTED = 'npwd:PhotoModeStarted', - NPWD_PHOTO_MODE_ENDED = 'npwd:PhotoModeEnded', - TAKE_PHOTO_SUCCESS = 'npwd:TakePhotoSuccess', - SAVE_IMAGE = 'npwd:saveImage', - UPLOAD_PHOTO = 'npwd:UploadPhoto', - FETCH_PHOTOS = 'npwd:FetchPhotos', - DELETE_PHOTO = 'npwd:deletePhoto', - DELETE_MULTIPLE_PHOTOS = 'npwd:deleteMultiplePhotos', - GET_AUTHORISATION_TOKEN = 'npwd:getAuthToken', -} diff --git a/typings/settings.ts b/typings/settings.ts deleted file mode 100644 index 4eff339e9..000000000 --- a/typings/settings.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { SETTING_MENTIONS, SETTINGS_ALL_TWEETS } from './twitter'; - -export interface IconSetObject { - custom: boolean; - name: string; -} - -export interface SettingOption { - label: string; - value: T | string | number; -} - -export enum KvpItems { - NPWD_RINGTONE = 'npwd-ringtone', - NPWD_NOTIFICATION = 'npwd-notification', - NPWD_FRAME = 'npwd-frame', -} - -export type IPhoneLocalStorage = { - [key: string]: IPhoneSettings; -}; - -export interface IPhoneSettings { - language: SettingOption; - iconSet: SettingOption; - wallpaper: SettingOption; - frame: SettingOption; - theme: SettingOption; - zoom: SettingOption; - streamerMode: boolean; - anonymousMode: boolean; - ringtone: SettingOption; - callVolume: number; - notiSound: SettingOption; - TWITTER_notiFilter: SettingOption; - TWITTER_notiSound: SettingOption; - TWITTER_notiSoundVol: number; - TWITTER_notifyNewFeedTweet: boolean; - MARKETPLACE_notifyNewListing: boolean; -} - -export enum SettingEvents { - NUI_SETTINGS_UPDATED = 'npwd:nuiSettingsUpdated', - PREVIEW_ALERT = 'npwd:previewAlert', - PREVIEW_RINGTONE = 'npwd:previewRingtone', -} diff --git a/typings/twitter.ts b/typings/twitter.ts deleted file mode 100644 index 88b6b19b5..000000000 --- a/typings/twitter.ts +++ /dev/null @@ -1,88 +0,0 @@ -export interface NewTweet { - message: string; - images?: string; - retweet?: number; -} - -export type SETTING_MENTIONS = 'mentions'; -export type SETTINGS_ALL_TWEETS = 'all'; - -export interface Tweet extends NewTweet { - profile_name: string; - profile_id: number; - id: number; - identifier: string; - isMine: boolean; - isLiked: boolean; - isReported: boolean; - avatar_url: string; - isRetweet: number | boolean; - likes: number; - isRetweetedByPlayer?: boolean; - retweetIdentifier: string; - retweetId: string; - seconds_since_tweet: number; - retweetProfileName: string; - retweetAvatarUrl: string; - createdAt: string; - updatedAt: string; -} - -export interface GetTweet extends NewTweet { - profile_name: string; - profile_id: number; - id: number; - identifier: string; - isMine: boolean; - isLiked: boolean; - isReported: boolean; - avatar_url: string; - isRetweet: number | boolean; - likes: number; - isRetweetedByPlayer?: boolean; - retweetIdentifier: string; - retweetId: string; - seconds_since_tweet: number; - retweetProfileName: string; - retweetAvatarUrl: string; - createdAt: string; - updatedAt: string; -} - -export interface Image { - id: string; - link: string; -} -export interface FormattedTweet extends Omit { - images: Image[]; -} - -export interface TwitterProfile { - id: number; - profile_name: string; - identifier: string; - avatar_url?: string; - createdAt: string; - updatedAt: string; -} - -export interface UpdateProfileProps { - avatar_url: string; - profile_name: string; -} - -export enum TwitterEvents { - FETCH_TWEETS = 'npwd:fetchTweets', - FETCH_TWEETS_FILTERED = 'npwd:fetchTweetsFiltered', - CREATE_PROFILE = 'npwd:createTwitterProfile', - GET_OR_CREATE_PROFILE = 'npwd:getOrCreateTwitterProfile', - UPDATE_PROFILE = 'npwd:updateTwitterProfile', - CREATE_TWEET = 'npwd:createTweet', - CREATE_TWEET_BROADCAST = 'createTweetBroadcast', - DELETE_TWEET = 'npwd:deleteTweet', - DELETE_TWEET_BROADCAST = 'npwd:deleteTweetBroadcast', - TOGGLE_LIKE = 'npwd:toggleLike', - RETWEET = 'npwd:retweet', - REPORT = 'npwd:reportTweet', - TWEET_LIKED_BROADCAST = 'npwd:tweetLikedBroadcast', -}