epist 1.2.0 → 1.2.1

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.
@@ -62,5 +62,10 @@ export declare class Epist {
62
62
  /**
63
63
  * Ingest a podcast RSS feed
64
64
  */
65
- ingestRss(url: string, name?: string, refreshIntervalMinutes?: number): Promise<any>;
65
+ ingestRss(url: string, name?: string, refreshIntervalMinutes?: number, options?: {
66
+ max_episodes?: number;
67
+ start_date?: string;
68
+ include_keywords?: string;
69
+ exclude_keywords?: string;
70
+ }): Promise<any>;
66
71
  }
package/dist/cjs/index.js CHANGED
@@ -124,13 +124,16 @@ class Epist {
124
124
  /**
125
125
  * Ingest a podcast RSS feed
126
126
  */
127
- async ingestRss(url, name, refreshIntervalMinutes) {
127
+ async ingestRss(url, name, refreshIntervalMinutes, options) {
128
128
  try {
129
- const payload = { url };
130
- if (name)
131
- payload.name = name;
132
- if (refreshIntervalMinutes)
133
- payload.refresh_interval_minutes = refreshIntervalMinutes;
129
+ const payload = {
130
+ url,
131
+ name,
132
+ refresh_interval_minutes: refreshIntervalMinutes,
133
+ ...options
134
+ };
135
+ // Filter undefined values
136
+ Object.keys(payload).forEach(key => payload[key] === undefined && delete payload[key]);
134
137
  const response = await this.client.post('/ingest/rss', payload);
135
138
  return response.data;
136
139
  }
package/dist/esm/index.js CHANGED
@@ -117,13 +117,16 @@ export class Epist {
117
117
  /**
118
118
  * Ingest a podcast RSS feed
119
119
  */
120
- async ingestRss(url, name, refreshIntervalMinutes) {
120
+ async ingestRss(url, name, refreshIntervalMinutes, options) {
121
121
  try {
122
- const payload = { url };
123
- if (name)
124
- payload.name = name;
125
- if (refreshIntervalMinutes)
126
- payload.refresh_interval_minutes = refreshIntervalMinutes;
122
+ const payload = {
123
+ url,
124
+ name,
125
+ refresh_interval_minutes: refreshIntervalMinutes,
126
+ ...options
127
+ };
128
+ // Filter undefined values
129
+ Object.keys(payload).forEach(key => payload[key] === undefined && delete payload[key]);
127
130
  const response = await this.client.post('/ingest/rss', payload);
128
131
  return response.data;
129
132
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epist",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Official JavaScript/TypeScript SDK for Epist.ai",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/index.ts CHANGED
@@ -164,11 +164,27 @@ export class Epist {
164
164
  /**
165
165
  * Ingest a podcast RSS feed
166
166
  */
167
- async ingestRss(url: string, name?: string, refreshIntervalMinutes?: number): Promise<any> {
167
+ async ingestRss(
168
+ url: string,
169
+ name?: string,
170
+ refreshIntervalMinutes?: number,
171
+ options?: {
172
+ max_episodes?: number;
173
+ start_date?: string;
174
+ include_keywords?: string;
175
+ exclude_keywords?: string;
176
+ }
177
+ ): Promise<any> {
168
178
  try {
169
- const payload: any = { url };
170
- if (name) payload.name = name;
171
- if (refreshIntervalMinutes) payload.refresh_interval_minutes = refreshIntervalMinutes;
179
+ const payload: any = {
180
+ url,
181
+ name,
182
+ refresh_interval_minutes: refreshIntervalMinutes,
183
+ ...options
184
+ };
185
+
186
+ // Filter undefined values
187
+ Object.keys(payload).forEach(key => payload[key] === undefined && delete payload[key]);
172
188
 
173
189
  const response = await this.client.post('/ingest/rss', payload);
174
190
  return response.data;