@smithery/api 0.36.0 → 0.38.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 (52) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/client.d.mts +1 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +1 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +8 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +8 -1
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/skills/index.d.mts +2 -1
  12. package/resources/skills/index.d.mts.map +1 -1
  13. package/resources/skills/index.d.ts +2 -1
  14. package/resources/skills/index.d.ts.map +1 -1
  15. package/resources/skills/index.js +3 -1
  16. package/resources/skills/index.js.map +1 -1
  17. package/resources/skills/index.mjs +1 -0
  18. package/resources/skills/index.mjs.map +1 -1
  19. package/resources/skills/reviews.d.mts +62 -40
  20. package/resources/skills/reviews.d.mts.map +1 -1
  21. package/resources/skills/reviews.d.ts +62 -40
  22. package/resources/skills/reviews.d.ts.map +1 -1
  23. package/resources/skills/reviews.js +23 -4
  24. package/resources/skills/reviews.js.map +1 -1
  25. package/resources/skills/reviews.mjs +23 -4
  26. package/resources/skills/reviews.mjs.map +1 -1
  27. package/resources/skills/skills.d.mts +21 -2
  28. package/resources/skills/skills.d.mts.map +1 -1
  29. package/resources/skills/skills.d.ts +21 -2
  30. package/resources/skills/skills.d.ts.map +1 -1
  31. package/resources/skills/skills.js +4 -0
  32. package/resources/skills/skills.js.map +1 -1
  33. package/resources/skills/skills.mjs +4 -0
  34. package/resources/skills/skills.mjs.map +1 -1
  35. package/resources/skills/votes.d.mts +61 -0
  36. package/resources/skills/votes.d.mts.map +1 -0
  37. package/resources/skills/votes.d.ts +61 -0
  38. package/resources/skills/votes.d.ts.map +1 -0
  39. package/resources/skills/votes.js +35 -0
  40. package/resources/skills/votes.js.map +1 -0
  41. package/resources/skills/votes.mjs +31 -0
  42. package/resources/skills/votes.mjs.map +1 -0
  43. package/src/client.ts +8 -1
  44. package/src/resources/skills/index.ts +15 -0
  45. package/src/resources/skills/reviews.ts +92 -44
  46. package/src/resources/skills/skills.ts +55 -0
  47. package/src/resources/skills/votes.ts +99 -0
  48. package/src/version.ts +1 -1
  49. package/version.d.mts +1 -1
  50. package/version.d.ts +1 -1
  51. package/version.js +1 -1
  52. package/version.mjs +1 -1
