Skip to content

Commit

Permalink
Merge pull request #66 from ufosc/feature/types-sync
Browse files Browse the repository at this point in the history
move track queue to jukebox module
  • Loading branch information
IkeHunter authored Nov 1, 2024
2 parents cd1e766 + e2a83fd commit 841b8cb
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 80 deletions.
34 changes: 17 additions & 17 deletions proxy/api/index.html

Large diffs are not rendered by default.

189 changes: 130 additions & 59 deletions proxy/api/output.swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,25 @@ paths:
schema:
type: array
items:
$ref: '#/components/schemas/SpotifyLink'
$ref: '#/components/schemas/SpotifyAccount'
tags:
- spotify
'/api/v1/spotify/links/{id}':
delete:
operationId: SpotifyController_deleteSpotifyLink
parameters:
- name: id
required: true
in: path
schema:
type: number
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/SpotifyAccount'
tags:
- spotify
/api/v1/jukebox/jukeboxes:
Expand Down Expand Up @@ -741,6 +759,25 @@ paths:
tags:
- jukeboxes
'/api/v1/jukebox/{jukebox_id}/links':
get:
operationId: JukeboxController_getJukeboxLinks
parameters:
- name: jukebox_id
required: true
in: path
schema:
type: number
responses:
'200':
description: ''
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/JukeboxLinkDto'
tags:
- jukeboxes
post:
operationId: JukeboxController_addLinkToJukebox
parameters:
Expand All @@ -761,7 +798,71 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/SpotifyLinkDto'
$ref: '#/components/schemas/JukeboxLinkDto'
tags:
- jukeboxes
'/api/v1/jukebox/{jukebox_id}/links/{id}':
delete:
operationId: JukeboxController_deleteJukeboxLink
parameters:
- name: jukebox_id
required: true
in: path
schema:
type: number
- name: id
required: true
in: path
schema:
type: number
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/JukeboxLinkAssignment'
tags:
- jukeboxes
'/api/v1/jukebox/{jukebox_id}/active-link':
get:
operationId: JukeboxController_getActiveJukeboxLink
parameters:
- name: jukebox_id
required: true
in: path
schema:
type: number
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/SpotifyAccount'
tags:
- jukeboxes
post:
operationId: JukeboxController_setActiveJukeboxLink
parameters:
- name: jukebox_id
required: true
in: path
schema:
type: number
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AddJukeboxLinkDto'
responses:
'201':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/SpotifyAccount'
tags:
- jukeboxes
components:
Expand Down Expand Up @@ -824,7 +925,7 @@ components:
oneOf:
- $ref: '#/components/schemas/RoleEnum'
- $ref: '#/components/schemas/BlankEnum'
coins:
points:
type: integer
maximum: 2147483647
minimum: -2147483648
Expand All @@ -851,7 +952,7 @@ components:
- $ref: '#/components/schemas/BlankEnum'
owner:
type: boolean
coins:
points:
type: integer
maximum: 2147483647
minimum: -2147483648
Expand Down Expand Up @@ -896,7 +997,7 @@ components:
- $ref: '#/components/schemas/BlankEnum'
owner:
type: boolean
coins:
points:
type: integer
maximum: 2147483647
minimum: -2147483648
Expand Down Expand Up @@ -961,7 +1062,6 @@ components:
items:
$ref: '#/components/schemas/UserClubNested'
required:
- clubs
- email
- id
- password
Expand Down Expand Up @@ -991,16 +1091,16 @@ components:
type: string
club_id:
type: number
spotify_link_assignments:
link_assignments:
type: array
items:
$ref: '#/components/schemas/JukeboxSpotifyLinkAssignment'
$ref: '#/components/schemas/JukeboxLinkAssignment'
required:
- id
- name
- club_id
- spotify_link_assignments
SpotifyLink:
- link_assignments
SpotifyAccount:
type: object
properties:
id:
Expand All @@ -1010,7 +1110,7 @@ components:
refresh_token:
type: string
user_id:
type: string
type: number
spotify_email:
type: string
expires_in:
Expand All @@ -1023,7 +1123,7 @@ components:
jukebox_assignments:
type: array
items:
$ref: '#/components/schemas/JukeboxSpotifyLinkAssignment'
$ref: '#/components/schemas/JukeboxLinkAssignment'
required:
- id
- access_token
Expand All @@ -1034,7 +1134,7 @@ components:
- expires_at
- token_type
- jukebox_assignments
JukeboxSpotifyLinkAssignment:
JukeboxLinkAssignment:
type: object
properties:
jukebox_id:
Expand All @@ -1044,7 +1144,7 @@ components:
spotify_link_id:
type: number
spotify_link:
$ref: '#/components/schemas/SpotifyLink'
$ref: '#/components/schemas/SpotifyAccount'
active:
type: boolean
required:
Expand All @@ -1063,50 +1163,22 @@ components:
required:
- name
- club_id
SpotifyLinkNestedDto:
type: object
properties:
spotify_email:
type: string
required:
- spotify_email
SpotifyLinkDto:
JukeboxLinkDto:
type: object
properties:
id:
type: number
readOnly: true
created_at:
format: date-time
type:
type: string
readOnly: true
updated_at:
format: date-time
type: string
readOnly: true
access_token:
type: string
user_id:
type: string
spotify_email:
type: string
expires_at:
format: date-time
type: string
token_type:
email:
type: string
expires_in:
type: number
active:
type: boolean
required:
- id
- created_at
- updated_at
- access_token
- user_id
- spotify_email
- expires_at
- token_type
- expires_in
- type
- email
- active
JukeboxDto:
type: object
properties:
Expand All @@ -1125,33 +1197,32 @@ components:
type: string
club_id:
type: number
spotify_links:
links:
type: array
items:
$ref: '#/components/schemas/SpotifyLinkNestedDto'
active_spotify_link:
$ref: '#/components/schemas/SpotifyLinkDto'
$ref: '#/components/schemas/JukeboxLinkDto'
required:
- id
- created_at
- updated_at
- name
- club_id
- spotify_links
- links
UpdateJukeboxDto:
type: object
properties:
name:
type: string
active_spotify_link:
$ref: '#/components/schemas/SpotifyLinkNestedDto'
AddJukeboxLinkDto:
type: object
properties:
spotifyEmail:
type:
type: string
email:
type: string
required:
- spotifyEmail
- type
- email
securitySchemes:
basicAuth:
type: http
Expand Down
2 changes: 1 addition & 1 deletion src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { DatabaseModule } from './config/database.module'
import { JukeboxModule } from './jukebox/jukebox.module'
import { NetworkModule } from './network/network.module'
import { SpotifyModule } from './spotify/spotify.module'
import { TrackQueueModule } from './track-queue/track-queue.module'
import { TrackQueueModule } from './jukebox/track-queue/track-queue.module'
import { AxiosProvider } from './utils/providers/axios.provider'

@Module({
Expand Down
6 changes: 3 additions & 3 deletions src/jukebox/jukebox.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { SpotifyModule } from '../spotify/spotify.module'
import { Jukebox, JukeboxLinkAssignment } from './entities/jukebox.entity'
import { JukeboxController } from './jukebox.controller'
import { JukeboxService } from './jukebox.service'
import { TrackQueueService } from './track-queue/track-queue.service'

@Module({
controllers: [JukeboxController],
providers: [JukeboxService],
providers: [JukeboxService, TrackQueueService],
imports: [
// MongooseModule.forFeature([{ name: Jukebox.name, schema: JukeboxSchema }]),
TypeOrmModule.forFeature([Jukebox, JukeboxLinkAssignment]),
SpotifyModule,
],
exports: [JukeboxService],
exports: [JukeboxService, TrackQueueService],
})
export class JukeboxModule {}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 841b8cb

Please sign in to comment.