Fix connection class imports

This commit is contained in:
Puyodead1 2023-08-06 22:56:13 -04:00
parent 033e2108e7
commit 5c8359ec45
No known key found for this signature in database
GPG Key ID: A4FA4FEC0DD353FC
16 changed files with 30 additions and 30 deletions

View File

@ -23,9 +23,9 @@ import {
ConnectionStore,
DiscordApiErrors,
FieldErrors,
RefreshableConnection,
} from "@spacebar/util";
import { Request, Response, Router } from "express";
import RefreshableConnection from "../../../../../../../util/connections/RefreshableConnection";
const router = Router();
// TODO: this route is only used for spotify, twitch, and youtube. (battlenet seems to be able to PUT, maybe others also)

View File

@ -22,9 +22,9 @@ import {
ConnectionCallbackSchema,
ConnectionLoader,
DiscordApiErrors,
Connection,
} from "@spacebar/util";
import wretch from "wretch";
import Connection from "../../util/connections/Connection";
import { BattleNetSettings } from "./BattleNetSettings";
interface BattleNetConnectionUser {
@ -33,10 +33,10 @@ interface BattleNetConnectionUser {
battletag: string;
}
interface BattleNetErrorResponse {
error: string;
error_description: string;
}
// interface BattleNetErrorResponse {
// error: string;
// error_description: string;
// }
export default class BattleNetConnection extends Connection {
public readonly id = "battlenet";

View File

@ -22,9 +22,9 @@ import {
ConnectionCallbackSchema,
ConnectionLoader,
DiscordApiErrors,
Connection,
} from "@spacebar/util";
import wretch from "wretch";
import Connection from "../../util/connections/Connection";
import { DiscordSettings } from "./DiscordSettings";
interface UserResponse {

View File

@ -22,9 +22,9 @@ import {
ConnectionCallbackSchema,
ConnectionLoader,
DiscordApiErrors,
Connection,
} from "@spacebar/util";
import wretch from "wretch";
import Connection from "../../util/connections/Connection";
import { EpicGamesSettings } from "./EpicGamesSettings";
export interface UserResponse {

View File

@ -22,9 +22,9 @@ import {
ConnectionCallbackSchema,
ConnectionLoader,
DiscordApiErrors,
Connection,
} from "@spacebar/util";
import wretch from "wretch";
import Connection from "../../util/connections/Connection";
import { FacebookSettings } from "./FacebookSettings";
export interface FacebookErrorResponse {

View File

@ -22,9 +22,9 @@ import {
ConnectionCallbackSchema,
ConnectionLoader,
DiscordApiErrors,
Connection,
} from "@spacebar/util";
import wretch from "wretch";
import Connection from "../../util/connections/Connection";
import { GitHubSettings } from "./GitHubSettings";
interface UserResponse {

View File

@ -22,9 +22,9 @@ import {
ConnectionCallbackSchema,
ConnectionLoader,
DiscordApiErrors,
Connection,
} from "@spacebar/util";
import wretch from "wretch";
import Connection from "../../util/connections/Connection";
import { RedditSettings } from "./RedditSettings";
export interface UserResponse {

View File

@ -22,9 +22,9 @@ import {
ConnectionCallbackSchema,
ConnectionLoader,
DiscordApiErrors,
RefreshableConnection,
} from "@spacebar/util";
import wretch from "wretch";
import RefreshableConnection from "../../util/connections/RefreshableConnection";
import { SpotifySettings } from "./SpotifySettings";
export interface UserResponse {

View File

@ -22,9 +22,9 @@ import {
ConnectionCallbackSchema,
ConnectionLoader,
DiscordApiErrors,
RefreshableConnection,
} from "@spacebar/util";
import wretch from "wretch";
import RefreshableConnection from "../../util/connections/RefreshableConnection";
import { TwitchSettings } from "./TwitchSettings";
interface TwitchConnectionUserResponse {

View File

@ -22,9 +22,9 @@ import {
ConnectionCallbackSchema,
ConnectionLoader,
DiscordApiErrors,
RefreshableConnection,
} from "@spacebar/util";
import wretch from "wretch";
import RefreshableConnection from "../../util/connections/RefreshableConnection";
import { TwitterSettings } from "./TwitterSettings";
interface TwitterUserResponse {
@ -40,10 +40,10 @@ interface TwitterUserResponse {
};
}
interface TwitterErrorResponse {
error: string;
error_description: string;
}
// interface TwitterErrorResponse {
// error: string;
// error_description: string;
// }
export default class TwitterConnection extends RefreshableConnection {
public readonly id = "twitter";

View File

@ -22,9 +22,9 @@ import {
ConnectionCallbackSchema,
ConnectionLoader,
DiscordApiErrors,
Connection,
} from "@spacebar/util";
import wretch from "wretch";
import Connection from "../../util/connections/Connection";
import { XboxSettings } from "./XboxSettings";
interface XboxUserResponse {
@ -44,10 +44,10 @@ interface XboxUserResponse {
};
}
interface XboxErrorResponse {
error: string;
error_description: string;
}
// interface XboxErrorResponse {
// error: string;
// error_description: string;
// }
export default class XboxConnection extends Connection {
public readonly id = "xbox";

View File

@ -22,9 +22,9 @@ import {
ConnectionCallbackSchema,
ConnectionLoader,
DiscordApiErrors,
Connection,
} from "@spacebar/util";
import wretch from "wretch";
import Connection from "../../util/connections/Connection";
import { YoutubeSettings } from "./YoutubeSettings";
interface YouTubeConnectionChannelListResult {

View File

@ -24,7 +24,7 @@ import { Config, DiscordApiErrors } from "../util";
/**
* A connection that can be used to connect to an external service.
*/
export default abstract class Connection {
export abstract class Connection {
id: string;
settings: { enabled: boolean };
states: Map<string, string> = new Map();

View File

@ -18,7 +18,7 @@
import fs from "fs";
import path from "path";
import Connection from "./Connection";
import { Connection } from "@spacebar/util";
import { ConnectionConfig } from "./ConnectionConfig";
import { ConnectionStore } from "./ConnectionStore";

View File

@ -16,8 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import Connection from "./Connection";
import RefreshableConnection from "./RefreshableConnection";
import { Connection } from "./Connection";
import { RefreshableConnection } from "./RefreshableConnection";
export class ConnectionStore {
public static connections: Map<string, Connection | RefreshableConnection> =

View File

@ -18,12 +18,12 @@
import { ConnectedAccount } from "../entities";
import { ConnectedAccountCommonOAuthTokenResponse } from "../interfaces";
import Connection from "./Connection";
import { Connection } from "./Connection";
/**
* A connection that can refresh its token.
*/
export default abstract class RefreshableConnection extends Connection {
export abstract class RefreshableConnection extends Connection {
refreshEnabled = true;
/**
* Refreshes the token for a connected account.