@semantha/product-sdk 11.6.1 → 11.8.0
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/{chunk-2DHIHJB5.js → chunk-4CX7MUVC.js} +2 -2
- package/dist/chunk-4CX7MUVC.js.map +1 -0
- package/dist/{chunk-TYQ3NAQE.js → chunk-7VUBZ76N.js} +2 -2
- package/dist/{chunk-TYQ3NAQE.js.map → chunk-7VUBZ76N.js.map} +1 -1
- package/dist/{chunk-HQUUS6GC.js → chunk-CULSSUTK.js} +2 -2
- package/dist/{chunk-HQUUS6GC.js.map → chunk-CULSSUTK.js.map} +1 -1
- package/dist/{chunk-HYOHQM5J.mjs → chunk-FA37ZZXB.mjs} +2 -2
- package/dist/chunk-FA37ZZXB.mjs.map +1 -0
- package/dist/{chunk-45JLFIMJ.mjs → chunk-GJ5RRVHT.mjs} +2 -2
- package/dist/{chunk-45JLFIMJ.mjs.map → chunk-GJ5RRVHT.mjs.map} +1 -1
- package/dist/{chunk-FUYAWPCE.mjs → chunk-P2K3VXP2.mjs} +2 -2
- package/dist/{chunk-FUYAWPCE.mjs.map → chunk-P2K3VXP2.mjs.map} +1 -1
- package/dist/{chunk-OGW7UVWP.js → chunk-TNOEPM5N.js} +2 -2
- package/dist/{chunk-OGW7UVWP.js.map → chunk-TNOEPM5N.js.map} +1 -1
- package/dist/{chunk-ZCQJ5ZKX.mjs → chunk-VH2AB5TA.mjs} +2 -2
- package/dist/{chunk-ZCQJ5ZKX.mjs.map → chunk-VH2AB5TA.mjs.map} +1 -1
- package/dist/document-chat/api/index.d.mts +3 -1
- package/dist/document-chat/api/index.d.ts +3 -1
- package/dist/document-chat/api/index.js +1 -1
- package/dist/document-chat/api/index.js.map +1 -1
- package/dist/document-chat/api/index.mjs +1 -1
- package/dist/document-chat/api/index.mjs.map +1 -1
- package/dist/file-box/api/index.js +1 -1
- package/dist/file-box/api/index.mjs +1 -1
- package/dist/file-box/index.js +1 -1
- package/dist/file-box/index.mjs +1 -1
- package/dist/requirements/api/index.js +1 -1
- package/dist/requirements/api/index.mjs +1 -1
- package/dist/rest/index.d.mts +9 -3
- package/dist/rest/index.d.ts +9 -3
- package/dist/rest/index.js +1 -1
- package/dist/rest/index.mjs +1 -1
- package/dist/structure-navigator/api/index.js +1 -1
- package/dist/structure-navigator/api/index.mjs +1 -1
- package/dist/structure-navigator/index.js +1 -1
- package/dist/structure-navigator/index.mjs +1 -1
- package/dist/table-extractor/api/index.js +1 -1
- package/dist/table-extractor/api/index.mjs +1 -1
- package/dist/tracking/api/index.js +1 -1
- package/dist/tracking/api/index.mjs +1 -1
- package/dist/tracking/index.js +1 -1
- package/dist/tracking/index.mjs +1 -1
- package/package.json +6 -6
- package/dist/chunk-2DHIHJB5.js.map +0 -1
- package/dist/chunk-HYOHQM5J.mjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunk2DHIHJB5_js=require('../../chunk-2DHIHJB5.js'),W=require('fs');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var W__namespace=/*#__PURE__*/_interopNamespace(W);var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var p=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t){return (await this.restClient.post(this.ENDPOINT,t,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),{},"blob")).toFile()}};var m=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new p(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var d=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/aitasks/${this.analysisid}`;}ENDPOINT;pagedresults(){return new l(this.restClient,this.ENDPOINT)}results(){return new m(this.restClient,this.ENDPOINT)}};var E=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/aitasks";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var u=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/report";}ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var N=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/analyses";}ENDPOINT;report(){return new u(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}async postJson(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var h=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var c=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/stats";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var y=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;stats(){return new c(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var C=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/analyses/${this.analysisid}`;}ENDPOINT;pagedresults(){return new y(this.restClient,this.ENDPOINT)}results(){return new h(this.restClient,this.ENDPOINT)}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var f=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new f(this.restClient,this.ENDPOINT)}};var g=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/bulk";}ENDPOINT;results(){return new s(this.restClient,this.ENDPOINT)}};var P=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/classifications";}ENDPOINT};var T=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/comments";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var O=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/roles";}ENDPOINT};var D=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/currentuser";}ENDPOINT;roles(){return new O(this.restClient,this.ENDPOINT)}};var v=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/evaluations/${this.id}`;}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/evaluations";}ENDPOINT;async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var I=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/exceltemplates/${this.id}`;}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var R=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/new";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var x=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/exceltemplates";}ENDPOINT;new(){return new R(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var w=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/references";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}};var A=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.resultid=n;this.ENDPOINT=this.parentEndpoint+`/results/${this.resultid}`;}ENDPOINT;comments(){return new T(this.restClient,this.ENDPOINT)}evaluations(){return new o(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var M=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;aitasks(t){return t!=null?new d(this.restClient,this.ENDPOINT,t):new E(this.restClient,this.ENDPOINT)}analyses(t){return t!=null?new C(this.restClient,this.ENDPOINT,t):new N(this.restClient,this.ENDPOINT)}bulk(){return new g(this.restClient,this.ENDPOINT)}classifications(){return new P(this.restClient,this.ENDPOINT)}evaluations(t){return t!=null?new v(this.restClient,this.ENDPOINT,t):new o(this.restClient,this.ENDPOINT)}exceltemplates(t){return t!=null?new I(this.restClient,this.ENDPOINT,t):new x(this.restClient,this.ENDPOINT)}references(){return new w(this.restClient,this.ENDPOINT)}results(t){return t!=null?new A(this.restClient,this.ENDPOINT,t):new s(this.restClient,this.ENDPOINT)}};var b=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var S=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/requirements";}ENDPOINT;currentuser(){return new D(this.restClient,this.ENDPOINT)}domains(t){return t!=null?new M(this.restClient,this.ENDPOINT,t):new b(this.restClient,this.ENDPOINT)}};var J="/api",F=class r{constructor(t,e){this.restClient=t;this.parentEndpoint=e;}static loginWithApiKey(t,e){if(!e)throw new Error("You need to supply an API key to login.");if(!t)throw new Error("You need to supply a server url to login.");return new r(new chunk2DHIHJB5_js.c(this.parseServerUrl(t),e),J)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new r(new chunk2DHIHJB5_js.c(this.parseServerUrl(t)),J)}static loginWithCredentials(t,e,n,H){return t=this.parseServerUrl(t),new r(new chunk2DHIHJB5_js.c(t,void 0,e,n,H),J)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=W__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(k=>k.length!==0).map(k=>k.split("=")),H=this.getValueOfInPropertiesFile("serverUrl",n),X=this.getValueOfInPropertiesFile("clientId",n),B=this.getValueOfInPropertiesFile("clientSecret",n),$=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(H,X,B,$)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let n of e)if(n[0]===t)return n[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}requirements(){return new S(this.restClient,this.endpoint())}};exports.AitaskEndpoint=d;exports.AitasksEndpoint=E;exports.AitasksPagedresultsEndpoint=l;exports.AitasksResultsEndpoint=m;exports.AitasksresultsExportEndpoint=p;exports.AnalysesEndpoint=N;exports.AnalysisEndpoint=C;exports.AnalysisResultsEndpoint=h;exports.BulkEndpoint=g;exports.ClassificationsEndpoint=P;exports.CommentsEndpoint=T;exports.CurrentuserEndpoint=D;exports.DomainEndpoint=M;exports.DomainsEndpoint=b;exports.EvaluationEndpoint=v;exports.EvaluationsEndpoint=o;exports.ExceltemplateEndpoint=I;exports.ExceltemplatesEndpoint=x;exports.ExportEndpoint=f;exports.NewEndpoint=R;exports.PagedresultsEndpoint=y;exports.ReferencesEndpoint=w;exports.ReportEndpoint=u;exports.RequirementsAPI=F;exports.RequirementsEndpoint=S;exports.ResultEndpoint=A;exports.ResultsEndpoint=s;exports.RolesEndpoint=O;exports.StatsEndpoint=c;//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';var chunk4CX7MUVC_js=require('../../chunk-4CX7MUVC.js'),W=require('fs');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var W__namespace=/*#__PURE__*/_interopNamespace(W);var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var p=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t){return (await this.restClient.post(this.ENDPOINT,t,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),{},"blob")).toFile()}};var m=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new p(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var d=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/aitasks/${this.analysisid}`;}ENDPOINT;pagedresults(){return new l(this.restClient,this.ENDPOINT)}results(){return new m(this.restClient,this.ENDPOINT)}};var E=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/aitasks";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var u=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/report";}ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var N=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/analyses";}ENDPOINT;report(){return new u(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}async postJson(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var h=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var c=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/stats";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var y=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;stats(){return new c(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var C=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/analyses/${this.analysisid}`;}ENDPOINT;pagedresults(){return new y(this.restClient,this.ENDPOINT)}results(){return new h(this.restClient,this.ENDPOINT)}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var f=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new f(this.restClient,this.ENDPOINT)}};var g=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/bulk";}ENDPOINT;results(){return new s(this.restClient,this.ENDPOINT)}};var P=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/classifications";}ENDPOINT};var T=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/comments";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var O=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/roles";}ENDPOINT};var D=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/currentuser";}ENDPOINT;roles(){return new O(this.restClient,this.ENDPOINT)}};var v=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/evaluations/${this.id}`;}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/evaluations";}ENDPOINT;async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var I=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/exceltemplates/${this.id}`;}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var R=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/new";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var x=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/exceltemplates";}ENDPOINT;new(){return new R(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var w=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/references";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}};var A=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.resultid=n;this.ENDPOINT=this.parentEndpoint+`/results/${this.resultid}`;}ENDPOINT;comments(){return new T(this.restClient,this.ENDPOINT)}evaluations(){return new o(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var M=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;aitasks(t){return t!=null?new d(this.restClient,this.ENDPOINT,t):new E(this.restClient,this.ENDPOINT)}analyses(t){return t!=null?new C(this.restClient,this.ENDPOINT,t):new N(this.restClient,this.ENDPOINT)}bulk(){return new g(this.restClient,this.ENDPOINT)}classifications(){return new P(this.restClient,this.ENDPOINT)}evaluations(t){return t!=null?new v(this.restClient,this.ENDPOINT,t):new o(this.restClient,this.ENDPOINT)}exceltemplates(t){return t!=null?new I(this.restClient,this.ENDPOINT,t):new x(this.restClient,this.ENDPOINT)}references(){return new w(this.restClient,this.ENDPOINT)}results(t){return t!=null?new A(this.restClient,this.ENDPOINT,t):new s(this.restClient,this.ENDPOINT)}};var b=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var S=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/requirements";}ENDPOINT;currentuser(){return new D(this.restClient,this.ENDPOINT)}domains(t){return t!=null?new M(this.restClient,this.ENDPOINT,t):new b(this.restClient,this.ENDPOINT)}};var J="/api",F=class r{constructor(t,e){this.restClient=t;this.parentEndpoint=e;}static loginWithApiKey(t,e){if(!e)throw new Error("You need to supply an API key to login.");if(!t)throw new Error("You need to supply a server url to login.");return new r(new chunk4CX7MUVC_js.c(this.parseServerUrl(t),e),J)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new r(new chunk4CX7MUVC_js.c(this.parseServerUrl(t)),J)}static loginWithCredentials(t,e,n,H){return t=this.parseServerUrl(t),new r(new chunk4CX7MUVC_js.c(t,void 0,e,n,H),J)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=W__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(k=>k.length!==0).map(k=>k.split("=")),H=this.getValueOfInPropertiesFile("serverUrl",n),X=this.getValueOfInPropertiesFile("clientId",n),B=this.getValueOfInPropertiesFile("clientSecret",n),$=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(H,X,B,$)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let n of e)if(n[0]===t)return n[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}requirements(){return new S(this.restClient,this.endpoint())}};exports.AitaskEndpoint=d;exports.AitasksEndpoint=E;exports.AitasksPagedresultsEndpoint=l;exports.AitasksResultsEndpoint=m;exports.AitasksresultsExportEndpoint=p;exports.AnalysesEndpoint=N;exports.AnalysisEndpoint=C;exports.AnalysisResultsEndpoint=h;exports.BulkEndpoint=g;exports.ClassificationsEndpoint=P;exports.CommentsEndpoint=T;exports.CurrentuserEndpoint=D;exports.DomainEndpoint=M;exports.DomainsEndpoint=b;exports.EvaluationEndpoint=v;exports.EvaluationsEndpoint=o;exports.ExceltemplateEndpoint=I;exports.ExceltemplatesEndpoint=x;exports.ExportEndpoint=f;exports.NewEndpoint=R;exports.PagedresultsEndpoint=y;exports.ReferencesEndpoint=w;exports.ReportEndpoint=u;exports.RequirementsAPI=F;exports.RequirementsEndpoint=S;exports.ResultEndpoint=A;exports.ResultsEndpoint=s;exports.RolesEndpoint=O;exports.StatsEndpoint=c;//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {c as c$1}from'../../chunk-HYOHQM5J.mjs';import*as W from'fs';var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var p=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t){return (await this.restClient.post(this.ENDPOINT,t,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),{},"blob")).toFile()}};var m=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new p(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var d=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/aitasks/${this.analysisid}`;}ENDPOINT;pagedresults(){return new l(this.restClient,this.ENDPOINT)}results(){return new m(this.restClient,this.ENDPOINT)}};var E=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/aitasks";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var u=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/report";}ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var N=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/analyses";}ENDPOINT;report(){return new u(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}async postJson(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var h=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var c=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/stats";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var y=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;stats(){return new c(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var C=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/analyses/${this.analysisid}`;}ENDPOINT;pagedresults(){return new y(this.restClient,this.ENDPOINT)}results(){return new h(this.restClient,this.ENDPOINT)}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var f=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new f(this.restClient,this.ENDPOINT)}};var g=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/bulk";}ENDPOINT;results(){return new s(this.restClient,this.ENDPOINT)}};var P=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/classifications";}ENDPOINT};var T=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/comments";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var O=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/roles";}ENDPOINT};var D=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/currentuser";}ENDPOINT;roles(){return new O(this.restClient,this.ENDPOINT)}};var v=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/evaluations/${this.id}`;}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/evaluations";}ENDPOINT;async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var I=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/exceltemplates/${this.id}`;}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var R=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/new";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var x=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/exceltemplates";}ENDPOINT;new(){return new R(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var w=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/references";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}};var A=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.resultid=n;this.ENDPOINT=this.parentEndpoint+`/results/${this.resultid}`;}ENDPOINT;comments(){return new T(this.restClient,this.ENDPOINT)}evaluations(){return new o(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var M=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;aitasks(t){return t!=null?new d(this.restClient,this.ENDPOINT,t):new E(this.restClient,this.ENDPOINT)}analyses(t){return t!=null?new C(this.restClient,this.ENDPOINT,t):new N(this.restClient,this.ENDPOINT)}bulk(){return new g(this.restClient,this.ENDPOINT)}classifications(){return new P(this.restClient,this.ENDPOINT)}evaluations(t){return t!=null?new v(this.restClient,this.ENDPOINT,t):new o(this.restClient,this.ENDPOINT)}exceltemplates(t){return t!=null?new I(this.restClient,this.ENDPOINT,t):new x(this.restClient,this.ENDPOINT)}references(){return new w(this.restClient,this.ENDPOINT)}results(t){return t!=null?new A(this.restClient,this.ENDPOINT,t):new s(this.restClient,this.ENDPOINT)}};var b=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var S=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/requirements";}ENDPOINT;currentuser(){return new D(this.restClient,this.ENDPOINT)}domains(t){return t!=null?new M(this.restClient,this.ENDPOINT,t):new b(this.restClient,this.ENDPOINT)}};var J="/api",F=class r{constructor(t,e){this.restClient=t;this.parentEndpoint=e;}static loginWithApiKey(t,e){if(!e)throw new Error("You need to supply an API key to login.");if(!t)throw new Error("You need to supply a server url to login.");return new r(new c$1(this.parseServerUrl(t),e),J)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new r(new c$1(this.parseServerUrl(t)),J)}static loginWithCredentials(t,e,n,H){return t=this.parseServerUrl(t),new r(new c$1(t,void 0,e,n,H),J)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=W.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(k=>k.length!==0).map(k=>k.split("=")),H=this.getValueOfInPropertiesFile("serverUrl",n),X=this.getValueOfInPropertiesFile("clientId",n),B=this.getValueOfInPropertiesFile("clientSecret",n),$=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(H,X,B,$)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let n of e)if(n[0]===t)return n[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}requirements(){return new S(this.restClient,this.endpoint())}};export{d as AitaskEndpoint,E as AitasksEndpoint,l as AitasksPagedresultsEndpoint,m as AitasksResultsEndpoint,p as AitasksresultsExportEndpoint,N as AnalysesEndpoint,C as AnalysisEndpoint,h as AnalysisResultsEndpoint,g as BulkEndpoint,P as ClassificationsEndpoint,T as CommentsEndpoint,D as CurrentuserEndpoint,M as DomainEndpoint,b as DomainsEndpoint,v as EvaluationEndpoint,o as EvaluationsEndpoint,I as ExceltemplateEndpoint,x as ExceltemplatesEndpoint,f as ExportEndpoint,R as NewEndpoint,y as PagedresultsEndpoint,w as ReferencesEndpoint,u as ReportEndpoint,F as RequirementsAPI,S as RequirementsEndpoint,A as ResultEndpoint,s as ResultsEndpoint,O as RolesEndpoint,c as StatsEndpoint};//# sourceMappingURL=index.mjs.map
|
|
1
|
+
import {c as c$1}from'../../chunk-FA37ZZXB.mjs';import*as W from'fs';var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var p=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t){return (await this.restClient.post(this.ENDPOINT,t,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),{},"blob")).toFile()}};var m=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new p(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var d=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/aitasks/${this.analysisid}`;}ENDPOINT;pagedresults(){return new l(this.restClient,this.ENDPOINT)}results(){return new m(this.restClient,this.ENDPOINT)}};var E=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/aitasks";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var u=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/report";}ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var N=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/analyses";}ENDPOINT;report(){return new u(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}async postJson(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var h=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var c=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/stats";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var y=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;stats(){return new c(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var C=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/analyses/${this.analysisid}`;}ENDPOINT;pagedresults(){return new y(this.restClient,this.ENDPOINT)}results(){return new h(this.restClient,this.ENDPOINT)}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var f=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new f(this.restClient,this.ENDPOINT)}};var g=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/bulk";}ENDPOINT;results(){return new s(this.restClient,this.ENDPOINT)}};var P=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/classifications";}ENDPOINT};var T=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/comments";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var O=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/roles";}ENDPOINT};var D=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/currentuser";}ENDPOINT;roles(){return new O(this.restClient,this.ENDPOINT)}};var v=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/evaluations/${this.id}`;}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/evaluations";}ENDPOINT;async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var I=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/exceltemplates/${this.id}`;}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var R=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/new";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var x=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/exceltemplates";}ENDPOINT;new(){return new R(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var w=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/references";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}};var A=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.resultid=n;this.ENDPOINT=this.parentEndpoint+`/results/${this.resultid}`;}ENDPOINT;comments(){return new T(this.restClient,this.ENDPOINT)}evaluations(){return new o(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var M=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;aitasks(t){return t!=null?new d(this.restClient,this.ENDPOINT,t):new E(this.restClient,this.ENDPOINT)}analyses(t){return t!=null?new C(this.restClient,this.ENDPOINT,t):new N(this.restClient,this.ENDPOINT)}bulk(){return new g(this.restClient,this.ENDPOINT)}classifications(){return new P(this.restClient,this.ENDPOINT)}evaluations(t){return t!=null?new v(this.restClient,this.ENDPOINT,t):new o(this.restClient,this.ENDPOINT)}exceltemplates(t){return t!=null?new I(this.restClient,this.ENDPOINT,t):new x(this.restClient,this.ENDPOINT)}references(){return new w(this.restClient,this.ENDPOINT)}results(t){return t!=null?new A(this.restClient,this.ENDPOINT,t):new s(this.restClient,this.ENDPOINT)}};var b=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var S=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/requirements";}ENDPOINT;currentuser(){return new D(this.restClient,this.ENDPOINT)}domains(t){return t!=null?new M(this.restClient,this.ENDPOINT,t):new b(this.restClient,this.ENDPOINT)}};var J="/api",F=class r{constructor(t,e){this.restClient=t;this.parentEndpoint=e;}static loginWithApiKey(t,e){if(!e)throw new Error("You need to supply an API key to login.");if(!t)throw new Error("You need to supply a server url to login.");return new r(new c$1(this.parseServerUrl(t),e),J)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new r(new c$1(this.parseServerUrl(t)),J)}static loginWithCredentials(t,e,n,H){return t=this.parseServerUrl(t),new r(new c$1(t,void 0,e,n,H),J)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=W.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(k=>k.length!==0).map(k=>k.split("=")),H=this.getValueOfInPropertiesFile("serverUrl",n),X=this.getValueOfInPropertiesFile("clientId",n),B=this.getValueOfInPropertiesFile("clientSecret",n),$=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(H,X,B,$)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let n of e)if(n[0]===t)return n[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}requirements(){return new S(this.restClient,this.endpoint())}};export{d as AitaskEndpoint,E as AitasksEndpoint,l as AitasksPagedresultsEndpoint,m as AitasksResultsEndpoint,p as AitasksresultsExportEndpoint,N as AnalysesEndpoint,C as AnalysisEndpoint,h as AnalysisResultsEndpoint,g as BulkEndpoint,P as ClassificationsEndpoint,T as CommentsEndpoint,D as CurrentuserEndpoint,M as DomainEndpoint,b as DomainsEndpoint,v as EvaluationEndpoint,o as EvaluationsEndpoint,I as ExceltemplateEndpoint,x as ExceltemplatesEndpoint,f as ExportEndpoint,R as NewEndpoint,y as PagedresultsEndpoint,w as ReferencesEndpoint,u as ReportEndpoint,F as RequirementsAPI,S as RequirementsEndpoint,A as ResultEndpoint,s as ResultsEndpoint,O as RolesEndpoint,c as StatsEndpoint};//# sourceMappingURL=index.mjs.map
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/rest/index.d.mts
CHANGED
|
@@ -46,9 +46,15 @@ declare class RestClient {
|
|
|
46
46
|
post<R>(url: string, params?: any, headers?: {
|
|
47
47
|
[key: string]: string;
|
|
48
48
|
}, data?: any, responseType?: ResponseType): Promise<RestResponse<R>>;
|
|
49
|
-
delete(url: string, data?: any, params?: any
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
delete(url: string, data?: any, params?: any, headers?: {
|
|
50
|
+
[key: string]: string;
|
|
51
|
+
}): Promise<RestResponse<void>>;
|
|
52
|
+
patch<R>(url: string, data?: any, headers?: {
|
|
53
|
+
[key: string]: string;
|
|
54
|
+
}): Promise<RestResponse<R>>;
|
|
55
|
+
put<R>(url: string, data: any, headers?: {
|
|
56
|
+
[key: string]: string;
|
|
57
|
+
}): Promise<RestResponse<R>>;
|
|
52
58
|
toHeader(acceptMimeType: MediaType, contentType?: string): {
|
|
53
59
|
[key: string]: string;
|
|
54
60
|
};
|
package/dist/rest/index.d.ts
CHANGED
|
@@ -46,9 +46,15 @@ declare class RestClient {
|
|
|
46
46
|
post<R>(url: string, params?: any, headers?: {
|
|
47
47
|
[key: string]: string;
|
|
48
48
|
}, data?: any, responseType?: ResponseType): Promise<RestResponse<R>>;
|
|
49
|
-
delete(url: string, data?: any, params?: any
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
delete(url: string, data?: any, params?: any, headers?: {
|
|
50
|
+
[key: string]: string;
|
|
51
|
+
}): Promise<RestResponse<void>>;
|
|
52
|
+
patch<R>(url: string, data?: any, headers?: {
|
|
53
|
+
[key: string]: string;
|
|
54
|
+
}): Promise<RestResponse<R>>;
|
|
55
|
+
put<R>(url: string, data: any, headers?: {
|
|
56
|
+
[key: string]: string;
|
|
57
|
+
}): Promise<RestResponse<R>>;
|
|
52
58
|
toHeader(acceptMimeType: MediaType, contentType?: string): {
|
|
53
59
|
[key: string]: string;
|
|
54
60
|
};
|
package/dist/rest/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk4CX7MUVC_js=require('../chunk-4CX7MUVC.js');Object.defineProperty(exports,"MediaType",{enumerable:true,get:function(){return chunk4CX7MUVC_js.b}});Object.defineProperty(exports,"RestClient",{enumerable:true,get:function(){return chunk4CX7MUVC_js.c}});Object.defineProperty(exports,"RestResponse",{enumerable:true,get:function(){return chunk4CX7MUVC_js.a}});//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/rest/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{b as MediaType,c as RestClient,a as RestResponse}from'../chunk-
|
|
1
|
+
export{b as MediaType,c as RestClient,a as RestResponse}from'../chunk-FA37ZZXB.mjs';//# sourceMappingURL=index.mjs.map
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkCULSSUTK_js=require('../../chunk-CULSSUTK.js');require('../../chunk-4CX7MUVC.js');Object.defineProperty(exports,"BinaryEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.a}});Object.defineProperty(exports,"ConfigurationEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.b}});Object.defineProperty(exports,"ConfigurationsEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.c}});Object.defineProperty(exports,"DocumentstructureEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.f}});Object.defineProperty(exports,"DocumentstructuresEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.g}});Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.h}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.i}});Object.defineProperty(exports,"EventsEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.d}});Object.defineProperty(exports,"ScreenshotsEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.e}});Object.defineProperty(exports,"StructureNavigatorAPI",{enumerable:true,get:function(){return chunkCULSSUTK_js.k}});Object.defineProperty(exports,"StructurenavigatorEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.j}});//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as BinaryEndpoint,b as ConfigurationEndpoint,c as ConfigurationsEndpoint,f as DocumentstructureEndpoint,g as DocumentstructuresEndpoint,h as DomainEndpoint,i as DomainsEndpoint,d as EventsEndpoint,e as ScreenshotsEndpoint,k as StructureNavigatorAPI,j as StructurenavigatorEndpoint}from'../../chunk-
|
|
1
|
+
export{a as BinaryEndpoint,b as ConfigurationEndpoint,c as ConfigurationsEndpoint,f as DocumentstructureEndpoint,g as DocumentstructuresEndpoint,h as DomainEndpoint,i as DomainsEndpoint,d as EventsEndpoint,e as ScreenshotsEndpoint,k as StructureNavigatorAPI,j as StructurenavigatorEndpoint}from'../../chunk-VH2AB5TA.mjs';import'../../chunk-FA37ZZXB.mjs';//# sourceMappingURL=index.mjs.map
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkCULSSUTK_js=require('../chunk-CULSSUTK.js'),chunkKFGKXHFV_js=require('../chunk-KFGKXHFV.js');require('../chunk-4CX7MUVC.js');Object.defineProperty(exports,"BinaryEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.a}});Object.defineProperty(exports,"ConfigurationEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.b}});Object.defineProperty(exports,"ConfigurationsEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.c}});Object.defineProperty(exports,"DocumentstructureEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.f}});Object.defineProperty(exports,"DocumentstructuresEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.g}});Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.h}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.i}});Object.defineProperty(exports,"EventsEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.d}});Object.defineProperty(exports,"ScreenshotsEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.e}});Object.defineProperty(exports,"StructureNavigatorAPI",{enumerable:true,get:function(){return chunkCULSSUTK_js.k}});Object.defineProperty(exports,"StructurenavigatorEndpoint",{enumerable:true,get:function(){return chunkCULSSUTK_js.j}});Object.defineProperty(exports,"BulkDocumentStructureStatusEnumValues",{enumerable:true,get:function(){return chunkKFGKXHFV_js.a}});Object.defineProperty(exports,"DocumentStructureOverviewStatusEnumValues",{enumerable:true,get:function(){return chunkKFGKXHFV_js.c}});Object.defineProperty(exports,"DocumentStructureStatusEnumValues",{enumerable:true,get:function(){return chunkKFGKXHFV_js.e}});Object.defineProperty(exports,"EventTypeEnumValues",{enumerable:true,get:function(){return chunkKFGKXHFV_js.g}});Object.defineProperty(exports,"isBulkDocumentStructureStatusEnumValue",{enumerable:true,get:function(){return chunkKFGKXHFV_js.b}});Object.defineProperty(exports,"isDocumentStructureOverviewStatusEnumValue",{enumerable:true,get:function(){return chunkKFGKXHFV_js.d}});Object.defineProperty(exports,"isDocumentStructureStatusEnumValue",{enumerable:true,get:function(){return chunkKFGKXHFV_js.f}});Object.defineProperty(exports,"isEventTypeEnumValue",{enumerable:true,get:function(){return chunkKFGKXHFV_js.h}});//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as BinaryEndpoint,b as ConfigurationEndpoint,c as ConfigurationsEndpoint,f as DocumentstructureEndpoint,g as DocumentstructuresEndpoint,h as DomainEndpoint,i as DomainsEndpoint,d as EventsEndpoint,e as ScreenshotsEndpoint,k as StructureNavigatorAPI,j as StructurenavigatorEndpoint}from'../chunk-
|
|
1
|
+
export{a as BinaryEndpoint,b as ConfigurationEndpoint,c as ConfigurationsEndpoint,f as DocumentstructureEndpoint,g as DocumentstructuresEndpoint,h as DomainEndpoint,i as DomainsEndpoint,d as EventsEndpoint,e as ScreenshotsEndpoint,k as StructureNavigatorAPI,j as StructurenavigatorEndpoint}from'../chunk-VH2AB5TA.mjs';export{a as BulkDocumentStructureStatusEnumValues,c as DocumentStructureOverviewStatusEnumValues,e as DocumentStructureStatusEnumValues,g as EventTypeEnumValues,b as isBulkDocumentStructureStatusEnumValue,d as isDocumentStructureOverviewStatusEnumValue,f as isDocumentStructureStatusEnumValue,h as isEventTypeEnumValue}from'../chunk-OFG4XO3Z.mjs';import'../chunk-FA37ZZXB.mjs';//# sourceMappingURL=index.mjs.map
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk4CX7MUVC_js=require('../../chunk-4CX7MUVC.js'),d=require('fs');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var d__namespace=/*#__PURE__*/_interopNamespace(d);var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/values";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/tableextractor";}ENDPOINT;values(){return new o(this.restClient,this.ENDPOINT)}};var p="/api",c=class i{constructor(t,e){this.restClient=t;this.parentEndpoint=e;}static loginWithApiKey(t,e){if(!e)throw new Error("You need to supply an API key to login.");if(!t)throw new Error("You need to supply a server url to login.");return new i(new chunk4CX7MUVC_js.c(this.parseServerUrl(t),e),p)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new i(new chunk4CX7MUVC_js.c(this.parseServerUrl(t)),p)}static loginWithCredentials(t,e,r,a){return t=this.parseServerUrl(t),new i(new chunk4CX7MUVC_js.c(t,void 0,e,r,a),p)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let r=d__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(l=>l.length!==0).map(l=>l.split("=")),a=this.getValueOfInPropertiesFile("serverUrl",r),u=this.getValueOfInPropertiesFile("clientId",r),f=this.getValueOfInPropertiesFile("clientSecret",r),g=this.getValueOfInPropertiesFile("tokenUrl",r);return i.loginWithCredentials(a,u,f,g)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let r of e)if(r[0]===t)return r[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}tableextractor(){return new s(this.restClient,this.endpoint())}};exports.TableExtractorAPI=c;exports.TableextractorEndpoint=s;exports.ValuesEndpoint=o;//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {c as c$1}from'../../chunk-
|
|
1
|
+
import {c as c$1}from'../../chunk-FA37ZZXB.mjs';import*as d from'fs';var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/values";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/tableextractor";}ENDPOINT;values(){return new o(this.restClient,this.ENDPOINT)}};var p="/api",c=class i{constructor(t,e){this.restClient=t;this.parentEndpoint=e;}static loginWithApiKey(t,e){if(!e)throw new Error("You need to supply an API key to login.");if(!t)throw new Error("You need to supply a server url to login.");return new i(new c$1(this.parseServerUrl(t),e),p)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new i(new c$1(this.parseServerUrl(t)),p)}static loginWithCredentials(t,e,r,a){return t=this.parseServerUrl(t),new i(new c$1(t,void 0,e,r,a),p)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let r=d.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(l=>l.length!==0).map(l=>l.split("=")),a=this.getValueOfInPropertiesFile("serverUrl",r),u=this.getValueOfInPropertiesFile("clientId",r),f=this.getValueOfInPropertiesFile("clientSecret",r),g=this.getValueOfInPropertiesFile("tokenUrl",r);return i.loginWithCredentials(a,u,f,g)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let r of e)if(r[0]===t)return r[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}tableextractor(){return new s(this.restClient,this.endpoint())}};export{c as TableExtractorAPI,s as TableextractorEndpoint,o as ValuesEndpoint};//# sourceMappingURL=index.mjs.map
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk7VUBZ76N_js=require('../../chunk-7VUBZ76N.js');require('../../chunk-4CX7MUVC.js');Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunk7VUBZ76N_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunk7VUBZ76N_js.d}});Object.defineProperty(exports,"LogEndpoint",{enumerable:true,get:function(){return chunk7VUBZ76N_js.a}});Object.defineProperty(exports,"TrackEndpoint",{enumerable:true,get:function(){return chunk7VUBZ76N_js.b}});Object.defineProperty(exports,"TrackingAPI",{enumerable:true,get:function(){return chunk7VUBZ76N_js.f}});Object.defineProperty(exports,"UitrackingEndpoint",{enumerable:true,get:function(){return chunk7VUBZ76N_js.e}});//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{c as DomainEndpoint,d as DomainsEndpoint,a as LogEndpoint,b as TrackEndpoint,f as TrackingAPI,e as UitrackingEndpoint}from'../../chunk-
|
|
1
|
+
export{c as DomainEndpoint,d as DomainsEndpoint,a as LogEndpoint,b as TrackEndpoint,f as TrackingAPI,e as UitrackingEndpoint}from'../../chunk-GJ5RRVHT.mjs';import'../../chunk-FA37ZZXB.mjs';//# sourceMappingURL=index.mjs.map
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/tracking/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk7VUBZ76N_js=require('../chunk-7VUBZ76N.js'),chunkJCDJ3B7Q_js=require('../chunk-JCDJ3B7Q.js');require('../chunk-4CX7MUVC.js');Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunk7VUBZ76N_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunk7VUBZ76N_js.d}});Object.defineProperty(exports,"LogEndpoint",{enumerable:true,get:function(){return chunk7VUBZ76N_js.a}});Object.defineProperty(exports,"TrackEndpoint",{enumerable:true,get:function(){return chunk7VUBZ76N_js.b}});Object.defineProperty(exports,"TrackingAPI",{enumerable:true,get:function(){return chunk7VUBZ76N_js.f}});Object.defineProperty(exports,"UitrackingEndpoint",{enumerable:true,get:function(){return chunk7VUBZ76N_js.e}});Object.defineProperty(exports,"LoggingLevelEnumValues",{enumerable:true,get:function(){return chunkJCDJ3B7Q_js.a}});Object.defineProperty(exports,"isLoggingLevelEnumValue",{enumerable:true,get:function(){return chunkJCDJ3B7Q_js.b}});//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/tracking/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{c as DomainEndpoint,d as DomainsEndpoint,a as LogEndpoint,b as TrackEndpoint,f as TrackingAPI,e as UitrackingEndpoint}from'../chunk-
|
|
1
|
+
export{c as DomainEndpoint,d as DomainsEndpoint,a as LogEndpoint,b as TrackEndpoint,f as TrackingAPI,e as UitrackingEndpoint}from'../chunk-GJ5RRVHT.mjs';export{a as LoggingLevelEnumValues,b as isLoggingLevelEnumValue}from'../chunk-BE73RDIS.mjs';import'../chunk-FA37ZZXB.mjs';//# sourceMappingURL=index.mjs.map
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semantha/product-sdk",
|
|
3
3
|
"description": "SDK for semantha products",
|
|
4
|
-
"version": "11.
|
|
4
|
+
"version": "11.8.0",
|
|
5
5
|
"packageManager": "pnpm@11.6.0+sha512.9a36518224080c6fe5165afdcfe79bfa118c29be703f3f462b1e32efe1e98e47e8750b148e08286250aad4113cc7993ca413c4e2cd447752708c2ee5751bc95f",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=24"
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"homepage": "https://aleph-alpha.com",
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/jest": "30.0.0",
|
|
30
|
-
"@types/node": "24.13.
|
|
31
|
-
"eslint": "10.
|
|
30
|
+
"@types/node": "24.13.3",
|
|
31
|
+
"eslint": "10.8.0",
|
|
32
32
|
"jest": "30.4.2",
|
|
33
|
-
"prettier": "3.9.
|
|
34
|
-
"ts-jest": "29.4.
|
|
33
|
+
"prettier": "3.9.6",
|
|
34
|
+
"ts-jest": "29.4.12",
|
|
35
35
|
"tsup": "8.5.1",
|
|
36
36
|
"typescript": "5.9.3",
|
|
37
|
-
"typescript-eslint": "8.
|
|
37
|
+
"typescript-eslint": "8.65.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"axios": "^1.18.1"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../semantha-product-sdk/rest/restResponse.ts","../semantha-product-sdk/rest/restClient.ts"],"names":["RestResponse","response","contentDisposition","filename","match","MediaType","RestClient","_RestClient","serverUrl","apiKey","clientId","client_secret","tokenUrl","data","axios","headers","form","key","value","method","url","config","authHeader","params","responseType","acceptMimeType","contentType"],"mappings":"oJAEO,IAAMA,CAAAA,CAAN,KAAsB,CAC3B,WAAA,CAA6BC,CAAAA,CAAqC,CAArC,IAAA,CAAA,QAAA,CAAAA,EAAsC,CAEnE,MAAM,SAAsB,CAC1B,OAAA,CAAQ,MAAM,IAAA,CAAK,QAAA,EAAU,IAC/B,CAEA,MAAM,QAAwB,CAC5B,IAAMA,CAAAA,CAA0B,MAAM,IAAA,CAAK,QAAA,CACrCC,CAAAA,CAAqBD,CAAAA,EAAU,QAAQ,qBAAqB,CAAA,CAC9DE,CAAAA,CAAW,MAAA,CACf,GAAID,CAAAA,CAAoB,CACtB,IAAME,EAAQF,CAAAA,CAAmB,KAAA,CAAM,sBAAsB,CAAA,CACzDE,CAAAA,EAASA,CAAAA,CAAM,CAAC,CAAA,GAClBD,EAAWC,CAAAA,CAAM,CAAC,CAAA,EAEtB,CACA,OAAO,IAAI,IAAA,CAAK,CAACH,EAAS,IAAI,CAAA,CAAGE,CAAQ,CAC3C,CAEA,MAAM,aAAA,EAAiC,CACrC,QAAQ,MAAM,IAAA,CAAK,QAAA,EAAU,MAC/B,CAEA,MAAM,aAAA,EAAiC,CACrC,QAAQ,MAAM,IAAA,CAAK,QAAA,EAAU,UAC/B,CACF,EC1BO,IAAKE,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,EAAA,IAAA,CAAO,kBAAA,CACPA,CAAAA,CAAA,IAAA,CAAO,mEAAA,CACPA,CAAAA,CAAA,GAAA,CAAM,iBAAA,CACNA,EAAA,IAAA,CAAO,yEAAA,CACPA,CAAAA,CAAA,GAAA,CAAM,iBAAA,CACNA,CAAAA,CAAA,MAAA,CAAS,oBAAA,CACTA,EAAA,GAAA,CAAM,WAAA,CACNA,CAAAA,CA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AC1B,GAAI,CAACT,CAAAA,CACHA,EAAU,MAAM,IAAA,CAAK,0BAAA,EAA2B,CAAA,KAC3C,CACL,IAAMO,CAAAA,CAAa,MAAM,KAAK,sBAAA,EAAuB,CACrDP,CAAAA,CAAU,CAAE,GAAGA,CAAAA,CAAS,GAAGO,CAAW,EACxC,CACA,OAAO,IAAItB,CAAAA,CACTc,kBAAAA,CAAM,IAAA,CAAQ,IAAA,CAAK,SAAA,CAAYM,EAAK,IAAA,CAAK,aAAA,CAAcP,CAAAA,CAAME,CAAO,EAAG,CAAE,MAAA,CAAAQ,CAAAA,CAAQ,OAAA,CAAAR,EAAS,YAAA,CAAAS,CAAa,CAAC,CAC1G,CACF,CAEA,MAAM,MAAA,CAAOJ,EAAaP,CAAAA,CAAYU,CAAAA,CAA2C,CAC/E,OAAO,IAAA,CAAK,OAAA,CAAc,QAAA,CAAUH,CAAAA,CAAK,CAAE,IAAA,CAAAP,CAAAA,CAAM,MAAA,CAAAU,CAAO,CAAC,CAC3D,CAEA,MAAM,MAASH,CAAAA,CAAaP,CAAAA,CAAsC,CAChE,OAAO,IAAA,CAAK,OAAA,CAAW,OAAA,CAASO,CAAAA,CAAK,CAAE,IAAA,CAAAP,CAAK,CAAC,CAC/C,CAEA,MAAM,GAAA,CAAOO,CAAAA,CAAaP,EAAqC,CAC7D,OAAO,IAAA,CAAK,OAAA,CAAW,KAAA,CAAOO,CAAAA,CAAK,CAAE,IAAA,CAAAP,CAAK,CAAC,CAC7C,CAEA,QAAA,CAASY,CAAAA,CAA2BC,CAAAA,CAAiD,CACnF,OAAIA,EACK,CAAE,MAAA,CAAQD,CAAAA,CAAgB,cAAA,CAAgBC,CAAY,CAAA,CAExD,CAAE,MAAA,CAAQD,CAAe,CAClC,CACF","file":"chunk-2DHIHJB5.js","sourcesContent":["import { AxiosResponse } from 'axios';\n\nexport class RestResponse<T> {\n constructor(private readonly response: Promise<AxiosResponse<T>>) {}\n\n async toModel(): Promise<T> {\n return (await this.response).data;\n }\n\n async toFile(): Promise<File> {\n const response: AxiosResponse = await this.response;\n const contentDisposition = response?.headers['content-disposition'];\n let filename = 'file';\n if (contentDisposition) {\n const match = contentDisposition.match(/filename=\"?([^\"]+)\"?/);\n if (match && match[1]) {\n filename = match[1];\n }\n }\n return new File([response.data], filename);\n }\n\n async getStatusCode(): Promise<number> {\n return (await this.response).status;\n }\n\n async getStatusText(): Promise<string> {\n return (await this.response).statusText;\n }\n}\n","import axios, { AxiosRequestConfig, AxiosResponse, ResponseType } from 'axios';\nimport { RestResponse } from './restResponse';\n\nexport enum MediaType {\n JSON = 'application/json',\n XLSX = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n PDF = 'application/pdf',\n DOCX = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n ZIP = 'application/zip',\n REQIFZ = 'application/reqifz',\n PNG = 'image/png',\n BINARY = 'application/octet-stream',\n TEXT_PLAIN = 'text/plain'\n}\n\nexport class RestClient {\n // in seconds\n private static readonly LEEWAY = 30;\n\n private expireTime: number;\n private accessToken: string;\n private skipAuthHeader: boolean;\n\n constructor(\n private readonly serverUrl: string,\n private readonly apiKey?: string,\n private readonly clientId?: string,\n private readonly client_secret?: string,\n private readonly tokenUrl?: string\n ) {\n this.expireTime = 0.0;\n this.accessToken = '';\n this.skipAuthHeader = !!serverUrl && !(apiKey || clientId || client_secret || tokenUrl);\n }\n\n async buildHeadersForJsonRequest(): Promise<{ [key: string]: string }> {\n if (this.skipAuthHeader) {\n return {\n Accept: 'application/json'\n };\n }\n return {\n Accept: 'application/json',\n Authorization: `Bearer ${await this.getToken()}`\n };\n }\n\n async buildHeadersForRequest(): Promise<{ [key: string]: string }> {\n if (this.skipAuthHeader) {\n return {};\n }\n return {\n Authorization: `Bearer ${await this.getToken()}`\n };\n }\n\n async getToken(): Promise<string> {\n if (this.apiKey) {\n return this.apiKey;\n }\n if (\n this.clientId &&\n this.client_secret &&\n this.tokenUrl &&\n (this.accessToken == '' || this.expireTime < performance.now())\n ) {\n const data = {\n grant_type: 'client_credentials',\n client_id: this.clientId,\n client_secret: this.client_secret,\n scope: 'openid'\n };\n const response = await axios.post(this.tokenUrl, data, {\n headers: { accept: 'application/json', 'content-type': 'application/x-www-form-urlencoded' }\n });\n if (response.status >= axios.HttpStatusCode.BadRequest) {\n // example for error response: {\"error\":\"invalid_client\",\"error_description\":\"Invalid client or Invalid client credentials\"}\n // we have no token -> this leads to a permission error\n return '';\n }\n this.accessToken = response.data['id_token'] ?? response.data['access_token'];\n this.expireTime = performance.now() + (response.data['expires_in'] - RestClient.LEEWAY);\n }\n return this.accessToken;\n }\n\n // Multipart endpoints announce it via a multipart/form-data Content-Type header\n // set by the generated code; their plain-object bodies (possibly containing\n // Blobs) must be sent as FormData, not JSON-serialized.\n private toRequestData(data: any, headers?: { [key: string]: string }): any {\n if (!headers?.['Content-Type']?.startsWith('multipart/form-data')) {\n return data;\n }\n // axios must set the Content-Type itself to include the multipart boundary\n delete headers['Content-Type'];\n if (!data || typeof data !== 'object' || data instanceof FormData) {\n return data;\n }\n const form = new FormData();\n for (const [key, value] of Object.entries(data)) {\n if (value === undefined || value === null) {\n continue;\n }\n if (value instanceof Blob) {\n form.append(key, value, (value as File).name ?? key);\n } else if (typeof value === 'object') {\n form.append(key, JSON.stringify(value));\n } else {\n form.append(key, String(value));\n }\n }\n return form;\n }\n\n private async request<R>(\n method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE',\n url: string,\n config: { params?: any; headers?: { [key: string]: string }; data?: any; responseType?: ResponseType }\n ): Promise<RestResponse<R>> {\n if (!config.headers) {\n config.headers = await this.buildHeadersForJsonRequest();\n } else {\n const authHeader = await this.buildHeadersForRequest();\n config.headers = { ...config.headers, ...authHeader };\n }\n // convert first: toRequestData strips a multipart Content-Type from config.headers\n const data = this.toRequestData(config.data, config.headers);\n return new RestResponse<R>(\n axios.request<R>({\n method: method,\n url: this.serverUrl + url,\n headers: { ...config.headers, 'User-Agent': 'semantha TypeScript SDK; ' },\n data: data,\n params: config.params,\n responseType: config.responseType\n })\n );\n }\n\n async get<R>(\n url: string,\n params?: any,\n headers?: { [key: string]: string },\n data?: any,\n responseType: ResponseType = 'json'\n ): Promise<RestResponse<R>> {\n return this.request<R>('GET', url, { params, headers, data, responseType });\n }\n\n async post<R>(\n url: string,\n params?: any,\n headers?: { [key: string]: string },\n data?: any,\n responseType: ResponseType = 'json'\n ): Promise<RestResponse<R>> {\n if (!headers) {\n headers = await this.buildHeadersForJsonRequest();\n } else {\n const authHeader = await this.buildHeadersForRequest();\n headers = { ...headers, ...authHeader };\n }\n return new RestResponse<R>(\n axios.post<R>(this.serverUrl + url, this.toRequestData(data, headers), { params, headers, responseType })\n );\n }\n\n async delete(url: string, data?: any, params?: any): Promise<RestResponse<void>> {\n return this.request<void>('DELETE', url, { data, params });\n }\n\n async patch<R>(url: string, data?: any): Promise<RestResponse<R>> {\n return this.request<R>('PATCH', url, { data });\n }\n\n async put<R>(url: string, data: any): Promise<RestResponse<R>> {\n return this.request<R>('PUT', url, { data });\n }\n\n toHeader(acceptMimeType: MediaType, contentType?: string): { [key: string]: string } {\n if (contentType) {\n return { Accept: acceptMimeType, 'Content-Type': contentType };\n }\n return { Accept: acceptMimeType };\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../semantha-product-sdk/rest/restResponse.ts","../semantha-product-sdk/rest/restClient.ts"],"names":["RestResponse","response","contentDisposition","filename","match","MediaType","RestClient","_RestClient","serverUrl","apiKey","clientId","client_secret","tokenUrl","data","axios","headers","form","key","value","method","url","config","authHeader","params","responseType","acceptMimeType","contentType"],"mappings":"qBAEO,IAAMA,CAAAA,CAAN,KAAsB,CAC3B,WAAA,CAA6BC,CAAAA,CAAqC,CAArC,IAAA,CAAA,QAAA,CAAAA,EAAsC,CAEnE,MAAM,SAAsB,CAC1B,OAAA,CAAQ,MAAM,IAAA,CAAK,QAAA,EAAU,IAC/B,CAEA,MAAM,QAAwB,CAC5B,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AAS,YAAA,CAAAS,CAAa,CAAC,CAC1G,CACF,CAEA,MAAM,MAAA,CAAOJ,EAAaP,CAAAA,CAAYU,CAAAA,CAA2C,CAC/E,OAAO,IAAA,CAAK,OAAA,CAAc,QAAA,CAAUH,CAAAA,CAAK,CAAE,IAAA,CAAAP,CAAAA,CAAM,MAAA,CAAAU,CAAO,CAAC,CAC3D,CAEA,MAAM,MAASH,CAAAA,CAAaP,CAAAA,CAAsC,CAChE,OAAO,IAAA,CAAK,OAAA,CAAW,OAAA,CAASO,CAAAA,CAAK,CAAE,IAAA,CAAAP,CAAK,CAAC,CAC/C,CAEA,MAAM,GAAA,CAAOO,CAAAA,CAAaP,EAAqC,CAC7D,OAAO,IAAA,CAAK,OAAA,CAAW,KAAA,CAAOO,CAAAA,CAAK,CAAE,IAAA,CAAAP,CAAK,CAAC,CAC7C,CAEA,QAAA,CAASY,CAAAA,CAA2BC,CAAAA,CAAiD,CACnF,OAAIA,EACK,CAAE,MAAA,CAAQD,CAAAA,CAAgB,cAAA,CAAgBC,CAAY,CAAA,CAExD,CAAE,MAAA,CAAQD,CAAe,CAClC,CACF","file":"chunk-HYOHQM5J.mjs","sourcesContent":["import { AxiosResponse } from 'axios';\n\nexport class RestResponse<T> {\n constructor(private readonly response: Promise<AxiosResponse<T>>) {}\n\n async toModel(): Promise<T> {\n return (await this.response).data;\n }\n\n async toFile(): Promise<File> {\n const response: AxiosResponse = await this.response;\n const contentDisposition = response?.headers['content-disposition'];\n let filename = 'file';\n if (contentDisposition) {\n const match = contentDisposition.match(/filename=\"?([^\"]+)\"?/);\n if (match && match[1]) {\n filename = match[1];\n }\n }\n return new File([response.data], filename);\n }\n\n async getStatusCode(): Promise<number> {\n return (await this.response).status;\n }\n\n async getStatusText(): Promise<string> {\n return (await this.response).statusText;\n }\n}\n","import axios, { AxiosRequestConfig, AxiosResponse, ResponseType } from 'axios';\nimport { RestResponse } from './restResponse';\n\nexport enum MediaType {\n JSON = 'application/json',\n XLSX = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n PDF = 'application/pdf',\n DOCX = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n ZIP = 'application/zip',\n REQIFZ = 'application/reqifz',\n PNG = 'image/png',\n BINARY = 'application/octet-stream',\n TEXT_PLAIN = 'text/plain'\n}\n\nexport class RestClient {\n // in seconds\n private static readonly LEEWAY = 30;\n\n private expireTime: number;\n private accessToken: string;\n private skipAuthHeader: boolean;\n\n constructor(\n private readonly serverUrl: string,\n private readonly apiKey?: string,\n private readonly clientId?: string,\n private readonly client_secret?: string,\n private readonly tokenUrl?: string\n ) {\n this.expireTime = 0.0;\n this.accessToken = '';\n this.skipAuthHeader = !!serverUrl && !(apiKey || clientId || client_secret || tokenUrl);\n }\n\n async buildHeadersForJsonRequest(): Promise<{ [key: string]: string }> {\n if (this.skipAuthHeader) {\n return {\n Accept: 'application/json'\n };\n }\n return {\n Accept: 'application/json',\n Authorization: `Bearer ${await this.getToken()}`\n };\n }\n\n async buildHeadersForRequest(): Promise<{ [key: string]: string }> {\n if (this.skipAuthHeader) {\n return {};\n }\n return {\n Authorization: `Bearer ${await this.getToken()}`\n };\n }\n\n async getToken(): Promise<string> {\n if (this.apiKey) {\n return this.apiKey;\n }\n if (\n this.clientId &&\n this.client_secret &&\n this.tokenUrl &&\n (this.accessToken == '' || this.expireTime < performance.now())\n ) {\n const data = {\n grant_type: 'client_credentials',\n client_id: this.clientId,\n client_secret: this.client_secret,\n scope: 'openid'\n };\n const response = await axios.post(this.tokenUrl, data, {\n headers: { accept: 'application/json', 'content-type': 'application/x-www-form-urlencoded' }\n });\n if (response.status >= axios.HttpStatusCode.BadRequest) {\n // example for error response: {\"error\":\"invalid_client\",\"error_description\":\"Invalid client or Invalid client credentials\"}\n // we have no token -> this leads to a permission error\n return '';\n }\n this.accessToken = response.data['id_token'] ?? response.data['access_token'];\n this.expireTime = performance.now() + (response.data['expires_in'] - RestClient.LEEWAY);\n }\n return this.accessToken;\n }\n\n // Multipart endpoints announce it via a multipart/form-data Content-Type header\n // set by the generated code; their plain-object bodies (possibly containing\n // Blobs) must be sent as FormData, not JSON-serialized.\n private toRequestData(data: any, headers?: { [key: string]: string }): any {\n if (!headers?.['Content-Type']?.startsWith('multipart/form-data')) {\n return data;\n }\n // axios must set the Content-Type itself to include the multipart boundary\n delete headers['Content-Type'];\n if (!data || typeof data !== 'object' || data instanceof FormData) {\n return data;\n }\n const form = new FormData();\n for (const [key, value] of Object.entries(data)) {\n if (value === undefined || value === null) {\n continue;\n }\n if (value instanceof Blob) {\n form.append(key, value, (value as File).name ?? key);\n } else if (typeof value === 'object') {\n form.append(key, JSON.stringify(value));\n } else {\n form.append(key, String(value));\n }\n }\n return form;\n }\n\n private async request<R>(\n method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE',\n url: string,\n config: { params?: any; headers?: { [key: string]: string }; data?: any; responseType?: ResponseType }\n ): Promise<RestResponse<R>> {\n if (!config.headers) {\n config.headers = await this.buildHeadersForJsonRequest();\n } else {\n const authHeader = await this.buildHeadersForRequest();\n config.headers = { ...config.headers, ...authHeader };\n }\n // convert first: toRequestData strips a multipart Content-Type from config.headers\n const data = this.toRequestData(config.data, config.headers);\n return new RestResponse<R>(\n axios.request<R>({\n method: method,\n url: this.serverUrl + url,\n headers: { ...config.headers, 'User-Agent': 'semantha TypeScript SDK; ' },\n data: data,\n params: config.params,\n responseType: config.responseType\n })\n );\n }\n\n async get<R>(\n url: string,\n params?: any,\n headers?: { [key: string]: string },\n data?: any,\n responseType: ResponseType = 'json'\n ): Promise<RestResponse<R>> {\n return this.request<R>('GET', url, { params, headers, data, responseType });\n }\n\n async post<R>(\n url: string,\n params?: any,\n headers?: { [key: string]: string },\n data?: any,\n responseType: ResponseType = 'json'\n ): Promise<RestResponse<R>> {\n if (!headers) {\n headers = await this.buildHeadersForJsonRequest();\n } else {\n const authHeader = await this.buildHeadersForRequest();\n headers = { ...headers, ...authHeader };\n }\n return new RestResponse<R>(\n axios.post<R>(this.serverUrl + url, this.toRequestData(data, headers), { params, headers, responseType })\n );\n }\n\n async delete(url: string, data?: any, params?: any): Promise<RestResponse<void>> {\n return this.request<void>('DELETE', url, { data, params });\n }\n\n async patch<R>(url: string, data?: any): Promise<RestResponse<R>> {\n return this.request<R>('PATCH', url, { data });\n }\n\n async put<R>(url: string, data: any): Promise<RestResponse<R>> {\n return this.request<R>('PUT', url, { data });\n }\n\n toHeader(acceptMimeType: MediaType, contentType?: string): { [key: string]: string } {\n if (contentType) {\n return { Accept: acceptMimeType, 'Content-Type': contentType };\n }\n return { Accept: acceptMimeType };\n }\n}\n"]}
|