@dpgradio/creative 5.0.1 → 5.0.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dpgradio/creative",
3
- "version": "5.0.1",
3
+ "version": "5.0.3",
4
4
  "description": "Support package for standalone Javascript applications",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/api/api.js CHANGED
@@ -4,6 +4,7 @@ import tap from '../utils/tap.js'
4
4
  import Channels from './endpoints/Channels.js'
5
5
  import Config from './endpoints/Config.js'
6
6
  import Members from './endpoints/Members.js'
7
+ import Ratings from './endpoints/Ratings.js'
7
8
 
8
9
  const GLOBAL_API_URL = 'https://api.radio.dpgmedia.cloud'
9
10
 
@@ -20,6 +21,7 @@ export class Api {
20
21
  this.channels = new Channels(this)
21
22
  this.config = new Config(this)
22
23
  this.members = new Members(this)
24
+ this.ratings = new Ratings(this)
23
25
  }
24
26
 
25
27
  get baseUrl() {
@@ -0,0 +1,15 @@
1
+ import Endpoint from './Endpoint.js'
2
+
3
+ export default class Ratings extends Endpoint {
4
+ async allForMember() {
5
+ return await this.requestData((r) => r.get('/members/me/ratings'), 'ratings')
6
+ }
7
+
8
+ async like(selectorCode) {
9
+ await this.api.request().post(`/tracks/${selectorCode}/ratings`, { rating: 1 })
10
+ }
11
+
12
+ async unlike(selectorCode) {
13
+ await this.api.request().delete(`/tracks/${selectorCode}/ratings`)
14
+ }
15
+ }
@@ -16,4 +16,6 @@
16
16
  --joe-blue: 7 77 163;
17
17
  --joe-blue-dark: 44 45 119;
18
18
  --joe-blue-light: 0 130 220;
19
+
20
+ --joe-text: 78 78 78;
19
21
  }
@@ -0,0 +1,11 @@
1
+ :root {
2
+ --willy-gray: 231 230 225;
3
+ --willy-gray--alt: 244 243 239;
4
+ --willy-black: 20 20 20;
5
+ --willy-primary-text: 56 56 56;
6
+ --willy-primary-color: 255 159 28;
7
+ --willy-primary-color--pastel: 255 184 87;
8
+ --willy-secondary-color: 8 126 139;
9
+ --willy-tertiary-color: 198 39 26;
10
+ --willy-tertiary-color--alt: 231 53 54;
11
+ }