11import { serviceRequest } from '../../shared.js' ;
22import { ID , SCOPES } from '../config.js' ;
33
4- import type { ServiceMethod } from '../../../services/types.js' ;
5- import type { QueryParameters } from '../types.js' ;
6- import type { EntityType } from './endpoint.js' ;
7-
4+ import type { JSONFetchResponse , ServiceMethod } from '../../../services/types.js' ;
5+ import type { PaginatedResponse , QueryParameters } from '../types.js' ;
6+ import type { EntityType , EndpointListDocument } from './endpoint.js' ;
87/**
98 * @see https://docs.globus.org/api/transfer/endpoint_search/#search_scope
109 */
@@ -34,11 +33,19 @@ export type EndpointSearchQuery = QueryParameters<
3433 'Offset'
3534> ;
3635
36+ export type EndpointSearchResult = PaginatedResponse <
37+ 'Offset' ,
38+ Omit < EndpointListDocument , 'length' >
39+ > ;
40+
3741/**
3842 * Get a list of endpoints matching the search filters in a given search scope.
3943 * @see https://docs.globus.org/api/transfer/endpoint_search/#endpoint_search
4044 */
41- export const endpointSearch = function ( options ?, sdkOptions ?) {
45+ export const endpointSearch = function (
46+ options ?,
47+ sdkOptions ?,
48+ ) : Promise < JSONFetchResponse < EndpointSearchResult > > {
4249 const serviceRequestOptions = {
4350 ...options ,
4451 query : options ?. query ,
@@ -52,8 +59,11 @@ export const endpointSearch = function (options?, sdkOptions?) {
5259 serviceRequestOptions ,
5360 sdkOptions ,
5461 ) ;
55- } satisfies ServiceMethod < {
56- query ?: EndpointSearchQuery ;
57- } > ;
62+ } satisfies ServiceMethod <
63+ {
64+ query ?: EndpointSearchQuery ;
65+ } ,
66+ JSONFetchResponse < EndpointSearchResult >
67+ > ;
5868
5969export default endpointSearch ;
0 commit comments