@@ -0,0 +1,61 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { RequestOptions } from "../../internal/request-options.js";
4
+ export declare class Votes extends APIResource {
5
+ /**
6
+ * Upvote or downvote a skill. Updates existing vote if one exists.
7
+ */
8
+ create(slug: string, params: VoteCreateParams, options?: RequestOptions): APIPromise<SkillVoteResponse>;
9
+ /**
10
+ * Remove vote from a skill
11
+ */
12
+ delete(slug: string, params: VoteDeleteParams, options?: RequestOptions): APIPromise<void>;
13
+ /**
14
+ * Get upvote/downvote counts and current user's vote (if authenticated)
15
+ */
16
+ get(slug: string, params: VoteGetParams, options?: RequestOptions): APIPromise<SkillVoteCounts>;
17
+ }
18
+ export interface SkillVoteCounts {
19
+ downvotes: number;
20
+ upvotes: number;
21
+ /**
22
+ * Current user's vote, null if not voted
23
+ */
24
+ userVote: 'up' | 'down' | null;
25
+ }
26
+ export interface SkillVoteError {
27
+ error: string;
28
+ }
29
+ export interface SkillVoteRequest {
30
+ /**
31
+ * Vote direction
32
+ */
33
+ vote: 'up' | 'down';
34
+ }
35
+ export interface SkillVoteResponse {
36
+ createdAt: string;
37
+ /**
38
+ * Vote direction
39
+ */
40
+ vote: 'up' | 'down';
41
+ }
42
+ export interface VoteCreateParams {
43
+ /**
44
+ * Path param
45
+ */
46
+ namespace: string;
47
+ /**
48
+ * Body param: Vote direction
49
+ */
50
+ vote: 'up' | 'down';
51
+ }
52
+ export interface VoteDeleteParams {
53
+ namespace: string;
54
+ }
55
+ export interface VoteGetParams {
56
+ namespace: string;
57
+ }
58
+ export declare namespace Votes {
59
+ export { type SkillVoteCounts as SkillVoteCounts, type SkillVoteError as SkillVoteError, type SkillVoteRequest as SkillVoteRequest, type SkillVoteResponse as SkillVoteResponse, type VoteCreateParams as VoteCreateParams, type VoteDeleteParams as VoteDeleteParams, type VoteGetParams as VoteGetParams, };
60
+ }
61
+ //# sourceMappingURL=votes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"votes.d.ts","sourceRoot":"","sources":["../../src/resources/skills/votes.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;IAKvG;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAQ1F;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,eAAe,CAAC;CAIhG;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAElB,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,aAAa,IAAI,aAAa,GACpC,CAAC;CACH"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Votes = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const headers_1 = require("../../internal/headers.js");
7
+ const path_1 = require("../../internal/utils/path.js");
8
+ class Votes extends resource_1.APIResource {
9
+ /**
10
+ * Upvote or downvote a skill. Updates existing vote if one exists.
11
+ */
12
+ create(slug, params, options) {
13
+ const { namespace, ...body } = params;
14
+ return this._client.post((0, path_1.path) `/skills/${namespace}/${slug}/vote`, { body, ...options });
15
+ }
16
+ /**
17
+ * Remove vote from a skill
18
+ */
19
+ delete(slug, params, options) {
20
+ const { namespace } = params;
21
+ return this._client.delete((0, path_1.path) `/skills/${namespace}/${slug}/vote`, {
22
+ ...options,
23
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
24
+ });
25
+ }
26
+ /**
27
+ * Get upvote/downvote counts and current user's vote (if authenticated)
28
+ */
29
+ get(slug, params, options) {
30
+ const { namespace } = params;
31
+ return this._client.get((0, path_1.path) `/skills/${namespace}/${slug}/vote`, options);
32
+ }
33
+ }
34
+ exports.Votes = Votes;
35
+ //# sourceMappingURL=votes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"votes.js","sourceRoot":"","sources":["../../src/resources/skills/votes.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAElD,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,KAAM,SAAQ,sBAAW;IACpC;;OAEG;IACH,MAAM,CAAC,IAAY,EAAE,MAAwB,EAAE,OAAwB;QACrE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,WAAW,SAAS,IAAI,IAAI,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAY,EAAE,MAAwB,EAAE,OAAwB;QACrE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,WAAW,SAAS,IAAI,IAAI,OAAO,EAAE;YAClE,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,IAAY,EAAE,MAAqB,EAAE,OAAwB;QAC/D,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,WAAW,SAAS,IAAI,IAAI,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;CACF;AA3BD,sBA2BC"}
@@ -0,0 +1,31 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { buildHeaders } from "../../internal/headers.mjs";
4
+ import { path } from "../../internal/utils/path.mjs";
5
+ export class Votes extends APIResource {
6
+ /**
7
+ * Upvote or downvote a skill. Updates existing vote if one exists.
8
+ */
9
+ create(slug, params, options) {
10
+ const { namespace, ...body } = params;
11
+ return this._client.post(path `/skills/${namespace}/${slug}/vote`, { body, ...options });
12
+ }
13
+ /**
14
+ * Remove vote from a skill
15
+ */
16
+ delete(slug, params, options) {
17
+ const { namespace } = params;
18
+ return this._client.delete(path `/skills/${namespace}/${slug}/vote`, {
19
+ ...options,
20
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
21
+ });
22
+ }
23
+ /**
24
+ * Get upvote/downvote counts and current user's vote (if authenticated)
25
+ */
26
+ get(slug, params, options) {
27
+ const { namespace } = params;
28
+ return this._client.get(path `/skills/${namespace}/${slug}/vote`, options);
29
+ }
30
+ }
31
+ //# sourceMappingURL=votes.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"votes.mjs","sourceRoot":"","sources":["../../src/resources/skills/votes.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;OAEG;IACH,MAAM,CAAC,IAAY,EAAE,MAAwB,EAAE,OAAwB;QACrE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,WAAW,SAAS,IAAI,IAAI,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAY,EAAE,MAAwB,EAAE,OAAwB;QACrE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,WAAW,SAAS,IAAI,IAAI,OAAO,EAAE;YAClE,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,IAAY,EAAE,MAAqB,EAAE,OAAwB;QAC/D,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,WAAW,SAAS,IAAI,IAAI,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;CACF"}
package/src/client.ts CHANGED
@@ -549,7 +549,7 @@ export class Smithery {
549
549
  controller: AbortController,
550
550
  ): Promise<Response> {
551
551
  const { signal, method, ...options } = init || {};
552
- const abort = controller.abort.bind(controller);
552
+ const abort = this._makeAbort(controller);
553
553
  if (signal) signal.addEventListener('abort', abort, { once: true });
554
554
 
555
555
  const timeout = setTimeout(abort, ms);
@@ -575,6 +575,7 @@ export class Smithery {
575
575
  return await this.fetch.call(undefined, url, fetchOptions);
576
576
  } finally {
577
577
  clearTimeout(timeout);
578
+ if (signal) signal.removeEventListener('abort', abort);
578
579
  }
579
580
  }
