Skip to content

Commit

Permalink
fix: export EndpointClient class normally so it can be used directly …
Browse files Browse the repository at this point in the history
…outside SDK
  • Loading branch information
rossiam committed Jul 22, 2020
1 parent ff60429 commit be3c48d
Show file tree
Hide file tree
Showing 20 changed files with 22 additions and 20 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ module.exports = {
},
],
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/explicit-function-return-type': ['error', {
allowExpressions: true,
}],
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'no-use-before-define': 'off',
Expand Down
2 changes: 1 addition & 1 deletion src/endpoint-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface ItemsList {
}
}

export default class EndpointClient {
export class EndpointClient {
private logger: Logger

constructor(public readonly basePath: string, public readonly config: EndpointClientConfig) {
Expand Down
2 changes: 1 addition & 1 deletion src/endpoint.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import EndpointClient from './endpoint-client'
import { EndpointClient } from './endpoint-client'


export class Endpoint {
Expand Down
2 changes: 1 addition & 1 deletion src/endpoint/apps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import EndpointClient, {EndpointClientConfig, HttpClientParams} from '../endpoint-client'
import { EndpointClient, EndpointClientConfig, HttpClientParams } from '../endpoint-client'
import { Endpoint } from '../endpoint'
import { Count, IconImage, Owner, PrincipalType, Status, SuccessStatusValue } from '../types'

Expand Down
2 changes: 1 addition & 1 deletion src/endpoint/capabilities.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Endpoint } from '../endpoint'
import EndpointClient, { EndpointClientConfig, HttpClientParams } from '../endpoint-client'
import { EndpointClient, EndpointClientConfig, HttpClientParams } from '../endpoint-client'
import { Status, SuccessStatusValue } from '../types'


Expand Down
2 changes: 1 addition & 1 deletion src/endpoint/deviceprofiles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Endpoint } from '../endpoint'
import EndpointClient, { EndpointClientConfig } from '../endpoint-client'
import { EndpointClient, EndpointClientConfig } from '../endpoint-client'
import { Owner, Status, SuccessStatusValue } from '../types'
import { CapabilityReference } from './devices'

Expand Down
2 changes: 1 addition & 1 deletion src/endpoint/devices.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Endpoint } from '../endpoint'
import EndpointClient, { EndpointClientConfig, HttpClientParams } from '../endpoint-client'
import { EndpointClient, EndpointClientConfig, HttpClientParams } from '../endpoint-client'
import { ConfigEntry} from './installedapps'
import { Links, Status, SuccessStatusValue } from '../types'
import {PresentationDevicePresentation} from './presentation'
Expand Down
2 changes: 1 addition & 1 deletion src/endpoint/installedapps.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Endpoint } from '../endpoint'
import EndpointClient, { EndpointClientConfig, HttpClientParams } from '../endpoint-client'
import { EndpointClient, EndpointClientConfig, HttpClientParams } from '../endpoint-client'
import { Count, Owner, PrincipalType, Status, SuccessStatusValue } from '../types'


Expand Down
2 changes: 1 addition & 1 deletion src/endpoint/locations.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Endpoint } from '../endpoint'
import EndpointClient, { EndpointClientConfig } from '../endpoint-client'
import { EndpointClient, EndpointClientConfig } from '../endpoint-client'
import { Status, SuccessStatusValue } from '../types'


Expand Down
2 changes: 1 addition & 1 deletion src/endpoint/modes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Endpoint } from '../endpoint'
import EndpointClient, { EndpointClientConfig } from '../endpoint-client'
import { EndpointClient, EndpointClientConfig } from '../endpoint-client'
import { Status, SuccessStatusValue } from '../types'


Expand Down
2 changes: 1 addition & 1 deletion src/endpoint/notifications.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Endpoint } from '../endpoint'
import EndpointClient, {EndpointClientConfig} from '../endpoint-client'
import { EndpointClient, EndpointClientConfig } from '../endpoint-client'


export enum NotificationRequestType {
Expand Down
2 changes: 1 addition & 1 deletion src/endpoint/presentation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Endpoint } from '../endpoint'
import EndpointClient, { EndpointClientConfig, HttpClientParams } from '../endpoint-client'
import { EndpointClient, EndpointClientConfig, HttpClientParams } from '../endpoint-client'
import {
CapabilityVisibleCondition,
CapabilityLabeledState,
Expand Down
2 changes: 1 addition & 1 deletion src/endpoint/rooms.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Endpoint } from '../endpoint'
import EndpointClient, { EndpointClientConfig } from '../endpoint-client'
import { EndpointClient, EndpointClientConfig } from '../endpoint-client'
import { Status, SuccessStatusValue } from '../types'
import { Device } from './devices'

Expand Down
2 changes: 1 addition & 1 deletion src/endpoint/rules.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Endpoint } from '../endpoint'
import EndpointClient, { EndpointClientConfig } from '../endpoint-client'
import { EndpointClient, EndpointClientConfig } from '../endpoint-client'
import { SuccessStatusValue, Status } from '../types'


Expand Down
2 changes: 1 addition & 1 deletion src/endpoint/scenes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Endpoint } from '../endpoint'
import EndpointClient, { EndpointClientConfig, HttpClientParams } from '../endpoint-client'
import { EndpointClient, EndpointClientConfig, HttpClientParams } from '../endpoint-client'
import { Status } from '../types'


Expand Down
2 changes: 1 addition & 1 deletion src/endpoint/schedules.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {isString, isDate} from 'underscore'
import { Endpoint } from '../endpoint'
import EndpointClient, { EndpointClientConfig } from '../endpoint-client'
import { EndpointClient, EndpointClientConfig } from '../endpoint-client'
import { Status, SuccessStatusValue } from '../types'
import { ConfigEntry } from './installedapps'
import { Location } from './locations'
Expand Down
2 changes: 1 addition & 1 deletion src/endpoint/schema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Endpoint } from '../endpoint'
import EndpointClient, { EndpointClientConfig } from '../endpoint-client'
import { EndpointClient, EndpointClientConfig } from '../endpoint-client'
import { SuccessStatusValue, Status } from '../types'


Expand Down
2 changes: 1 addition & 1 deletion src/endpoint/services.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Endpoint } from '../endpoint'
import EndpointClient, { EndpointClientConfig } from '../endpoint-client'
import { EndpointClient, EndpointClientConfig } from '../endpoint-client'
import { SuccessStatusValue, Status } from '../types'


Expand Down
2 changes: 1 addition & 1 deletion src/endpoint/subscriptions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Endpoint } from '../endpoint'
import EndpointClient, { EndpointClientConfig } from '../endpoint-client'
import { EndpointClient, EndpointClientConfig } from '../endpoint-client'
import { Count } from '../types'
import { ConfigEntry } from './installedapps'

Expand Down
2 changes: 1 addition & 1 deletion test/unit/endpoint-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
RefreshTokenStore,
SequentialRefreshTokenAuthenticator,
} from '../../src'
import EndpointClient, { defaultSmartThingsURLProvider } from '../../src/endpoint-client'
import { defaultSmartThingsURLProvider, EndpointClient } from '../../src/endpoint-client'


class TokenStore implements RefreshTokenStore {
Expand Down

0 comments on commit be3c48d

Please sign in to comment.