@smithery/api 0.1.0-alpha.9 → 0.2.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 (48) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/client.d.mts +3 -1
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -1
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/core/pagination.d.mts +22 -0
  9. package/core/pagination.d.mts.map +1 -1
  10. package/core/pagination.d.ts +22 -0
  11. package/core/pagination.d.ts.map +1 -1
  12. package/core/pagination.js +23 -1
  13. package/core/pagination.js.map +1 -1
  14. package/core/pagination.mjs +21 -0
  15. package/core/pagination.mjs.map +1 -1
  16. package/package.json +1 -1
  17. package/resources/servers/deployments.d.mts +161 -1
  18. package/resources/servers/deployments.d.mts.map +1 -1
  19. package/resources/servers/deployments.d.ts +161 -1
  20. package/resources/servers/deployments.d.ts.map +1 -1
  21. package/resources/servers/index.d.mts +1 -1
  22. package/resources/servers/index.d.mts.map +1 -1
  23. package/resources/servers/index.d.ts +1 -1
  24. package/resources/servers/index.d.ts.map +1 -1
  25. package/resources/servers/index.js.map +1 -1
  26. package/resources/servers/index.mjs.map +1 -1
  27. package/resources/servers/servers.d.mts +9 -3
  28. package/resources/servers/servers.d.mts.map +1 -1
  29. package/resources/servers/servers.d.ts +9 -3
  30. package/resources/servers/servers.d.ts.map +1 -1
  31. package/resources/servers/servers.js +1 -1
  32. package/resources/servers/servers.js.map +1 -1
  33. package/resources/servers/servers.mjs +1 -1
  34. package/resources/servers/servers.mjs.map +1 -1
  35. package/src/client.ts +10 -1
  36. package/src/core/pagination.ts +57 -0
  37. package/src/resources/servers/deployments.ts +241 -0
  38. package/src/resources/servers/index.ts +5 -0
  39. package/src/resources/servers/servers.ts +23 -1
  40. package/src/version.ts +1 -1
  41. package/version.d.mts +1 -1
  42. package/version.d.mts.map +1 -1
  43. package/version.d.ts +1 -1
  44. package/version.d.ts.map +1 -1
  45. package/version.js +1 -1
  46. package/version.js.map +1 -1
  47. package/version.mjs +1 -1
  48. package/version.mjs.map +1 -1
@@ -165,3 +165,60 @@ export class SmitheryPage<Item> extends AbstractPage<Item> implements SmitheryPa
165
165
  };
166
166
  }
167
167
  }
168
+
169
+ export interface SearchPageResponse<Item> {
170
+ data: Array<Item>;
171
+
172
+ pagination: SearchPageResponse.Pagination;
173
+ }
174
+
175
+ export namespace SearchPageResponse {
176
+ export interface Pagination {
177
+ page?: number;
178
+
179
+ pageSize?: number;
180
+
181
+ total?: number;
182
+ }
183
+ }
184
+
185
+ export interface SearchPageParams {
186
+ page?: number;
187
+
188
+ pageSize?: number;
189
+ }
190
+
191
+ export class SearchPage<Item> extends AbstractPage<Item> implements SearchPageResponse<Item> {
192
+ data: Array<Item>;
193
+
194
+ pagination: SearchPageResponse.Pagination;
195
+
196
+ constructor(
197
+ client: Smithery,
198
+ response: Response,
199
+ body: SearchPageResponse<Item>,
200
+ options: FinalRequestOptions,
201
+ ) {
202
+ super(client, response, body, options);
203
+
204
+ this.data = body.data || [];
205
+ this.pagination = body.pagination || {};
206
+ }
207
+
208
+ getPaginatedItems(): Item[] {
209
+ return this.data ?? [];
210
+ }
211
+
212
+ nextPageRequestOptions(): PageRequestOptions | null {
213
+ const query = this.options.query as SearchPageParams;
214
+ const currentPage = query?.page ?? 1;
215
+
216
+ return {
217
+ ...this.options,
218
+ query: {
219
+ ...maybeObj(this.options.query),
220
+ page: currentPage + 1,
221
+ },
222
+ };
223
+ }
224
+ }
@@ -54,6 +54,242 @@ export class Deployments extends APIResource {
54
54
  }
55
55
  }
56
56
 
