2022-02-23 05:51:12 -08:00
|
|
|
/*
|
|
|
|
|
Mocks for the use cases.
|
|
|
|
|
*/
|
|
|
|
|
/* eslint-disable */
|
|
|
|
|
|
|
|
|
|
class UserUseCaseMock {
|
|
|
|
|
async createUser(userObj) {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async getAllUsers() {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async getUser(params) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async updateUser(existingUser, newData) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async deleteUser(user) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async authUser(login, passwd) {
|
|
|
|
|
return {
|
|
|
|
|
generateToken: () => {}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class EntryUseCaseMock {
|
|
|
|
|
async createEntry(userObj) {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Offer {
|
|
|
|
|
async createOffer() {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
2024-12-02 22:19:54 -04:00
|
|
|
async removeStaleOffers(){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
async removeDuplicateOffers(){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
async loadOffers(){
|
|
|
|
|
|
|
|
|
|
}
|
2025-09-13 14:36:27 -04:00
|
|
|
async listOffers() {
|
|
|
|
|
return []
|
|
|
|
|
}
|
|
|
|
|
async listNftOffers() {
|
|
|
|
|
return []
|
|
|
|
|
}
|
|
|
|
|
async listFungibleOffers() {
|
|
|
|
|
return []
|
|
|
|
|
}
|
|
|
|
|
async takeOffer() {
|
|
|
|
|
return []
|
|
|
|
|
}
|
|
|
|
|
async listOffersByAddress() {
|
|
|
|
|
return []
|
|
|
|
|
}
|
|
|
|
|
async flagOffer() {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
|
|
|
|
async acceptCounterOffer() {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
2022-02-23 05:51:12 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Order {
|
|
|
|
|
async createOrder() {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
2024-12-02 22:19:54 -04:00
|
|
|
async removeStaleOrders(){
|
2025-04-10 18:04:51 -07:00
|
|
|
return {}
|
|
|
|
|
}
|
2025-09-13 14:36:27 -04:00
|
|
|
async listOrders() {
|
|
|
|
|
return []
|
|
|
|
|
}
|
|
|
|
|
async deleteOrder() {
|
|
|
|
|
return 'testTxid'
|
|
|
|
|
}
|
2025-04-10 18:04:51 -07:00
|
|
|
}
|
2024-12-02 22:19:54 -04:00
|
|
|
|
2025-01-15 17:59:09 -04:00
|
|
|
class UsageUseCaseMock {
|
|
|
|
|
async cleanUsage() {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async getRestSummary() {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async getTopIps(params) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async getTopEndpoints(existingUser, newData) {
|
|
|
|
|
return true
|
2024-12-02 22:19:54 -04:00
|
|
|
}
|
2025-06-05 18:25:10 -07:00
|
|
|
|
|
|
|
|
async clearUsage() {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async saveUsage() {
|
|
|
|
|
return true
|
|
|
|
|
}
|
2022-02-23 05:51:12 -08:00
|
|
|
}
|
|
|
|
|
|
2025-09-13 14:36:27 -04:00
|
|
|
class SmAccountUseCaseMock {
|
|
|
|
|
async listAccounts() {
|
|
|
|
|
return []
|
|
|
|
|
}
|
|
|
|
|
async getAccountByNpub() {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
|
|
|
|
async getAccountByBchAddr() {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
|
|
|
|
async checkForNewSmAccounts() {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
async updateSmAccounts() {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-23 05:51:12 -08:00
|
|
|
class UseCasesMock {
|
|
|
|
|
constuctor(localConfig = {}) {
|
|
|
|
|
// this.user = new UserUseCaseMock(localConfig)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
user = new UserUseCaseMock()
|
|
|
|
|
entry = new EntryUseCaseMock()
|
|
|
|
|
offer = new Offer()
|
|
|
|
|
order = new Order()
|
2025-01-15 17:59:09 -04:00
|
|
|
usage = new UsageUseCaseMock()
|
2025-09-13 14:36:27 -04:00
|
|
|
smAccount = new SmAccountUseCaseMock()
|
2022-02-23 05:51:12 -08:00
|
|
|
}
|
|
|
|
|
|
2022-09-08 08:58:39 -07:00
|
|
|
export default UseCasesMock;
|