diff --git a/src/backend/common/database/drizzle/schema/schema.ts b/src/backend/common/database/drizzle/schema/schema.ts index d18598b3..e9a05e6f 100644 --- a/src/backend/common/database/drizzle/schema/schema.ts +++ b/src/backend/common/database/drizzle/schema/schema.ts @@ -2,12 +2,12 @@ import { integer, sqliteTable, text, index, uniqueIndex, customType, type AnySQL import { defineRelations } from 'drizzle-orm'; import dayjs, { type Dayjs } from "dayjs"; import { nanoid } from "nanoid"; -import { type ErrorLike, type PlayObject } from "../../../../../core/Atomic.js"; -import { asPlayCheap } from "../../../../../core/PlayMarshalUtils.js"; -import { type ExternalMetadataTerm, type PlayTransformPartsConfig, type SearchAndReplaceTerm } from "../../../infrastructure/Transform.js"; -import { type JobRangeCount, type JobRangeTime } from "../../../infrastructure/Job.js"; +import { type ErrorLike, type PlayObject } from "../../../../../core/Atomic.ts"; +import { asPlayCheap } from "../../../../../core/PlayMarshalUtils.ts"; +import { type ExternalMetadataTerm, type PlayTransformPartsConfig, type SearchAndReplaceTerm } from "../../../infrastructure/Transform.ts"; +import { type JobRangeCount, type JobRangeTime } from "../../../infrastructure/Job.ts"; import { serializeError, deserializeError } from "serialize-error"; -import { generatePlayUid } from "../../../../../core/StringUtils.js"; +import { generatePlayUid } from "../../../../../core/StringUtils.ts"; const DayjsTimestamp = customType< { diff --git a/src/backend/common/infrastructure/Job.ts b/src/backend/common/infrastructure/Job.ts index 9d048704..4d35b60a 100644 --- a/src/backend/common/infrastructure/Job.ts +++ b/src/backend/common/infrastructure/Job.ts @@ -1,4 +1,4 @@ -import { type UnixTimestamp } from "../../../core/Atomic.js" +import { type UnixTimestamp } from "../../../core/Atomic.ts" export interface JobParameters { /** maximum number of results to get for the entire job */ diff --git a/src/backend/common/infrastructure/config/client/discord.ts b/src/backend/common/infrastructure/config/client/discord.ts index 17db740a..6ef5dbc9 100644 --- a/src/backend/common/infrastructure/config/client/discord.ts +++ b/src/backend/common/infrastructure/config/client/discord.ts @@ -1,6 +1,6 @@ import { ActivityType, StatusDisplayType } from "discord.js" -import { type CommonClientConfig, type CommonClientData } from "./index.js" -import { type ComponentType } from "../../../../../core/Atomic.js" +import { type CommonClientConfig, type CommonClientData } from "./index.ts" +import { type ComponentType } from "../../../../../core/Atomic.ts" export interface DiscordData { token?: string diff --git a/src/backend/common/infrastructure/config/client/koito.ts b/src/backend/common/infrastructure/config/client/koito.ts index 548d8016..f73fdfe6 100644 --- a/src/backend/common/infrastructure/config/client/koito.ts +++ b/src/backend/common/infrastructure/config/client/koito.ts @@ -1,6 +1,6 @@ -import { type ComponentType, type UnixTimestamp } from "../../../../../core/Atomic.js" -import { type RequestRetryOptions } from "../common.js" -import { type CommonClientConfig, type CommonClientData } from "./index.js" +import { type ComponentType, type UnixTimestamp } from "../../../../../core/Atomic.ts" +import { type RequestRetryOptions } from "../common.ts" +import { type CommonClientConfig, type CommonClientData } from "./index.ts" export interface ListensResponse { items: ListenObjectResponse[] diff --git a/src/backend/common/infrastructure/config/client/tealfm.ts b/src/backend/common/infrastructure/config/client/tealfm.ts index 24acdc4f..ee846256 100644 --- a/src/backend/common/infrastructure/config/client/tealfm.ts +++ b/src/backend/common/infrastructure/config/client/tealfm.ts @@ -1,7 +1,7 @@ -import { type ComponentType } from "../../../../../core/Atomic.js" -import { type RequestRetryOptions } from "../common.js" -import { type ATProtoAppData, type ATProtoUserIdentifierData } from "./atproto.js" -import { type CommonClientConfig, type CommonClientData, type CommonClientOptions } from "./index.js" +import { type ComponentType } from "../../../../../core/Atomic.ts" +import { type RequestRetryOptions } from "../common.ts" +import { type ATProtoAppData, type ATProtoUserIdentifierData } from "./atproto.ts" +import { type CommonClientConfig, type CommonClientData, type CommonClientOptions } from "./index.ts" export type TealData = RequestRetryOptions & ATProtoUserIdentifierData & Partial & { /** diff --git a/src/backend/common/infrastructure/config/source/tealfm.ts b/src/backend/common/infrastructure/config/source/tealfm.ts index 89f307a9..9315b642 100644 --- a/src/backend/common/infrastructure/config/source/tealfm.ts +++ b/src/backend/common/infrastructure/config/source/tealfm.ts @@ -1,6 +1,6 @@ -import { type TealData, type TealOptions } from "../client/tealfm.js" -import { type PollingOptions } from "../common.js" -import { type CommonSourceConfig, type CommonSourceData, type CommonSourceOptions } from "./index.js" +import { type TealData, type TealOptions } from "../client/tealfm.ts" +import { type PollingOptions } from "../common.ts" +import { type CommonSourceConfig, type CommonSourceData, type CommonSourceOptions } from "./index.ts" export interface TealSourceData extends TealData, CommonSourceData, PollingOptions { diff --git a/src/backend/scrobblers/ScrobbleClients.ts b/src/backend/scrobblers/ScrobbleClients.ts index 2afa17b0..9c904d70 100644 --- a/src/backend/scrobblers/ScrobbleClients.ts +++ b/src/backend/scrobblers/ScrobbleClients.ts @@ -444,35 +444,35 @@ ${sources.join('\n')}`); this.logger.debug({labels: [`${type} - ${name}`]}, `Constructing Client from ${source}`); switch (type) { case 'maloja': - const MalojaScrobbler = (await import('./MalojaScrobbler.js')).default; + const MalojaScrobbler = (await import('./MalojaScrobbler.ts')).default; newClient = new MalojaScrobbler(name, ({...clientConfig, data: d, options: compositeOptions} as unknown as MalojaClientConfig), this.emitter, this.logger); break; case 'lastfm': - const LastfmScrobbler = (await import('./LastfmScrobbler.js')).default; + const LastfmScrobbler = (await import('./LastfmScrobbler.ts')).default; newClient = new LastfmScrobbler(name, {...clientConfig, data: d, options: compositeOptions } as unknown as LastfmClientConfig, this.internalConfig, this.emitter, this.logger); break; case 'librefm': - const LibrefmScrobbler = (await import('./LibrefmScrobbler.js')).default; + const LibrefmScrobbler = (await import('./LibrefmScrobbler.ts')).default; newClient = new LibrefmScrobbler(name, {...clientConfig, data: d, options: compositeOptions } as unknown as LibrefmClientConfig, this.internalConfig, this.emitter, this.logger); break; case 'listenbrainz': - const ListenbrainzScrobbler = (await import('./ListenbrainzScrobbler.js')).default; + const ListenbrainzScrobbler = (await import('./ListenbrainzScrobbler.ts')).default; newClient = new ListenbrainzScrobbler(name, {...clientConfig, data: {configDir: this.internalConfig.configDir, ...d}, options: compositeOptions } as unknown as ListenBrainzClientConfig, {}, this.emitter, this.logger); break; case 'koito': - const KoitoScrobbler = (await import('./KoitoScrobbler.js')).default; + const KoitoScrobbler = (await import('./KoitoScrobbler.ts')).default; newClient = new KoitoScrobbler(name, {...clientConfig, data: {configDir: this.internalConfig.configDir, ...d}, options: compositeOptions } as unknown as KoitoClientConfig, {}, this.emitter, this.logger); break; case 'tealfm': - const TealScrobbler = (await import('./TealfmScrobbler.js')).default; + const TealScrobbler = (await import('./TealfmScrobbler.ts')).default; newClient = new TealScrobbler(name, {...clientConfig, data: d, options: compositeOptions} as unknown as TealClientConfig, this.internalConfig, this.emitter, this.logger); break; case 'rocksky': - const RockskyScrobbler = (await import('./RockskyScrobbler.js')).default; + const RockskyScrobbler = (await import('./RockskyScrobbler.ts')).default; newClient = new RockskyScrobbler(name, {...clientConfig, data: {configDir: this.internalConfig.configDir, ...d}, options: compositeOptions } as unknown as RockSkyClientConfig, this.internalConfig, this.emitter, this.logger); break; case 'discord': - const DiscordScrobbler = (await import('./DiscordScrobbler.js')).default; + const DiscordScrobbler = (await import('./DiscordScrobbler.ts')).default; newClient = new DiscordScrobbler(name, {...clientConfig, data: {configDir: this.internalConfig.configDir, ...d}, options: compositeOptions } as unknown as DiscordClientConfig, {}, this.emitter, this.logger); break; default: diff --git a/src/backend/sources/ScrobbleSources.ts b/src/backend/sources/ScrobbleSources.ts index c03324e6..e1816e43 100644 --- a/src/backend/sources/ScrobbleSources.ts +++ b/src/backend/sources/ScrobbleSources.ts @@ -990,125 +990,125 @@ export default class ScrobbleSources { let newSource: AbstractSource; switch (type) { case 'spotify': - const SpotifySource = (await import('./SpotifySource.js')).default; + const SpotifySource = (await import('./SpotifySource.ts')).default; newSource = new SpotifySource(name, compositeConfig as SpotifySourceConfig, this.internalConfig, this.emitter); break; case 'plex': - const PlexApiSource = (await import('./PlexApiSource.js')).default; + const PlexApiSource = (await import('./PlexApiSource.ts')).default; newSource = await new PlexApiSource(name, compositeConfig as PlexApiSourceConfig, this.internalConfig, this.emitter); break; case 'subsonic': - const {SubsonicSource} = (await import('./SubsonicSource.js')); + const {SubsonicSource} = (await import('./SubsonicSource.ts')); newSource = new SubsonicSource(name, compositeConfig as SubSonicSourceConfig, this.internalConfig, this.emitter); break; case 'jellyfin': - const JellyfinApiSource = (await import('./JellyfinApiSource.js')).default; + const JellyfinApiSource = (await import('./JellyfinApiSource.ts')).default; newSource = await new JellyfinApiSource(name, compositeConfig as JellyApiSourceConfig, this.internalConfig, this.emitter); break; case 'lastfm': - const LastfmSource = (await import('./LastfmSource.js')).default; + const LastfmSource = (await import('./LastfmSource.ts')).default; newSource = await new LastfmSource(name, compositeConfig as LastfmSourceConfig, this.internalConfig, this.emitter); break; case 'librefm': - const LibrefmSource = (await import('./LibrefmSource.js')).default; + const LibrefmSource = (await import('./LibrefmSource.ts')).default; newSource = await new LibrefmSource(name, compositeConfig as LibrefmSourceConfig, this.internalConfig, this.emitter); break; case 'deezer': const deezerConfig = compositeConfig as DeezerCompatConfig; if('arl' in deezerConfig.data && deezerConfig.data.arl !== undefined) { - const DeezerInternalSource = (await import('./DeezerInternalSource.js')).default; + const DeezerInternalSource = (await import('./DeezerInternalSource.ts')).default; newSource = await new DeezerInternalSource(name, compositeConfig as DeezerInternalSourceConfig, this.internalConfig, this.emitter); } else { - const DeezerSource = (await import('./DeezerSource.js')).default; + const DeezerSource = (await import('./DeezerSource.ts')).default; newSource = await new DeezerSource(name, compositeConfig as DeezerSourceConfig, this.internalConfig, this.emitter); } break; case 'ytmusic': - const YTMusicSource = (await import('./YTMusicSource.js')).default; + const YTMusicSource = (await import('./YTMusicSource.ts')).default; newSource = await new YTMusicSource(name, compositeConfig as YTMusicSourceConfig, this.internalConfig, this.emitter); break; case 'ymbridge': - const YandexMusicBridgeSource = (await import('./YandexMusicBridgeSource.js')).default; + const YandexMusicBridgeSource = (await import('./YandexMusicBridgeSource.ts')).default; newSource = await new YandexMusicBridgeSource(name, compositeConfig as YandexMusicBridgeSourceConfig, this.internalConfig, this.emitter); break; case 'mpris': - const {MPRISSource} = (await import('./MPRISSource.js')); + const {MPRISSource} = (await import('./MPRISSource.ts')); newSource = await new MPRISSource(name, compositeConfig as MPRISSourceConfig, this.internalConfig, this.emitter); break; case 'mopidy': - const {MopidySource} = (await import('./MopidySource.js')); + const {MopidySource} = (await import('./MopidySource.ts')); newSource = await new MopidySource(name, compositeConfig as MopidySourceConfig, this.internalConfig, this.emitter); break; case 'listenbrainz': - const ListenbrainzSource = (await import('./ListenbrainzSource.js')).default; + const ListenbrainzSource = (await import('./ListenbrainzSource.ts')).default; newSource = await new ListenbrainzSource(name, compositeConfig as ListenBrainzSourceConfig, this.internalConfig, this.emitter); break; case 'endpointlz': - const {EndpointListenbrainzSource} = (await import('./EndpointListenbrainzSource.js')); + const {EndpointListenbrainzSource} = (await import('./EndpointListenbrainzSource.ts')); newSource = await new EndpointListenbrainzSource(name, compositeConfig as ListenbrainzEndpointSourceConfig, this.internalConfig, this.emitter); break; case 'endpointlfm': - const {EndpointLastfmSource} = (await import('./EndpointLastfmSource.js')); + const {EndpointLastfmSource} = (await import('./EndpointLastfmSource.ts')); newSource = await new EndpointLastfmSource(name, compositeConfig as LastFMEndpointSourceConfig, this.internalConfig, this.emitter); break; case 'icecast': - const {IcecastSource} = (await import('./IcecastSource.js')); + const {IcecastSource} = (await import('./IcecastSource.ts')); newSource = await new IcecastSource(name, compositeConfig as IcecastSourceConfig, this.internalConfig, this.emitter); break; case 'jriver': - const {JRiverSource} = (await import('./JRiverSource.js')); + const {JRiverSource} = (await import('./JRiverSource.ts')); newSource = await new JRiverSource(name, compositeConfig as JRiverSourceConfig, this.internalConfig, this.emitter); break; case 'kodi': - const {KodiSource} = (await import('./KodiSource.js')); + const {KodiSource} = (await import('./KodiSource.ts')); newSource = await new KodiSource(name, compositeConfig as KodiSourceConfig, this.internalConfig, this.emitter); break; case 'webscrobbler': - const {WebScrobblerSource} = (await import('./WebScrobblerSource.js')); + const {WebScrobblerSource} = (await import('./WebScrobblerSource.ts')); newSource = await new WebScrobblerSource(name, compositeConfig as WebScrobblerSourceConfig, this.internalConfig, this.emitter); break; case 'chromecast': - const {ChromecastSource} = (await import('./ChromecastSource.js')); + const {ChromecastSource} = (await import('./ChromecastSource.ts')); newSource = await new ChromecastSource(name, compositeConfig as ChromecastSourceConfig, this.internalConfig, this.emitter); break; case 'musikcube': - const {MusikcubeSource} = (await import('./MusikcubeSource.js')); + const {MusikcubeSource} = (await import('./MusikcubeSource.ts')); newSource = await new MusikcubeSource(name, compositeConfig as MusikcubeSourceConfig, this.internalConfig, this.emitter); break; case 'musiccast': - const {MusicCastSource} = (await import('./MusicCastSource.js')); + const {MusicCastSource} = (await import('./MusicCastSource.ts')); newSource = await new MusicCastSource(name, compositeConfig as MusicCastSourceConfig, this.internalConfig, this.emitter); break; case 'mpd': - const {MPDSource} = (await import('./MPDSource.js')); + const {MPDSource} = (await import('./MPDSource.ts')); newSource = await new MPDSource(name, compositeConfig as MPDSourceConfig, this.internalConfig, this.emitter); break; case 'vlc': - const {VLCSource} = (await import('./VLCSource.js')); + const {VLCSource} = (await import('./VLCSource.ts')); newSource = await new VLCSource(name, compositeConfig as VLCSourceConfig, this.internalConfig, this.emitter); break; case 'azuracast': - const {AzuracastSource} = (await import('./AzuracastSource.js')); + const {AzuracastSource} = (await import('./AzuracastSource.ts')); newSource = await new AzuracastSource(name, compositeConfig as AzuracastSourceConfig, this.internalConfig, this.emitter); break; case 'koito': - const KoitoSource = (await import('./KoitoSource.js')).default; + const KoitoSource = (await import('./KoitoSource.ts')).default; newSource = await new KoitoSource(name, compositeConfig as KoitoSourceConfig, this.internalConfig, this.emitter); break; case 'maloja': - const MalojaSource = (await import('./MalojaSource.js')).default; + const MalojaSource = (await import('./MalojaSource.ts')).default; newSource = await new MalojaSource(name, compositeConfig as MalojaSourceConfig, this.internalConfig, this.emitter); break; case 'tealfm': - const TealfmSource = (await import('./TealfmSource.js')).default; + const TealfmSource = (await import('./TealfmSource.ts')).default; newSource = await new TealfmSource(name, compositeConfig as TealSourceConfig, this.internalConfig, this.emitter); break; case 'rocksky': - const RockskySource = (await import('./RockskySource.js')).default; + const RockskySource = (await import('./RockskySource.ts')).default; newSource = await new RockskySource(name, compositeConfig as RockskySourceConfig, this.internalConfig, this.emitter); break; case 'sonos': - const {SonosSource} = (await import('./SonosSource.js')); + const {SonosSource} = (await import('./SonosSource.ts')); newSource = await new SonosSource(name, compositeConfig as SonosSourceConfig, this.internalConfig, this.emitter); break; default: diff --git a/src/backend/utils/ValidationUtils.ts b/src/backend/utils/ValidationUtils.ts index aff0958d..e4c41cfb 100644 --- a/src/backend/utils/ValidationUtils.ts +++ b/src/backend/utils/ValidationUtils.ts @@ -83,8 +83,8 @@ export const validateJson = async (type: string, config: object, schemaIdenti let schemaFetchFunc; -const compiledPath = 'src/backend/utils/SchemaCompiledUtils.js', -dynamicPath = 'src/backend/utils/SchemaUtils.js'; +const compiledPath = 'src/backend/utils/SchemaCompiledUtils.ts', +dynamicPath = 'src/backend/utils/SchemaUtils.ts'; const getSchemaFunc = async () => { if(schemaFetchFunc !== undefined) { diff --git a/src/core/Api.ts b/src/core/Api.ts index 86c66091..579bd0aa 100644 --- a/src/core/Api.ts +++ b/src/core/Api.ts @@ -1,11 +1,11 @@ import type { PickKeys } from "ts-essentials" -import { type ComponentMinimalSelect } from "../backend/common/database/drizzle/drizzleTypes.js" -import { type ClientType } from "../backend/common/infrastructure/config/client/clients.js" -import { type SourceType } from "../backend/common/infrastructure/config/source/sources.js" -import { type ComponentType, type ErrorLike, type JsonPlayObject, type PlayState, type Replace, type SOURCE_SOT_TYPES, type SourcePlayerJson } from "./Atomic.js" +import { type ComponentMinimalSelect } from "../backend/common/database/drizzle/drizzleTypes.ts" +import { type ClientType } from "../backend/common/infrastructure/config/client/clients.ts" +import { type SourceType } from "../backend/common/infrastructure/config/source/sources.ts" +import { type ComponentType, type ErrorLike, type JsonPlayObject, type PlayState, type Replace, type SOURCE_SOT_TYPES, type SourcePlayerJson } from "./Atomic.ts" import { type Dayjs } from "dayjs" -import { INITIALIZING } from "../backend/common/infrastructure/Atomic.js" -import { type ErrorIsh } from "./ErrorUtils.js" +import { INITIALIZING } from "../backend/common/infrastructure/Atomic.ts" +import { type ErrorIsh } from "./ErrorUtils.ts" export interface PlayApiCommon { uid: string diff --git a/src/core/Atomic.ts b/src/core/Atomic.ts index 8438f4bb..43ac7b81 100644 --- a/src/core/Atomic.ts +++ b/src/core/Atomic.ts @@ -1,10 +1,10 @@ import type { LogDataPretty, LogLevel } from "@foxxmd/logging"; import type { Dayjs } from "dayjs"; -import type { AdditionalTrackInfoResponse } from "../backend/common/vendor/listenbrainz/interfaces.js"; +import type { AdditionalTrackInfoResponse } from "../backend/common/vendor/listenbrainz/interfaces.ts"; import type { Merge, RequiredKeys, StrictOmit } from "ts-essentials"; import type { ErrorObject } from "serialize-error"; -import type { PlayPlatformIdStr } from "../backend/common/infrastructure/Atomic.js"; -import type { FlowControlTerm, TransformHook } from "../backend/common/infrastructure/Transform.js"; +import type { PlayPlatformIdStr } from "../backend/common/infrastructure/Atomic.ts"; +import type { FlowControlTerm, TransformHook } from "../backend/common/infrastructure/Transform.ts"; import type { Changeset } from "json-diff-ts"; import type { IParseBaseOptions } from 'qs'; diff --git a/src/core/DataUtils.ts b/src/core/DataUtils.ts index a78fe781..d4bc238f 100644 --- a/src/core/DataUtils.ts +++ b/src/core/DataUtils.ts @@ -1,5 +1,5 @@ import { create as diffCreate } from "jsondiffpatch"; -import { type DeepReplaceValue, type numberFormatOptions, REGEX_ISO8601_LOOSE } from './Atomic.js'; +import { type DeepReplaceValue, type numberFormatOptions, REGEX_ISO8601_LOOSE } from './Atomic.ts'; import { diff, applyChangeset, type Changeset, type Options } from 'json-diff-ts'; // may want to return to this one day // but currently the jsondiffpatch formatter is the best console/ansi diff output for humans :( diff --git a/src/core/ErrorUtils.ts b/src/core/ErrorUtils.ts index 34776ef3..703e0e20 100644 --- a/src/core/ErrorUtils.ts +++ b/src/core/ErrorUtils.ts @@ -1,5 +1,5 @@ import { type MarkOptional } from "ts-essentials"; -import { truncateStringToLength } from "./StringUtils.js"; +import { truncateStringToLength } from "./StringUtils.ts"; import { type ErrorLike, isErrorLike } from 'serialize-error'; export type ErrorIsh = Error | MarkOptional; diff --git a/src/core/PlayMarshalUtils.ts b/src/core/PlayMarshalUtils.ts index ab82dd30..22a57bdd 100644 --- a/src/core/PlayMarshalUtils.ts +++ b/src/core/PlayMarshalUtils.ts @@ -1,13 +1,13 @@ import clone from 'clone'; import dayjs from 'dayjs'; import { Traverse, type TraverseContext } from 'neotraverse/modern'; -import { ListenRange } from '../backend/sources/PlayerState/ListenRange.js'; -import { type AmbPlayObject, type DateLike, type ErrorLike, type JsonPlayObject, type PlayObject, type PlayProgressAmb, REGEX_ISO8601_LOOSE, type Replace } from './Atomic.js'; -import { ListenProgressPositional, ListenProgressTS } from '../backend/sources/PlayerState/ListenProgress.js'; +import { ListenRange } from '../backend/sources/PlayerState/ListenRange.ts'; +import { type AmbPlayObject, type DateLike, type ErrorLike, type JsonPlayObject, type PlayObject, type PlayProgressAmb, REGEX_ISO8601_LOOSE, type Replace } from './Atomic.ts'; +import { ListenProgressPositional, ListenProgressTS } from '../backend/sources/PlayerState/ListenProgress.ts'; import type { DeepPick, ElementOf, MarkOptional, PickKeys } from 'ts-essentials'; -import { type PlaySelectWithQueueStates } from '../backend/common/database/drizzle/drizzleTypes.js'; +import { type PlaySelectWithQueueStates } from '../backend/common/database/drizzle/drizzleTypes.ts'; import { type ErrorObject, serializeError } from 'serialize-error'; -import { type PlayApiCommonDetailed } from './Api.js'; +import { type PlayApiCommonDetailed } from './Api.ts'; interface BlockPath { key: string, parent: string }; type BlockPaths = BlockPath[]; diff --git a/src/core/PlayTestUtils.ts b/src/core/PlayTestUtils.ts index 4dd459c0..1abb6065 100644 --- a/src/core/PlayTestUtils.ts +++ b/src/core/PlayTestUtils.ts @@ -5,18 +5,18 @@ import isBetween from "dayjs/plugin/isBetween.js"; import relativeTime from "dayjs/plugin/relativeTime.js"; import timezone from "dayjs/plugin/timezone.js"; import utc from "dayjs/plugin/utc.js"; -import { type ArtistCredit, type BrainzMeta, FEAT, JOINERS, JOINERS_FINAL, type JsonPlayObject, type MBID, type MissingMbidType, type ObjectPlayData, type PlayMeta, type PlayObject, type SourcePlayerObj } from "./Atomic.js"; -import { genGroupIdStr } from './PlayUtils.js'; -import { sortByNewestPlayDate } from './PlayUtils.js'; -import { CALCULATED_PLAYER_STATUSES, NO_DEVICE, NO_USER, type PlayerStateDataMaybePlay, type PlayPlatformId, REPORTED_PLAYER_STATUSES, SINGLE_USER_PLATFORM_ID } from '../backend/common/infrastructure/Atomic.js'; -import { arrayListAnd, artistNamesToCredits } from './StringUtils.js'; -import { findDelimiters } from "./StringUtils.js"; -import { type ListRecord } from '../backend/common/infrastructure/config/client/tealfm.js'; +import { type ArtistCredit, type BrainzMeta, FEAT, JOINERS, JOINERS_FINAL, type JsonPlayObject, type MBID, type MissingMbidType, type ObjectPlayData, type PlayMeta, type PlayObject, type SourcePlayerObj } from "./Atomic.ts"; +import { genGroupIdStr } from './PlayUtils.ts'; +import { sortByNewestPlayDate } from './PlayUtils.ts'; +import { CALCULATED_PLAYER_STATUSES, NO_DEVICE, NO_USER, type PlayerStateDataMaybePlay, type PlayPlatformId, REPORTED_PLAYER_STATUSES, SINGLE_USER_PLATFORM_ID } from '../backend/common/infrastructure/Atomic.ts'; +import { arrayListAnd, artistNamesToCredits } from './StringUtils.ts'; +import { findDelimiters } from "./StringUtils.ts"; +import { type ListRecord } from '../backend/common/infrastructure/config/client/tealfm.ts'; import { nanoid } from 'nanoid'; -import { type LastFMTrackObject } from '../backend/common/vendor/LastfmApiClient.js'; +import { type LastFMTrackObject } from '../backend/common/vendor/LastfmApiClient.ts'; import clone from 'clone'; -import { removeUndefinedKeys } from '../backend/utils.js'; -import { FmTealAlphaFeedPlay } from '../backend/common/vendor/teal/lexicons/index.js'; +import { removeUndefinedKeys } from '../backend/utils.ts'; +import { FmTealAlphaFeedPlay } from '../backend/common/vendor/teal/lexicons/index.ts'; dayjs.extend(utc) dayjs.extend(isBetween); diff --git a/src/core/PlayUtils.ts b/src/core/PlayUtils.ts index 7955c3df..be1f06af 100644 --- a/src/core/PlayUtils.ts +++ b/src/core/PlayUtils.ts @@ -1,5 +1,5 @@ -import { type PlayPlatformId } from "../backend/common/infrastructure/Atomic.js"; -import { type AmbPlayObject, type DateLike, type PlayObject, type PlayObjectMinimal } from "./Atomic.js"; +import { type PlayPlatformId } from "../backend/common/infrastructure/Atomic.ts"; +import { type AmbPlayObject, type DateLike, type PlayObject, type PlayObjectMinimal } from "./Atomic.ts"; import dayjs from "dayjs"; export const sortByNewestDate = (aPlayDate: DateLike, bPlayDate: DateLike) => { diff --git a/src/core/StringUtils.ts b/src/core/StringUtils.ts index 61b25c71..20ac0524 100644 --- a/src/core/StringUtils.ts +++ b/src/core/StringUtils.ts @@ -13,10 +13,10 @@ import { SCROBBLE_TS_SOC_START, type ScrobbleTsSOC, type TrackStringOptions -} from "./Atomic.js"; -import { DELIMETERS_REGEX, DELIMITERS } from "../backend/common/infrastructure/Atomic.js"; +} from "./Atomic.ts"; +import { DELIMETERS_REGEX, DELIMITERS } from "../backend/common/infrastructure/Atomic.ts"; import { parseRegexSingle } from "@foxxmd/regex-buddy-core"; -import { removeUndefinedKeys } from "../backend/utils.js"; +import { removeUndefinedKeys } from "../backend/utils.ts"; import { nanoid } from "nanoid"; dayjs.extend(utc) diff --git a/src/core/TimeUtils.ts b/src/core/TimeUtils.ts index 581085f5..29f3ec43 100644 --- a/src/core/TimeUtils.ts +++ b/src/core/TimeUtils.ts @@ -1,7 +1,7 @@ import dayjs, { type Dayjs } from "dayjs"; import isToday from 'dayjs/plugin/isToday.js'; -import { SHORT_CALENDAR_NOTZ_FORMAT, SHORT_TODAY_NOTZ_FORMAT } from "./Atomic.js"; -import { type Milliseconds } from "../backend/utils/TimeUtils.js"; +import { SHORT_CALENDAR_NOTZ_FORMAT, SHORT_TODAY_NOTZ_FORMAT } from "./Atomic.ts"; +import { type Milliseconds } from "../backend/utils/TimeUtils.ts"; dayjs.extend(isToday); diff --git a/src/core/tests/utils/apiFixtures.ts b/src/core/tests/utils/apiFixtures.ts index 6071091c..123cb3c7 100644 --- a/src/core/tests/utils/apiFixtures.ts +++ b/src/core/tests/utils/apiFixtures.ts @@ -1,20 +1,20 @@ import { faker } from "@faker-js/faker"; -import { type ComponentClientApi, type ComponentClientApiJson, type ComponentCommonApi, type ComponentCommonApiJson, type ComponentSourceApi, type ComponentSourceApiJson, type ComponentState, type PlayApiCommon, type PlayApiCommonDetailed, type PlayInputApi, type QueueStateApi } from "../../Api.js"; -import { CLIENT_INGRESS_QUEUE, type JsonPlayObject, type PlayObject, type PlayState, QUEUE_STATUSES, SOURCE_SOT, type SourcePlayerJson, sourceSotTypes } from "../../Atomic.js"; -import { generatePlay, normalizePlays } from "../../PlayTestUtils.js"; -import { generatePlayInput, generatePlayWithLifecycle, playWithLifecycleScrobble, randomPlayState } from "./fixtures.js"; -import { asJsonPlayObject } from "../../PlayMarshalUtils.js"; -import { generatePlayUid } from "../../StringUtils.js"; +import { type ComponentClientApi, type ComponentClientApiJson, type ComponentCommonApi, type ComponentCommonApiJson, type ComponentSourceApi, type ComponentSourceApiJson, type ComponentState, type PlayApiCommon, type PlayApiCommonDetailed, type PlayInputApi, type QueueStateApi } from "../../Api.ts"; +import { CLIENT_INGRESS_QUEUE, type JsonPlayObject, type PlayObject, type PlayState, QUEUE_STATUSES, SOURCE_SOT, type SourcePlayerJson, sourceSotTypes } from "../../Atomic.ts"; +import { generatePlay, normalizePlays } from "../../PlayTestUtils.ts"; +import { generatePlayInput, generatePlayWithLifecycle, playWithLifecycleScrobble, randomPlayState } from "./fixtures.ts"; +import { asJsonPlayObject } from "../../PlayMarshalUtils.ts"; +import { generatePlayUid } from "../../StringUtils.ts"; import dayjs, { type Dayjs } from "dayjs"; import { type ErrorLike } from "serialize-error"; import { nanoid } from "nanoid"; -import { isSourceType, type SourceType, sourceTypes } from "../../../backend/common/infrastructure/config/source/sources.js"; -import { type ClientType, clientTypes } from "../../../backend/common/infrastructure/config/client/clients.js"; -import { type ComponentSelect } from "../../../backend/common/database/drizzle/drizzleTypes.js"; -import { CALCULATED_PLAYER_STATUSES, isClientType, REPORTED_PLAYER_STATUSES } from "../../../backend/common/infrastructure/Atomic.js"; +import { isSourceType, type SourceType, sourceTypes } from "../../../backend/common/infrastructure/config/source/sources.ts"; +import { type ClientType, clientTypes } from "../../../backend/common/infrastructure/config/client/clients.ts"; +import { type ComponentSelect } from "../../../backend/common/database/drizzle/drizzleTypes.ts"; +import { CALCULATED_PLAYER_STATUSES, isClientType, REPORTED_PLAYER_STATUSES } from "../../../backend/common/infrastructure/Atomic.ts"; import { faMarker } from "@fortawesome/free-solid-svg-icons"; -import { generateArray } from "../../DataUtils.js"; -import { type ErrorIsh } from "../../ErrorUtils.js"; +import { generateArray } from "../../DataUtils.ts"; +import { type ErrorIsh } from "../../ErrorUtils.ts"; export const generatePlayApiCommon = (commonData: Partial & {play?: JsonPlayObject | PlayObject } = {}, ...playOpts: Parameters): PlayApiCommon => { let play: JsonPlayObject | PlayObject; diff --git a/src/core/tests/utils/fixtures.ts b/src/core/tests/utils/fixtures.ts index ad182232..b25d6351 100644 --- a/src/core/tests/utils/fixtures.ts +++ b/src/core/tests/utils/fixtures.ts @@ -1,16 +1,16 @@ import { Traverse } from 'neotraverse/modern'; import { faker } from '@faker-js/faker'; -import { type AmbPlayObject, type DateLike, type LifecycleInput, type LifecycleStep, type ObjectPlayData, PLAY_STATES, type PlayMeta, type PlayObject, type PlayOriginal, type PlayState, type ScrobbleResult } from '../../Atomic.js'; -import { generateBrainz, generateMbid, generatePlay, type GeneratePlayOpts, generatePlays } from '../../PlayTestUtils.js'; -import { statefulInvariantTransform } from '../../PlayUtils.js'; +import { type AmbPlayObject, type DateLike, type LifecycleInput, type LifecycleStep, type ObjectPlayData, PLAY_STATES, type PlayMeta, type PlayObject, type PlayOriginal, type PlayState, type ScrobbleResult } from '../../Atomic.ts'; +import { generateBrainz, generateMbid, generatePlay, type GeneratePlayOpts, generatePlays } from '../../PlayTestUtils.ts'; +import { statefulInvariantTransform } from '../../PlayUtils.ts'; import clone from 'clone'; -import { diffObjects } from '../../DataUtils.js'; -import { existingScrobble } from '../../../backend/utils/PlayComparisonUtils.js'; -import { UpstreamError } from '../../../backend/common/errors/UpstreamError.js'; -import { playToListenPayload } from '../../../backend/common/vendor/listenbrainz/lzUtils.js'; -import { mergeSimpleError, SimpleError, SkipTransformStageError, StagePrerequisiteError, StageTransformError } from '../../../backend/common/errors/MSErrors.js'; +import { diffObjects } from '../../DataUtils.ts'; +import { existingScrobble } from '../../../backend/utils/PlayComparisonUtils.ts'; +import { UpstreamError } from '../../../backend/common/errors/UpstreamError.ts'; +import { playToListenPayload } from '../../../backend/common/vendor/listenbrainz/lzUtils.ts'; +import { mergeSimpleError, SimpleError, SkipTransformStageError, StagePrerequisiteError, StageTransformError } from '../../../backend/common/errors/MSErrors.ts'; import dayjs, { type Dayjs } from 'dayjs'; -import { type TransformHook } from '../../../backend/common/infrastructure/Transform.js'; +import { type TransformHook } from '../../../backend/common/infrastructure/Transform.ts'; import { serializeError } from 'serialize-error'; export interface ScrobbleMatchOptions {