@semantha/product-sdk 9.3.5 → 9.3.7

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.
Files changed (39) hide show
  1. package/dist/{chunk-L3NE3MB6.mjs → chunk-CS6GMBMN.mjs} +2 -2
  2. package/dist/chunk-CS6GMBMN.mjs.map +1 -0
  3. package/dist/{chunk-EWH4N3WH.js → chunk-DZDAOP2P.js} +2 -2
  4. package/dist/{chunk-EWH4N3WH.js.map → chunk-DZDAOP2P.js.map} +1 -1
  5. package/dist/{chunk-OYJIIC7E.mjs → chunk-EYLT3IYT.mjs} +2 -2
  6. package/dist/{chunk-OYJIIC7E.mjs.map → chunk-EYLT3IYT.mjs.map} +1 -1
  7. package/dist/{chunk-5LVSCZPN.mjs → chunk-KXW4EKOH.mjs} +2 -2
  8. package/dist/{chunk-5LVSCZPN.mjs.map → chunk-KXW4EKOH.mjs.map} +1 -1
  9. package/dist/{chunk-PSWCXZCM.js → chunk-QLRNGP4O.js} +2 -2
  10. package/dist/chunk-QLRNGP4O.js.map +1 -0
  11. package/dist/{chunk-7HYARBNP.mjs → chunk-RBBUO547.mjs} +2 -2
  12. package/dist/{chunk-7HYARBNP.mjs.map → chunk-RBBUO547.mjs.map} +1 -1
  13. package/dist/{chunk-4GQLGD5G.js → chunk-TZZY6IKG.js} +2 -2
  14. package/dist/{chunk-4GQLGD5G.js.map → chunk-TZZY6IKG.js.map} +1 -1
  15. package/dist/{chunk-42V6ET2L.js → chunk-UMOFUDEK.js} +2 -2
  16. package/dist/{chunk-42V6ET2L.js.map → chunk-UMOFUDEK.js.map} +1 -1
  17. package/dist/file-box/api/index.js +1 -1
  18. package/dist/file-box/api/index.mjs +1 -1
  19. package/dist/file-box/index.js +1 -1
  20. package/dist/file-box/index.mjs +1 -1
  21. package/dist/requirements/api/index.js +1 -1
  22. package/dist/requirements/api/index.js.map +1 -1
  23. package/dist/requirements/api/index.mjs +1 -1
  24. package/dist/requirements/api/index.mjs.map +1 -1
  25. package/dist/rest/index.js +1 -1
  26. package/dist/rest/index.mjs +1 -1
  27. package/dist/structure-navigator/api/index.js +1 -1
  28. package/dist/structure-navigator/api/index.mjs +1 -1
  29. package/dist/structure-navigator/index.js +1 -1
  30. package/dist/structure-navigator/index.mjs +1 -1
  31. package/dist/table-extractor/api/index.js +1 -1
  32. package/dist/table-extractor/api/index.mjs +1 -1
  33. package/dist/tracking/api/index.js +1 -1
  34. package/dist/tracking/api/index.mjs +1 -1
  35. package/dist/tracking/index.js +1 -1
  36. package/dist/tracking/index.mjs +1 -1
  37. package/package.json +1 -1
  38. package/dist/chunk-L3NE3MB6.mjs.map +0 -1
  39. package/dist/chunk-PSWCXZCM.js.map +0 -1
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkPSWCXZCM_js=require('../../chunk-PSWCXZCM.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 n=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"),t)).toModel()}};var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/tableextractor";}ENDPOINT;values(){return new n(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 chunkPSWCXZCM_js.c(this.parseServerUrl(t),e),p)}static loginWithCredentials(t,e,r,s){return t=this.parseServerUrl(t),new i(new chunkPSWCXZCM_js.c(t,void 0,e,r,s),p)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let r=d__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(a=>a.length!==0).map(a=>a.split("=")),s=this.getValueOfInPropertiesFile("serverUrl",r),f=this.getValueOfInPropertiesFile("clientId",r),g=this.getValueOfInPropertiesFile("clientSecret",r),u=this.getValueOfInPropertiesFile("tokenUrl",r);return i.loginWithCredentials(s,f,g,u)}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 o(this.restClient,this.endpoint())}};exports.TableExtractorAPI=c;exports.TableextractorEndpoint=o;exports.ValuesEndpoint=n;//# sourceMappingURL=index.js.map
1
+ 'use strict';var chunkQLRNGP4O_js=require('../../chunk-QLRNGP4O.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 n=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"),t)).toModel()}};var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/tableextractor";}ENDPOINT;values(){return new n(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 chunkQLRNGP4O_js.c(this.parseServerUrl(t),e),p)}static loginWithCredentials(t,e,r,s){return t=this.parseServerUrl(t),new i(new chunkQLRNGP4O_js.c(t,void 0,e,r,s),p)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let r=d__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(a=>a.length!==0).map(a=>a.split("=")),s=this.getValueOfInPropertiesFile("serverUrl",r),f=this.getValueOfInPropertiesFile("clientId",r),g=this.getValueOfInPropertiesFile("clientSecret",r),u=this.getValueOfInPropertiesFile("tokenUrl",r);return i.loginWithCredentials(s,f,g,u)}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 o(this.restClient,this.endpoint())}};exports.TableExtractorAPI=c;exports.TableextractorEndpoint=o;exports.ValuesEndpoint=n;//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import {c as c$1}from'../../chunk-L3NE3MB6.mjs';import*as d from'fs';var n=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"),t)).toModel()}};var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/tableextractor";}ENDPOINT;values(){return new n(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 loginWithCredentials(t,e,r,s){return t=this.parseServerUrl(t),new i(new c$1(t,void 0,e,r,s),p)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let r=d.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(a=>a.length!==0).map(a=>a.split("=")),s=this.getValueOfInPropertiesFile("serverUrl",r),f=this.getValueOfInPropertiesFile("clientId",r),g=this.getValueOfInPropertiesFile("clientSecret",r),u=this.getValueOfInPropertiesFile("tokenUrl",r);return i.loginWithCredentials(s,f,g,u)}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 o(this.restClient,this.endpoint())}};export{c as TableExtractorAPI,o as TableextractorEndpoint,n as ValuesEndpoint};//# sourceMappingURL=index.mjs.map
1
+ import {c as c$1}from'../../chunk-CS6GMBMN.mjs';import*as d from'fs';var n=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"),t)).toModel()}};var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/tableextractor";}ENDPOINT;values(){return new n(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 loginWithCredentials(t,e,r,s){return t=this.parseServerUrl(t),new i(new c$1(t,void 0,e,r,s),p)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let r=d.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(a=>a.length!==0).map(a=>a.split("=")),s=this.getValueOfInPropertiesFile("serverUrl",r),f=this.getValueOfInPropertiesFile("clientId",r),g=this.getValueOfInPropertiesFile("clientSecret",r),u=this.getValueOfInPropertiesFile("tokenUrl",r);return i.loginWithCredentials(s,f,g,u)}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 o(this.restClient,this.endpoint())}};export{c as TableExtractorAPI,o as TableextractorEndpoint,n as ValuesEndpoint};//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk42V6ET2L_js=require('../../chunk-42V6ET2L.js');require('../../chunk-PSWCXZCM.js');Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunk42V6ET2L_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunk42V6ET2L_js.d}});Object.defineProperty(exports,"LogEndpoint",{enumerable:true,get:function(){return chunk42V6ET2L_js.a}});Object.defineProperty(exports,"TrackEndpoint",{enumerable:true,get:function(){return chunk42V6ET2L_js.b}});Object.defineProperty(exports,"TrackingAPI",{enumerable:true,get:function(){return chunk42V6ET2L_js.f}});Object.defineProperty(exports,"UitrackingEndpoint",{enumerable:true,get:function(){return chunk42V6ET2L_js.e}});//# sourceMappingURL=index.js.map
1
+ 'use strict';var chunkUMOFUDEK_js=require('../../chunk-UMOFUDEK.js');require('../../chunk-QLRNGP4O.js');Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkUMOFUDEK_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkUMOFUDEK_js.d}});Object.defineProperty(exports,"LogEndpoint",{enumerable:true,get:function(){return chunkUMOFUDEK_js.a}});Object.defineProperty(exports,"TrackEndpoint",{enumerable:true,get:function(){return chunkUMOFUDEK_js.b}});Object.defineProperty(exports,"TrackingAPI",{enumerable:true,get:function(){return chunkUMOFUDEK_js.f}});Object.defineProperty(exports,"UitrackingEndpoint",{enumerable:true,get:function(){return chunkUMOFUDEK_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-OYJIIC7E.mjs';import'../../chunk-L3NE3MB6.mjs';//# sourceMappingURL=index.mjs.map
1
+ export{c as DomainEndpoint,d as DomainsEndpoint,a as LogEndpoint,b as TrackEndpoint,f as TrackingAPI,e as UitrackingEndpoint}from'../../chunk-EYLT3IYT.mjs';import'../../chunk-CS6GMBMN.mjs';//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk42V6ET2L_js=require('../chunk-42V6ET2L.js'),chunkJCDJ3B7Q_js=require('../chunk-JCDJ3B7Q.js');require('../chunk-PSWCXZCM.js');Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunk42V6ET2L_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunk42V6ET2L_js.d}});Object.defineProperty(exports,"LogEndpoint",{enumerable:true,get:function(){return chunk42V6ET2L_js.a}});Object.defineProperty(exports,"TrackEndpoint",{enumerable:true,get:function(){return chunk42V6ET2L_js.b}});Object.defineProperty(exports,"TrackingAPI",{enumerable:true,get:function(){return chunk42V6ET2L_js.f}});Object.defineProperty(exports,"UitrackingEndpoint",{enumerable:true,get:function(){return chunk42V6ET2L_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
1
+ 'use strict';var chunkUMOFUDEK_js=require('../chunk-UMOFUDEK.js'),chunkJCDJ3B7Q_js=require('../chunk-JCDJ3B7Q.js');require('../chunk-QLRNGP4O.js');Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkUMOFUDEK_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkUMOFUDEK_js.d}});Object.defineProperty(exports,"LogEndpoint",{enumerable:true,get:function(){return chunkUMOFUDEK_js.a}});Object.defineProperty(exports,"TrackEndpoint",{enumerable:true,get:function(){return chunkUMOFUDEK_js.b}});Object.defineProperty(exports,"TrackingAPI",{enumerable:true,get:function(){return chunkUMOFUDEK_js.f}});Object.defineProperty(exports,"UitrackingEndpoint",{enumerable:true,get:function(){return chunkUMOFUDEK_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
@@ -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-OYJIIC7E.mjs';export{a as LoggingLevelEnumValues,b as isLoggingLevelEnumValue}from'../chunk-BE73RDIS.mjs';import'../chunk-L3NE3MB6.mjs';//# sourceMappingURL=index.mjs.map
1
+ export{c as DomainEndpoint,d as DomainsEndpoint,a as LogEndpoint,b as TrackEndpoint,f as TrackingAPI,e as UitrackingEndpoint}from'../chunk-EYLT3IYT.mjs';export{a as LoggingLevelEnumValues,b as isLoggingLevelEnumValue}from'../chunk-BE73RDIS.mjs';import'../chunk-CS6GMBMN.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": "",
4
- "version": "9.3.5",
4
+ "version": "9.3.7",
5
5
  "files": [
6
6
  "./dist"
7
7
  ],
@@ -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","method","url","params","headers","authHeader","responseType","acceptMimeType","contentType"],"mappings":"qBAEaA,IAAAA,CAAAA,CAAN,KAAsB,CAC3B,WAAA,CAA6BC,CAAqC,CAAA,CAArC,IAAAA,CAAAA,QAAAA,CAAAA,EAAsC,CAEnE,MAAM,OAAA,EAAsB,CAC1B,OAAA,CAAQ,MAAM,IAAA,CAAK,UAAU,IAC/B,CAEA,MAAM,MAAA,EAAwB,CAC5B,IAAMA,EAA0B,MAAM,IAAA,CAAK,QACrCC,CAAAA,CAAAA,CAAqBD,CAAU,EAAA,OAAA,CAAQ,qBAAqB,CAC9DE,CAAAA,CAAAA,CAAW,MACf,CAAA,GAAID,CAAoB,CAAA,CACtB,IAAME,CAAQF,CAAAA,CAAAA,CAAmB,KAAM,CAAA,sBAAsB,CACzDE,CAAAA,CAAAA,EAASA,EAAM,CAAC,CAAA,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aH,CAAAA,CAAAA,CAAqC,CAC7D,OAAO,IAAA,CAAK,OAAW,CAAA,KAAA,CAAOG,CAAMH,CAAAA,CAAAA,CAAOA,CAAK,CAClD,CAEA,QAASQ,CAAAA,CAAAA,CAA2BC,CAAiD,CAAA,CACnF,OAAIA,CACK,CAAA,CAAE,MAAQD,CAAAA,CAAAA,CAAgB,cAAgBC,CAAAA,CAAY,EAExD,CAAE,MAAA,CAAQD,CAAe,CAClC,CACF","file":"chunk-L3NE3MB6.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.blob()], 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}\n\nexport class RestClient {\n // in seconds\n private static readonly LEEWAY = 30;\n\n private expireTime: number;\n private accessToken: string;\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 }\n\n async buildHeadersForJsonRequest(): Promise<{ [key: string]: string }> {\n return {\n Accept: 'application/json',\n Authorization: `Bearer ${await this.getToken()}`\n };\n }\n\n async buildHeadersForRequest(): Promise<{ [key: string]: string }> {\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 private async request<R>(\n method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE',\n url: string,\n params?: any,\n headers?: { [key: string]: string },\n data?: any\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.request<R>({\n method: method,\n url: this.serverUrl + url,\n headers: { ...headers, 'User-Agent': 'semantha TypeScript SDK; ' },\n data: data,\n params: params\n })\n );\n }\n\n async get<R>(url: string, params?: any, headers?: { [key: string]: string }, data?: any): Promise<RestResponse<R>> {\n return this.request<R>('GET', url, params, headers, data);\n }\n\n async post<R>(url: string, params?: any, headers?: { [key: string]: string }, data?: any, responseType: ResponseType = 'json'): 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>(axios.post<R>(url, {params, headers, data, responseType}))\n }\n\n async delete(url: string, data?: any): Promise<void> {\n this.request<void>('DELETE', url, (data = data));\n }\n\n async patch<R>(url: string, data?: any): Promise<RestResponse<R>> {\n return this.request<R>('PATCH', url, (data = data));\n }\n\n async put<R>(url: string, data: any): Promise<RestResponse<R>> {\n return this.request<R>('PUT', url, (data = 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","method","url","params","headers","authHeader","responseType","acceptMimeType","contentType"],"mappings":"oJAEaA,IAAAA,CAAAA,CAAN,KAAsB,CAC3B,WAAA,CAA6BC,CAAqC,CAAA,CAArC,IAAAA,CAAAA,QAAAA,CAAAA,EAAsC,CAEnE,MAAM,OAAA,EAAsB,CAC1B,OAAA,CAAQ,MAAM,IAAA,CAAK,UAAU,IAC/B,CAEA,MAAM,MAAA,EAAwB,CAC5B,IAAMA,EAA0B,MAAM,IAAA,CAAK,QACrCC,CAAAA,CAAAA,CAAqBD,CAAU,EAAA,OAAA,CAAQ,qBAAqB,CAC9DE,CAAAA,CAAAA,CAAW,MACf,CAAA,GAAID,CAAoB,CAAA,CACtB,IAAME,CAAQF,CAAAA,CAAAA,CAAmB,KAAM,CAAA,sBAAsB,CACzDE,CAAAA,CAAAA,EAASA,EAAM,CAAC,CAAA,GAClBD,CAAWC,CAAAA,CAAAA,CAAM,CAAC,CAAA,EAEtB,CACA,OAAO,IAAI,IAAK,CAAA,CAACH,CAAS,CAAA,IAAA,CAAK,MAAM,CAAA,CAAGE,CAAQ,CAClD,CAEA,MAAM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,CAAiD,CAAA,CACnF,OAAIA,CACK,CAAA,CAAE,MAAQD,CAAAA,CAAAA,CAAgB,cAAgBC,CAAAA,CAAY,EAExD,CAAE,MAAA,CAAQD,CAAe,CAClC,CACF","file":"chunk-PSWCXZCM.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.blob()], 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}\n\nexport class RestClient {\n // in seconds\n private static readonly LEEWAY = 30;\n\n private expireTime: number;\n private accessToken: string;\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 }\n\n async buildHeadersForJsonRequest(): Promise<{ [key: string]: string }> {\n return {\n Accept: 'application/json',\n Authorization: `Bearer ${await this.getToken()}`\n };\n }\n\n async buildHeadersForRequest(): Promise<{ [key: string]: string }> {\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 private async request<R>(\n method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE',\n url: string,\n params?: any,\n headers?: { [key: string]: string },\n data?: any\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.request<R>({\n method: method,\n url: this.serverUrl + url,\n headers: { ...headers, 'User-Agent': 'semantha TypeScript SDK; ' },\n data: data,\n params: params\n })\n );\n }\n\n async get<R>(url: string, params?: any, headers?: { [key: string]: string }, data?: any): Promise<RestResponse<R>> {\n return this.request<R>('GET', url, params, headers, data);\n }\n\n async post<R>(url: string, params?: any, headers?: { [key: string]: string }, data?: any, responseType: ResponseType = 'json'): 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>(axios.post<R>(url, {params, headers, data, responseType}))\n }\n\n async delete(url: string, data?: any): Promise<void> {\n this.request<void>('DELETE', url, (data = data));\n }\n\n async patch<R>(url: string, data?: any): Promise<RestResponse<R>> {\n return this.request<R>('PATCH', url, (data = data));\n }\n\n async put<R>(url: string, data: any): Promise<RestResponse<R>> {\n return this.request<R>('PUT', url, (data = 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"]}