580
581
 
@@ -719,6 +720,12 @@ export class Smithery {
719
720
  return headers.values;
720
721
  }
721
722
 
723
+ private _makeAbort(controller: AbortController) {
724
+ // note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
725
+ // would capture all request options, and cause a memory leak.
726
+ return () => controller.abort();
727
+ }
728
+
722
729
  private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
723
730
  bodyHeaders: HeadersLike;
724
731
  body: BodyInit | undefined;
@@ -4,11 +4,16 @@ export {
4
4
  Reviews,
5
5
  type CreateReviewRequest,
6
6
  type CreateReviewResponse,
7
+ type ReviewError,
7
8
  type ReviewItem,
9
+ type ReviewVoteRequest,
10
+ type ReviewVoteResponse,
8
11
  type ReviewsListResponse,
9
12
  type ReviewCreateParams,
10
13
  type ReviewListParams,
11
14
  type ReviewDeleteParams,
15
+ type ReviewUnvoteParams,
16
+ type ReviewVoteParams,
12
17
  type ReviewItemsReviewsPage,
13
18
  } from './reviews';
14
19
  export {
@@ -19,3 +24,13 @@ export {
19
24
  type SkillGetParams,
20
25
  type SkillListResponsesSkillsPage,
21
26
  } from './skills';
27
+ export {
28
+ Votes,
29
+ type SkillVoteCounts,
30
+ type SkillVoteError,
31
+ type SkillVoteRequest,
32
+ type SkillVoteResponse,
33
+ type VoteCreateParams,
34
+ type VoteDeleteParams,
35
+ type VoteGetParams,
36
+ } from './votes';
@@ -9,8 +9,7 @@ import { path } from '../../internal/utils/path';
9
9
 
10
10
  export class Reviews extends APIResource {
11
11
  /**
12
- * Submit a review for a skill after using it. Updates existing review if one
13
- * already exists.
12
+ * Submit a review for a skill. Updates existing review if one already exists.
14
13
  */
15
14
  create(
16
15
  slug: string,
@@ -22,7 +21,7 @@ export class Reviews extends APIResource {
22
21
  }
23
22
 
24
23
  /**
25
- * Get paginated list of reviews for a skill with summary statistics
24
+ * Get paginated list of reviews with vote counts
26
25
  */
27
26
  list(
28
27
  slug: string,
@@ -37,7 +36,7 @@ export class Reviews extends APIResource {
37
36
  }
38
37
 
39
38
  /**
40
- * Delete your own review for a skill
39
+ * Delete your review
41
40
  */
42
41
  delete(slug: string, params: ReviewDeleteParams, options?: RequestOptions): APIPromise<void> {
43
42
  const { namespace } = params;
@@ -46,15 +45,37 @@ export class Reviews extends APIResource {
46
45
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
47
46
  });
48
47
  }
48
+
49
+ /**
50
+ * Remove vote from a review
51
+ */
52
+ unvote(reviewID: string, params: ReviewUnvoteParams, options?: RequestOptions): APIPromise<void> {
53
+ const { namespace, slug } = params;
54
+ return this._client.delete(path`/skills/${namespace}/${slug}/reviews/${reviewID}/vote`, {
55
+ ...options,
56
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
57
+ });
58
+ }
59
+
60
+ /**
61
+ * Upvote or downvote a review. Updates existing vote if one exists.
62
+ */
63
+ vote(reviewID: string, params: ReviewVoteParams, options?: RequestOptions): APIPromise<ReviewVoteResponse> {
64
+ const { namespace, slug, ...body } = params;
65
+ return this._client.post(path`/skills/${namespace}/${slug}/reviews/${reviewID}/vote`, {
66
+ body,
67
+ ...options,
68
+ });
69
+ }
49
70
  }
50
71
 
51
72
  export type ReviewItemsReviewsPage = ReviewsPage<ReviewItem>;
52
73
 
53
74
  export interface CreateReviewRequest {
54
75
  /**
55
- * Rating from 1 to 5 stars
76
+ * Review text (required)
56
77
  */
57
- rating: number;
78
+ review: string;
58
79
 
59
80
  /**
60
81
  * Optional agent model name (e.g., 'claude-3.5-sonnet')
@@ -62,9 +83,9 @@ export interface CreateReviewRequest {
62
83
  agentModel?: string;
63
84
 
64
85
  /**
65
- * Optional review comment
86
+ * Optional vote direction to submit with review
66
87
  */
67
- comment?: string;
88
+ vote?: 'up' | 'down';
68
89
  }
69
90
 
70
91
  export interface CreateReviewResponse {
@@ -73,14 +94,21 @@ export interface CreateReviewResponse {
73
94
  */
74
95
  id: string;
75
96
 
76
- comment: string | null;
77
-
78
97
  /**
79
98
  * ISO 8601 timestamp
80
99
  */
81
100
  createdAt: string;
82
101
 
83
- rating: number;
102
+ review: string;
103
+
104
+ /**
105
+ * Vote direction if submitted with review
106
+ */
107
+ vote: 'up' | 'down' | null;
108
+ }
109
+
110
+ export interface ReviewError {
111
+ error: string;
84
112
  }
85
113
 
86
114
  export interface ReviewItem {
@@ -90,58 +118,50 @@ export interface ReviewItem {
90
118
 
91
119
  agentModel: string | null;
92
120
 
93
- comment: string | null;
94
-
95
121
  /**
96
122
  * ISO 8601 timestamp
97
123
  */
98
124
  createdAt: string;
99
125
 
100
- rating: number;
126
+ downvotes: number;
127
+
128
+ review: string;
129
+
130
+ upvotes: number;
131
+ }
132
+
133
+ export interface ReviewVoteRequest {
134
+ /**
135
+ * Vote direction
136
+ */
137
+ vote: 'up' | 'down';
138
+ }
139
+
140
+ export interface ReviewVoteResponse {
141
+ createdAt: string;
142
+
143
+ /**
144
+ * Vote direction
145
+ */
146
+ vote: 'up' | 'down';
101
147
  }
102
148
 
103
149
  export interface ReviewsListResponse {
104
150
  pagination: ReviewsListResponse.Pagination;
105
151
 
106
152
  reviews: Array<ReviewItem>;
107
-
108
- summary: ReviewsListResponse.Summary;
109
153
  }
110
154
 
111
155
  export namespace ReviewsListResponse {
112
156
  export interface Pagination {
113
- /**
114
- * Current page number (1-indexed)
115
- */
116
157
  currentPage: number;
117
158
 
118
- /**
119
- * Number of results per page
120
- */
121
159
  pageSize: number;
122
160
 
123
- /**
124
- * Total number of matching reviews
125
- */
126
161
  totalCount: number;
127
162
 
128
- /**
129
- * Total number of pages available
130
- */
131
163
  totalPages: number;
132
164
  }
133
-
134
- export interface Summary {
135
- /**
136
- * Average rating across all reviews
137
- */
138
- averageRating: number;
139
-
140
- /**
141
- * Total number of reviews
142
- */
143
- totalReviews: number;
144
- }
145
165
  }
146
166
 
147
167
  export interface ReviewCreateParams {
@@ -151,9 +171,9 @@ export interface ReviewCreateParams {
151
171
  namespace: string;
152
172
 
153
173
  /**
154
- * Body param: Rating from 1 to 5 stars
174
+ * Body param: Review text (required)
155
175
  */
156
- rating: number;
176
+ review: string;
157
177
 
158
178
  /**
159
179
  * Body param: Optional agent model name (e.g., 'claude-3.5-sonnet')
@@ -161,9 +181,9 @@ export interface ReviewCreateParams {
161
181
  agentModel?: string;
162
182
 
163
183
  /**
164
- * Body param: Optional review comment
184
+ * Body param: Optional vote direction to submit with review
165
185
  */
166
- comment?: string;
186
+ vote?: 'up' | 'down';
167
187
  }
168
188
 
169
189
  export interface ReviewListParams extends ReviewsPageParams {
@@ -177,15 +197,43 @@ export interface ReviewDeleteParams {
177
197
  namespace: string;
178
198
  }
179
199
 
200
+ export interface ReviewUnvoteParams {
201
+ namespace: string;
202
+
203
+ slug: string;
204
+ }
205
+
206
+ export interface ReviewVoteParams {
207
+ /**
208
+ * Path param
209
+ */
210
+ namespace: string;
211
+
212
+ /**
213
+ * Path param
214
+ */
215
+ slug: string;
216
+
217
+ /**
218
+ * Body param: Vote direction
219
+ */
220
+ vote: 'up' | 'down';
221
+ }
222
+
180
223
  export declare namespace Reviews {
181
224
  export {
182
225
  type CreateReviewRequest as CreateReviewRequest,
183
226
  type CreateReviewResponse as CreateReviewResponse,
227
+ type ReviewError as ReviewError,
184
228
  type ReviewItem as ReviewItem,
229
+ type ReviewVoteRequest as ReviewVoteRequest,
230
+ type ReviewVoteResponse as ReviewVoteResponse,
185
231
  type ReviewsListResponse as ReviewsListResponse,
186
232
  type ReviewItemsReviewsPage as ReviewItemsReviewsPage,
187
233
  type ReviewCreateParams as ReviewCreateParams,
188
234
  type ReviewListParams as ReviewListParams,
189
235
  type ReviewDeleteParams as ReviewDeleteParams,
236
+ type ReviewUnvoteParams as ReviewUnvoteParams,
237
+ type ReviewVoteParams as ReviewVoteParams,
190
238
  };
191
239
  }
@@ -7,18 +7,35 @@ import {
7
7
  CreateReviewResponse,
8
8
  ReviewCreateParams,
9
9
  ReviewDeleteParams,
10
+ ReviewError,
10
11
  ReviewItem,
11
12
  ReviewItemsReviewsPage,
12
13
  ReviewListParams,
14
+ ReviewUnvoteParams,
15
+ ReviewVoteParams,
16
+ ReviewVoteRequest,
17
+ ReviewVoteResponse,
13
18
  Reviews,
14
19
  ReviewsListResponse,
15
20
  } from './reviews';
21
+ import * as VotesAPI from './votes';
22
+ import {
23
+ SkillVoteCounts,
24
+ SkillVoteError,
25
+ SkillVoteRequest,
26
+ SkillVoteResponse,
27
+ VoteCreateParams,
28
+ VoteDeleteParams,
29
+ VoteGetParams,
30
+ Votes,
31
+ } from './votes';
16
32
  import { APIPromise } from '../../core/api-promise';
17
33
  import { PagePromise, SkillsPage, type SkillsPageParams } from '../../core/pagination';
18
34
  import { RequestOptions } from '../../internal/request-options';
19
35
  import { path } from '../../internal/utils/path';
20
36
 
21
37
  export class Skills extends APIResource {
38
+ votes: VotesAPI.Votes = new VotesAPI.Votes(this._client);
22
39
  reviews: ReviewsAPI.Reviews = new ReviewsAPI.Reviews(this._client);
23
40
 
24
41
  /**
@@ -85,6 +102,11 @@ export interface SkillListResponse {
85
102
  */
86
103
  categories?: Array<string>;
87
104
 
105
+ /**
106
+ * Number of downvotes for this skill.
107
+ */
108
+ downvotes?: number;
109
+
88
110
  /**
89
111
  * GitHub fork count of the source repository, if applicable.
90
112
  */
@@ -100,6 +122,11 @@ export interface SkillListResponse {
100
122
  */
101
123
  gitUrl?: string;
102
124
 
125
+ /**
126
+ * Number of reviews for this skill.
127
+ */
128
+ reviewCount?: number;
129
+
103
130
  /**
104
131
  * Qualified names of MCP servers this skill depends on.
105
132
  */
@@ -114,6 +141,11 @@ export interface SkillListResponse {
114
141
  * Number of distinct users who have activated this skill.
115
142
  */
116
143
  uniqueUsers?: number;
144
+
145
+ /**
146
+ * Number of upvotes for this skill.
147
+ */
148
+ upvotes?: number;
117
149
  }
118
150
 
119
151
  export interface SkillGetResponse {
@@ -127,6 +159,8 @@ export interface SkillGetResponse {
127
159
 
128
160
  displayName: string;
129
161
 
162
+ downvotes: number;
163
+
130
164
  externalForks: number;
131
165
 
132
166
  externalStars: number;
@@ -141,6 +175,8 @@ export interface SkillGetResponse {
141
175
 
142
176
  qualityScore: number;
143
177
 
178
+ reviewCount: number;
179
+
144
180
  servers: Array<string>;
145
181
 
146
182
  slug: string;
@@ -148,6 +184,8 @@ export interface SkillGetResponse {
148
184
  totalActivations: number;
149
185
 
150
186
  uniqueUsers: number;
187
+
188
+ upvotes: number;
151
189
  }
152
190
 
153
191
  export interface SkillListParams extends SkillsPageParams {
@@ -194,6 +232,7 @@ export interface SkillGetParams {
194
232
  namespace: string;
195
233
  }
196
234
 
235
+ Skills.Votes = Votes;
197
236
  Skills.Reviews = Reviews;
198
237
 
199
238
  export declare namespace Skills {
@@ -205,15 +244,31 @@ export declare namespace Skills {
205
244
  type SkillGetParams as SkillGetParams,
206
245
  };
207
246
 
247
+ export {
248
+ Votes as Votes,
249
+ type SkillVoteCounts as SkillVoteCounts,
250
+ type SkillVoteError as SkillVoteError,
251
+ type SkillVoteRequest as SkillVoteRequest,
252
+ type SkillVoteResponse as SkillVoteResponse,
253
+ type VoteCreateParams as VoteCreateParams,
254
+ type VoteDeleteParams as VoteDeleteParams,
255
+ type VoteGetParams as VoteGetParams,
256
+ };
257
+
208
258
  export {
209
259
  Reviews as Reviews,
210
260
  type CreateReviewRequest as CreateReviewRequest,
211
261
  type CreateReviewResponse as CreateReviewResponse,
262
+ type ReviewError as ReviewError,
212
263
  type ReviewItem as ReviewItem,
264
+ type ReviewVoteRequest as ReviewVoteRequest,
265
+ type ReviewVoteResponse as ReviewVoteResponse,
213
266
  type ReviewsListResponse as ReviewsListResponse,
214
267
  type ReviewItemsReviewsPage as ReviewItemsReviewsPage,
215
268
  type ReviewCreateParams as ReviewCreateParams,
216
269
  type ReviewListParams as ReviewListParams,
217
270
  type ReviewDeleteParams as ReviewDeleteParams,
271
+ type ReviewUnvoteParams as ReviewUnvoteParams,
272
+ type ReviewVoteParams as ReviewVoteParams,
218
273
  };
219
274
  }
@@ -0,0 +1,99 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { buildHeaders } from '../../internal/headers';
6
+ import { RequestOptions } from '../../internal/request-options';
7
+ import { path } from '../../internal/utils/path';
8
+
9
+ export class Votes extends APIResource {
10
+ /**
11
+ * Upvote or downvote a skill. Updates existing vote if one exists.
12
+ */
13
+ create(slug: string, params: VoteCreateParams, options?: RequestOptions): APIPromise<SkillVoteResponse> {
14
+ const { namespace, ...body } = params;
15
+ return this._client.post(path`/skills/${namespace}/${slug}/vote`, { body, ...options });
16
+ }
17
+
18
+ /**
19
+ * Remove vote from a skill
20
+ */
21
+ delete(slug: string, params: VoteDeleteParams, options?: RequestOptions): APIPromise<void> {
22
+ const { namespace } = params;
23
+ return this._client.delete(path`/skills/${namespace}/${slug}/vote`, {
24
+ ...options,
25
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
26
+ });
27
+ }
28
+
29
+ /**
30
+ * Get upvote/downvote counts and current user's vote (if authenticated)
31
+ */
32
+ get(slug: string, params: VoteGetParams, options?: RequestOptions): APIPromise<SkillVoteCounts> {
33
+ const { namespace } = params;
34
+ return this._client.get(path`/skills/${namespace}/${slug}/vote`, options);
35
+ }
36
+ }
37
+
38
+ export interface SkillVoteCounts {
39
+ downvotes: number;
40
+
41
+ upvotes: number;
42
+
43
+ /**
44
+ * Current user's vote, null if not voted
45
+ */
46
+ userVote: 'up' | 'down' | null;
47
+ }
48
+
49
+ export interface SkillVoteError {
50
+ error: string;
51
+ }
52
+
53
+ export interface SkillVoteRequest {
54
+ /**
55
+ * Vote direction
56
+ */
57
+ vote: 'up' | 'down';
58
+ }
59
+
60
+ export interface SkillVoteResponse {
61
+ createdAt: string;
62
+
63
+ /**
64
+ * Vote direction
65
+ */
66
+ vote: 'up' | 'down';
67
+ }
68
+
69
+ export interface VoteCreateParams {
70
+ /**
71
+ * Path param
72
+ */
73
+ namespace: string;
74
+
75
+ /**
76
+ * Body param: Vote direction
77
+ */
78
+ vote: 'up' | 'down';
79
+ }
80
+
81
+ export interface VoteDeleteParams {
82
+ namespace: string;
83
+ }
84
+
85
+ export interface VoteGetParams {
86
+ namespace: string;
87
+ }
88
+
89
+ export declare namespace Votes {
90
+ export {
91
+ type SkillVoteCounts as SkillVoteCounts,
92
+ type SkillVoteError as SkillVoteError,
93
+ type SkillVoteRequest as SkillVoteRequest,
94
+ type SkillVoteResponse as SkillVoteResponse,
95
+ type VoteCreateParams as VoteCreateParams,
96
+ type VoteDeleteParams as VoteDeleteParams,
97
+ type VoteGetParams as VoteGetParams,
98
+ };
99
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.36.0'; // x-release-please-version
1
+ export const VERSION = '0.38.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.36.0";
1
+ export declare const VERSION = "0.38.0";
2
2
  //# sourceMappingURL=version.d.mts.map