@edifice.io/rest-client-base 2.6.6-develop-pedago.20260924111357 → 2.6.6-develop-b2school.20260924112430
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.
- package/dist/browser/index.js +19 -25
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.js +22 -28
- package/dist/react-native/index.js +19 -25
- package/package.json +2 -2
package/dist/browser/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var h = (a, t, e) =>
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var o = (a, t, e) => t in a ? u(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
|
+
var h = (a, t, e) => o(a, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
class c extends Error {
|
|
5
5
|
/**
|
|
6
6
|
* Create a new API error
|
|
@@ -67,7 +67,7 @@ class c extends Error {
|
|
|
67
67
|
return this._textData;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
class
|
|
70
|
+
class y {
|
|
71
71
|
constructor(t = fetch) {
|
|
72
72
|
this.fetchImpl = t;
|
|
73
73
|
}
|
|
@@ -142,7 +142,7 @@ class f {
|
|
|
142
142
|
return this.handleResponse(r);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
class
|
|
145
|
+
class f {
|
|
146
146
|
constructor(t) {
|
|
147
147
|
this.httpService = t;
|
|
148
148
|
}
|
|
@@ -170,7 +170,7 @@ class b {
|
|
|
170
170
|
return this.httpService.deleteJson(t, e);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
class
|
|
173
|
+
class U {
|
|
174
174
|
/**
|
|
175
175
|
* Creates a new API client instance
|
|
176
176
|
*
|
|
@@ -208,7 +208,7 @@ class A {
|
|
|
208
208
|
* @protected
|
|
209
209
|
*/
|
|
210
210
|
h(this, "httpAdapter");
|
|
211
|
-
this.baseUrl = t.baseUrl || "", this.defaultHeaders = t.defaultHeaders || {}, t.httpAdapter ? this.httpAdapter = t.httpAdapter : t.httpService ? this.httpAdapter = new
|
|
211
|
+
this.baseUrl = t.baseUrl || "", this.defaultHeaders = t.defaultHeaders || {}, t.httpAdapter ? this.httpAdapter = t.httpAdapter : t.httpService ? this.httpAdapter = new f(t.httpService) : this.httpAdapter = new y(t.fetchImpl || fetch);
|
|
212
212
|
}
|
|
213
213
|
/**
|
|
214
214
|
* Performs a GET request
|
|
@@ -306,12 +306,12 @@ class A {
|
|
|
306
306
|
*/
|
|
307
307
|
buildUrl(t, e) {
|
|
308
308
|
var l;
|
|
309
|
-
const s = !
|
|
310
|
-
if (!
|
|
309
|
+
const s = !URL.canParse(this.baseUrl), r = ((l = globalThis.location) == null ? void 0 : l.origin) ?? "", n = s ? `${r}${this.baseUrl}` : this.baseUrl;
|
|
310
|
+
if (!URL.canParse(n))
|
|
311
311
|
throw new URIError(`{baseUrl: ${this.baseUrl}} is not a parsable URL.`);
|
|
312
312
|
const i = new URL(n);
|
|
313
|
-
return i.pathname =
|
|
314
|
-
i.searchParams.append(
|
|
313
|
+
return i.pathname = b(i.pathname, t), e && e.forEach((d, p) => {
|
|
314
|
+
i.searchParams.append(p, d);
|
|
315
315
|
}), s ? i.pathname + i.search : i.toString();
|
|
316
316
|
}
|
|
317
317
|
/**
|
|
@@ -327,18 +327,12 @@ class A {
|
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
return new URL(a), !0;
|
|
333
|
-
} catch {
|
|
334
|
-
return !1;
|
|
335
|
-
}
|
|
336
|
-
}, m = (a, t) => `${a.replace(/\/$/, "")}/${t.replace(/^\//, "")}`;
|
|
337
|
-
function _(...a) {
|
|
330
|
+
const b = (a, t) => `${a.replace(/\/$/, "")}/${t.replace(/^\//, "")}`;
|
|
331
|
+
function A(...a) {
|
|
338
332
|
return () => {
|
|
339
333
|
};
|
|
340
334
|
}
|
|
341
|
-
function
|
|
335
|
+
function _(...a) {
|
|
342
336
|
return () => {
|
|
343
337
|
};
|
|
344
338
|
}
|
|
@@ -348,10 +342,10 @@ function g(...a) {
|
|
|
348
342
|
}
|
|
349
343
|
export {
|
|
350
344
|
c as ApiError,
|
|
351
|
-
|
|
345
|
+
_ as ApiProperty,
|
|
352
346
|
g as ApiPropertyOptional,
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
347
|
+
U as BaseApiClient,
|
|
348
|
+
y as FetchAdapter,
|
|
349
|
+
f as HttpServiceAdapter,
|
|
350
|
+
A as Type
|
|
357
351
|
};
|
package/dist/node/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
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){var o;const r=!URL.canParse(this.baseUrl),s=((o=globalThis.location)==null?void 0:o.origin)??"",n=r?`${s}${this.baseUrl}`:this.baseUrl;if(!URL.canParse(n))throw new URIError(`{baseUrl: ${this.baseUrl}} is not a parsable URL.`);const i=new URL(n);return i.pathname=v(i.pathname,t),e&&e.forEach((c,u)=>{i.searchParams.append(u,c)}),r?i.pathname+i.search:i.toString()}buildHeaders(t){return{...this.defaultHeaders,...t}}}const v=(a,t)=>`${a.replace(/\/$/,"")}/${t.replace(/^\//,"")}`;var p;(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"})(p||(p={}));var x=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===p.CLASS_TO_CLASS||r===p.PLAIN_TO_CLASS:s.options.toPlainOnly===!0?r===p.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===p.CLASS_TO_CLASS||e===p.PLAIN_TO_CLASS:r.options.toPlainOnly===!0?e===p.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===p.CLASS_TO_CLASS||e===p.PLAIN_TO_CLASS:r.options.toPlainOnly===!0?e===p.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,o=this.getAncestors(e);i<o.length;i++){var c=o[i],u=t.get(c);if(u){var h=Array.from(u.values()).filter(function(f){return f.propertyName!==void 0});n.push.apply(n,h)}}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,o=this.getAncestors(e);i<o.length;i++){var c=o[i],u=t.get(c);if(u){var h=u.get(r);if(h)return h}}},a.prototype.findMetadatas=function(t,e,r){var s=t.get(e),n;s&&(n=s.get(r));for(var i=[],o=0,c=this.getAncestors(e);o<c.length;o++){var u=c[o],h=t.get(u);h&&h.has(r)&&i.push.apply(i,h.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}(),O=new x;function L(a,t){return t===void 0&&(t={}),function(e,r){var s=Reflect.getMetadata("design:type",e,r);O.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=L;
|
package/dist/node/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var d = (a, t, e) =>
|
|
4
|
-
import { ApiProperty as
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var g = (a, t, e) => t in a ? y(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
|
+
var d = (a, t, e) => g(a, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { ApiProperty as T, ApiPropertyOptional as b } from "@nestjs/swagger";
|
|
5
5
|
class f extends Error {
|
|
6
6
|
/**
|
|
7
7
|
* Create a new API error
|
|
@@ -68,7 +68,7 @@ class f extends Error {
|
|
|
68
68
|
return this._textData;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
class
|
|
71
|
+
class _ {
|
|
72
72
|
constructor(t = fetch) {
|
|
73
73
|
this.fetchImpl = t;
|
|
74
74
|
}
|
|
@@ -143,7 +143,7 @@ class M {
|
|
|
143
143
|
return this.handleResponse(s);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
class
|
|
146
|
+
class M {
|
|
147
147
|
constructor(t) {
|
|
148
148
|
this.httpService = t;
|
|
149
149
|
}
|
|
@@ -171,7 +171,7 @@ class A {
|
|
|
171
171
|
return this.httpService.deleteJson(t, e);
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
class
|
|
174
|
+
class O {
|
|
175
175
|
/**
|
|
176
176
|
* Creates a new API client instance
|
|
177
177
|
*
|
|
@@ -209,7 +209,7 @@ class L {
|
|
|
209
209
|
* @protected
|
|
210
210
|
*/
|
|
211
211
|
d(this, "httpAdapter");
|
|
212
|
-
this.baseUrl = t.baseUrl || "", this.defaultHeaders = t.defaultHeaders || {}, t.httpAdapter ? this.httpAdapter = t.httpAdapter : t.httpService ? this.httpAdapter = new
|
|
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);
|
|
213
213
|
}
|
|
214
214
|
/**
|
|
215
215
|
* Performs a GET request
|
|
@@ -307,11 +307,11 @@ class L {
|
|
|
307
307
|
*/
|
|
308
308
|
buildUrl(t, e) {
|
|
309
309
|
var o;
|
|
310
|
-
const r = !
|
|
311
|
-
if (!
|
|
310
|
+
const r = !URL.canParse(this.baseUrl), s = ((o = globalThis.location) == null ? void 0 : o.origin) ?? "", n = r ? `${s}${this.baseUrl}` : this.baseUrl;
|
|
311
|
+
if (!URL.canParse(n))
|
|
312
312
|
throw new URIError(`{baseUrl: ${this.baseUrl}} is not a parsable URL.`);
|
|
313
313
|
const i = new URL(n);
|
|
314
|
-
return i.pathname =
|
|
314
|
+
return i.pathname = A(i.pathname, t), e && e.forEach((c, u) => {
|
|
315
315
|
i.searchParams.append(u, c);
|
|
316
316
|
}), r ? i.pathname + i.search : i.toString();
|
|
317
317
|
}
|
|
@@ -328,18 +328,12 @@ class L {
|
|
|
328
328
|
};
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
|
-
const
|
|
332
|
-
try {
|
|
333
|
-
return new URL(a), !0;
|
|
334
|
-
} catch {
|
|
335
|
-
return !1;
|
|
336
|
-
}
|
|
337
|
-
}, S = (a, t) => `${a.replace(/\/$/, "")}/${t.replace(/^\//, "")}`;
|
|
331
|
+
const A = (a, t) => `${a.replace(/\/$/, "")}/${t.replace(/^\//, "")}`;
|
|
338
332
|
var p;
|
|
339
333
|
(function(a) {
|
|
340
334
|
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";
|
|
341
335
|
})(p || (p = {}));
|
|
342
|
-
var
|
|
336
|
+
var S = (
|
|
343
337
|
/** @class */
|
|
344
338
|
function() {
|
|
345
339
|
function a() {
|
|
@@ -437,11 +431,11 @@ var v = (
|
|
|
437
431
|
return this._ancestorsMap.get(t);
|
|
438
432
|
}, a;
|
|
439
433
|
}()
|
|
440
|
-
),
|
|
441
|
-
function
|
|
434
|
+
), v = new S();
|
|
435
|
+
function L(a, t) {
|
|
442
436
|
return t === void 0 && (t = {}), function(e, r) {
|
|
443
437
|
var s = Reflect.getMetadata("design:type", e, r);
|
|
444
|
-
|
|
438
|
+
v.addTypeMetadata({
|
|
445
439
|
target: e.constructor,
|
|
446
440
|
propertyName: r,
|
|
447
441
|
reflectedType: s,
|
|
@@ -452,10 +446,10 @@ function C(a, t) {
|
|
|
452
446
|
}
|
|
453
447
|
export {
|
|
454
448
|
f as ApiError,
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
449
|
+
T as ApiProperty,
|
|
450
|
+
b as ApiPropertyOptional,
|
|
451
|
+
O as BaseApiClient,
|
|
452
|
+
_ as FetchAdapter,
|
|
453
|
+
M as HttpServiceAdapter,
|
|
454
|
+
L as Type
|
|
461
455
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var h = (a, t, e) =>
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var o = (a, t, e) => t in a ? u(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
|
+
var h = (a, t, e) => o(a, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
class c extends Error {
|
|
5
5
|
/**
|
|
6
6
|
* Create a new API error
|
|
@@ -67,7 +67,7 @@ class c extends Error {
|
|
|
67
67
|
return this._textData;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
class
|
|
70
|
+
class y {
|
|
71
71
|
constructor(t = fetch) {
|
|
72
72
|
this.fetchImpl = t;
|
|
73
73
|
}
|
|
@@ -142,7 +142,7 @@ class f {
|
|
|
142
142
|
return this.handleResponse(r);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
class
|
|
145
|
+
class f {
|
|
146
146
|
constructor(t) {
|
|
147
147
|
this.httpService = t;
|
|
148
148
|
}
|
|
@@ -170,7 +170,7 @@ class b {
|
|
|
170
170
|
return this.httpService.deleteJson(t, e);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
class
|
|
173
|
+
class U {
|
|
174
174
|
/**
|
|
175
175
|
* Creates a new API client instance
|
|
176
176
|
*
|
|
@@ -208,7 +208,7 @@ class A {
|
|
|
208
208
|
* @protected
|
|
209
209
|
*/
|
|
210
210
|
h(this, "httpAdapter");
|
|
211
|
-
this.baseUrl = t.baseUrl || "", this.defaultHeaders = t.defaultHeaders || {}, t.httpAdapter ? this.httpAdapter = t.httpAdapter : t.httpService ? this.httpAdapter = new
|
|
211
|
+
this.baseUrl = t.baseUrl || "", this.defaultHeaders = t.defaultHeaders || {}, t.httpAdapter ? this.httpAdapter = t.httpAdapter : t.httpService ? this.httpAdapter = new f(t.httpService) : this.httpAdapter = new y(t.fetchImpl || fetch);
|
|
212
212
|
}
|
|
213
213
|
/**
|
|
214
214
|
* Performs a GET request
|
|
@@ -306,12 +306,12 @@ class A {
|
|
|
306
306
|
*/
|
|
307
307
|
buildUrl(t, e) {
|
|
308
308
|
var l;
|
|
309
|
-
const s = !
|
|
310
|
-
if (!
|
|
309
|
+
const s = !URL.canParse(this.baseUrl), r = ((l = globalThis.location) == null ? void 0 : l.origin) ?? "", n = s ? `${r}${this.baseUrl}` : this.baseUrl;
|
|
310
|
+
if (!URL.canParse(n))
|
|
311
311
|
throw new URIError(`{baseUrl: ${this.baseUrl}} is not a parsable URL.`);
|
|
312
312
|
const i = new URL(n);
|
|
313
|
-
return i.pathname =
|
|
314
|
-
i.searchParams.append(
|
|
313
|
+
return i.pathname = b(i.pathname, t), e && e.forEach((d, p) => {
|
|
314
|
+
i.searchParams.append(p, d);
|
|
315
315
|
}), s ? i.pathname + i.search : i.toString();
|
|
316
316
|
}
|
|
317
317
|
/**
|
|
@@ -327,18 +327,12 @@ class A {
|
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
return new URL(a), !0;
|
|
333
|
-
} catch {
|
|
334
|
-
return !1;
|
|
335
|
-
}
|
|
336
|
-
}, m = (a, t) => `${a.replace(/\/$/, "")}/${t.replace(/^\//, "")}`;
|
|
337
|
-
function _(...a) {
|
|
330
|
+
const b = (a, t) => `${a.replace(/\/$/, "")}/${t.replace(/^\//, "")}`;
|
|
331
|
+
function A(...a) {
|
|
338
332
|
return () => {
|
|
339
333
|
};
|
|
340
334
|
}
|
|
341
|
-
function
|
|
335
|
+
function _(...a) {
|
|
342
336
|
return () => {
|
|
343
337
|
};
|
|
344
338
|
}
|
|
@@ -348,10 +342,10 @@ function g(...a) {
|
|
|
348
342
|
}
|
|
349
343
|
export {
|
|
350
344
|
c as ApiError,
|
|
351
|
-
|
|
345
|
+
_ as ApiProperty,
|
|
352
346
|
g as ApiPropertyOptional,
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
347
|
+
U as BaseApiClient,
|
|
348
|
+
y as FetchAdapter,
|
|
349
|
+
f as HttpServiceAdapter,
|
|
350
|
+
A as Type
|
|
357
351
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/rest-client-base",
|
|
3
|
-
"version": "2.6.6-develop-
|
|
3
|
+
"version": "2.6.6-develop-b2school.20260924112430",
|
|
4
4
|
"description": "Abstract base for Edifice client SDKs (no application-specific logic)",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "AGPL-3.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
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.6.6-develop-
|
|
46
|
+
"@edifice.io/client": "2.6.6-develop-b2school.20260924112430"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"clean": "rm -rf dist node_modules",
|