Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
requestOptions?: ListUserIDsOptions & RequestOptions
): Readonly> => {
const { page, hitsPerPage, ...options } = requestOptions || {};
const mappedRequestOptions = createMappedRequestOptions(options);
if (page) {
mappedRequestOptions.queryParameters.page = page; // eslint-disable-line functional/immutable-data
}
if (hitsPerPage) {
mappedRequestOptions.queryParameters.hitsPerPage = hitsPerPage; // eslint-disable-line functional/immutable-data
}
return base.transporter.read(
{
method: MethodEnum.Get,
path: '1/clusters/mapping',
},
mappedRequestOptions
);
};
};
if (length) {
mappedRequestOptions.queryParameters.length = length; // eslint-disable-line functional/immutable-data
}
if (offset) {
mappedRequestOptions.queryParameters.offset = offset; // eslint-disable-line functional/immutable-data
}
if (type) {
mappedRequestOptions.queryParameters.type = type; // eslint-disable-line functional/immutable-data
}
return base.transporter.read(
{
method: MethodEnum.Get,
path: '1/logs',
},
mappedRequestOptions
);
};
};
return (
objectID: string,
requestOptions?: RequestOptions & GetObjectOptions
): Readonly> => {
const { attributesToRetrieve, ...options } = requestOptions || {};
const mappedRequestOptions = createMappedRequestOptions(options);
if (attributesToRetrieve) {
mappedRequestOptions.queryParameters.attributesToRetrieve = attributesToRetrieve; // eslint-disable-line functional/immutable-data
}
return base.transporter.read(
{
method: MethodEnum.Get,
path: encode('1/indexes/%s/%s', base.indexName, objectID),
},
mappedRequestOptions
);
};
};
return (requestOptions?: RequestOptions): Readonly> => {
const mappedRequestOptions = createMappedRequestOptions(requestOptions);
// eslint-disable-next-line functional/immutable-data
mappedRequestOptions.queryParameters.getVersion = '2';
return base.transporter.read(
{
method: MethodEnum.Get,
path: encode('1/indexes/%s/settings', base.indexName),
},
mappedRequestOptions
);
};
};
return (requestOptions?: RequestOptions): Readonly> => {
return base.transporter.read(
{
method: MethodEnum.Get,
path: '1/clusters/mapping/top',
},
requestOptions
);
};
};
return (
requestOptions?: RequestOptions & GetABTestsOptions
): Readonly> => {
return base.transporter.read(
{
method: MethodEnum.Get,
path: '2/abtests',
},
requestOptions
);
};
};
return (
taskID: number,
requestOptions?: RequestOptions
): Readonly> => {
return base.transporter.read(
{
method: MethodEnum.Get,
path: encode('1/indexes/%s/task/%s', base.indexName, taskID.toString()),
},
requestOptions
);
};
};
return (userID: string, requestOptions?: RequestOptions): Readonly> => {
return base.transporter.read(
{
method: MethodEnum.Get,
path: encode('1/clusters/mapping/%s', userID),
},
requestOptions
);
};
};
return (requestOptions?: RequestOptions): Readonly> => {
return base.transporter.read(
{
method: MethodEnum.Get,
path: '1/clusters',
},
requestOptions
);
};
};
return (
requestOptions?: RequestOptions
): Readonly> => {
return base.transporter.read(
{
method: MethodEnum.Get,
path: '1/strategies/personalization',
},
requestOptions
);
};
};