ttfm-socket 1.1.5-beta.0 → 1.2.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { Action, ParamsFrom } from "actionhero";
2
- import { ActionName, MiddlewareName } from "../types/names.js";
2
+ import { ActionName, MiddlewareName } from "../types/names";
3
3
  export declare class AddDjAction extends Action {
4
4
  name: ActionName.addDj;
5
5
  description: string;
@@ -1,5 +1,5 @@
1
1
  import { Action, ParamsFrom, Connection } from "actionhero";
2
- import { ActionName } from "../types/names.js";
2
+ import { ActionName } from "../types/names";
3
3
  export declare class JoinRoomAction extends Action {
4
4
  name: ActionName.joinRoom;
5
5
  description: string;
@@ -1,6 +1,6 @@
1
1
  import { Action, ParamsFrom } from "actionhero";
2
- import { ActionName, MiddlewareName } from "../types/names.js";
3
- import { OneTimeAnimationType } from "../types/messages.js";
2
+ import { ActionName, MiddlewareName } from "../types/names";
3
+ import { OneTimeAnimationType } from "../types/messages";
4
4
  export declare class PlayOneTimeAnimationAction extends Action {
5
5
  name: ActionName.playOneTimeAnimation;
6
6
  description: string;
@@ -1,6 +1,6 @@
1
1
  import { Action, ParamsFrom } from "actionhero";
2
- import { ActionName, MiddlewareName } from "../types/names.js";
3
- import { ServerRoomState } from "../types/state.js";
2
+ import { ActionName, MiddlewareName } from "../types/names";
3
+ import { ServerRoomState } from "../types/state";
4
4
  export declare class RemoveDjAction extends Action {
5
5
  name: ActionName.removeDj;
6
6
  description: string;
@@ -1,5 +1,5 @@
1
1
  import { Action, ParamsFrom } from "actionhero";
2
- import { ActionName, MiddlewareName } from "../types/names.js";
2
+ import { ActionName, MiddlewareName } from "../types/names";
3
3
  export declare class SkipSongAction extends Action {
4
4
  name: ActionName.skipSong;
5
5
  description: string;
@@ -1,5 +1,5 @@
1
1
  import { Action, ParamsFrom } from "actionhero";
2
- import { ActionName, MiddlewareName } from "../types/names.js";
2
+ import { ActionName, MiddlewareName } from "../types/names";
3
3
  export declare class UpdateNextSongAction extends Action {
4
4
  name: ActionName.updateNextSong;
5
5
  description: string;
@@ -1,6 +1,6 @@
1
1
  import { Action, ParamsFrom } from "actionhero";
2
- import { ActionName, MiddlewareName } from "../types/names.js";
3
- import { SongVotes } from "../types/state.js";
2
+ import { ActionName, MiddlewareName } from "../types/names";
3
+ import { SongVotesInput } from "../types/state";
4
4
  export declare class VoteOnSongAction extends Action {
5
5
  name: ActionName.voteOnSong;
6
6
  description: string;
@@ -13,8 +13,8 @@ export declare class VoteOnSongAction extends Action {
13
13
  };
14
14
  songVotes: {
15
15
  required: true;
16
- formatter: (voteParams: Partial<SongVotes>) => Partial<SongVotes>;
17
- validator: (songVotes: Partial<SongVotes>) => void;
16
+ formatter: (voteParams: Partial<SongVotesInput>) => Partial<SongVotesInput>;
17
+ validator: (songVotes: Partial<SongVotesInput>) => void;
18
18
  description: string;
19
19
  };
20
20
  };
@@ -3355,8 +3355,8 @@
3355
3355
  }
3356
3356
  };
3357
3357
  if (typeof Primus === 'undefined') {
3358
- var util = require('node:util');
3359
- var EventEmitter = require('node:events').EventEmitter;
3358
+ var util = require('util');
3359
+ var EventEmitter = require('events').EventEmitter;
3360
3360
  util.inherits(ActionheroWebsocketClient, EventEmitter);
3361
3361
  }
3362
3362
  else {
@@ -1,7 +1,7 @@
1
1
  import EventEmitter from "eventemitter3";
2
- import { ServerMessage, StatefulServerMessage, StatelessServerMessage, StatefulServerMessageNameType, StatelessServerMessageNameType, ExtractStatelessServerMessage } from "../types/messages.js";
3
- import { JoinRoomAction } from "../actions/joinRoom.js";
4
- import type { ParamsFrom, SimpleAction } from "./types.js";
2
+ import { ServerMessage, StatefulServerMessage, StatelessServerMessage, StatefulServerMessageNameType, StatelessServerMessageNameType, ExtractStatelessServerMessage } from "../types/messages";
3
+ import { JoinRoomAction } from "../actions/joinRoom";
4
+ import type { ParamsFrom, SimpleAction } from "./types";
5
5
  type ConnectionState = "connected" | "disconnected" | "reconnecting" | "timeout";
6
6
  type ClientActionParams<A extends SimpleAction> = Omit<ParamsFrom<A>, "roomUuid" | "userUuid" | "tokenRole">;
7
7
  type RequiredFieldsOnly<T> = {
@@ -1,14 +1,14 @@
1
- export { SocketClient } from "./SocketClient.js";
2
- export type { JoinRoomAction } from "../actions/joinRoom.js";
3
- export type { AddDjAction } from "../actions/addDj.js";
4
- export type { PlayOneTimeAnimationAction } from "../actions/playOneTimeAnimation.js";
5
- export type { RemoveDjAction } from "../actions/removeDj.js";
6
- export type { SkipSongAction } from "../actions/skipSong.js";
7
- export type { UpdateNextSongAction } from "../actions/updateNextSong.js";
8
- export type { VoteOnSongAction } from "../actions/voteOnSong.js";
9
- export { ActionName } from "../types/names.js";
10
- export * from "../types/messages.js";
11
- export * from "./types.js";
12
- export * from "../types/services.js";
13
- export type { AllClientUserData as AllUserData, AvatarPosition, ClientRoomState as RoomState, ClientDj as Dj, ClientRoomUser as RoomUser, ClientNowPlaying as NowPlaying, SongVotes, GhostUserProfile, VoteCounts, } from "../types/state.js";
14
- export { TokenRole } from "../types/services.js";
1
+ export { SocketClient } from "./SocketClient";
2
+ export type { JoinRoomAction } from "../actions/joinRoom";
3
+ export type { AddDjAction } from "../actions/addDj";
4
+ export type { PlayOneTimeAnimationAction } from "../actions/playOneTimeAnimation";
5
+ export type { RemoveDjAction } from "../actions/removeDj";
6
+ export type { SkipSongAction } from "../actions/skipSong";
7
+ export type { UpdateNextSongAction } from "../actions/updateNextSong";
8
+ export type { VoteOnSongAction } from "../actions/voteOnSong";
9
+ export { ActionName } from "../types/names";
10
+ export * from "../types/messages";
11
+ export * from "./types";
12
+ export * from "../types/services";
13
+ export type { AllClientUserData as AllUserData, AvatarPosition, ClientRoomState as RoomState, ClientDj as Dj, ClientRoomUser as RoomUser, ClientNowPlaying as NowPlaying, SongVotes, GhostUserProfile, VoteCounts, } from "../types/state";
14
+ export { TokenRole } from "../types/services";
@@ -1,4 +1,4 @@
1
- import { ActionName } from "../types/names.js";
1
+ import { ActionName } from "../types/names";
2
2
  type SimpleInput = {
3
3
  required?: boolean;
4
4
  formatter?: Function | string[] | Function[];
@@ -0,0 +1,31 @@
1
+ export interface BaseOperation {
2
+ path: string;
3
+ }
4
+ export interface AddOperation<T> extends BaseOperation {
5
+ op: "add";
6
+ value: T;
7
+ }
8
+ export interface RemoveOperation extends BaseOperation {
9
+ op: "remove";
10
+ }
11
+ export interface ReplaceOperation<T> extends BaseOperation {
12
+ op: "replace";
13
+ value: T;
14
+ }
15
+ export interface MoveOperation extends BaseOperation {
16
+ op: "move";
17
+ from: string;
18
+ }
19
+ export interface CopyOperation extends BaseOperation {
20
+ op: "copy";
21
+ from: string;
22
+ }
23
+ export interface TestOperation<T> extends BaseOperation {
24
+ op: "test";
25
+ value: T;
26
+ }
27
+ export interface GetOperation<T> extends BaseOperation {
28
+ op: "_get";
29
+ value: T;
30
+ }
31
+ export declare type Operation = AddOperation<unknown> | RemoveOperation | ReplaceOperation<unknown> | MoveOperation | CopyOperation | TestOperation<unknown> | GetOperation<unknown>;
@@ -1,6 +1,6 @@
1
- import { Operation } from "fast-json-patch";
2
- import { JoinRoomAction } from "../actions/joinRoom.js";
1
+ import { JoinRoomAction } from "../actions/joinRoom";
3
2
  import { ActionResponse } from "./actionhero";
3
+ import { Operation } from "./jsonPatch";
4
4
  export declare const StatefulServerMessageName: {
5
5
  readonly addedDj: "addedDj";
6
6
  readonly lookedUpSong: "lookedUpSong";
@@ -65,6 +65,7 @@ export declare type MinimalCrateSongResDTO = {
65
65
  crateSongUuid?: string;
66
66
  status?: MinimalCrateSongResDTO.status;
67
67
  position?: number;
68
+ explicit: boolean;
68
69
  };
69
70
  export declare namespace MinimalCrateSongResDTO {
70
71
  enum status {
@@ -106,12 +107,14 @@ export declare namespace UserRoles {
106
107
  export declare type RoomDto = {
107
108
  song?: MinimalCrateSongResDTO | null;
108
109
  unlisted?: boolean;
110
+ varietyStyleMusic?: boolean;
111
+ explicit: boolean;
109
112
  id?: number;
110
113
  name: string;
111
114
  description: string;
112
115
  vibe: string;
113
116
  djType: RoomDto.djType;
114
- musicProviderKeys: Array<"apple" | "audius" | "napster" | "soundCloudPublic" | "spotify" | "uploadService" | "youtube">;
117
+ musicProviderKeys: Array<"apple" | "audius" | "napster" | "soundCloudPublic" | "spotify" | "uploadService" | "youtube" | "sevenDigital">;
115
118
  numberOfDjs: number;
116
119
  songsPerDj: number;
117
120
  usersInRoomUuids?: Array<string>;
@@ -135,6 +138,7 @@ export declare type RoomDto = {
135
138
  isLive: boolean;
136
139
  liveAudio: boolean;
137
140
  posterUrl?: string | null;
141
+ discordServer?: string | null;
138
142
  externalUrl?: string | null;
139
143
  uuid: string;
140
144
  isGuestPasswordProtected: boolean;
@@ -171,6 +175,7 @@ export declare type OtherUserProfileResDto = {
171
175
  uuid: string;
172
176
  avatarId: string;
173
177
  nickname: string;
178
+ discordNickname: string;
174
179
  firstName: string;
175
180
  lastName: string;
176
181
  pronoun: string;
@@ -185,6 +190,7 @@ export declare type OtherUserProfileResDto = {
185
190
  twitter: string;
186
191
  snapchat: string;
187
192
  tiktok: string;
193
+ discord: string;
188
194
  badges: Array<"VERIFIED" | "PLATINUM" | "DOUBLE_PLATINUM" | "JQBX" | "STAFF">;
189
195
  priceForGig: number;
190
196
  };
@@ -1,4 +1,4 @@
1
- import { MinimalCrateSongResDTO, OtherUserProfileResDto, RoomDto, TokenRole, UserRoles } from "./services.js";
1
+ import { MinimalCrateSongResDTO, OtherUserProfileResDto, RoomDto, TokenRole, UserRoles } from "./services";
2
2
  export type GhostUserProfile = Pick<OtherUserProfileResDto, "color" | "uuid" | "avatarId" | "nickname">;
3
3
  export type ServerDj = {
4
4
  userUuid: string;
@@ -16,6 +16,10 @@ export type SongVotes = {
16
16
  like?: boolean;
17
17
  star?: boolean;
18
18
  };
19
+ export type SongVotesInput = {
20
+ like?: boolean | null;
21
+ star?: boolean;
22
+ };
19
23
  export type ServerUserData = {
20
24
  userProfile: OtherUserProfileResDto | GhostUserProfile;
21
25
  position: AvatarPosition;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ttfm-socket",
3
- "version": "1.1.5-beta.0",
3
+ "version": "1.2.0-beta.0",
4
4
  "main": "./dist-client/client/index.js",
5
5
  "typings": "./dist-client/client/index.d.ts",
6
6
  "devDependencies": {