1- import { ApiSettingsV2 } from "./apiSettingsV2 .js" ;
1+ import { ApiSettings } from "./apiSettings .js" ;
22import { Dispatcher } from "undici" ;
33import { BaseParameters } from "@/v2/client/index.js" ;
44import {
@@ -16,10 +16,10 @@ import { BaseProduct } from "@/v2/product/baseProduct.js";
1616
1717
1818export class MindeeApiV2 {
19- settings : ApiSettingsV2 ;
19+ settings : ApiSettings ;
2020
2121 constructor ( dispatcher ?: Dispatcher , apiKey ?: string ) {
22- this . settings = new ApiSettingsV2 ( { dispatcher : dispatcher , apiKey : apiKey } ) ;
22+ this . settings = new ApiSettings ( { dispatcher : dispatcher , apiKey : apiKey } ) ;
2323 }
2424
2525 /**
@@ -80,7 +80,10 @@ export class MindeeApiV2 {
8080 result : BaseHttpResponse ,
8181 responseClass : ResponseConstructor < T > ,
8282 ) : T {
83- if ( result . messageObj ?. statusCode && ( result . messageObj ?. statusCode > 399 || result . messageObj ?. statusCode < 200 ) ) {
83+ if (
84+ result . messageObj ?. statusCode
85+ && ( result . messageObj ?. statusCode > 399 || result . messageObj ?. statusCode < 200 )
86+ ) {
8487 if ( result . data ?. status !== null ) {
8588 throw new MindeeHttpErrorV2 ( new ErrorResponse ( result . data ) ) ;
8689 }
@@ -98,7 +101,9 @@ export class MindeeApiV2 {
98101 try {
99102 return new responseClass ( result . data ) ;
100103 } catch ( e ) {
101- logger . error ( `Raised '${ e } ' Couldn't deserialize response object:\n${ JSON . stringify ( result . data ) } ` ) ;
104+ logger . error (
105+ `Raised '${ e } ' Couldn't deserialize response object:\n${ JSON . stringify ( result . data ) } `
106+ ) ;
102107 throw new MindeeDeserializationError ( "Couldn't deserialize response object." ) ;
103108 }
104109 }
0 commit comments