Skip to content

Commit

Permalink
ULMS-3167 Refactored api routes, removed deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkonst committed Jul 25, 2024
1 parent abebb19 commit 640c635
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 427 deletions.
55 changes: 0 additions & 55 deletions src/conference.js

This file was deleted.

196 changes: 0 additions & 196 deletions src/dispatcher.js

This file was deleted.

26 changes: 26 additions & 0 deletions src/error.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
/* eslint-disable max-classes-per-file, unicorn/prevent-abbreviations */
export class ApiError extends Error {
constructor(message, options) {
super(message, options)

const { is_transient: isTransient } = options || {}

this.name = 'ApiError'
this.isTransient = isTransient
}

/**
* Factory method for creating error instance
* @param payload {{ kind?: string, is_transient?: boolean }}
* @returns {ApiError}
*/
static fromPayload(payload) {
const { kind, is_transient: isTransient } = payload

return new ApiError(kind, { isTransient })
}

get kind() {
return this.message
}
}

export class MQTTClientError extends Error {
constructor(...args) {
super(...args)
Expand Down
44 changes: 0 additions & 44 deletions src/event.js

This file was deleted.

3 changes: 0 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
export { default as Backoff } from './backoff'
export { default as Broker } from './broker'
export { default as Conference } from './conference'
export { default as Dispatcher } from './dispatcher'
export { default as Event } from './event'
export { default as FVS } from './fvs'
export { default as FetchHttpClient } from './http-client'
export { MQTTClient, ReconnectingMQTTClient, defaultOptions } from './mqtt'
Expand Down
Loading

0 comments on commit 640c635

Please sign in to comment.