refactor: split api into api, api-cli & api-plugin

This commit is contained in:
2023-06-02 16:41:25 +02:00
parent 495a63977c
commit b21833de40
205 changed files with 1981 additions and 1492 deletions

View File

@@ -20,7 +20,6 @@ import {SCErrorResponse, SCLicensePlate, SCSearchRequest, SCThings} from '@opens
export class ApiError extends Error {
/**
* Instantiate a new error
*
* @param data Representation of an error that happened in the backend
*/
constructor(protected data: Partial<SCErrorResponse>) {
@@ -38,12 +37,12 @@ export class ApiError extends Error {
let string_ = super.toString();
// add additional data
if (typeof this.data.additionalData !== 'undefined') {
if (this.data.additionalData !== undefined) {
string_ += `\n\n${JSON.stringify(this.data.additionalData)}`;
}
// add "remote" stack trace
if (typeof this.data.stack !== 'undefined') {
if (this.data.stack !== undefined) {
string_ += `\n\n${this.data.stack}`;
}
@@ -57,7 +56,6 @@ export class ApiError extends Error {
export class OutOfRangeError extends ApiError {
/**
* Instantiate a new error
*
* @param searchRequest Search request where window is out of range
*/
constructor(searchRequest: SCSearchRequest) {
@@ -75,7 +73,6 @@ export class OutOfRangeError extends ApiError {
export class BulkWithMultipleTypesError extends ApiError {
/**
* Instantiate a new error
*
* @param offendingThing Thing that has a different type than the previous things
*/
constructor(offendingThing: SCThings) {