podcast-api 2.0.1 → 2.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": "podcast-api",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "JavaScript bindings for the Listen Notes Podcast API",
5
5
  "main": "src/PodcastApiClient.js",
6
6
  "scripts": {
@@ -38,9 +38,11 @@ const _fetch = (path, config, method = 'GET', queryParams = {}, formParams = nul
38
38
  return response;
39
39
  } else {
40
40
  const err = new Error(`HTTP ${response.status}`);
41
- err.response = response;
42
- err.response.config = responseConfig;
43
- err.response.headers = responseHeaders;
41
+ err.response = {
42
+ status: response.status,
43
+ config: responseConfig,
44
+ headers: responseHeaders,
45
+ };
44
46
  throw err;
45
47
  }
46
48
  }).then((response) => {
@@ -69,6 +69,11 @@ const addApiMethodsToClient = (client) => {
69
69
  return client.httpClient._get(`/podcasts/${id}/audience`, otherParams);
70
70
  };
71
71
 
72
+ client.fetchPodcastsByDomain = (params) => {
73
+ const { domain_name, ...otherParams } = params;
74
+ return client.httpClient._get(`/podcasts/domains/${domain_name}`, otherParams);
75
+ };
76
+
72
77
  return client;
73
78
  };
74
79