@edifice.io/rest-client-base 2.5.22-develop-b2school.20260608181736 → 2.5.22-develop.20260615185517

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -170,7 +170,7 @@ class u {
170
170
  return this.httpService.deleteJson(t, e);
171
171
  }
172
172
  }
173
- class o {
173
+ class y {
174
174
  /**
175
175
  * Creates a new API client instance
176
176
  *
@@ -302,10 +302,15 @@ class o {
302
302
  * @param queryParams Optional query parameters
303
303
  * @returns Complete URL
304
304
  * @protected
305
+ * @throws {URIError} if the baseUrl attribute is not parsable
305
306
  */
306
307
  buildUrl(t, e) {
307
- let s = `${this.baseUrl}${t}`;
308
- return s.startsWith("//") && (s = s.replace(/^\/\//, "/")), e && e.toString() && (s += `?${e.toString()}`), s;
308
+ if (!URL.canParse(this.baseUrl))
309
+ throw new URIError(`{baseUrl: ${this.baseUrl}} is not a parsable URL.`);
310
+ const s = new URL(this.baseUrl);
311
+ return s.pathname = t, e && e.forEach((r, n, p) => {
312
+ s.searchParams.set(n, r);
313
+ }), s.toString();
309
314
  }
310
315
  /**
311
316
  * Builds headers for a request by combining default and request-specific headers
@@ -320,24 +325,24 @@ class o {
320
325
  };
321
326
  }
322
327
  }
323
- function y(...a) {
328
+ function f(...a) {
324
329
  return () => {
325
330
  };
326
331
  }
327
- function f(...a) {
332
+ function b(...a) {
328
333
  return () => {
329
334
  };
330
335
  }
331
- function b(...a) {
336
+ function m(...a) {
332
337
  return () => {
333
338
  };
334
339
  }
335
340
  export {
336
341
  i as ApiError,
337
- f as ApiProperty,
338
- b as ApiPropertyOptional,
339
- o as BaseApiClient,
342
+ b as ApiProperty,
343
+ m as ApiPropertyOptional,
344
+ y as BaseApiClient,
340
345
  d as FetchAdapter,
341
346
  u as HttpServiceAdapter,
342
- y as Type
347
+ f as Type
343
348
  };
@@ -1 +1 @@
1
- "use strict";var M=Object.defineProperty;var A=(n,t,r)=>t in n?M(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r;var c=(n,t,r)=>A(n,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("@nestjs/swagger");class l extends Error{constructor(r,e){super(e||`API request failed: ${r.status} ${r.statusText}`);c(this,"_response");c(this,"_jsonData",null);c(this,"_textData",null);this.name="ApiError",this._response=r,Object.setPrototypeOf(this,l.prototype)}response(){return this._response}status(){return this._response.status}statusText(){return this._response.statusText}async json(){if(this._jsonData===null)try{const r=this._response.clone();this._jsonData=await r.json()}catch{this._jsonData=null}return this._jsonData}async text(){if(this._textData===null)try{const r=this._response.clone();this._textData=await r.text()}catch{this._textData=""}return this._textData}}class g{constructor(t=fetch){this.fetchImpl=t}async handleResponse(t){if(!t.ok)throw new l(t);const r=t.headers.get("content-type");return r&&r.includes("application/json")?await t.json():{}}async get(t,r){const e=await this.fetchImpl(t,{method:"GET",headers:r,credentials:"include"});return this.handleResponse(e)}async post(t,r,e){const s=await this.fetchImpl(t,{method:"POST",headers:{"Content-Type":"application/json",...e},body:JSON.stringify(r),credentials:"include"});return this.handleResponse(s)}async put(t,r,e){const s=await this.fetchImpl(t,{method:"PUT",headers:{"Content-Type":"application/json",...e},body:JSON.stringify(r),credentials:"include"});return this.handleResponse(s)}async patch(t,r,e){const s=await this.fetchImpl(t,{method:"PATCH",headers:{"Content-Type":"application/json",...e},body:JSON.stringify(r),credentials:"include"});return this.handleResponse(s)}async delete(t,r){const e=await this.fetchImpl(t,{method:"DELETE",headers:r,credentials:"include"});return this.handleResponse(e)}async deleteWithBody(t,r,e){const s=await this.fetchImpl(t,{method:"DELETE",headers:{"Content-Type":"application/json",...e},body:JSON.stringify(r),credentials:"include"});return this.handleResponse(s)}}class _{constructor(t){this.httpService=t}async get(t,r){const e=r?{headers:r}:void 0;return this.httpService.get(t,e)}async post(t,r,e){const s=e?{headers:e}:void 0;return this.httpService.postJson(t,r,s)}async put(t,r,e){const s=e?{headers:e}:void 0;return this.httpService.putJson(t,r,s)}async patch(t,r,e){const s=e?{headers:e}:void 0;return this.httpService.patchJson(t,r,s)}async delete(t,r){const e=r?{headers:r}:void 0;return this.httpService.delete(t,e)}async deleteWithBody(t,r,e){return this.httpService.deleteJson(t,r)}}class S{constructor(t={}){c(this,"baseUrl");c(this,"defaultHeaders");c(this,"httpAdapter");this.baseUrl=t.baseUrl||"",this.defaultHeaders=t.defaultHeaders||{},t.httpAdapter?this.httpAdapter=t.httpAdapter:t.httpService?this.httpAdapter=new _(t.httpService):this.httpAdapter=new g(t.fetchImpl||fetch)}async get(t,r,e){const s=this.buildUrl(t,r);return this.httpAdapter.get(s,this.buildHeaders(e==null?void 0:e.headers))}async post(t,r,e,s){const a=this.buildUrl(t,e);return this.httpAdapter.post(a,r,this.buildHeaders(s==null?void 0:s.headers))}async put(t,r,e,s){const a=this.buildUrl(t,e);return this.httpAdapter.put(a,r,this.buildHeaders(s==null?void 0:s.headers))}async patch(t,r,e,s){const a=this.buildUrl(t,e);return this.httpAdapter.patch(a,r,this.buildHeaders(s==null?void 0:s.headers))}async delete(t,r,e){const s=this.buildUrl(t,r);return this.httpAdapter.delete(s,this.buildHeaders(e==null?void 0:e.headers))}async deleteWithBody(t,r,e,s){const a=this.buildUrl(t,e);return this.httpAdapter.deleteWithBody(a,r,this.buildHeaders(s==null?void 0:s.headers))}buildUrl(t,r){let e=`${this.baseUrl}${t}`;return e.startsWith("//")&&(e=e.replace(/^\/\//,"/")),r&&r.toString()&&(e+=`?${r.toString()}`),e}buildHeaders(t){return{...this.defaultHeaders,...t}}}var o;(function(n){n[n.PLAIN_TO_CLASS=0]="PLAIN_TO_CLASS",n[n.CLASS_TO_PLAIN=1]="CLASS_TO_PLAIN",n[n.CLASS_TO_CLASS=2]="CLASS_TO_CLASS"})(o||(o={}));var v=function(){function n(){this._typeMetadatas=new Map,this._transformMetadatas=new Map,this._exposeMetadatas=new Map,this._excludeMetadatas=new Map,this._ancestorsMap=new Map}return n.prototype.addTypeMetadata=function(t){this._typeMetadatas.has(t.target)||this._typeMetadatas.set(t.target,new Map),this._typeMetadatas.get(t.target).set(t.propertyName,t)},n.prototype.addTransformMetadata=function(t){this._transformMetadatas.has(t.target)||this._transformMetadatas.set(t.target,new Map),this._transformMetadatas.get(t.target).has(t.propertyName)||this._transformMetadatas.get(t.target).set(t.propertyName,[]),this._transformMetadatas.get(t.target).get(t.propertyName).push(t)},n.prototype.addExposeMetadata=function(t){this._exposeMetadatas.has(t.target)||this._exposeMetadatas.set(t.target,new Map),this._exposeMetadatas.get(t.target).set(t.propertyName,t)},n.prototype.addExcludeMetadata=function(t){this._excludeMetadatas.has(t.target)||this._excludeMetadatas.set(t.target,new Map),this._excludeMetadatas.get(t.target).set(t.propertyName,t)},n.prototype.findTransformMetadatas=function(t,r,e){return this.findMetadatas(this._transformMetadatas,t,r).filter(function(s){return!s.options||s.options.toClassOnly===!0&&s.options.toPlainOnly===!0?!0:s.options.toClassOnly===!0?e===o.CLASS_TO_CLASS||e===o.PLAIN_TO_CLASS:s.options.toPlainOnly===!0?e===o.CLASS_TO_PLAIN:!0})},n.prototype.findExcludeMetadata=function(t,r){return this.findMetadata(this._excludeMetadatas,t,r)},n.prototype.findExposeMetadata=function(t,r){return this.findMetadata(this._exposeMetadatas,t,r)},n.prototype.findExposeMetadataByCustomName=function(t,r){return this.getExposedMetadatas(t).find(function(e){return e.options&&e.options.name===r})},n.prototype.findTypeMetadata=function(t,r){return this.findMetadata(this._typeMetadatas,t,r)},n.prototype.getStrategy=function(t){var r=this._excludeMetadatas.get(t),e=r&&r.get(void 0),s=this._exposeMetadatas.get(t),a=s&&s.get(void 0);return e&&a||!e&&!a?"none":e?"excludeAll":"exposeAll"},n.prototype.getExposedMetadatas=function(t){return this.getMetadata(this._exposeMetadatas,t)},n.prototype.getExcludedMetadatas=function(t){return this.getMetadata(this._excludeMetadatas,t)},n.prototype.getExposedProperties=function(t,r){return this.getExposedMetadatas(t).filter(function(e){return!e.options||e.options.toClassOnly===!0&&e.options.toPlainOnly===!0?!0:e.options.toClassOnly===!0?r===o.CLASS_TO_CLASS||r===o.PLAIN_TO_CLASS:e.options.toPlainOnly===!0?r===o.CLASS_TO_PLAIN:!0}).map(function(e){return e.propertyName})},n.prototype.getExcludedProperties=function(t,r){return this.getExcludedMetadatas(t).filter(function(e){return!e.options||e.options.toClassOnly===!0&&e.options.toPlainOnly===!0?!0:e.options.toClassOnly===!0?r===o.CLASS_TO_CLASS||r===o.PLAIN_TO_CLASS:e.options.toPlainOnly===!0?r===o.CLASS_TO_PLAIN:!0}).map(function(e){return e.propertyName})},n.prototype.clear=function(){this._typeMetadatas.clear(),this._exposeMetadatas.clear(),this._excludeMetadatas.clear(),this._ancestorsMap.clear()},n.prototype.getMetadata=function(t,r){var e=t.get(r),s;e&&(s=Array.from(e.values()).filter(function(f){return f.propertyName!==void 0}));for(var a=[],i=0,p=this.getAncestors(r);i<p.length;i++){var h=p[i],d=t.get(h);if(d){var u=Array.from(d.values()).filter(function(f){return f.propertyName!==void 0});a.push.apply(a,u)}}return a.concat(s||[])},n.prototype.findMetadata=function(t,r,e){var s=t.get(r);if(s){var a=s.get(e);if(a)return a}for(var i=0,p=this.getAncestors(r);i<p.length;i++){var h=p[i],d=t.get(h);if(d){var u=d.get(e);if(u)return u}}},n.prototype.findMetadatas=function(t,r,e){var s=t.get(r),a;s&&(a=s.get(e));for(var i=[],p=0,h=this.getAncestors(r);p<h.length;p++){var d=h[p],u=t.get(d);u&&u.has(e)&&i.push.apply(i,u.get(e))}return i.slice().reverse().concat((a||[]).slice().reverse())},n.prototype.getAncestors=function(t){if(!t)return[];if(!this._ancestorsMap.has(t)){for(var r=[],e=Object.getPrototypeOf(t.prototype.constructor);typeof e.prototype<"u";e=Object.getPrototypeOf(e.prototype.constructor))r.push(e);this._ancestorsMap.set(t,r)}return this._ancestorsMap.get(t)},n}(),x=new v;function O(n,t){return t===void 0&&(t={}),function(r,e){var s=Reflect.getMetadata("design:type",r,e);x.addTypeMetadata({target:r.constructor,propertyName:e,reflectedType:s,typeFunction:n,options:t})}}Object.defineProperty(exports,"ApiProperty",{enumerable:!0,get:()=>y.ApiProperty});Object.defineProperty(exports,"ApiPropertyOptional",{enumerable:!0,get:()=>y.ApiPropertyOptional});exports.ApiError=l;exports.BaseApiClient=S;exports.FetchAdapter=g;exports.HttpServiceAdapter=_;exports.Type=O;
1
+ "use strict";var M=Object.defineProperty;var A=(a,t,e)=>t in a?M(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var d=(a,t,e)=>A(a,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("@nestjs/swagger");class l extends Error{constructor(e,r){super(r||`API request failed: ${e.status} ${e.statusText}`);d(this,"_response");d(this,"_jsonData",null);d(this,"_textData",null);this.name="ApiError",this._response=e,Object.setPrototypeOf(this,l.prototype)}response(){return this._response}status(){return this._response.status}statusText(){return this._response.statusText}async json(){if(this._jsonData===null)try{const e=this._response.clone();this._jsonData=await e.json()}catch{this._jsonData=null}return this._jsonData}async text(){if(this._textData===null)try{const e=this._response.clone();this._textData=await e.text()}catch{this._textData=""}return this._textData}}class g{constructor(t=fetch){this.fetchImpl=t}async handleResponse(t){if(!t.ok)throw new l(t);const e=t.headers.get("content-type");return e&&e.includes("application/json")?await t.json():{}}async get(t,e){const r=await this.fetchImpl(t,{method:"GET",headers:e,credentials:"include"});return this.handleResponse(r)}async post(t,e,r){const s=await this.fetchImpl(t,{method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(e),credentials:"include"});return this.handleResponse(s)}async put(t,e,r){const s=await this.fetchImpl(t,{method:"PUT",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(e),credentials:"include"});return this.handleResponse(s)}async patch(t,e,r){const s=await this.fetchImpl(t,{method:"PATCH",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(e),credentials:"include"});return this.handleResponse(s)}async delete(t,e){const r=await this.fetchImpl(t,{method:"DELETE",headers:e,credentials:"include"});return this.handleResponse(r)}async deleteWithBody(t,e,r){const s=await this.fetchImpl(t,{method:"DELETE",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(e),credentials:"include"});return this.handleResponse(s)}}class _{constructor(t){this.httpService=t}async get(t,e){const r=e?{headers:e}:void 0;return this.httpService.get(t,r)}async post(t,e,r){const s=r?{headers:r}:void 0;return this.httpService.postJson(t,e,s)}async put(t,e,r){const s=r?{headers:r}:void 0;return this.httpService.putJson(t,e,s)}async patch(t,e,r){const s=r?{headers:r}:void 0;return this.httpService.patchJson(t,e,s)}async delete(t,e){const r=e?{headers:e}:void 0;return this.httpService.delete(t,r)}async deleteWithBody(t,e,r){return this.httpService.deleteJson(t,e)}}class S{constructor(t={}){d(this,"baseUrl");d(this,"defaultHeaders");d(this,"httpAdapter");this.baseUrl=t.baseUrl||"",this.defaultHeaders=t.defaultHeaders||{},t.httpAdapter?this.httpAdapter=t.httpAdapter:t.httpService?this.httpAdapter=new _(t.httpService):this.httpAdapter=new g(t.fetchImpl||fetch)}async get(t,e,r){const s=this.buildUrl(t,e);return this.httpAdapter.get(s,this.buildHeaders(r==null?void 0:r.headers))}async post(t,e,r,s){const n=this.buildUrl(t,r);return this.httpAdapter.post(n,e,this.buildHeaders(s==null?void 0:s.headers))}async put(t,e,r,s){const n=this.buildUrl(t,r);return this.httpAdapter.put(n,e,this.buildHeaders(s==null?void 0:s.headers))}async patch(t,e,r,s){const n=this.buildUrl(t,r);return this.httpAdapter.patch(n,e,this.buildHeaders(s==null?void 0:s.headers))}async delete(t,e,r){const s=this.buildUrl(t,e);return this.httpAdapter.delete(s,this.buildHeaders(r==null?void 0:r.headers))}async deleteWithBody(t,e,r,s){const n=this.buildUrl(t,r);return this.httpAdapter.deleteWithBody(n,e,this.buildHeaders(s==null?void 0:s.headers))}buildUrl(t,e){if(!URL.canParse(this.baseUrl))throw new URIError(`{baseUrl: ${this.baseUrl}} is not a parsable URL.`);const r=new URL(this.baseUrl);return r.pathname=t,e&&e.forEach((s,n,i)=>{r.searchParams.set(n,s)}),r.toString()}buildHeaders(t){return{...this.defaultHeaders,...t}}}var o;(function(a){a[a.PLAIN_TO_CLASS=0]="PLAIN_TO_CLASS",a[a.CLASS_TO_PLAIN=1]="CLASS_TO_PLAIN",a[a.CLASS_TO_CLASS=2]="CLASS_TO_CLASS"})(o||(o={}));var v=function(){function a(){this._typeMetadatas=new Map,this._transformMetadatas=new Map,this._exposeMetadatas=new Map,this._excludeMetadatas=new Map,this._ancestorsMap=new Map}return a.prototype.addTypeMetadata=function(t){this._typeMetadatas.has(t.target)||this._typeMetadatas.set(t.target,new Map),this._typeMetadatas.get(t.target).set(t.propertyName,t)},a.prototype.addTransformMetadata=function(t){this._transformMetadatas.has(t.target)||this._transformMetadatas.set(t.target,new Map),this._transformMetadatas.get(t.target).has(t.propertyName)||this._transformMetadatas.get(t.target).set(t.propertyName,[]),this._transformMetadatas.get(t.target).get(t.propertyName).push(t)},a.prototype.addExposeMetadata=function(t){this._exposeMetadatas.has(t.target)||this._exposeMetadatas.set(t.target,new Map),this._exposeMetadatas.get(t.target).set(t.propertyName,t)},a.prototype.addExcludeMetadata=function(t){this._excludeMetadatas.has(t.target)||this._excludeMetadatas.set(t.target,new Map),this._excludeMetadatas.get(t.target).set(t.propertyName,t)},a.prototype.findTransformMetadatas=function(t,e,r){return this.findMetadatas(this._transformMetadatas,t,e).filter(function(s){return!s.options||s.options.toClassOnly===!0&&s.options.toPlainOnly===!0?!0:s.options.toClassOnly===!0?r===o.CLASS_TO_CLASS||r===o.PLAIN_TO_CLASS:s.options.toPlainOnly===!0?r===o.CLASS_TO_PLAIN:!0})},a.prototype.findExcludeMetadata=function(t,e){return this.findMetadata(this._excludeMetadatas,t,e)},a.prototype.findExposeMetadata=function(t,e){return this.findMetadata(this._exposeMetadatas,t,e)},a.prototype.findExposeMetadataByCustomName=function(t,e){return this.getExposedMetadatas(t).find(function(r){return r.options&&r.options.name===e})},a.prototype.findTypeMetadata=function(t,e){return this.findMetadata(this._typeMetadatas,t,e)},a.prototype.getStrategy=function(t){var e=this._excludeMetadatas.get(t),r=e&&e.get(void 0),s=this._exposeMetadatas.get(t),n=s&&s.get(void 0);return r&&n||!r&&!n?"none":r?"excludeAll":"exposeAll"},a.prototype.getExposedMetadatas=function(t){return this.getMetadata(this._exposeMetadatas,t)},a.prototype.getExcludedMetadatas=function(t){return this.getMetadata(this._excludeMetadatas,t)},a.prototype.getExposedProperties=function(t,e){return this.getExposedMetadatas(t).filter(function(r){return!r.options||r.options.toClassOnly===!0&&r.options.toPlainOnly===!0?!0:r.options.toClassOnly===!0?e===o.CLASS_TO_CLASS||e===o.PLAIN_TO_CLASS:r.options.toPlainOnly===!0?e===o.CLASS_TO_PLAIN:!0}).map(function(r){return r.propertyName})},a.prototype.getExcludedProperties=function(t,e){return this.getExcludedMetadatas(t).filter(function(r){return!r.options||r.options.toClassOnly===!0&&r.options.toPlainOnly===!0?!0:r.options.toClassOnly===!0?e===o.CLASS_TO_CLASS||e===o.PLAIN_TO_CLASS:r.options.toPlainOnly===!0?e===o.CLASS_TO_PLAIN:!0}).map(function(r){return r.propertyName})},a.prototype.clear=function(){this._typeMetadatas.clear(),this._exposeMetadatas.clear(),this._excludeMetadatas.clear(),this._ancestorsMap.clear()},a.prototype.getMetadata=function(t,e){var r=t.get(e),s;r&&(s=Array.from(r.values()).filter(function(f){return f.propertyName!==void 0}));for(var n=[],i=0,p=this.getAncestors(e);i<p.length;i++){var h=p[i],c=t.get(h);if(c){var u=Array.from(c.values()).filter(function(f){return f.propertyName!==void 0});n.push.apply(n,u)}}return n.concat(s||[])},a.prototype.findMetadata=function(t,e,r){var s=t.get(e);if(s){var n=s.get(r);if(n)return n}for(var i=0,p=this.getAncestors(e);i<p.length;i++){var h=p[i],c=t.get(h);if(c){var u=c.get(r);if(u)return u}}},a.prototype.findMetadatas=function(t,e,r){var s=t.get(e),n;s&&(n=s.get(r));for(var i=[],p=0,h=this.getAncestors(e);p<h.length;p++){var c=h[p],u=t.get(c);u&&u.has(r)&&i.push.apply(i,u.get(r))}return i.slice().reverse().concat((n||[]).slice().reverse())},a.prototype.getAncestors=function(t){if(!t)return[];if(!this._ancestorsMap.has(t)){for(var e=[],r=Object.getPrototypeOf(t.prototype.constructor);typeof r.prototype<"u";r=Object.getPrototypeOf(r.prototype.constructor))e.push(r);this._ancestorsMap.set(t,e)}return this._ancestorsMap.get(t)},a}(),x=new v;function O(a,t){return t===void 0&&(t={}),function(e,r){var s=Reflect.getMetadata("design:type",e,r);x.addTypeMetadata({target:e.constructor,propertyName:r,reflectedType:s,typeFunction:a,options:t})}}Object.defineProperty(exports,"ApiProperty",{enumerable:!0,get:()=>y.ApiProperty});Object.defineProperty(exports,"ApiPropertyOptional",{enumerable:!0,get:()=>y.ApiPropertyOptional});exports.ApiError=l;exports.BaseApiClient=S;exports.FetchAdapter=g;exports.HttpServiceAdapter=_;exports.Type=O;
@@ -1,21 +1,21 @@
1
1
  var y = Object.defineProperty;
2
- var g = (n, t, r) => t in n ? y(n, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[t] = r;
3
- var h = (n, t, r) => g(n, typeof t != "symbol" ? t + "" : t, r);
4
- import { ApiProperty as T, ApiPropertyOptional as P } from "@nestjs/swagger";
2
+ var _ = (a, t, e) => t in a ? y(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
+ var c = (a, t, e) => _(a, typeof t != "symbol" ? t + "" : t, e);
4
+ import { ApiProperty as P, ApiPropertyOptional as T } from "@nestjs/swagger";
5
5
  class f extends Error {
6
6
  /**
7
7
  * Create a new API error
8
8
  * @param response The original HTTP response
9
9
  * @param message Optional custom error message
10
10
  */
11
- constructor(r, e) {
11
+ constructor(e, r) {
12
12
  super(
13
- e || `API request failed: ${r.status} ${r.statusText}`
13
+ r || `API request failed: ${e.status} ${e.statusText}`
14
14
  );
15
- h(this, "_response");
16
- h(this, "_jsonData", null);
17
- h(this, "_textData", null);
18
- this.name = "ApiError", this._response = r, Object.setPrototypeOf(this, f.prototype);
15
+ c(this, "_response");
16
+ c(this, "_jsonData", null);
17
+ c(this, "_textData", null);
18
+ this.name = "ApiError", this._response = e, Object.setPrototypeOf(this, f.prototype);
19
19
  }
20
20
  /**
21
21
  * Get the original Response object
@@ -46,8 +46,8 @@ class f extends Error {
46
46
  async json() {
47
47
  if (this._jsonData === null)
48
48
  try {
49
- const r = this._response.clone();
50
- this._jsonData = await r.json();
49
+ const e = this._response.clone();
50
+ this._jsonData = await e.json();
51
51
  } catch {
52
52
  this._jsonData = null;
53
53
  }
@@ -60,84 +60,84 @@ class f extends Error {
60
60
  async text() {
61
61
  if (this._textData === null)
62
62
  try {
63
- const r = this._response.clone();
64
- this._textData = await r.text();
63
+ const e = this._response.clone();
64
+ this._textData = await e.text();
65
65
  } catch {
66
66
  this._textData = "";
67
67
  }
68
68
  return this._textData;
69
69
  }
70
70
  }
71
- class _ {
71
+ class g {
72
72
  constructor(t = fetch) {
73
73
  this.fetchImpl = t;
74
74
  }
75
75
  async handleResponse(t) {
76
76
  if (!t.ok)
77
77
  throw new f(t);
78
- const r = t.headers.get("content-type");
79
- return r && r.includes("application/json") ? await t.json() : {};
78
+ const e = t.headers.get("content-type");
79
+ return e && e.includes("application/json") ? await t.json() : {};
80
80
  }
81
- async get(t, r) {
82
- const e = await this.fetchImpl(t, {
81
+ async get(t, e) {
82
+ const r = await this.fetchImpl(t, {
83
83
  method: "GET",
84
- headers: r,
84
+ headers: e,
85
85
  credentials: "include"
86
86
  });
87
- return this.handleResponse(e);
87
+ return this.handleResponse(r);
88
88
  }
89
- async post(t, r, e) {
89
+ async post(t, e, r) {
90
90
  const s = await this.fetchImpl(t, {
91
91
  method: "POST",
92
92
  headers: {
93
93
  "Content-Type": "application/json",
94
- ...e
94
+ ...r
95
95
  },
96
- body: JSON.stringify(r),
96
+ body: JSON.stringify(e),
97
97
  credentials: "include"
98
98
  });
99
99
  return this.handleResponse(s);
100
100
  }
101
- async put(t, r, e) {
101
+ async put(t, e, r) {
102
102
  const s = await this.fetchImpl(t, {
103
103
  method: "PUT",
104
104
  headers: {
105
105
  "Content-Type": "application/json",
106
- ...e
106
+ ...r
107
107
  },
108
- body: JSON.stringify(r),
108
+ body: JSON.stringify(e),
109
109
  credentials: "include"
110
110
  });
111
111
  return this.handleResponse(s);
112
112
  }
113
- async patch(t, r, e) {
113
+ async patch(t, e, r) {
114
114
  const s = await this.fetchImpl(t, {
115
115
  method: "PATCH",
116
116
  headers: {
117
117
  "Content-Type": "application/json",
118
- ...e
118
+ ...r
119
119
  },
120
- body: JSON.stringify(r),
120
+ body: JSON.stringify(e),
121
121
  credentials: "include"
122
122
  });
123
123
  return this.handleResponse(s);
124
124
  }
125
- async delete(t, r) {
126
- const e = await this.fetchImpl(t, {
125
+ async delete(t, e) {
126
+ const r = await this.fetchImpl(t, {
127
127
  method: "DELETE",
128
- headers: r,
128
+ headers: e,
129
129
  credentials: "include"
130
130
  });
131
- return this.handleResponse(e);
131
+ return this.handleResponse(r);
132
132
  }
133
- async deleteWithBody(t, r, e) {
133
+ async deleteWithBody(t, e, r) {
134
134
  const s = await this.fetchImpl(t, {
135
135
  method: "DELETE",
136
136
  headers: {
137
137
  "Content-Type": "application/json",
138
- ...e
138
+ ...r
139
139
  },
140
- body: JSON.stringify(r),
140
+ body: JSON.stringify(e),
141
141
  credentials: "include"
142
142
  });
143
143
  return this.handleResponse(s);
@@ -147,28 +147,28 @@ class M {
147
147
  constructor(t) {
148
148
  this.httpService = t;
149
149
  }
150
- async get(t, r) {
151
- const e = r ? { headers: r } : void 0;
152
- return this.httpService.get(t, e);
150
+ async get(t, e) {
151
+ const r = e ? { headers: e } : void 0;
152
+ return this.httpService.get(t, r);
153
153
  }
154
- async post(t, r, e) {
155
- const s = e ? { headers: e } : void 0;
156
- return this.httpService.postJson(t, r, s);
154
+ async post(t, e, r) {
155
+ const s = r ? { headers: r } : void 0;
156
+ return this.httpService.postJson(t, e, s);
157
157
  }
158
- async put(t, r, e) {
159
- const s = e ? { headers: e } : void 0;
160
- return this.httpService.putJson(t, r, s);
158
+ async put(t, e, r) {
159
+ const s = r ? { headers: r } : void 0;
160
+ return this.httpService.putJson(t, e, s);
161
161
  }
162
- async patch(t, r, e) {
163
- const s = e ? { headers: e } : void 0;
164
- return this.httpService.patchJson(t, r, s);
162
+ async patch(t, e, r) {
163
+ const s = r ? { headers: r } : void 0;
164
+ return this.httpService.patchJson(t, e, s);
165
165
  }
166
- async delete(t, r) {
167
- const e = r ? { headers: r } : void 0;
168
- return this.httpService.delete(t, e);
166
+ async delete(t, e) {
167
+ const r = e ? { headers: e } : void 0;
168
+ return this.httpService.delete(t, r);
169
169
  }
170
- async deleteWithBody(t, r, e) {
171
- return this.httpService.deleteJson(t, r);
170
+ async deleteWithBody(t, e, r) {
171
+ return this.httpService.deleteJson(t, e);
172
172
  }
173
173
  }
174
174
  class x {
@@ -198,18 +198,18 @@ class x {
198
198
  * Base URL for all API requests
199
199
  * @protected
200
200
  */
201
- h(this, "baseUrl");
201
+ c(this, "baseUrl");
202
202
  /**
203
203
  * Default headers included with all requests
204
204
  * @protected
205
205
  */
206
- h(this, "defaultHeaders");
206
+ c(this, "defaultHeaders");
207
207
  /**
208
208
  * HTTP adapter for making requests
209
209
  * @protected
210
210
  */
211
- h(this, "httpAdapter");
212
- this.baseUrl = t.baseUrl || "", this.defaultHeaders = t.defaultHeaders || {}, t.httpAdapter ? this.httpAdapter = t.httpAdapter : t.httpService ? this.httpAdapter = new M(t.httpService) : this.httpAdapter = new _(t.fetchImpl || fetch);
211
+ c(this, "httpAdapter");
212
+ this.baseUrl = t.baseUrl || "", this.defaultHeaders = t.defaultHeaders || {}, t.httpAdapter ? this.httpAdapter = t.httpAdapter : t.httpService ? this.httpAdapter = new M(t.httpService) : this.httpAdapter = new g(t.fetchImpl || fetch);
213
213
  }
214
214
  /**
215
215
  * Performs a GET request
@@ -218,9 +218,9 @@ class x {
218
218
  * @param options Request options
219
219
  * @returns Promise resolving to the response data
220
220
  */
221
- async get(t, r, e) {
222
- const s = this.buildUrl(t, r);
223
- return this.httpAdapter.get(s, this.buildHeaders(e == null ? void 0 : e.headers));
221
+ async get(t, e, r) {
222
+ const s = this.buildUrl(t, e);
223
+ return this.httpAdapter.get(s, this.buildHeaders(r == null ? void 0 : r.headers));
224
224
  }
225
225
  /**
226
226
  * Performs a POST request
@@ -230,11 +230,11 @@ class x {
230
230
  * @param options Request options
231
231
  * @returns Promise resolving to the response data
232
232
  */
233
- async post(t, r, e, s) {
234
- const a = this.buildUrl(t, e);
233
+ async post(t, e, r, s) {
234
+ const n = this.buildUrl(t, r);
235
235
  return this.httpAdapter.post(
236
- a,
237
- r,
236
+ n,
237
+ e,
238
238
  this.buildHeaders(s == null ? void 0 : s.headers)
239
239
  );
240
240
  }
@@ -246,11 +246,11 @@ class x {
246
246
  * @param options Request options
247
247
  * @returns Promise resolving to the response data
248
248
  */
249
- async put(t, r, e, s) {
250
- const a = this.buildUrl(t, e);
249
+ async put(t, e, r, s) {
250
+ const n = this.buildUrl(t, r);
251
251
  return this.httpAdapter.put(
252
- a,
253
- r,
252
+ n,
253
+ e,
254
254
  this.buildHeaders(s == null ? void 0 : s.headers)
255
255
  );
256
256
  }
@@ -262,11 +262,11 @@ class x {
262
262
  * @param options Request options
263
263
  * @returns Promise resolving to the response data
264
264
  */
265
- async patch(t, r, e, s) {
266
- const a = this.buildUrl(t, e);
265
+ async patch(t, e, r, s) {
266
+ const n = this.buildUrl(t, r);
267
267
  return this.httpAdapter.patch(
268
- a,
269
- r,
268
+ n,
269
+ e,
270
270
  this.buildHeaders(s == null ? void 0 : s.headers)
271
271
  );
272
272
  }
@@ -277,9 +277,9 @@ class x {
277
277
  * @param options Request options
278
278
  * @returns Promise resolving when the request is complete
279
279
  */
280
- async delete(t, r, e) {
281
- const s = this.buildUrl(t, r);
282
- return this.httpAdapter.delete(s, this.buildHeaders(e == null ? void 0 : e.headers));
280
+ async delete(t, e, r) {
281
+ const s = this.buildUrl(t, e);
282
+ return this.httpAdapter.delete(s, this.buildHeaders(r == null ? void 0 : r.headers));
283
283
  }
284
284
  /**
285
285
  * Performs a DELETE request with body
@@ -289,11 +289,11 @@ class x {
289
289
  * @param options Request options
290
290
  * @returns Promise resolving to the response data
291
291
  */
292
- async deleteWithBody(t, r, e, s) {
293
- const a = this.buildUrl(t, e);
292
+ async deleteWithBody(t, e, r, s) {
293
+ const n = this.buildUrl(t, r);
294
294
  return this.httpAdapter.deleteWithBody(
295
- a,
296
- r,
295
+ n,
296
+ e,
297
297
  this.buildHeaders(s == null ? void 0 : s.headers)
298
298
  );
299
299
  }
@@ -303,10 +303,15 @@ class x {
303
303
  * @param queryParams Optional query parameters
304
304
  * @returns Complete URL
305
305
  * @protected
306
+ * @throws {URIError} if the baseUrl attribute is not parsable
306
307
  */
307
- buildUrl(t, r) {
308
- let e = `${this.baseUrl}${t}`;
309
- return e.startsWith("//") && (e = e.replace(/^\/\//, "/")), r && r.toString() && (e += `?${r.toString()}`), e;
308
+ buildUrl(t, e) {
309
+ if (!URL.canParse(this.baseUrl))
310
+ throw new URIError(`{baseUrl: ${this.baseUrl}} is not a parsable URL.`);
311
+ const r = new URL(this.baseUrl);
312
+ return r.pathname = t, e && e.forEach((s, n, i) => {
313
+ r.searchParams.set(n, s);
314
+ }), r.toString();
310
315
  }
311
316
  /**
312
317
  * Builds headers for a request by combining default and request-specific headers
@@ -322,126 +327,126 @@ class x {
322
327
  }
323
328
  }
324
329
  var o;
325
- (function(n) {
326
- n[n.PLAIN_TO_CLASS = 0] = "PLAIN_TO_CLASS", n[n.CLASS_TO_PLAIN = 1] = "CLASS_TO_PLAIN", n[n.CLASS_TO_CLASS = 2] = "CLASS_TO_CLASS";
330
+ (function(a) {
331
+ a[a.PLAIN_TO_CLASS = 0] = "PLAIN_TO_CLASS", a[a.CLASS_TO_PLAIN = 1] = "CLASS_TO_PLAIN", a[a.CLASS_TO_CLASS = 2] = "CLASS_TO_CLASS";
327
332
  })(o || (o = {}));
328
- var S = (
333
+ var A = (
329
334
  /** @class */
330
335
  function() {
331
- function n() {
336
+ function a() {
332
337
  this._typeMetadatas = /* @__PURE__ */ new Map(), this._transformMetadatas = /* @__PURE__ */ new Map(), this._exposeMetadatas = /* @__PURE__ */ new Map(), this._excludeMetadatas = /* @__PURE__ */ new Map(), this._ancestorsMap = /* @__PURE__ */ new Map();
333
338
  }
334
- return n.prototype.addTypeMetadata = function(t) {
339
+ return a.prototype.addTypeMetadata = function(t) {
335
340
  this._typeMetadatas.has(t.target) || this._typeMetadatas.set(t.target, /* @__PURE__ */ new Map()), this._typeMetadatas.get(t.target).set(t.propertyName, t);
336
- }, n.prototype.addTransformMetadata = function(t) {
341
+ }, a.prototype.addTransformMetadata = function(t) {
337
342
  this._transformMetadatas.has(t.target) || this._transformMetadatas.set(t.target, /* @__PURE__ */ new Map()), this._transformMetadatas.get(t.target).has(t.propertyName) || this._transformMetadatas.get(t.target).set(t.propertyName, []), this._transformMetadatas.get(t.target).get(t.propertyName).push(t);
338
- }, n.prototype.addExposeMetadata = function(t) {
343
+ }, a.prototype.addExposeMetadata = function(t) {
339
344
  this._exposeMetadatas.has(t.target) || this._exposeMetadatas.set(t.target, /* @__PURE__ */ new Map()), this._exposeMetadatas.get(t.target).set(t.propertyName, t);
340
- }, n.prototype.addExcludeMetadata = function(t) {
345
+ }, a.prototype.addExcludeMetadata = function(t) {
341
346
  this._excludeMetadatas.has(t.target) || this._excludeMetadatas.set(t.target, /* @__PURE__ */ new Map()), this._excludeMetadatas.get(t.target).set(t.propertyName, t);
342
- }, n.prototype.findTransformMetadatas = function(t, r, e) {
343
- return this.findMetadatas(this._transformMetadatas, t, r).filter(function(s) {
344
- return !s.options || s.options.toClassOnly === !0 && s.options.toPlainOnly === !0 ? !0 : s.options.toClassOnly === !0 ? e === o.CLASS_TO_CLASS || e === o.PLAIN_TO_CLASS : s.options.toPlainOnly === !0 ? e === o.CLASS_TO_PLAIN : !0;
347
+ }, a.prototype.findTransformMetadatas = function(t, e, r) {
348
+ return this.findMetadatas(this._transformMetadatas, t, e).filter(function(s) {
349
+ return !s.options || s.options.toClassOnly === !0 && s.options.toPlainOnly === !0 ? !0 : s.options.toClassOnly === !0 ? r === o.CLASS_TO_CLASS || r === o.PLAIN_TO_CLASS : s.options.toPlainOnly === !0 ? r === o.CLASS_TO_PLAIN : !0;
345
350
  });
346
- }, n.prototype.findExcludeMetadata = function(t, r) {
347
- return this.findMetadata(this._excludeMetadatas, t, r);
348
- }, n.prototype.findExposeMetadata = function(t, r) {
349
- return this.findMetadata(this._exposeMetadatas, t, r);
350
- }, n.prototype.findExposeMetadataByCustomName = function(t, r) {
351
- return this.getExposedMetadatas(t).find(function(e) {
352
- return e.options && e.options.name === r;
351
+ }, a.prototype.findExcludeMetadata = function(t, e) {
352
+ return this.findMetadata(this._excludeMetadatas, t, e);
353
+ }, a.prototype.findExposeMetadata = function(t, e) {
354
+ return this.findMetadata(this._exposeMetadatas, t, e);
355
+ }, a.prototype.findExposeMetadataByCustomName = function(t, e) {
356
+ return this.getExposedMetadatas(t).find(function(r) {
357
+ return r.options && r.options.name === e;
353
358
  });
354
- }, n.prototype.findTypeMetadata = function(t, r) {
355
- return this.findMetadata(this._typeMetadatas, t, r);
356
- }, n.prototype.getStrategy = function(t) {
357
- var r = this._excludeMetadatas.get(t), e = r && r.get(void 0), s = this._exposeMetadatas.get(t), a = s && s.get(void 0);
358
- return e && a || !e && !a ? "none" : e ? "excludeAll" : "exposeAll";
359
- }, n.prototype.getExposedMetadatas = function(t) {
359
+ }, a.prototype.findTypeMetadata = function(t, e) {
360
+ return this.findMetadata(this._typeMetadatas, t, e);
361
+ }, a.prototype.getStrategy = function(t) {
362
+ var e = this._excludeMetadatas.get(t), r = e && e.get(void 0), s = this._exposeMetadatas.get(t), n = s && s.get(void 0);
363
+ return r && n || !r && !n ? "none" : r ? "excludeAll" : "exposeAll";
364
+ }, a.prototype.getExposedMetadatas = function(t) {
360
365
  return this.getMetadata(this._exposeMetadatas, t);
361
- }, n.prototype.getExcludedMetadatas = function(t) {
366
+ }, a.prototype.getExcludedMetadatas = function(t) {
362
367
  return this.getMetadata(this._excludeMetadatas, t);
363
- }, n.prototype.getExposedProperties = function(t, r) {
364
- return this.getExposedMetadatas(t).filter(function(e) {
365
- return !e.options || e.options.toClassOnly === !0 && e.options.toPlainOnly === !0 ? !0 : e.options.toClassOnly === !0 ? r === o.CLASS_TO_CLASS || r === o.PLAIN_TO_CLASS : e.options.toPlainOnly === !0 ? r === o.CLASS_TO_PLAIN : !0;
366
- }).map(function(e) {
367
- return e.propertyName;
368
+ }, a.prototype.getExposedProperties = function(t, e) {
369
+ return this.getExposedMetadatas(t).filter(function(r) {
370
+ return !r.options || r.options.toClassOnly === !0 && r.options.toPlainOnly === !0 ? !0 : r.options.toClassOnly === !0 ? e === o.CLASS_TO_CLASS || e === o.PLAIN_TO_CLASS : r.options.toPlainOnly === !0 ? e === o.CLASS_TO_PLAIN : !0;
371
+ }).map(function(r) {
372
+ return r.propertyName;
368
373
  });
369
- }, n.prototype.getExcludedProperties = function(t, r) {
370
- return this.getExcludedMetadatas(t).filter(function(e) {
371
- return !e.options || e.options.toClassOnly === !0 && e.options.toPlainOnly === !0 ? !0 : e.options.toClassOnly === !0 ? r === o.CLASS_TO_CLASS || r === o.PLAIN_TO_CLASS : e.options.toPlainOnly === !0 ? r === o.CLASS_TO_PLAIN : !0;
372
- }).map(function(e) {
373
- return e.propertyName;
374
+ }, a.prototype.getExcludedProperties = function(t, e) {
375
+ return this.getExcludedMetadatas(t).filter(function(r) {
376
+ return !r.options || r.options.toClassOnly === !0 && r.options.toPlainOnly === !0 ? !0 : r.options.toClassOnly === !0 ? e === o.CLASS_TO_CLASS || e === o.PLAIN_TO_CLASS : r.options.toPlainOnly === !0 ? e === o.CLASS_TO_PLAIN : !0;
377
+ }).map(function(r) {
378
+ return r.propertyName;
374
379
  });
375
- }, n.prototype.clear = function() {
380
+ }, a.prototype.clear = function() {
376
381
  this._typeMetadatas.clear(), this._exposeMetadatas.clear(), this._excludeMetadatas.clear(), this._ancestorsMap.clear();
377
- }, n.prototype.getMetadata = function(t, r) {
378
- var e = t.get(r), s;
379
- e && (s = Array.from(e.values()).filter(function(l) {
382
+ }, a.prototype.getMetadata = function(t, e) {
383
+ var r = t.get(e), s;
384
+ r && (s = Array.from(r.values()).filter(function(l) {
380
385
  return l.propertyName !== void 0;
381
386
  }));
382
- for (var a = [], i = 0, p = this.getAncestors(r); i < p.length; i++) {
383
- var c = p[i], d = t.get(c);
384
- if (d) {
385
- var u = Array.from(d.values()).filter(function(l) {
387
+ for (var n = [], i = 0, p = this.getAncestors(e); i < p.length; i++) {
388
+ var d = p[i], h = t.get(d);
389
+ if (h) {
390
+ var u = Array.from(h.values()).filter(function(l) {
386
391
  return l.propertyName !== void 0;
387
392
  });
388
- a.push.apply(a, u);
393
+ n.push.apply(n, u);
389
394
  }
390
395
  }
391
- return a.concat(s || []);
392
- }, n.prototype.findMetadata = function(t, r, e) {
393
- var s = t.get(r);
396
+ return n.concat(s || []);
397
+ }, a.prototype.findMetadata = function(t, e, r) {
398
+ var s = t.get(e);
394
399
  if (s) {
395
- var a = s.get(e);
396
- if (a)
397
- return a;
400
+ var n = s.get(r);
401
+ if (n)
402
+ return n;
398
403
  }
399
- for (var i = 0, p = this.getAncestors(r); i < p.length; i++) {
400
- var c = p[i], d = t.get(c);
401
- if (d) {
402
- var u = d.get(e);
404
+ for (var i = 0, p = this.getAncestors(e); i < p.length; i++) {
405
+ var d = p[i], h = t.get(d);
406
+ if (h) {
407
+ var u = h.get(r);
403
408
  if (u)
404
409
  return u;
405
410
  }
406
411
  }
407
- }, n.prototype.findMetadatas = function(t, r, e) {
408
- var s = t.get(r), a;
409
- s && (a = s.get(e));
410
- for (var i = [], p = 0, c = this.getAncestors(r); p < c.length; p++) {
411
- var d = c[p], u = t.get(d);
412
- u && u.has(e) && i.push.apply(i, u.get(e));
412
+ }, a.prototype.findMetadatas = function(t, e, r) {
413
+ var s = t.get(e), n;
414
+ s && (n = s.get(r));
415
+ for (var i = [], p = 0, d = this.getAncestors(e); p < d.length; p++) {
416
+ var h = d[p], u = t.get(h);
417
+ u && u.has(r) && i.push.apply(i, u.get(r));
413
418
  }
414
- return i.slice().reverse().concat((a || []).slice().reverse());
415
- }, n.prototype.getAncestors = function(t) {
419
+ return i.slice().reverse().concat((n || []).slice().reverse());
420
+ }, a.prototype.getAncestors = function(t) {
416
421
  if (!t)
417
422
  return [];
418
423
  if (!this._ancestorsMap.has(t)) {
419
- for (var r = [], e = Object.getPrototypeOf(t.prototype.constructor); typeof e.prototype < "u"; e = Object.getPrototypeOf(e.prototype.constructor))
420
- r.push(e);
421
- this._ancestorsMap.set(t, r);
424
+ for (var e = [], r = Object.getPrototypeOf(t.prototype.constructor); typeof r.prototype < "u"; r = Object.getPrototypeOf(r.prototype.constructor))
425
+ e.push(r);
426
+ this._ancestorsMap.set(t, e);
422
427
  }
423
428
  return this._ancestorsMap.get(t);
424
- }, n;
429
+ }, a;
425
430
  }()
426
- ), A = new S();
427
- function O(n, t) {
428
- return t === void 0 && (t = {}), function(r, e) {
429
- var s = Reflect.getMetadata("design:type", r, e);
430
- A.addTypeMetadata({
431
- target: r.constructor,
432
- propertyName: e,
431
+ ), S = new A();
432
+ function O(a, t) {
433
+ return t === void 0 && (t = {}), function(e, r) {
434
+ var s = Reflect.getMetadata("design:type", e, r);
435
+ S.addTypeMetadata({
436
+ target: e.constructor,
437
+ propertyName: r,
433
438
  reflectedType: s,
434
- typeFunction: n,
439
+ typeFunction: a,
435
440
  options: t
436
441
  });
437
442
  };
438
443
  }
439
444
  export {
440
445
  f as ApiError,
441
- T as ApiProperty,
442
- P as ApiPropertyOptional,
446
+ P as ApiProperty,
447
+ T as ApiPropertyOptional,
443
448
  x as BaseApiClient,
444
- _ as FetchAdapter,
449
+ g as FetchAdapter,
445
450
  M as HttpServiceAdapter,
446
451
  O as Type
447
452
  };
@@ -170,7 +170,7 @@ class u {
170
170
  return this.httpService.deleteJson(t, e);
171
171
  }
172
172
  }
173
- class o {
173
+ class y {
174
174
  /**
175
175
  * Creates a new API client instance
176
176
  *
@@ -302,10 +302,15 @@ class o {
302
302
  * @param queryParams Optional query parameters
303
303
  * @returns Complete URL
304
304
  * @protected
305
+ * @throws {URIError} if the baseUrl attribute is not parsable
305
306
  */
306
307
  buildUrl(t, e) {
307
- let s = `${this.baseUrl}${t}`;
308
- return s.startsWith("//") && (s = s.replace(/^\/\//, "/")), e && e.toString() && (s += `?${e.toString()}`), s;
308
+ if (!URL.canParse(this.baseUrl))
309
+ throw new URIError(`{baseUrl: ${this.baseUrl}} is not a parsable URL.`);
310
+ const s = new URL(this.baseUrl);
311
+ return s.pathname = t, e && e.forEach((r, n, p) => {
312
+ s.searchParams.set(n, r);
313
+ }), s.toString();
309
314
  }
310
315
  /**
311
316
  * Builds headers for a request by combining default and request-specific headers
@@ -320,24 +325,24 @@ class o {
320
325
  };
321
326
  }
322
327
  }
323
- function y(...a) {
328
+ function f(...a) {
324
329
  return () => {
325
330
  };
326
331
  }
327
- function f(...a) {
332
+ function b(...a) {
328
333
  return () => {
329
334
  };
330
335
  }
331
- function b(...a) {
336
+ function m(...a) {
332
337
  return () => {
333
338
  };
334
339
  }
335
340
  export {
336
341
  i as ApiError,
337
- f as ApiProperty,
338
- b as ApiPropertyOptional,
339
- o as BaseApiClient,
342
+ b as ApiProperty,
343
+ m as ApiPropertyOptional,
344
+ y as BaseApiClient,
340
345
  d as FetchAdapter,
341
346
  u as HttpServiceAdapter,
342
- y as Type
347
+ f as Type
343
348
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/rest-client-base",
3
- "version": "2.5.22-develop-b2school.20260608181736",
3
+ "version": "2.5.22-develop.20260615185517",
4
4
  "description": "Abstract base for Edifice client SDKs (no application-specific logic)",
5
5
  "private": false,
6
6
  "license": "AGPL-3.0",
@@ -43,11 +43,12 @@
43
43
  "path": "0.12.7",
44
44
  "vite": "5.4.14",
45
45
  "vite-plugin-dts": "4.5.4",
46
- "@edifice.io/client": "2.5.22-develop-b2school.20260608181736"
46
+ "@edifice.io/client": "2.5.22-develop.20260615185517"
47
47
  },
48
48
  "scripts": {
49
49
  "clean": "rm -rf dist node_modules",
50
- "format": "prettier --write src",
50
+ "format": "prettier --check src",
51
+ "format:write": "prettier --write src",
51
52
  "lint": "eslint src",
52
53
  "lint:fix": "eslint src --fix",
53
54
  "build": "pnpm run build:node && pnpm run build:browser && pnpm run build:react-native",