mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-04 20:42:52 +00:00
feat: enable stricter typescript compiler options
This commit is contained in:
@@ -128,8 +128,8 @@ export class Client {
|
||||
size: 1,
|
||||
});
|
||||
|
||||
if (response.data.length === 1 && response.data[0].uid === uid) {
|
||||
return response.data[0];
|
||||
if (response.data.length === 1 && response.data[0]!.uid === uid) {
|
||||
return response.data[0]!;
|
||||
}
|
||||
|
||||
throw new SCInternalServerErrorResponse(new SCNotFoundErrorResponse(true), true);
|
||||
@@ -220,11 +220,11 @@ export class Client {
|
||||
for (const key of Object.keys(multiSearchRequest)) {
|
||||
const searchRequest = multiSearchRequest[key];
|
||||
|
||||
if (searchRequest.size === undefined) {
|
||||
if (searchRequest?.size === undefined) {
|
||||
preFlightRequest[key] = {
|
||||
...searchRequest,
|
||||
};
|
||||
preFlightRequest[key].size = 0;
|
||||
preFlightRequest[key]!.size = 0;
|
||||
preFlightNecessary = true;
|
||||
}
|
||||
}
|
||||
@@ -245,8 +245,8 @@ export class Client {
|
||||
);
|
||||
|
||||
// set size for multi search requests that were in pre flight request
|
||||
for (const key of Object.keys(preFlightRequest)) {
|
||||
returnMultiSearchRequest[key].size = preFlightResponse[key].pagination.total;
|
||||
for (const key in preFlightRequest) {
|
||||
returnMultiSearchRequest[key]!.size = preFlightResponse[key]!.pagination.total;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ export class ConnectorClient extends Client {
|
||||
const thingSource = source === undefined ? 'stapps-api' : source;
|
||||
|
||||
// request a new bulk
|
||||
const bulk = await this.bulk(things[0].type, thingSource, timeout);
|
||||
const bulk = await this.bulk(things[0]!.type, thingSource, timeout);
|
||||
|
||||
// add items to the bulk - 5 concurrently
|
||||
await Promise.all(
|
||||
|
||||
@@ -33,7 +33,7 @@ export class ApiError extends Error {
|
||||
/**
|
||||
* Add additional data to the output of the error
|
||||
*/
|
||||
toString(): string {
|
||||
override toString(): string {
|
||||
let string_ = super.toString();
|
||||
|
||||
// add additional data
|
||||
|
||||
Reference in New Issue
Block a user