@superagnt/reddit-data 2.0.4 → 2.0.5

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/index.js CHANGED
@@ -7,7 +7,8 @@ import { homedir as _homedir } from 'node:os'
7
7
  import { join as _join } from 'node:path'
8
8
  import { existsSync as _existsSync, readFileSync as _readFileSync } from 'node:fs'
9
9
 
10
- const BASE_URL = 'https://api.superagnt.com/v1/data/reddit'
10
+ // SUPERAGNT_API_URL overrides the API origin (QA/staging); customers never set it.
11
+ const BASE_URL = (process.env.SUPERAGNT_API_URL || 'https://api.superagnt.com') + '/v1/data/reddit'
11
12
 
12
13
 
13
14
  // ── Auth Module (inlined) ────────────────────────────────────────────────────
@@ -111,7 +112,7 @@ export default function register(api) {
111
112
  "subreddit"
112
113
  ]
113
114
  },
114
- execute: async (input) => {
115
+ execute: async (_toolCallId, input) => {
115
116
  const key = ensureApiKey()
116
117
  const params = parseToolInput(input)
117
118
  return callSuperagnt(key, 'GET', '/getSimilarSubreddits', params)
@@ -137,7 +138,7 @@ export default function register(api) {
137
138
  "post_url"
138
139
  ]
139
140
  },
140
- execute: async (input) => {
141
+ execute: async (_toolCallId, input) => {
141
142
  const key = ensureApiKey()
142
143
  const params = parseToolInput(input)
143
144
  return callSuperagnt(key, 'GET', '/getPostDuplicates', params)
@@ -159,7 +160,7 @@ export default function register(api) {
159
160
  "subreddit"
160
161
  ]
161
162
  },
162
- execute: async (input) => {
163
+ execute: async (_toolCallId, input) => {
163
164
  const key = ensureApiKey()
164
165
  const params = parseToolInput(input)
165
166
  return callSuperagnt(key, 'GET', '/getSubredditModerators', params)
@@ -181,7 +182,7 @@ export default function register(api) {
181
182
  "subreddit"
182
183
  ]
183
184
  },
184
- execute: async (input) => {
185
+ execute: async (_toolCallId, input) => {
185
186
  const key = ensureApiKey()
186
187
  const params = parseToolInput(input)
187
188
  return callSuperagnt(key, 'GET', '/getSubredditRules', params)
@@ -216,7 +217,7 @@ export default function register(api) {
216
217
  "username"
217
218
  ]
218
219
  },
219
- execute: async (input) => {
220
+ execute: async (_toolCallId, input) => {
220
221
  const key = ensureApiKey()
221
222
  const params = parseToolInput(input)
222
223
  return callSuperagnt(key, 'GET', '/getUserOverview', params)
@@ -242,7 +243,7 @@ export default function register(api) {
242
243
  "query"
243
244
  ]
244
245
  },
245
- execute: async (input) => {
246
+ execute: async (_toolCallId, input) => {
246
247
  const key = ensureApiKey()
247
248
  const params = parseToolInput(input)
248
249
  return callSuperagnt(key, 'GET', '/getSearchUsers', params)
@@ -261,7 +262,7 @@ export default function register(api) {
261
262
  }
262
263
  }
263
264
  },
264
- execute: async (input) => {
265
+ execute: async (_toolCallId, input) => {
265
266
  const key = ensureApiKey()
266
267
  const params = parseToolInput(input)
267
268
  return callSuperagnt(key, 'GET', '/getBestPopularPosts', params)
@@ -292,7 +293,7 @@ export default function register(api) {
292
293
  "time"
293
294
  ]
294
295
  },
295
- execute: async (input) => {
296
+ execute: async (_toolCallId, input) => {
296
297
  const key = ensureApiKey()
297
298
  const params = parseToolInput(input)
298
299
  return callSuperagnt(key, 'GET', '/getControversialPostsBySubreddit', params)
@@ -332,7 +333,7 @@ export default function register(api) {
332
333
  "subreddit"
333
334
  ]
334
335
  },
335
- execute: async (input) => {
336
+ execute: async (_toolCallId, input) => {
336
337
  const key = ensureApiKey()
337
338
  const params = parseToolInput(input)
338
339
  return callSuperagnt(key, 'GET', '/getUserPostRankInSubreddit', params)
@@ -354,7 +355,7 @@ export default function register(api) {
354
355
  "subreddit"
355
356
  ]
356
357
  },
357
- execute: async (input) => {
358
+ execute: async (_toolCallId, input) => {
358
359
  const key = ensureApiKey()
359
360
  const params = parseToolInput(input)
360
361
  return callSuperagnt(key, 'GET', '/getSubredditInfo', params)
@@ -380,7 +381,7 @@ export default function register(api) {
380
381
  "subreddit"
381
382
  ]
382
383
  },
383
- execute: async (input) => {
384
+ execute: async (_toolCallId, input) => {
384
385
  const key = ensureApiKey()
385
386
  const params = parseToolInput(input)
386
387
  return callSuperagnt(key, 'GET', '/getCommentsBySubreddit', params)
@@ -411,7 +412,7 @@ export default function register(api) {
411
412
  "post_url"
412
413
  ]
413
414
  },
414
- execute: async (input) => {
415
+ execute: async (_toolCallId, input) => {
415
416
  const key = ensureApiKey()
416
417
  const params = parseToolInput(input)
417
418
  return callSuperagnt(key, 'GET', '/getPostCommentsWithSort', params)
@@ -433,7 +434,7 @@ export default function register(api) {
433
434
  "username"
434
435
  ]
435
436
  },
436
- execute: async (input) => {
437
+ execute: async (_toolCallId, input) => {
437
438
  const key = ensureApiKey()
438
439
  const params = parseToolInput(input)
439
440
  return callSuperagnt(key, 'GET', '/getProfile', params)
@@ -455,7 +456,7 @@ export default function register(api) {
455
456
  "post_url"
456
457
  ]
457
458
  },
458
- execute: async (input) => {
459
+ execute: async (_toolCallId, input) => {
459
460
  const key = ensureApiKey()
460
461
  const params = parseToolInput(input)
461
462
  return callSuperagnt(key, 'GET', '/getPostComments', params)
@@ -477,7 +478,7 @@ export default function register(api) {
477
478
  "username"
478
479
  ]
479
480
  },
480
- execute: async (input) => {
481
+ execute: async (_toolCallId, input) => {
481
482
  const key = ensureApiKey()
482
483
  const params = parseToolInput(input)
483
484
  return callSuperagnt(key, 'GET', '/getUserStats', params)
@@ -515,7 +516,7 @@ export default function register(api) {
515
516
  "query"
516
517
  ]
517
518
  },
518
- execute: async (input) => {
519
+ execute: async (_toolCallId, input) => {
519
520
  const key = ensureApiKey()
520
521
  const params = parseToolInput(input)
521
522
  return callSuperagnt(key, 'GET', '/getSearchPosts', params)
@@ -541,7 +542,7 @@ export default function register(api) {
541
542
  "query"
542
543
  ]
543
544
  },
544
- execute: async (input) => {
545
+ execute: async (_toolCallId, input) => {
545
546
  const key = ensureApiKey()
546
547
  const params = parseToolInput(input)
547
548
  return callSuperagnt(key, 'GET', '/getSearchSubreddits', params)
@@ -560,7 +561,7 @@ export default function register(api) {
560
561
  }
561
562
  }
562
563
  },
563
- execute: async (input) => {
564
+ execute: async (_toolCallId, input) => {
564
565
  const key = ensureApiKey()
565
566
  const params = parseToolInput(input)
566
567
  return callSuperagnt(key, 'GET', '/getNewSubreddits', params)
@@ -579,7 +580,7 @@ export default function register(api) {
579
580
  }
580
581
  }
581
582
  },
582
- execute: async (input) => {
583
+ execute: async (_toolCallId, input) => {
583
584
  const key = ensureApiKey()
584
585
  const params = parseToolInput(input)
585
586
  return callSuperagnt(key, 'GET', '/getPopularSubreddits', params)
@@ -601,7 +602,7 @@ export default function register(api) {
601
602
  "post_url"
602
603
  ]
603
604
  },
604
- execute: async (input) => {
605
+ execute: async (_toolCallId, input) => {
605
606
  const key = ensureApiKey()
606
607
  const params = parseToolInput(input)
607
608
  return callSuperagnt(key, 'GET', '/getPostDetails', params)
@@ -632,7 +633,7 @@ export default function register(api) {
632
633
  "sort"
633
634
  ]
634
635
  },
635
- execute: async (input) => {
636
+ execute: async (_toolCallId, input) => {
636
637
  const key = ensureApiKey()
637
638
  const params = parseToolInput(input)
638
639
  return callSuperagnt(key, 'GET', '/getPostsBySubreddit', params)
@@ -663,7 +664,7 @@ export default function register(api) {
663
664
  "username"
664
665
  ]
665
666
  },
666
- execute: async (input) => {
667
+ execute: async (_toolCallId, input) => {
667
668
  const key = ensureApiKey()
668
669
  const params = parseToolInput(input)
669
670
  return callSuperagnt(key, 'GET', '/getTopCommentsByUsername', params)
@@ -689,7 +690,7 @@ export default function register(api) {
689
690
  "sort"
690
691
  ]
691
692
  },
692
- execute: async (input) => {
693
+ execute: async (_toolCallId, input) => {
693
694
  const key = ensureApiKey()
694
695
  const params = parseToolInput(input)
695
696
  return callSuperagnt(key, 'GET', '/getPopularPosts', params)
@@ -720,7 +721,7 @@ export default function register(api) {
720
721
  "subreddit"
721
722
  ]
722
723
  },
723
- execute: async (input) => {
724
+ execute: async (_toolCallId, input) => {
724
725
  const key = ensureApiKey()
725
726
  const params = parseToolInput(input)
726
727
  return callSuperagnt(key, 'GET', '/getTopPostsBySubreddit', params)
@@ -751,7 +752,7 @@ export default function register(api) {
751
752
  "username"
752
753
  ]
753
754
  },
754
- execute: async (input) => {
755
+ execute: async (_toolCallId, input) => {
755
756
  const key = ensureApiKey()
756
757
  const params = parseToolInput(input)
757
758
  return callSuperagnt(key, 'GET', '/getCommentsByUsername', params)
@@ -782,7 +783,7 @@ export default function register(api) {
782
783
  "time"
783
784
  ]
784
785
  },
785
- execute: async (input) => {
786
+ execute: async (_toolCallId, input) => {
786
787
  const key = ensureApiKey()
787
788
  const params = parseToolInput(input)
788
789
  return callSuperagnt(key, 'GET', '/getTopPostsByUsername', params)
@@ -813,7 +814,7 @@ export default function register(api) {
813
814
  "sort"
814
815
  ]
815
816
  },
816
- execute: async (input) => {
817
+ execute: async (_toolCallId, input) => {
817
818
  const key = ensureApiKey()
818
819
  const params = parseToolInput(input)
819
820
  return callSuperagnt(key, 'GET', '/getPostsByUsername', params)
@@ -832,7 +833,7 @@ export default function register(api) {
832
833
  }
833
834
  }
834
835
  },
835
- execute: async (input) => {
836
+ execute: async (_toolCallId, input) => {
836
837
  const key = ensureApiKey()
837
838
  const params = parseToolInput(input)
838
839
  return callSuperagnt(key, 'GET', '/getRisingPopularPosts', params)
@@ -858,7 +859,7 @@ export default function register(api) {
858
859
  "time"
859
860
  ]
860
861
  },
861
- execute: async (input) => {
862
+ execute: async (_toolCallId, input) => {
862
863
  const key = ensureApiKey()
863
864
  const params = parseToolInput(input)
864
865
  return callSuperagnt(key, 'GET', '/getTopPopularPosts', params)
@@ -2,7 +2,7 @@
2
2
  "id": "reddit-data",
3
3
  "name": "Reddit Data",
4
4
  "description": "Unified access to subreddit metadata, post threads, user activity, and search. Built for LLMs and automation — not one-off scraping.",
5
- "version": "2.0.4",
5
+ "version": "2.0.5",
6
6
  "contracts": {
7
7
  "tools": [
8
8
  "superagnt_reddit_Similar_Subreddits",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superagnt/reddit-data",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "type": "module",
5
5
  "description": "Unified access to subreddit metadata, post threads, user activity, and search. Built for LLMs and automation — not one-off scraping.",
6
6
  "main": "index.js",