@smithery/api 0.36.0 → 0.37.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.
- package/CHANGELOG.md +10 -0
- package/package.json +1 -1
- package/resources/skills/index.d.mts +2 -1
- package/resources/skills/index.d.mts.map +1 -1
- package/resources/skills/index.d.ts +2 -1
- package/resources/skills/index.d.ts.map +1 -1
- package/resources/skills/index.js +3 -1
- package/resources/skills/index.js.map +1 -1
- package/resources/skills/index.mjs +1 -0
- package/resources/skills/index.mjs.map +1 -1
- package/resources/skills/reviews.d.mts +48 -44
- package/resources/skills/reviews.d.mts.map +1 -1
- package/resources/skills/reviews.d.ts +48 -44
- package/resources/skills/reviews.d.ts.map +1 -1
- package/resources/skills/reviews.js +23 -4
- package/resources/skills/reviews.js.map +1 -1
- package/resources/skills/reviews.mjs +23 -4
- package/resources/skills/reviews.mjs.map +1 -1
- package/resources/skills/skills.d.mts +6 -2
- package/resources/skills/skills.d.mts.map +1 -1
- package/resources/skills/skills.d.ts +6 -2
- package/resources/skills/skills.d.ts.map +1 -1
- package/resources/skills/skills.js +4 -0
- package/resources/skills/skills.js.map +1 -1
- package/resources/skills/skills.mjs +4 -0
- package/resources/skills/skills.mjs.map +1 -1
- package/resources/skills/votes.d.mts +55 -0
- package/resources/skills/votes.d.mts.map +1 -0
- package/resources/skills/votes.d.ts +55 -0
- package/resources/skills/votes.d.ts.map +1 -0
- package/resources/skills/votes.js +35 -0
- package/resources/skills/votes.js.map +1 -0
- package/resources/skills/votes.mjs +31 -0
- package/resources/skills/votes.mjs.map +1 -0
- package/src/resources/skills/index.ts +13 -0
- package/src/resources/skills/reviews.ts +75 -50
- package/src/resources/skills/skills.ts +30 -0
- package/src/resources/skills/votes.ts +91 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,91 @@
|
|
|
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: boolean | null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface SkillVoteRequest {
|
|
50
|
+
/**
|
|
51
|
+
* true for thumbs up, false for thumbs down
|
|
52
|
+
*/
|
|
53
|
+
isPositive: boolean;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface SkillVoteResponse {
|
|
57
|
+
createdAt: string;
|
|
58
|
+
|
|
59
|
+
isPositive: boolean;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface VoteCreateParams {
|
|
63
|
+
/**
|
|
64
|
+
* Path param
|
|
65
|
+
*/
|
|
66
|
+
namespace: string;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Body param: true for thumbs up, false for thumbs down
|
|
70
|
+
*/
|
|
71
|
+
isPositive: boolean;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface VoteDeleteParams {
|
|
75
|
+
namespace: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface VoteGetParams {
|
|
79
|
+
namespace: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export declare namespace Votes {
|
|
83
|
+
export {
|
|
84
|
+
type SkillVoteCounts as SkillVoteCounts,
|
|
85
|
+
type SkillVoteRequest as SkillVoteRequest,
|
|
86
|
+
type SkillVoteResponse as SkillVoteResponse,
|
|
87
|
+
type VoteCreateParams as VoteCreateParams,
|
|
88
|
+
type VoteDeleteParams as VoteDeleteParams,
|
|
89
|
+
type VoteGetParams as VoteGetParams,
|
|
90
|
+
};
|
|
91
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.37.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.37.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.37.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.37.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|