javascript-ampache 1.0.9 → 1.1.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.
Files changed (46) hide show
  1. package/README.md +50 -47
  2. package/dist/base.d.ts +5 -0
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.m.js.map +1 -1
  5. package/dist/index.modern.mjs.map +1 -1
  6. package/dist/index.umd.js.map +1 -1
  7. package/package.json +38 -38
  8. package/src/albums/index.ts +86 -86
  9. package/src/albums/types.ts +38 -32
  10. package/src/artists/index.ts +88 -88
  11. package/src/artists/types.ts +38 -32
  12. package/src/auth/index.ts +103 -103
  13. package/src/auth/types.ts +25 -25
  14. package/src/base.ts +134 -119
  15. package/src/bookmarks/index.ts +115 -122
  16. package/src/bookmarks/types.ts +15 -9
  17. package/src/catalogs/index.ts +130 -119
  18. package/src/catalogs/types.ts +27 -15
  19. package/src/genres/index.ts +39 -40
  20. package/src/genres/types.ts +23 -17
  21. package/src/index.ts +63 -26
  22. package/src/labels/index.ts +43 -44
  23. package/src/labels/types.ts +20 -14
  24. package/src/licenses/index.ts +43 -44
  25. package/src/licenses/types.ts +14 -8
  26. package/src/live-streams/index.ts +104 -107
  27. package/src/live-streams/types.ts +16 -10
  28. package/src/playlists/index.ts +264 -269
  29. package/src/playlists/types.ts +20 -14
  30. package/src/podcasts/index.ts +174 -177
  31. package/src/podcasts/types.ts +85 -67
  32. package/src/preferences/index.ts +114 -116
  33. package/src/preferences/types.ts +18 -12
  34. package/src/shares/index.ts +100 -96
  35. package/src/shares/types.ts +25 -19
  36. package/src/shouts/index.ts +18 -22
  37. package/src/shouts/types.ts +9 -9
  38. package/src/songs/index.ts +208 -203
  39. package/src/songs/types.ts +77 -65
  40. package/src/system/index.ts +689 -572
  41. package/src/system/types.ts +33 -19
  42. package/src/users/index.ts +227 -245
  43. package/src/users/types.ts +38 -32
  44. package/src/utils.ts +25 -25
  45. package/src/videos/index.ts +49 -53
  46. package/src/videos/types.ts +42 -30
package/README.md CHANGED
@@ -1,47 +1,50 @@
1
- # javascript-ampache
2
-
3
- A JS client for the Ampache API written in Typescript.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install javascript-ampache
9
- ```
10
-
11
- ## Usage
12
-
13
- Import `javascript-ampache` module in your project and initialize it with the URL to your server e.g. http://music.com.au
14
-
15
- ```js
16
- import AmpacheAPI from 'javascript-ampache';
17
-
18
- const API = new AmpacheAPI({ url: 'http://pathToYourAmpacheServer', sessionKey: yourSessionAuthKey }); // debug: true - will log the final GET to console
19
-
20
- // either set the session key at time of instantiation or set/update with:
21
- API.setSessionKey(yourSessionAuthKey);
22
-
23
- let allUsers = API.users();
24
-
25
- let thisAlbum = API.album({ filter: 123 });
26
-
27
- let results = API.advancedSearch({
28
- type: "album",
29
- operator: "and",
30
- random: 1,
31
- limit: 20,
32
- rules: [
33
- ['title', 0, 'monkey'], // Title contains 'monkey'
34
- ['myrating', 2, 4] // Rating is 4 stars
35
- ]
36
- });
37
- ```
38
-
39
- ## Build
40
- ```bash
41
- npm run build
42
- ```
43
-
44
- ### Special thanks
45
- https://lyamkin.com/blog/how-to-build-api-client-library-in-js/ & https://github.com/ilyamkin/dev-to-js
46
-
47
-
1
+ # javascript-ampache
2
+
3
+ A JS client for the Ampache API written in Typescript.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install javascript-ampache
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ Import `javascript-ampache` module in your project and initialize it with the URL to your server e.g. http://music.com.au
14
+
15
+ ```js
16
+ import AmpacheAPI from "javascript-ampache";
17
+
18
+ const API = new AmpacheAPI({
19
+ url: "http://pathToYourAmpacheServer",
20
+ sessionKey: yourSessionAuthKey,
21
+ }); // debug: true - will log the final GET to console
22
+
23
+ // either set the session key at time of instantiation or set/update with:
24
+ API.setSessionKey(yourSessionAuthKey);
25
+
26
+ let allUsers = API.users();
27
+
28
+ let thisAlbum = API.album({ filter: 123 });
29
+
30
+ let results = API.advancedSearch({
31
+ type: "album",
32
+ operator: "and",
33
+ random: 1,
34
+ limit: 20,
35
+ rules: [
36
+ ["title", 0, "monkey"], // Title contains 'monkey'
37
+ ["myrating", 2, 4], // Rating is 4 stars
38
+ ],
39
+ });
40
+ ```
41
+
42
+ ## Build
43
+
44
+ ```bash
45
+ npm run build
46
+ ```
47
+
48
+ ### Special thanks
49
+
50
+ https://lyamkin.com/blog/how-to-build-api-client-library-in-js/ & https://github.com/ilyamkin/dev-to-js
package/dist/base.d.ts CHANGED
@@ -35,6 +35,11 @@ export declare abstract class Base {
35
35
  protected request<T>(endpoint: string): Promise<T>;
36
36
  protected binary<T>(endpoint: string): Promise<Blob>;
37
37
  setSessionKey(sessionKey: string): void;
38
+ /**
39
+ * Construct and return a URL
40
+ * @param endpoint
41
+ * @param [params]
42
+ */
38
43
  rawURL(endpoint: string, params?: {}): string;
39
44
  }
40
45
  export {};