(v4.2) Open Discord Framework Update (Part 2)

Replaced all "Default" classes & types with ID mappings & improved types. Updated Interactive Setup CLI & certain events, renamed ODStat's to ODStatistics. Moved many classes, types & interfaces to the framework
This commit is contained in:
DJj123dj
2026-04-03 11:18:59 +02:00
parent f42b70d1b9
commit fa8bc0eb6c
79 changed files with 2044 additions and 5111 deletions
+88
View File
@@ -0,0 +1,88 @@
///////////////////////////////////////
//OPEN TICKET DATABASE MAPPINGS
///////////////////////////////////////
import * as api from "@open-discord-bots/framework/api"
import { ODTicketJson } from "../api/ticket"
import { ODOptionJson } from "../api/option"
/**## ODDatabaseManagerIdMappings `interface`
* A list of all available IDs in the default `ODDatabaseManager` class in `opendiscord`.
* It's used to generate typescript declarations for this class.
*/
export interface ODDatabaseManagerIdMappings extends api.ODDatabaseManagerIdConstraint {
"opendiscord:global":ODGlobalDatabase,
"opendiscord:stats":ODStatsDatabase,
"opendiscord:tickets":ODTicketsDatabase,
"opendiscord:users":ODUsersDatabase,
"opendiscord:options":ODOptionsDatabase,
}
/**## ODMappedDatabaseManager `class
* A special class with types for the Open Ticket `ODDatabaseManager` class.
*/
export class ODMappedDatabaseManager extends api.ODDatabaseManager<ODDatabaseManagerIdMappings> {}
/**## ODGlobalDatabase `class
* A special class with types for the Open Ticket `database/global.json` database file
*/
export class ODGlobalDatabase extends api.ODFormattedJsonDatabase<ODGlobalDatabaseIdMappings> {}
/**## ODStatsDatabase `class
* A special class with types for the Open Ticket `database/stats.json` database file
*/
export class ODStatsDatabase extends api.ODFormattedJsonDatabase {}
/**## ODTicketsDatabase `class
* A special class with types for the Open Ticket `database/tickets.json` database file
*/
export class ODTicketsDatabase extends api.ODFormattedJsonDatabase<ODTicketsDatabaseIdMappings> {}
/**## ODUsersDatabase `class
* A special class with types for the Open Ticket `database/users.json` database file
*/
export class ODUsersDatabase extends api.ODFormattedJsonDatabase<ODUsersDatabaseIdMappings> {}
/**## ODOptionsDatabase `class
* A special class with types for the Open Ticket `database/options.json` database file
*/
export class ODOptionsDatabase extends api.ODFormattedJsonDatabase<ODOptionsDatabaseIdMappings> {}
/////////////////////////////////////////
// DATABASE MAPPINGS, CATEGORIES & TYPES
/////////////////////////////////////////
/**## ODGlobalDatabaseIdMappings `interface`
* A list of all available IDs in the default `ODGlobalDatabase` class in `opendiscord`.
* It's used to generate typescript declarations for this class.
*/
export interface ODGlobalDatabaseIdMappings extends api.ODDatabaseIdConstraint {
"opendiscord:panel-message":string,
"opendiscord:panel-update":string,
"opendiscord:option-suffix-counter":number,
"opendiscord:option-suffix-history":string[],
"opendiscord:last-version":string
}
/**## ODTicketsDatabaseIdMappings `interface`
* A list of all available IDs in the default `ODTicketsDatabase` class in `opendiscord`.
* It's used to generate typescript declarations for this class.
*/
export interface ODTicketsDatabaseIdMappings extends api.ODDatabaseIdConstraint {
"opendiscord:ticket":ODTicketJson
}
/**## ODUsersDatabaseIdMappings `interface`
* A list of all available IDs in the default `ODUsersDatabase` class in `opendiscord`.
* It's used to generate typescript declarations for this class.
*/
export interface ODUsersDatabaseIdMappings extends api.ODDatabaseIdConstraint {
"opendiscord:blacklist":ODTicketJson
}
/**## ODOptionsDatabaseIdMappings `interface`
* A list of all available IDs in the default `ODOptionsDatabase` class in `opendiscord`.
* It's used to generate typescript declarations for this class.
*/
export interface ODOptionsDatabaseIdMappings extends api.ODDatabaseIdConstraint {
"opendiscord:used-option":ODOptionJson
}