@smithery/api 0.1.0-alpha.8 → 0.1.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 +41 -0
- package/README.md +5 -5
- package/client.d.mts +6 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -1
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +22 -0
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts +22 -0
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.js +23 -1
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs +21 -0
- package/core/pagination.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/search.d.mts +4 -0
- package/resources/search.d.mts.map +1 -0
- package/resources/search.d.ts +4 -0
- package/resources/search.d.ts.map +1 -0
- package/resources/search.js +9 -0
- package/resources/search.js.map +1 -0
- package/resources/search.mjs +5 -0
- package/resources/search.mjs.map +1 -0
- package/resources/servers/deployments.d.mts +165 -288
- package/resources/servers/deployments.d.mts.map +1 -1
- package/resources/servers/deployments.d.ts +165 -288
- package/resources/servers/deployments.d.ts.map +1 -1
- package/resources/servers/index.d.mts +1 -1
- package/resources/servers/index.d.mts.map +1 -1
- package/resources/servers/index.d.ts +1 -1
- package/resources/servers/index.d.ts.map +1 -1
- package/resources/servers/index.js.map +1 -1
- package/resources/servers/index.mjs.map +1 -1
- package/resources/servers/servers.d.mts +9 -3
- package/resources/servers/servers.d.mts.map +1 -1
- package/resources/servers/servers.d.ts +9 -3
- package/resources/servers/servers.d.ts.map +1 -1
- package/resources/servers/servers.js +1 -1
- package/resources/servers/servers.js.map +1 -1
- package/resources/servers/servers.mjs +1 -1
- package/resources/servers/servers.mjs.map +1 -1
- package/src/client.ts +15 -1
- package/src/core/pagination.ts +57 -0
- package/src/resources/index.ts +1 -0
- package/src/resources/search.ts +5 -0
- package/src/resources/servers/deployments.ts +202 -385
- package/src/resources/servers/index.ts +5 -0
- package/src/resources/servers/servers.ts +23 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
|
@@ -23,7 +23,7 @@ class Servers extends resource_1.APIResource {
|
|
|
23
23
|
return this._client.get((0, path_1.path) `/servers/${qualifiedName}`, options);
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
* Get a paginated list of all servers
|
|
26
|
+
* Get a paginated list of all servers. Use the `q` parameter to search.
|
|
27
27
|
*/
|
|
28
28
|
list(query = {}, options) {
|
|
29
29
|
return this._client.getAPIList('/servers', (pagination_1.SmitheryPage), { query, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"servers.js","sourceRoot":"","sources":["../../src/resources/servers/servers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,yEAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"servers.js","sourceRoot":"","sources":["../../src/resources/servers/servers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,yEAAgD;AAChD,kDAcuB;AACvB,2DAAkC;AAClC,oCAA8D;AAE9D,yDAA2F;AAE3F,uDAAiD;AAEjD,MAAa,OAAQ,SAAQ,sBAAW;IAAxC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAkBtD,CAAC;IAhBC;;OAEG;IACH,QAAQ,CAAC,aAAqB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,YAAY,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;OAEG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,CAAA,yBAAgC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtG,CAAC;CACF;AApBD,0BAoBC;AAwGD,OAAO,CAAC,WAAW,GAAG,yBAAW,CAAC;AAClC,OAAO,CAAC,IAAI,GAAG,WAAI,CAAC"}
|
|
@@ -19,7 +19,7 @@ export class Servers extends APIResource {
|
|
|
19
19
|
return this._client.get(path `/servers/${qualifiedName}`, options);
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Get a paginated list of all servers
|
|
22
|
+
* Get a paginated list of all servers. Use the `q` parameter to search.
|
|
23
23
|
*/
|
|
24
24
|
list(query = {}, options) {
|
|
25
25
|
return this._client.getAPIList('/servers', (SmitheryPage), { query, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"servers.mjs","sourceRoot":"","sources":["../../src/resources/servers/servers.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,
|
|
1
|
+
{"version":3,"file":"servers.mjs","sourceRoot":"","sources":["../../src/resources/servers/servers.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EASL,WAAW,GAKZ;OACM,KAAK,OAAO;OACZ,EAAkC,IAAI,EAAE;OAExC,EAAe,YAAY,EAA2B;OAEtD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IAAxC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAkBtD,CAAC;IAhBC;;OAEG;IACH,QAAQ,CAAC,aAAqB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;OAEG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,CAAA,YAAgC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtG,CAAC;CACF;AAwGD,OAAO,CAAC,WAAW,GAAG,WAAW,CAAC;AAClC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC"}
|
package/src/client.ts
CHANGED
|
@@ -14,11 +14,18 @@ import * as Opts from './internal/request-options';
|
|
|
14
14
|
import { VERSION } from './version';
|
|
15
15
|
import * as Errors from './core/error';
|
|
16
16
|
import * as Pagination from './core/pagination';
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
AbstractPage,
|
|
19
|
+
type SearchPageParams,
|
|
20
|
+
SearchPageResponse,
|
|
21
|
+
type SmitheryPageParams,
|
|
22
|
+
SmitheryPageResponse,
|
|
23
|
+
} from './core/pagination';
|
|
18
24
|
import * as Uploads from './core/uploads';
|
|
19
25
|
import * as API from './resources/index';
|
|
20
26
|
import { APIPromise } from './core/api-promise';
|
|
21
27
|
import { Health, HealthCheckResponse } from './resources/health';
|
|
28
|
+
import { Search } from './resources/search';
|
|
22
29
|
import { Uplink, UplinkCreateTokenResponse } from './resources/uplink';
|
|
23
30
|
import {
|
|
24
31
|
ServerListParams,
|
|
@@ -745,11 +752,13 @@ export class Smithery {
|
|
|
745
752
|
|
|
746
753
|
health: API.Health = new API.Health(this);
|
|
747
754
|
servers: API.Servers = new API.Servers(this);
|
|
755
|
+
search: API.Search = new API.Search(this);
|
|
748
756
|
uplink: API.Uplink = new API.Uplink(this);
|
|
749
757
|
}
|
|
750
758
|
|
|
751
759
|
Smithery.Health = Health;
|
|
752
760
|
Smithery.Servers = Servers;
|
|
761
|
+
Smithery.Search = Search;
|
|
753
762
|
Smithery.Uplink = Uplink;
|
|
754
763
|
|
|
755
764
|
export declare namespace Smithery {
|
|
@@ -758,6 +767,9 @@ export declare namespace Smithery {
|
|
|
758
767
|
export import SmitheryPage = Pagination.SmitheryPage;
|
|
759
768
|
export { type SmitheryPageParams as SmitheryPageParams, type SmitheryPageResponse as SmitheryPageResponse };
|
|
760
769
|
|
|
770
|
+
export import SearchPage = Pagination.SearchPage;
|
|
771
|
+
export { type SearchPageParams as SearchPageParams, type SearchPageResponse as SearchPageResponse };
|
|
772
|
+
|
|
761
773
|
export { Health as Health, type HealthCheckResponse as HealthCheckResponse };
|
|
762
774
|
|
|
763
775
|
export {
|
|
@@ -768,5 +780,7 @@ export declare namespace Smithery {
|
|
|
768
780
|
type ServerListParams as ServerListParams,
|
|
769
781
|
};
|
|
770
782
|
|
|
783
|
+
export { Search as Search };
|
|
784
|
+
|
|
771
785
|
export { Uplink as Uplink, type UplinkCreateTokenResponse as UplinkCreateTokenResponse };
|
|
772
786
|
}
|
package/src/core/pagination.ts
CHANGED
|
@@ -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
|
+
}
|
package/src/resources/index.ts
CHANGED