@edifice.io/rest-client-base 2.5.4-feat-ENABLING-562.20251216145848 → 2.5.5-develop-pedago.20260112142155

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.
@@ -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}(),O=new v;function x(n,t){return t===void 0&&(t={}),function(r,e){var s=Reflect.getMetadata("design:type",r,e);O.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});Object.defineProperty(exports,"ApiPropertyOptions",{enumerable:!0,get:()=>y.ApiPropertyOptions});exports.ApiError=l;exports.BaseApiClient=S;exports.FetchAdapter=g;exports.HttpServiceAdapter=_;exports.Type=x;
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,7 +1,7 @@
1
1
  var y = Object.defineProperty;
2
2
  var g = (n, t, r) => t in n ? y(n, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[t] = r;
3
3
  var h = (n, t, r) => g(n, typeof t != "symbol" ? t + "" : t, r);
4
- import { ApiProperty as T, ApiPropertyOptional as P, ApiPropertyOptions as w } from "@nestjs/swagger";
4
+ import { ApiProperty as T, ApiPropertyOptional as P } from "@nestjs/swagger";
5
5
  class f extends Error {
6
6
  /**
7
7
  * Create a new API error
@@ -325,7 +325,7 @@ var o;
325
325
  (function(n) {
326
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";
327
327
  })(o || (o = {}));
328
- var A = (
328
+ var S = (
329
329
  /** @class */
330
330
  function() {
331
331
  function n() {
@@ -423,11 +423,11 @@ var A = (
423
423
  return this._ancestorsMap.get(t);
424
424
  }, n;
425
425
  }()
426
- ), S = new A();
426
+ ), A = new S();
427
427
  function O(n, t) {
428
428
  return t === void 0 && (t = {}), function(r, e) {
429
429
  var s = Reflect.getMetadata("design:type", r, e);
430
- S.addTypeMetadata({
430
+ A.addTypeMetadata({
431
431
  target: r.constructor,
432
432
  propertyName: e,
433
433
  reflectedType: s,
@@ -440,7 +440,6 @@ export {
440
440
  f as ApiError,
441
441
  T as ApiProperty,
442
442
  P as ApiPropertyOptional,
443
- w as ApiPropertyOptions,
444
443
  x as BaseApiClient,
445
444
  _ as FetchAdapter,
446
445
  M as HttpServiceAdapter,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/rest-client-base",
3
- "version": "2.5.4-feat-ENABLING-562.20251216145848",
3
+ "version": "2.5.5-develop-pedago.20260112142155",
4
4
  "description": "Abstract base for Edifice client SDKs (no application-specific logic)",
5
5
  "private": false,
6
6
  "license": "AGPL-3.0",
@@ -42,7 +42,7 @@
42
42
  "path": "0.12.7",
43
43
  "vite": "5.4.14",
44
44
  "vite-plugin-dts": "4.5.4",
45
- "@edifice.io/client": "2.5.4-feat-ENABLING-562.20251216145848"
45
+ "@edifice.io/client": "2.5.5-develop-pedago.20260112142155"
46
46
  },
47
47
  "scripts": {
48
48
  "clean": "rm -rf dist node_modules",