57
+ export type DeployPayload = HostedDeployPayload | ExternalDeployPayload | StdioDeployPayload;
58
+
59
+ export interface ExternalDeployPayload {
60
+ type: 'external';
61
+
62
+ upstreamUrl: string;
63
+ }
64
+
65
+ export interface HostedDeployPayload {
66
+ stateful: boolean;
67
+
68
+ type: 'hosted';
69
+
70
+ configSchema?: { [key: string]: unknown };
71
+
72
+ serverCard?: ServerCard;
73
+
74
+ source?: HostedDeployPayload.Source;
75
+ }
76
+
77
+ export namespace HostedDeployPayload {
78
+ export interface Source {
79
+ branch?: string;
80
+
81
+ commit?: string;
82
+ }
83
+ }
84
+
85
+ export interface ServerCard {
86
+ serverInfo: ServerCard.ServerInfo;
87
+
88
+ authentication?: ServerCard.Authentication;
89
+
90
+ prompts?: Array<ServerCard.Prompt>;
91
+
92
+ resources?: Array<ServerCard.Resource>;
93
+
94
+ tools?: Array<ServerCard.Tool>;
95
+
96
+ [k: string]: unknown;
97
+ }
98
+
99
+ export namespace ServerCard {
100
+ export interface ServerInfo {
101
+ name: string;
102
+
103
+ version: string;
104
+
105
+ description?: string;
106
+
107
+ icons?: Array<ServerInfo.Icon>;
108
+
109
+ title?: string;
110
+
111
+ websiteUrl?: string;
112
+ }
113
+
114
+ export namespace ServerInfo {
115
+ export interface Icon {
116
+ src: string;
117
+
118
+ mimeType?: string;
119
+
120
+ sizes?: Array<string>;
121
+
122
+ theme?: 'light' | 'dark';
123
+ }
124
+ }
125
+
126
+ export interface Authentication {
127
+ required: boolean;
128
+
129
+ schemes: Array<string>;
130
+ }
131
+
132
+ export interface Prompt {
133
+ name: string;
134
+
135
+ _meta?: { [key: string]: unknown };
136
+
137
+ arguments?: Array<Prompt.Argument>;
138
+
139
+ description?: string;
140
+
141
+ icons?: Array<Prompt.Icon>;
142
+
143
+ title?: string;
144
+ }
145
+
146
+ export namespace Prompt {
147
+ export interface Argument {
148
+ name: string;
149
+
150
+ description?: string;
151
+
152
+ required?: boolean;
153
+ }
154
+
155
+ export interface Icon {
156
+ src: string;
157
+
158
+ mimeType?: string;
159
+
160
+ sizes?: Array<string>;
161
+
162
+ theme?: 'light' | 'dark';
163
+ }
164
+ }
165
+
166
+ export interface Resource {
167
+ name: string;
168
+
169
+ uri: string;
170
+
171
+ _meta?: { [key: string]: unknown };
172
+
173
+ annotations?: Resource.Annotations;
174
+
175
+ description?: string;
176
+
177
+ icons?: Array<Resource.Icon>;
178
+
179
+ mimeType?: string;
180
+
181
+ title?: string;
182
+ }
183
+
184
+ export namespace Resource {
185
+ export interface Annotations {
186
+ audience?: Array<'user' | 'assistant'>;
187
+
188
+ lastModified?: string;
189
+
190
+ priority?: number;
191
+ }
192
+
193
+ export interface Icon {
194
+ src: string;
195
+
196
+ mimeType?: string;
197
+
198
+ sizes?: Array<string>;
199
+
200
+ theme?: 'light' | 'dark';
201
+ }
202
+ }
203
+
204
+ export interface Tool {
205
+ inputSchema: Tool.InputSchema;
206
+
207
+ name: string;
208
+
209
+ _meta?: { [key: string]: unknown };
210
+
211
+ annotations?: Tool.Annotations;
212
+
213
+ description?: string;
214
+
215
+ execution?: Tool.Execution;
216
+
217
+ icons?: Array<Tool.Icon>;
218
+
219
+ outputSchema?: Tool.OutputSchema;
220
+
221
+ title?: string;
222
+ }
223
+
224
+ export namespace Tool {
225
+ export interface InputSchema {
226
+ type: 'object';
227
+
228
+ properties?: { [key: string]: unknown };
229
+
230
+ required?: Array<string>;
231
+
232
+ [k: string]: unknown;
233
+ }
234
+
235
+ export interface Annotations {
236
+ destructiveHint?: boolean;
237
+
238
+ idempotentHint?: boolean;
239
+
240
+ openWorldHint?: boolean;
241
+
242
+ readOnlyHint?: boolean;
243
+
244
+ title?: string;
245
+ }
246
+
247
+ export interface Execution {
248
+ taskSupport?: 'required' | 'optional' | 'forbidden';
249
+ }
250
+
251
+ export interface Icon {
252
+ src: string;
253
+
254
+ mimeType?: string;
255
+
256
+ sizes?: Array<string>;
257
+
258
+ theme?: 'light' | 'dark';
259
+ }
260
+
261
+ export interface OutputSchema {
262
+ type: 'object';
263
+
264
+ properties?: { [key: string]: unknown };
265
+
266
+ required?: Array<string>;
267
+
268
+ [k: string]: unknown;
269
+ }
270
+ }
271
+ }
272
+
273
+ export interface StdioDeployPayload {
274
+ runtime: 'node';
275
+
276
+ type: 'stdio';
277
+
278
+ configSchema?: { [key: string]: unknown };
279
+
280
+ serverCard?: ServerCard;
281
+
282
+ source?: StdioDeployPayload.Source;
283
+ }
284
+
285
+ export namespace StdioDeployPayload {
286
+ export interface Source {
287
+ branch?: string;
288
+
289
+ commit?: string;
290
+ }
291
+ }
292
+
57
293
  export interface DeploymentRetrieveResponse {
58
294
  id: string;
59
295
 
@@ -152,6 +388,11 @@ export interface DeploymentResumeParams {
152
388
 
153
389
  export declare namespace Deployments {
154
390
  export {
391
+ type DeployPayload as DeployPayload,
392
+ type ExternalDeployPayload as ExternalDeployPayload,
393
+ type HostedDeployPayload as HostedDeployPayload,
394
+ type ServerCard as ServerCard,
395
+ type StdioDeployPayload as StdioDeployPayload,
155
396
  type DeploymentRetrieveResponse as DeploymentRetrieveResponse,
156
397
  type DeploymentListResponse as DeploymentListResponse,
157
398
  type DeploymentDeployResponse as DeploymentDeployResponse,
@@ -2,6 +2,11 @@
2
2
 
3
3
  export {
4
4
  Deployments,
5
+ type DeployPayload,
6
+ type ExternalDeployPayload,
7
+ type HostedDeployPayload,
8
+ type ServerCard,
9
+ type StdioDeployPayload,
5
10
  type DeploymentRetrieveResponse,
6
11
  type DeploymentListResponse,
7
12
  type DeploymentDeployResponse,
@@ -3,6 +3,7 @@
3
3
  import { APIResource } from '../../core/resource';
4
4
  import * as DeploymentsAPI from './deployments';
5
5
  import {
6
+ DeployPayload,
6
7
  DeploymentDeployParams,
7
8
  DeploymentDeployResponse,
8
9
  DeploymentListResponse,
@@ -11,6 +12,10 @@ import {
11
12
  DeploymentRetrieveParams,
12
13
  DeploymentRetrieveResponse,
13
14
  Deployments,
15
+ ExternalDeployPayload,
16
+ HostedDeployPayload,
17
+ ServerCard,
18
+ StdioDeployPayload,
14
19
  } from './deployments';
15
20
  import * as LogsAPI from './logs';
16
21
  import { LogListParams, LogListResponse, Logs } from './logs';
@@ -31,7 +36,7 @@ export class Servers extends APIResource {
31
36
  }
32
37
 
33
38
  /**
34
- * Get a paginated list of all servers
39
+ * Get a paginated list of all servers. Use the `q` parameter to search.
35
40
  */
36
41
  list(
37
42
  query: ServerListParams | null | undefined = {},
@@ -128,7 +133,19 @@ export interface ServerListResponse {
128
133
  }
129
134
 
130
135
  export interface ServerListParams extends SmitheryPageParams {
136
+ isDeployed?: '0' | '1' | 'true' | 'false';
137
+
138
+ ownerId?: string;
139
+
131
140
  q?: string;
141
+
142
+ remote?: '0' | '1' | 'true' | 'false';
143
+
144
+ repoName?: string;
145
+
146
+ repoOwner?: string;
147
+
148
+ verified?: '0' | '1' | 'true' | 'false';
132
149
  }
133
150
 
134
151
  Servers.Deployments = Deployments;
@@ -144,6 +161,11 @@ export declare namespace Servers {
144
161
 
145
162
  export {
146
163
  Deployments as Deployments,
164
+ type DeployPayload as DeployPayload,
165
+ type ExternalDeployPayload as ExternalDeployPayload,
166
+ type HostedDeployPayload as HostedDeployPayload,
167
+ type ServerCard as ServerCard,
168
+ type StdioDeployPayload as StdioDeployPayload,
147
169
  type DeploymentRetrieveResponse as DeploymentRetrieveResponse,
148
170
  type DeploymentListResponse as DeploymentListResponse,
149
171
  type DeploymentDeployResponse as DeploymentDeployResponse,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.1.0-alpha.9'; // x-release-please-version
1
+ export const VERSION = '0.2.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.0-alpha.9";
1
+ export declare const VERSION = "0.2.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,kBAAkB,CAAC"}
1
+ {"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.0-alpha.9";
1
+ export declare const VERSION = "0.2.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,kBAAkB,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.1.0-alpha.9'; // x-release-please-version
4
+ exports.VERSION = '0.2.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,eAAe,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.1.0-alpha.9'; // x-release-please-version
1
+ export const VERSION = '0.2.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
package/version.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}