@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.
Files changed (45) hide show
  1. package/dist/{chunk-2DHIHJB5.js → chunk-4CX7MUVC.js} +2 -2
  2. package/dist/chunk-4CX7MUVC.js.map +1 -0
  3. package/dist/{chunk-TYQ3NAQE.js → chunk-7VUBZ76N.js} +2 -2
  4. package/dist/{chunk-TYQ3NAQE.js.map → chunk-7VUBZ76N.js.map} +1 -1
  5. package/dist/{chunk-HQUUS6GC.js → chunk-CULSSUTK.js} +2 -2
  6. package/dist/{chunk-HQUUS6GC.js.map → chunk-CULSSUTK.js.map} +1 -1
  7. package/dist/{chunk-HYOHQM5J.mjs → chunk-FA37ZZXB.mjs} +2 -2
  8. package/dist/chunk-FA37ZZXB.mjs.map +1 -0
  9. package/dist/{chunk-45JLFIMJ.mjs → chunk-GJ5RRVHT.mjs} +2 -2
  10. package/dist/{chunk-45JLFIMJ.mjs.map → chunk-GJ5RRVHT.mjs.map} +1 -1
  11. package/dist/{chunk-FUYAWPCE.mjs → chunk-P2K3VXP2.mjs} +2 -2
  12. package/dist/{chunk-FUYAWPCE.mjs.map → chunk-P2K3VXP2.mjs.map} +1 -1
  13. package/dist/{chunk-OGW7UVWP.js → chunk-TNOEPM5N.js} +2 -2
  14. package/dist/{chunk-OGW7UVWP.js.map → chunk-TNOEPM5N.js.map} +1 -1
  15. package/dist/{chunk-ZCQJ5ZKX.mjs → chunk-VH2AB5TA.mjs} +2 -2
  16. package/dist/{chunk-ZCQJ5ZKX.mjs.map → chunk-VH2AB5TA.mjs.map} +1 -1
  17. package/dist/document-chat/api/index.d.mts +3 -1
  18. package/dist/document-chat/api/index.d.ts +3 -1
  19. package/dist/document-chat/api/index.js +1 -1
  20. package/dist/document-chat/api/index.js.map +1 -1
  21. package/dist/document-chat/api/index.mjs +1 -1
  22. package/dist/document-chat/api/index.mjs.map +1 -1
  23. package/dist/file-box/api/index.js +1 -1
  24. package/dist/file-box/api/index.mjs +1 -1
  25. package/dist/file-box/index.js +1 -1
  26. package/dist/file-box/index.mjs +1 -1
  27. package/dist/requirements/api/index.js +1 -1
  28. package/dist/requirements/api/index.mjs +1 -1
  29. package/dist/rest/index.d.mts +9 -3
  30. package/dist/rest/index.d.ts +9 -3
  31. package/dist/rest/index.js +1 -1
  32. package/dist/rest/index.mjs +1 -1
  33. package/dist/structure-navigator/api/index.js +1 -1
  34. package/dist/structure-navigator/api/index.mjs +1 -1
  35. package/dist/structure-navigator/index.js +1 -1
  36. package/dist/structure-navigator/index.mjs +1 -1
  37. package/dist/table-extractor/api/index.js +1 -1
  38. package/dist/table-extractor/api/index.mjs +1 -1
  39. package/dist/tracking/api/index.js +1 -1
  40. package/dist/tracking/api/index.mjs +1 -1
  41. package/dist/tracking/index.js +1 -1
  42. package/dist/tracking/index.mjs +1 -1
  43. package/package.json +6 -6
  44. package/dist/chunk-2DHIHJB5.js.map +0 -1
  45. package/dist/chunk-HYOHQM5J.mjs.map +0 -1
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk2DHIHJB5_js=require('./chunk-2DHIHJB5.js'),h=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 h__namespace=/*#__PURE__*/_interopNamespace(h);var o=class{constructor(t,e,r){this.restClient=t;this.parentEndpoint=e;this.id=r;this.ENDPOINT=this.parentEndpoint+`/boxes/${this.id}`;}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/boxes";}ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}};var p=class{constructor(t,e,r){this.restClient=t;this.parentEndpoint=e;this.domainname=r;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;boxes(t){return t!=null?new o(this.restClient,this.ENDPOINT,t):new s(this.restClient,this.ENDPOINT)}};var a=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/filebox";}ENDPOINT;domains(t){return t!=null?new p(this.restClient,this.ENDPOINT,t):new a(this.restClient,this.ENDPOINT)}};var f="/api/v1",g=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 chunk2DHIHJB5_js.c(this.parseServerUrl(t),e),f)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new i(new chunk2DHIHJB5_js.c(this.parseServerUrl(t)),f)}static loginWithCredentials(t,e,r,d){return t=this.parseServerUrl(t),new i(new chunk2DHIHJB5_js.c(t,void 0,e,r,d),f)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let r=h__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(m=>m.length!==0).map(m=>m.split("=")),d=this.getValueOfInPropertiesFile("serverUrl",r),u=this.getValueOfInPropertiesFile("clientId",r),c=this.getValueOfInPropertiesFile("clientSecret",r),E=this.getValueOfInPropertiesFile("tokenUrl",r);return i.loginWithCredentials(d,u,c,E)}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}filebox(){return new l(this.restClient,this.endpoint())}};exports.a=o;exports.b=s;exports.c=p;exports.d=a;exports.e=l;exports.f=g;//# sourceMappingURL=chunk-OGW7UVWP.js.map
2
- //# sourceMappingURL=chunk-OGW7UVWP.js.map
1
+ 'use strict';var chunk4CX7MUVC_js=require('./chunk-4CX7MUVC.js'),h=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 h__namespace=/*#__PURE__*/_interopNamespace(h);var o=class{constructor(t,e,r){this.restClient=t;this.parentEndpoint=e;this.id=r;this.ENDPOINT=this.parentEndpoint+`/boxes/${this.id}`;}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/boxes";}ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}};var p=class{constructor(t,e,r){this.restClient=t;this.parentEndpoint=e;this.domainname=r;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;boxes(t){return t!=null?new o(this.restClient,this.ENDPOINT,t):new s(this.restClient,this.ENDPOINT)}};var a=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/filebox";}ENDPOINT;domains(t){return t!=null?new p(this.restClient,this.ENDPOINT,t):new a(this.restClient,this.ENDPOINT)}};var f="/api/v1",g=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),f)}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)),f)}static loginWithCredentials(t,e,r,d){return t=this.parseServerUrl(t),new i(new chunk4CX7MUVC_js.c(t,void 0,e,r,d),f)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let r=h__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(m=>m.length!==0).map(m=>m.split("=")),d=this.getValueOfInPropertiesFile("serverUrl",r),u=this.getValueOfInPropertiesFile("clientId",r),c=this.getValueOfInPropertiesFile("clientSecret",r),E=this.getValueOfInPropertiesFile("tokenUrl",r);return i.loginWithCredentials(d,u,c,E)}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}filebox(){return new l(this.restClient,this.endpoint())}};exports.a=o;exports.b=s;exports.c=p;exports.d=a;exports.e=l;exports.f=g;//# sourceMappingURL=chunk-TNOEPM5N.js.map
2
+ //# sourceMappingURL=chunk-TNOEPM5N.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../semantha-product-sdk/file-box/api/box.ts","../semantha-product-sdk/file-box/api/boxes.ts","../semantha-product-sdk/file-box/api/domain.ts","../semantha-product-sdk/file-box/api/domains.ts","../semantha-product-sdk/file-box/api/filebox.ts","../semantha-product-sdk/file-box/api/fileBoxAPI.ts"],"names":["BoxEndpoint","restClient","parentEndpoint","id","BoxesEndpoint","body","params","DomainEndpoint","domainname","DomainsEndpoint","FileboxEndpoint","PARENT_ENDPOINT","FileBoxAPI","_FileBoxAPI","serverUrl","apiKey","RestClient","clientId","clientSecret","tokenUrl","credentialsFilePath","lines","h","line","searchKey"],"mappings":"ubAUO,IAAMA,CAAAA,CAAN,KAAkB,CAGvB,WAAA,CACmBC,CAAAA,CACAC,EACAC,CAAAA,CACjB,CAHiB,IAAA,CAAA,UAAA,CAAAF,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,CAAAA,CACA,QAAAC,CAAAA,CAEjB,IAAA,CAAK,QAAA,CAAW,IAAA,CAAK,cAAA,CAAiB,CAAA,OAAA,EAAe,KAAK,EAAE,CAAA,EAC9D,CARiB,QAAA,CAUjB,MAAM,GAAA,EAAoB,CACxB,OAAA,CACE,MAAM,IAAA,CAAK,UAAA,CAAW,GAAA,CACpB,IAAA,CAAK,SACL,EAAC,CACD,IAAA,CAAK,UAAA,CAAW,QAAA,CAAA,kBAAuB,CACzC,GACA,OAAA,EACJ,CACF,ECnBO,IAAMC,CAAAA,CAAN,KAAoB,CAGzB,WAAA,CACmBH,CAAAA,CACAC,CAAAA,CACjB,CAFiB,IAAA,CAAA,UAAA,CAAAD,CAAAA,CACA,oBAAAC,CAAAA,CAEjB,IAAA,CAAK,QAAA,CAAW,IAAA,CAAK,cAAA,CAAiB,SACxC,CAPiB,QAAA,CAYjB,MAAM,IAAA,CACJG,CAAAA,CACAC,CAAAA,CAEsB,CACtB,QACE,MAAM,IAAA,CAAK,UAAA,CAAW,IAAA,CACpB,IAAA,CAAK,QAAA,CACLA,EACA,IAAA,CAAK,UAAA,CAAW,QAAA,CAAA,kBAAuB,CAAA,CACvCD,CACF,CAAA,EACA,SACJ,CACF,EC5BO,IAAME,CAAAA,CAAN,KAAqB,CAG1B,WAAA,CACmBN,CAAAA,CACAC,CAAAA,CACAM,CAAAA,CACjB,CAHiB,IAAA,CAAA,UAAA,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C7D,CAEF","file":"chunk-OGW7UVWP.js","sourcesContent":["import { Box } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/filebox/domains/{domainname}/boxes/{id}\"\n * This is a generated file do not change manually!\n */\nexport class BoxEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly id: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/boxes\" + `/${this.id}`;\n }\n\n async get(): Promise<Box> {\n return (\n await this.restClient.get<Box>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON)\n )\n ).toModel();\n }\n}\n","import { Box } from '../model';\nimport { BoxCreated } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/filebox/domains/{domainname}/boxes\"\n * This is a generated file do not change manually!\n */\nexport class BoxesEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/boxes\";\n }\n\n /**\n * @param body Box? - \n */\n async post(\n body: Box,\n params?: {\n uilanguage?: string,\n }): Promise<BoxCreated> {\n return (\n await this.restClient.post<BoxCreated>(\n this.ENDPOINT,\n params,\n this.restClient.toHeader(MediaType.JSON),\n body\n )\n ).toModel();\n }\n}\n","import { BoxEndpoint } from './box';\nimport { BoxesEndpoint } from './boxes';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/filebox/domains/{domainname}\"\n * This is a generated file do not change manually!\n */\nexport class DomainEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly domainname: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\" + `/${this.domainname}`;\n }\n\n boxes(): BoxesEndpoint;\n boxes(id: string): BoxEndpoint\n \n boxes(id?: string): BoxEndpoint | BoxesEndpoint {\n if(id !== undefined && id !== null) {\n\t return new BoxEndpoint(this.restClient, this.ENDPOINT, id);\n } else {\n\t return new BoxesEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/filebox/domains\"\n * This is a generated file do not change manually!\n */\nexport class DomainsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\";\n }\n}\n","import { DomainEndpoint } from './domain';\nimport { DomainsEndpoint } from './domains';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/filebox\"\n * This is a generated file do not change manually!\n */\nexport class FileboxEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/filebox\";\n }\n\n domains(): DomainsEndpoint;\n domains(domainname: string): DomainEndpoint\n \n domains(domainname?: string): DomainEndpoint | DomainsEndpoint {\n if(domainname !== undefined && domainname !== null) {\n\t return new DomainEndpoint(this.restClient, this.ENDPOINT, domainname);\n } else {\n\t return new DomainsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import * as fs from 'fs';\n\nimport { FileboxEndpoint } from './filebox';\nimport { RestClient } from '../../rest';\n\nconst PARENT_ENDPOINT = '/api/v1';\n\n/**\n * Entry point to the FileBox API.\n *\n * @author semantha\n * Calls the /filebox, endpoints.\n *\n * Note:\n * The constructor is not meant to be invoked directly\n * use `loginXXX()` with your credentials instead.\n *\n * this is a generated class do not change manually!\n */\nexport class FileBoxAPI {\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string\n ) {\n }\n\n /**\n * Access to the FileBox API\n *\n * @param serverUrl: string - URL to the FileBox server.\n * @param apiKey: string - A valid bearer token for accessing the given url.\n *\n * @return FileBoxAPI: Entry point to the FileBox API.\n */\n static loginWithApiKey(\n serverUrl: string,\n apiKey: string\n ): FileBoxAPI {\n if(!apiKey) {\n throw new Error('You need to supply an API key to login.');\n }\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new FileBoxAPI(new RestClient(this.parseServerUrl(serverUrl), apiKey), PARENT_ENDPOINT);\n }\n\n\n /**\n * Access to the FileBox API, when there is a auth proxy in place to handle the addition of the Authorization header\n *\n * @param serverUrl: string - URL to the FileBox server.\n *\n * @return FileBoxAPI: Entry point to the FileBox API.\n */\n static loginWithAuthProxy(\n serverUrl: string\n ): FileBoxAPI {\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new FileBoxAPI(new RestClient(this.parseServerUrl(serverUrl)), PARENT_ENDPOINT);\n }\n\n /**\n * Access to the FileBox API\n *\n * @param serverUrl: string - URL to the FileBox server.\n * @param clientId: string - OAuth2 client id.\n * @param clientSecret: string - OAuth2 client secret.\n * @param tokenUrl: string OAuth2 url to get a valid access token\n *\n * @return FileBoxAPI: Entry point to the FileBox API.\n */\n static loginWithCredentials(\n serverUrl: string,\n clientId: string,\n clientSecret: string,\n tokenUrl: string\n ): FileBoxAPI {\n serverUrl = this.parseServerUrl(serverUrl);\n return new FileBoxAPI(new RestClient(serverUrl, undefined, clientId, clientSecret, tokenUrl), PARENT_ENDPOINT);\n }\n\t\n /**\n * Access to the FileBox API\n *\n * @param credentialsFilePath: string - Path to a properties file providing client credentials.\n *\n * @return FileBoxAPI: Entry point to the FileBox API.\n */\n static loginWithCredentialsFile(credentialsFilePath: string) : FileBoxAPI {\n if (credentialsFilePath.endsWith('.properties') || credentialsFilePath.endsWith('.PROPERTIES')) {\n const rawData = fs.readFileSync(credentialsFilePath, 'utf8');\n const lines = rawData\n\t .split(/[\\n|\\r\\n]/)\n\t .filter(line => line.length !== 0)\n\t .map(line => line.split('='));\n\t const serverUrl = this.getValueOfInPropertiesFile('serverUrl', lines);\n\t const clientId = this.getValueOfInPropertiesFile('clientId', lines);\n\t const clientSecret = this.getValueOfInPropertiesFile('clientSecret', lines);\n\t const tokenUrl = this.getValueOfInPropertiesFile('tokenUrl', lines);\n\t return FileBoxAPI.loginWithCredentials(serverUrl, clientId, clientSecret, tokenUrl);\n\t}\n throw new Error('Can not login, please supply a credentials properties file.');\n }\n\n private static parseServerUrl(serverUrl: string): string {\n if (serverUrl.endsWith('/')) {\n serverUrl = serverUrl.slice(0, -1);\n }\n if (serverUrl.endsWith('/tt-platform-ui/en/#')) {\n serverUrl = serverUrl.replace('/tt-platform-ui/en/#', '/tt-product-server');\n } else if (!serverUrl.endsWith('/tt-product-server')) {\n serverUrl += '/tt-product-server';\n }\n return serverUrl;\n }\n\n private static getValueOfInPropertiesFile(searchKey: string, lines: string[][]): string {\n for (const line of lines) {\n if (line[0] === searchKey) {\n return line[1].replace('\\\\:', ':');\n }\n }\n throw Error(`.properties files contains no ${searchKey}!`);\n }\n\n endpoint(): string {\n return this.parentEndpoint;\n }\n\n filebox(): FileboxEndpoint {\n return new FileboxEndpoint(this.restClient, this.endpoint());\n }\n\n}"]}
1
+ {"version":3,"sources":["../semantha-product-sdk/file-box/api/box.ts","../semantha-product-sdk/file-box/api/boxes.ts","../semantha-product-sdk/file-box/api/domain.ts","../semantha-product-sdk/file-box/api/domains.ts","../semantha-product-sdk/file-box/api/filebox.ts","../semantha-product-sdk/file-box/api/fileBoxAPI.ts"],"names":["BoxEndpoint","restClient","parentEndpoint","id","BoxesEndpoint","body","params","DomainEndpoint","domainname","DomainsEndpoint","FileboxEndpoint","PARENT_ENDPOINT","FileBoxAPI","_FileBoxAPI","serverUrl","apiKey","RestClient","clientId","clientSecret","tokenUrl","credentialsFilePath","lines","h","line","searchKey"],"mappings":"ubAUO,IAAMA,CAAAA,CAAN,KAAkB,CAGvB,WAAA,CACmBC,CAAAA,CACAC,EACAC,CAAAA,CACjB,CAHiB,IAAA,CAAA,UAAA,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oBAAA,CAAqBC,CAAAA,CAAWG,CAAAA,CAAUC,CAAAA,CAAcC,CAAQ,CACpF,CACG,MAAM,IAAI,KAAA,CAAM,6DAA6D,CAC/E,CAEA,OAAe,cAAA,CAAeL,CAAAA,CAA2B,CACvD,OAAIA,CAAAA,CAAU,QAAA,CAAS,GAAG,CAAA,GACxBA,CAAAA,CAAYA,CAAAA,CAAU,KAAA,CAAM,CAAA,CAAG,EAAE,CAAA,CAAA,CAE/BA,CAAAA,CAAU,QAAA,CAAS,sBAAsB,CAAA,CAC3CA,CAAAA,CAAYA,CAAAA,CAAU,OAAA,CAAQ,uBAAwB,oBAAoB,CAAA,CAChEA,CAAAA,CAAU,QAAA,CAAS,oBAAoB,CAAA,GACjDA,GAAa,oBAAA,CAAA,CAERA,CACT,CAEA,OAAe,0BAAA,CAA2BU,CAAAA,CAAmBH,EAA2B,CACtF,IAAA,IAAWE,CAAAA,IAAQF,CAAAA,CACjB,GAAIE,CAAAA,CAAK,CAAC,CAAA,GAAMC,CAAAA,CACd,OAAOD,CAAAA,CAAK,CAAC,CAAA,CAAE,OAAA,CAAQ,MAAO,GAAG,CAAA,CAGrC,MAAM,KAAA,CAAM,CAAA,8BAAA,EAAiCC,CAAS,GAAG,CAC3D,CAEA,QAAA,EAAmB,CACjB,OAAO,IAAA,CAAK,cACd,CAEA,OAAA,EAA2B,CACzB,OAAO,IAAId,CAAAA,CAAgB,IAAA,CAAK,UAAA,CAAY,IAAA,CAAK,QAAA,EAAU,CAC7D,CAEF","file":"chunk-TNOEPM5N.js","sourcesContent":["import { Box } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/filebox/domains/{domainname}/boxes/{id}\"\n * This is a generated file do not change manually!\n */\nexport class BoxEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly id: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/boxes\" + `/${this.id}`;\n }\n\n async get(): Promise<Box> {\n return (\n await this.restClient.get<Box>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON)\n )\n ).toModel();\n }\n}\n","import { Box } from '../model';\nimport { BoxCreated } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/filebox/domains/{domainname}/boxes\"\n * This is a generated file do not change manually!\n */\nexport class BoxesEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/boxes\";\n }\n\n /**\n * @param body Box? - \n */\n async post(\n body: Box,\n params?: {\n uilanguage?: string,\n }): Promise<BoxCreated> {\n return (\n await this.restClient.post<BoxCreated>(\n this.ENDPOINT,\n params,\n this.restClient.toHeader(MediaType.JSON),\n body\n )\n ).toModel();\n }\n}\n","import { BoxEndpoint } from './box';\nimport { BoxesEndpoint } from './boxes';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/filebox/domains/{domainname}\"\n * This is a generated file do not change manually!\n */\nexport class DomainEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly domainname: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\" + `/${this.domainname}`;\n }\n\n boxes(): BoxesEndpoint;\n boxes(id: string): BoxEndpoint\n \n boxes(id?: string): BoxEndpoint | BoxesEndpoint {\n if(id !== undefined && id !== null) {\n\t return new BoxEndpoint(this.restClient, this.ENDPOINT, id);\n } else {\n\t return new BoxesEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/filebox/domains\"\n * This is a generated file do not change manually!\n */\nexport class DomainsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\";\n }\n}\n","import { DomainEndpoint } from './domain';\nimport { DomainsEndpoint } from './domains';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/filebox\"\n * This is a generated file do not change manually!\n */\nexport class FileboxEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/filebox\";\n }\n\n domains(): DomainsEndpoint;\n domains(domainname: string): DomainEndpoint\n \n domains(domainname?: string): DomainEndpoint | DomainsEndpoint {\n if(domainname !== undefined && domainname !== null) {\n\t return new DomainEndpoint(this.restClient, this.ENDPOINT, domainname);\n } else {\n\t return new DomainsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import * as fs from 'fs';\n\nimport { FileboxEndpoint } from './filebox';\nimport { RestClient } from '../../rest';\n\nconst PARENT_ENDPOINT = '/api/v1';\n\n/**\n * Entry point to the FileBox API.\n *\n * @author semantha\n * Calls the /filebox, endpoints.\n *\n * Note:\n * The constructor is not meant to be invoked directly\n * use `loginXXX()` with your credentials instead.\n *\n * this is a generated class do not change manually!\n */\nexport class FileBoxAPI {\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string\n ) {\n }\n\n /**\n * Access to the FileBox API\n *\n * @param serverUrl: string - URL to the FileBox server.\n * @param apiKey: string - A valid bearer token for accessing the given url.\n *\n * @return FileBoxAPI: Entry point to the FileBox API.\n */\n static loginWithApiKey(\n serverUrl: string,\n apiKey: string\n ): FileBoxAPI {\n if(!apiKey) {\n throw new Error('You need to supply an API key to login.');\n }\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new FileBoxAPI(new RestClient(this.parseServerUrl(serverUrl), apiKey), PARENT_ENDPOINT);\n }\n\n\n /**\n * Access to the FileBox API, when there is a auth proxy in place to handle the addition of the Authorization header\n *\n * @param serverUrl: string - URL to the FileBox server.\n *\n * @return FileBoxAPI: Entry point to the FileBox API.\n */\n static loginWithAuthProxy(\n serverUrl: string\n ): FileBoxAPI {\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new FileBoxAPI(new RestClient(this.parseServerUrl(serverUrl)), PARENT_ENDPOINT);\n }\n\n /**\n * Access to the FileBox API\n *\n * @param serverUrl: string - URL to the FileBox server.\n * @param clientId: string - OAuth2 client id.\n * @param clientSecret: string - OAuth2 client secret.\n * @param tokenUrl: string OAuth2 url to get a valid access token\n *\n * @return FileBoxAPI: Entry point to the FileBox API.\n */\n static loginWithCredentials(\n serverUrl: string,\n clientId: string,\n clientSecret: string,\n tokenUrl: string\n ): FileBoxAPI {\n serverUrl = this.parseServerUrl(serverUrl);\n return new FileBoxAPI(new RestClient(serverUrl, undefined, clientId, clientSecret, tokenUrl), PARENT_ENDPOINT);\n }\n\t\n /**\n * Access to the FileBox API\n *\n * @param credentialsFilePath: string - Path to a properties file providing client credentials.\n *\n * @return FileBoxAPI: Entry point to the FileBox API.\n */\n static loginWithCredentialsFile(credentialsFilePath: string) : FileBoxAPI {\n if (credentialsFilePath.endsWith('.properties') || credentialsFilePath.endsWith('.PROPERTIES')) {\n const rawData = fs.readFileSync(credentialsFilePath, 'utf8');\n const lines = rawData\n\t .split(/[\\n|\\r\\n]/)\n\t .filter(line => line.length !== 0)\n\t .map(line => line.split('='));\n\t const serverUrl = this.getValueOfInPropertiesFile('serverUrl', lines);\n\t const clientId = this.getValueOfInPropertiesFile('clientId', lines);\n\t const clientSecret = this.getValueOfInPropertiesFile('clientSecret', lines);\n\t const tokenUrl = this.getValueOfInPropertiesFile('tokenUrl', lines);\n\t return FileBoxAPI.loginWithCredentials(serverUrl, clientId, clientSecret, tokenUrl);\n\t}\n throw new Error('Can not login, please supply a credentials properties file.');\n }\n\n private static parseServerUrl(serverUrl: string): string {\n if (serverUrl.endsWith('/')) {\n serverUrl = serverUrl.slice(0, -1);\n }\n if (serverUrl.endsWith('/tt-platform-ui/en/#')) {\n serverUrl = serverUrl.replace('/tt-platform-ui/en/#', '/tt-product-server');\n } else if (!serverUrl.endsWith('/tt-product-server')) {\n serverUrl += '/tt-product-server';\n }\n return serverUrl;\n }\n\n private static getValueOfInPropertiesFile(searchKey: string, lines: string[][]): string {\n for (const line of lines) {\n if (line[0] === searchKey) {\n return line[1].replace('\\\\:', ':');\n }\n }\n throw Error(`.properties files contains no ${searchKey}!`);\n }\n\n endpoint(): string {\n return this.parentEndpoint;\n }\n\n filebox(): FileboxEndpoint {\n return new FileboxEndpoint(this.restClient, this.endpoint());\n }\n\n}"]}
@@ -1,2 +1,2 @@
1
- import {c as c$1}from'./chunk-HYOHQM5J.mjs';import*as P from'fs';var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/binary";}ENDPOINT;async getAsXlsx(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),null,"blob")).toFile()}async getAsDocx(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/vnd.openxmlformats-officedocument.wordprocessingml.document"),null,"blob")).toFile()}async getAsPdf(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/pdf"),null,"blob")).toFile()}};var a=class{constructor(t,e,i){this.restClient=t;this.parentEndpoint=e;this.configurationid=i;this.ENDPOINT=this.parentEndpoint+`/configurations/${this.configurationid}`;}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 patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/configurations";}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"),t)).toModel()}};var p=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/events";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}};var u=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/screenshots";}ENDPOINT;async getAsPng(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("image/png"),null,"blob")).toFile()}};var c=class{constructor(t,e,i){this.restClient=t;this.parentEndpoint=e;this.documentstructureid=i;this.ENDPOINT=this.parentEndpoint+`/documentstructures/${this.documentstructureid}`;}ENDPOINT;binary(){return new s(this.restClient,this.ENDPOINT)}events(){return new p(this.restClient,this.ENDPOINT)}screenshots(){return new u(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async getAsReqifz(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/reqifz"),null,"blob")).toFile()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var d=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documentstructures";}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 post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}};var m=class{constructor(t,e,i){this.restClient=t;this.parentEndpoint=e;this.domainname=i;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;configurations(t){return t!=null?new a(this.restClient,this.ENDPOINT,t):new l(this.restClient,this.ENDPOINT)}documentstructures(t){return t!=null?new c(this.restClient,this.ENDPOINT,t):new d(this.restClient,this.ENDPOINT)}};var h=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var g=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/structurenavigator";}ENDPOINT;domains(t){return t!=null?new m(this.restClient,this.ENDPOINT,t):new h(this.restClient,this.ENDPOINT)}};var E="/api",C=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),E)}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)),E)}static loginWithCredentials(t,e,i,N){return t=this.parseServerUrl(t),new r(new c$1(t,void 0,e,i,N),E)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let i=P.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(f=>f.length!==0).map(f=>f.split("=")),N=this.getValueOfInPropertiesFile("serverUrl",i),D=this.getValueOfInPropertiesFile("clientId",i),O=this.getValueOfInPropertiesFile("clientSecret",i),v=this.getValueOfInPropertiesFile("tokenUrl",i);return r.loginWithCredentials(N,D,O,v)}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 i of e)if(i[0]===t)return i[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}structurenavigator(){return new g(this.restClient,this.endpoint())}};export{s as a,a as b,l as c,p as d,u as e,c as f,d as g,m as h,h as i,g as j,C as k};//# sourceMappingURL=chunk-ZCQJ5ZKX.mjs.map
2
- //# sourceMappingURL=chunk-ZCQJ5ZKX.mjs.map
1
+ import {c as c$1}from'./chunk-FA37ZZXB.mjs';import*as P from'fs';var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/binary";}ENDPOINT;async getAsXlsx(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),null,"blob")).toFile()}async getAsDocx(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/vnd.openxmlformats-officedocument.wordprocessingml.document"),null,"blob")).toFile()}async getAsPdf(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/pdf"),null,"blob")).toFile()}};var a=class{constructor(t,e,i){this.restClient=t;this.parentEndpoint=e;this.configurationid=i;this.ENDPOINT=this.parentEndpoint+`/configurations/${this.configurationid}`;}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 patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/configurations";}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"),t)).toModel()}};var p=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/events";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}};var u=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/screenshots";}ENDPOINT;async getAsPng(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("image/png"),null,"blob")).toFile()}};var c=class{constructor(t,e,i){this.restClient=t;this.parentEndpoint=e;this.documentstructureid=i;this.ENDPOINT=this.parentEndpoint+`/documentstructures/${this.documentstructureid}`;}ENDPOINT;binary(){return new s(this.restClient,this.ENDPOINT)}events(){return new p(this.restClient,this.ENDPOINT)}screenshots(){return new u(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async getAsReqifz(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/reqifz"),null,"blob")).toFile()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var d=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documentstructures";}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 post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}};var m=class{constructor(t,e,i){this.restClient=t;this.parentEndpoint=e;this.domainname=i;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;configurations(t){return t!=null?new a(this.restClient,this.ENDPOINT,t):new l(this.restClient,this.ENDPOINT)}documentstructures(t){return t!=null?new c(this.restClient,this.ENDPOINT,t):new d(this.restClient,this.ENDPOINT)}};var h=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var g=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/structurenavigator";}ENDPOINT;domains(t){return t!=null?new m(this.restClient,this.ENDPOINT,t):new h(this.restClient,this.ENDPOINT)}};var E="/api",C=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),E)}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)),E)}static loginWithCredentials(t,e,i,N){return t=this.parseServerUrl(t),new r(new c$1(t,void 0,e,i,N),E)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let i=P.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(f=>f.length!==0).map(f=>f.split("=")),N=this.getValueOfInPropertiesFile("serverUrl",i),D=this.getValueOfInPropertiesFile("clientId",i),O=this.getValueOfInPropertiesFile("clientSecret",i),v=this.getValueOfInPropertiesFile("tokenUrl",i);return r.loginWithCredentials(N,D,O,v)}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 i of e)if(i[0]===t)return i[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}structurenavigator(){return new g(this.restClient,this.endpoint())}};export{s as a,a as b,l as c,p as d,u as e,c as f,d as g,m as h,h as i,g as j,C as k};//# sourceMappingURL=chunk-VH2AB5TA.mjs.map
2
+ //# sourceMappingURL=chunk-VH2AB5TA.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../semantha-product-sdk/structure-navigator/api/binary.ts","../semantha-product-sdk/structure-navigator/api/configuration.ts","../semantha-product-sdk/structure-navigator/api/configurations.ts","../semantha-product-sdk/structure-navigator/api/events.ts","../semantha-product-sdk/structure-navigator/api/screenshots.ts","../semantha-product-sdk/structure-navigator/api/documentstructure.ts","../semantha-product-sdk/structure-navigator/api/documentstructures.ts","../semantha-product-sdk/structure-navigator/api/domain.ts","../semantha-product-sdk/structure-navigator/api/domains.ts","../semantha-product-sdk/structure-navigator/api/structurenavigator.ts","../semantha-product-sdk/structure-navigator/api/structureNavigatorAPI.ts"],"names":["BinaryEndpoint","restClient","parentEndpoint","ConfigurationEndpoint","configurationid","body","ConfigurationsEndpoint","EventsEndpoint","params","ScreenshotsEndpoint","DocumentstructureEndpoint","documentstructureid","DocumentstructuresEndpoint","data","DomainEndpoint","domainname","DomainsEndpoint","StructurenavigatorEndpoint","PARENT_ENDPOINT","StructureNavigatorAPI","_StructureNavigatorAPI","serverUrl","apiKey","RestClient","clientId","clientSecret","tokenUrl","credentialsFilePath","lines","line","searchKey"],"mappings":"iEASO,IAAMA,CAAAA,CAAN,KAAqB,CAG1B,WAAA,CACmBC,CAAAA,CACAC,EACjB,CAFiB,IAAA,CAAA,UAAA,CAAAD,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,CAAAA,CAEjB,IAAA,CAAK,SAAW,IAAA,CAAK,cAAA,CAAiB,UACxC,CAPiB,QAAA,CAYjB,MAAM,SAAA,EAA2B,CAC/B,OAAA,CACE,MAAM,IAAA,CAAK,UAAA,CAAW,GAAA,CACpB,IAAA,CAAK,SACL,EAAC,CACD,IAAA,CAAK,UAAA,CAAW,QAAA,CAAA,mEAAuB,CAAA,CACvC,IAAA,CACA,MACF,CAAA,EACA,MAAA,EACJ,CAIA,MAAM,SAAA,EAA2B,CAC/B,OAAA,CACE,MAAM,IAAA,CAAK,UAAA,CAAW,GAAA,CACpB,IAAA,CAAK,QAAA,CACL,EAAC,CACD,IAAA,CAAK,UAAA,CAAW,QAAA,CAAA,yEAAuB,CAAA,CACvC,I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OAAe,0BAAA,CAA2BS,EAAmBF,CAAAA,CAA2B,CACtF,IAAA,IAAWC,CAAAA,IAAQD,CAAAA,CACjB,GAAIC,CAAAA,CAAK,CAAC,CAAA,GAAMC,CAAAA,CACd,OAAOD,CAAAA,CAAK,CAAC,CAAA,CAAE,QAAQ,KAAA,CAAO,GAAG,CAAA,CAGrC,MAAM,KAAA,CAAM,CAAA,8BAAA,EAAiCC,CAAS,CAAA,CAAA,CAAG,CAC3D,CAEA,QAAA,EAAmB,CACjB,OAAO,IAAA,CAAK,cACd,CAEA,kBAAA,EAAiD,CAC/C,OAAO,IAAIb,CAAAA,CAA2B,IAAA,CAAK,UAAA,CAAY,IAAA,CAAK,QAAA,EAAU,CACxE,CAEF","file":"chunk-ZCQJ5ZKX.mjs","sourcesContent":["import { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator/domains/{domainname}/documentstructures/{documentstructureid}/binary\"\n * This is a generated file do not change manually!\n */\nexport class BinaryEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/binary\";\n }\n\n /**\n * Returns the input document.\n */\n async getAsXlsx(): Promise<Blob> {\n return (\n await this.restClient.get<Blob>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.XLSX),\n null,\n \"blob\"\n )\n ).toFile();\n }\n /**\n * Returns the input document.\n */\n async getAsDocx(): Promise<Blob> {\n return (\n await this.restClient.get<Blob>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.DOCX),\n null,\n \"blob\"\n )\n ).toFile();\n }\n /**\n * Returns the input document.\n */\n async getAsPdf(): Promise<Blob> {\n return (\n await this.restClient.get<Blob>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.PDF),\n null,\n \"blob\"\n )\n ).toFile();\n }\n}\n","import { Configuration } from '../model';\nimport { ConfigurationUpdate } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator/domains/{domainname}/configurations/{configurationid}\"\n * This is a generated file do not change manually!\n */\nexport class ConfigurationEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly configurationid: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/configurations\" + `/${this.configurationid}`;\n }\n\n /**\n * Returns the configuration for the given id.\n */\n async get(): Promise<Configuration> {\n return (\n await this.restClient.get<Configuration>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON)\n )\n ).toModel();\n }\n\n /**\n * Delete a given configuration. Needs roles: 'Advanced User', 'Domain Admin' or 'Expert User'\n */\n async delete() {\n return await this.restClient.delete(this.ENDPOINT);\n }\n\n /**\n * Make changes to an existing configuration. Needs roles: 'Advanced User', 'Domain Admin' or 'Expert User'\n *\n * @param body ConfigurationUpdate - \n */\n async patch(\n body: ConfigurationUpdate,\n ): Promise<Configuration> {\n return (\n await this.restClient.patch<Configuration>(\n this.ENDPOINT,\n body\n )\n ).toModel();\n }\n}\n","import { Configuration } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator/domains/{domainname}/configurations\"\n * This is a generated file do not change manually!\n */\nexport class ConfigurationsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/configurations\";\n }\n\n /**\n * Returns all configurations.\n */\n async get(): Promise<Configuration[]> {\n return (\n await this.restClient.get<Configuration[]>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON)\n )\n ).toModel();\n }\n\n /**\n * Delete all configurations. Needs roles: 'Advanced User', 'Domain Admin' or 'Expert User'\n */\n async delete() {\n return await this.restClient.delete(this.ENDPOINT);\n }\n\n /**\n * Creates a new configuration. Needs roles: 'Advanced User', 'Domain Admin' or 'Expert User'\n *\n * @param body Configuration? - \n */\n async post(\n body?: Configuration,\n ): Promise<Configuration> {\n return (\n await this.restClient.post<Configuration>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON),\n body\n )\n ).toModel();\n }\n}\n","import { Event } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator/domains/{domainname}/documentstructures/{documentstructureid}/events\"\n * This is a generated file do not change manually!\n */\nexport class EventsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/events\";\n }\n\n /**\n * Returns all events of given document structure\n */\n async get(): Promise<Event[]> {\n return (\n await this.restClient.get<Event[]>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON)\n )\n ).toModel();\n }\n\n /**\n * Creates a new event for a document structure.\n *\n * @param body Event? - \n */\n async post(\n body: Event,\n params?: {\n lasteventid?: string,\n }): Promise<Event> {\n return (\n await this.restClient.post<Event>(\n this.ENDPOINT,\n params,\n this.restClient.toHeader(MediaType.JSON),\n body\n )\n ).toModel();\n }\n}\n","import { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator/domains/{domainname}/documentstructures/{documentstructureid}/screenshots\"\n * This is a generated file do not change manually!\n */\nexport class ScreenshotsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/screenshots\";\n }\n\n /**\n * Returns a 'screenshot' of a page of the given document structure\n *\n * @param page number? - Number of the page to create a screenshot. Zero based\n * @param x number? - X position of the area to screenshot.\n * @param y number? - Y position of the area to screenshot.\n * @param width number? - Width of the area to screenshot.\n * @param height number? - Height of the area to screenshot.\n */\n async getAsPng(params?: {\n page?: number,\n x?: number,\n y?: number,\n width?: number,\n height?: number,\n }): Promise<Blob> {\n return (\n await this.restClient.get<Blob>(\n this.ENDPOINT,\n params,\n this.restClient.toHeader(MediaType.PNG),\n null,\n \"blob\"\n )\n ).toFile();\n }\n}\n","import { BinaryEndpoint } from './binary';\nimport { DocumentStructure } from '../model';\nimport { DocumentStructureOverview } from '../model';\nimport { DocumentStructureReplaceSections } from '../model';\nimport { DocumentStructureUpdate } from '../model';\nimport { EventsEndpoint } from './events';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\nimport { ScreenshotsEndpoint } from './screenshots';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator/domains/{domainname}/documentstructures/{documentstructureid}\"\n * This is a generated file do not change manually!\n */\nexport class DocumentstructureEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly documentstructureid: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documentstructures\" + `/${this.documentstructureid}`;\n }\n\n binary(): BinaryEndpoint {\n return new BinaryEndpoint(this.restClient, this.ENDPOINT);\n }\n\n events(): EventsEndpoint {\n return new EventsEndpoint(this.restClient, this.ENDPOINT);\n }\n\n screenshots(): ScreenshotsEndpoint {\n return new ScreenshotsEndpoint(this.restClient, this.ENDPOINT);\n }\n\n /**\n * Returns the document structure for the given id.\n */\n async get(): Promise<DocumentStructure> {\n return (\n await this.restClient.get<DocumentStructure>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON)\n )\n ).toModel();\n }\n /**\n * Returns the document structure for the given id.\n */\n async getAsReqifz(): Promise<Blob> {\n return (\n await this.restClient.get<Blob>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.REQIFZ),\n null,\n \"blob\"\n )\n ).toFile();\n }\n\n /**\n * Delete a given document structure.\n */\n async delete() {\n return await this.restClient.delete(this.ENDPOINT);\n }\n\n /**\n * Make changes to an existing document structure.\n *\n * @param body DocumentStructureUpdate - \n */\n async patch(\n body: DocumentStructureUpdate,\n ): Promise<DocumentStructureOverview> {\n return (\n await this.restClient.patch<DocumentStructureOverview>(\n this.ENDPOINT,\n body\n )\n ).toModel();\n }\n\n /**\n * Replace paragraphs of an existing document structure.\n *\n * @param body DocumentStructureReplaceSections - \n */\n async put(\n body: DocumentStructureReplaceSections,\n ): Promise<DocumentStructureOverview> {\n return (\n await this.restClient.put<DocumentStructureOverview>(\n this.ENDPOINT,\n body\n )\n ).toModel();\n }\n}\n","import { DocumentStructureOverview } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator/domains/{domainname}/documentstructures\"\n * This is a generated file do not change manually!\n */\nexport class DocumentstructuresEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documentstructures\";\n }\n\n /**\n * Returns an overview of all available document structures.\n *\n * @param customfield string? - \n * @param customfieldvalues string? - \n */\n async get(params?: {\n customfield?: string,\n customfieldvalues?: string,\n }): Promise<DocumentStructureOverview[]> {\n return (\n await this.restClient.get<DocumentStructureOverview[]>(\n this.ENDPOINT,\n params,\n this.restClient.toHeader(MediaType.JSON)\n )\n ).toModel();\n }\n\n /**\n * Delete all document structures. Needs role: 'Domain Admin'\n */\n async delete() {\n return await this.restClient.delete(this.ENDPOINT);\n }\n\n /**\n * Creates a new document structure.\n *\n * @param file Blob? - \n * @param name string? - \n * @param publicaccess boolean? - \n * @param configurationid string? - \n */\n async post(data: {\n file?: Blob,\n name?: string,\n publicaccess?: boolean,\n configurationid?: string,\n }): Promise<DocumentStructureOverview> {\n return (\n await this.restClient.post<DocumentStructureOverview>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON, \"multipart/form-data\"),\n data\n )\n ).toModel();\n }\n}\n","import { ConfigurationEndpoint } from './configuration';\nimport { ConfigurationsEndpoint } from './configurations';\nimport { DocumentstructureEndpoint } from './documentstructure';\nimport { DocumentstructuresEndpoint } from './documentstructures';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator/domains/{domainname}\"\n * This is a generated file do not change manually!\n */\nexport class DomainEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly domainname: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\" + `/${this.domainname}`;\n }\n\n configurations(): ConfigurationsEndpoint;\n configurations(configurationid: string): ConfigurationEndpoint\n \n configurations(configurationid?: string): ConfigurationEndpoint | ConfigurationsEndpoint {\n if(configurationid !== undefined && configurationid !== null) {\n\t return new ConfigurationEndpoint(this.restClient, this.ENDPOINT, configurationid);\n } else {\n\t return new ConfigurationsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n\n documentstructures(): DocumentstructuresEndpoint;\n documentstructures(documentstructureid: string): DocumentstructureEndpoint\n \n documentstructures(documentstructureid?: string): DocumentstructureEndpoint | DocumentstructuresEndpoint {\n if(documentstructureid !== undefined && documentstructureid !== null) {\n\t return new DocumentstructureEndpoint(this.restClient, this.ENDPOINT, documentstructureid);\n } else {\n\t return new DocumentstructuresEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator/domains\"\n * This is a generated file do not change manually!\n */\nexport class DomainsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\";\n }\n}\n","import { DomainEndpoint } from './domain';\nimport { DomainsEndpoint } from './domains';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator\"\n * This is a generated file do not change manually!\n */\nexport class StructurenavigatorEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/structurenavigator\";\n }\n\n domains(): DomainsEndpoint;\n domains(domainname: string): DomainEndpoint\n \n domains(domainname?: string): DomainEndpoint | DomainsEndpoint {\n if(domainname !== undefined && domainname !== null) {\n\t return new DomainEndpoint(this.restClient, this.ENDPOINT, domainname);\n } else {\n\t return new DomainsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import * as fs from 'fs';\n\nimport { StructurenavigatorEndpoint } from './structurenavigator';\nimport { RestClient } from '../../rest';\n\nconst PARENT_ENDPOINT = '/api';\n\n/**\n * Entry point to the StructureNavigator API.\n *\n * @author semantha\n * Calls the /structurenavigator, endpoints.\n *\n * Note:\n * The constructor is not meant to be invoked directly\n * use `loginXXX()` with your credentials instead.\n *\n * this is a generated class do not change manually!\n */\nexport class StructureNavigatorAPI {\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string\n ) {\n }\n\n /**\n * Access to the StructureNavigator API\n *\n * @param serverUrl: string - URL to the StructureNavigator server.\n * @param apiKey: string - A valid bearer token for accessing the given url.\n *\n * @return StructureNavigatorAPI: Entry point to the StructureNavigator API.\n */\n static loginWithApiKey(\n serverUrl: string,\n apiKey: string\n ): StructureNavigatorAPI {\n if(!apiKey) {\n throw new Error('You need to supply an API key to login.');\n }\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new StructureNavigatorAPI(new RestClient(this.parseServerUrl(serverUrl), apiKey), PARENT_ENDPOINT);\n }\n\n\n /**\n * Access to the StructureNavigator API, when there is a auth proxy in place to handle the addition of the Authorization header\n *\n * @param serverUrl: string - URL to the StructureNavigator server.\n *\n * @return StructureNavigatorAPI: Entry point to the StructureNavigator API.\n */\n static loginWithAuthProxy(\n serverUrl: string\n ): StructureNavigatorAPI {\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new StructureNavigatorAPI(new RestClient(this.parseServerUrl(serverUrl)), PARENT_ENDPOINT);\n }\n\n /**\n * Access to the StructureNavigator API\n *\n * @param serverUrl: string - URL to the StructureNavigator server.\n * @param clientId: string - OAuth2 client id.\n * @param clientSecret: string - OAuth2 client secret.\n * @param tokenUrl: string OAuth2 url to get a valid access token\n *\n * @return StructureNavigatorAPI: Entry point to the StructureNavigator API.\n */\n static loginWithCredentials(\n serverUrl: string,\n clientId: string,\n clientSecret: string,\n tokenUrl: string\n ): StructureNavigatorAPI {\n serverUrl = this.parseServerUrl(serverUrl);\n return new StructureNavigatorAPI(new RestClient(serverUrl, undefined, clientId, clientSecret, tokenUrl), PARENT_ENDPOINT);\n }\n\t\n /**\n * Access to the StructureNavigator API\n *\n * @param credentialsFilePath: string - Path to a properties file providing client credentials.\n *\n * @return StructureNavigatorAPI: Entry point to the StructureNavigator API.\n */\n static loginWithCredentialsFile(credentialsFilePath: string) : StructureNavigatorAPI {\n if (credentialsFilePath.endsWith('.properties') || credentialsFilePath.endsWith('.PROPERTIES')) {\n const rawData = fs.readFileSync(credentialsFilePath, 'utf8');\n const lines = rawData\n\t .split(/[\\n|\\r\\n]/)\n\t .filter(line => line.length !== 0)\n\t .map(line => line.split('='));\n\t const serverUrl = this.getValueOfInPropertiesFile('serverUrl', lines);\n\t const clientId = this.getValueOfInPropertiesFile('clientId', lines);\n\t const clientSecret = this.getValueOfInPropertiesFile('clientSecret', lines);\n\t const tokenUrl = this.getValueOfInPropertiesFile('tokenUrl', lines);\n\t return StructureNavigatorAPI.loginWithCredentials(serverUrl, clientId, clientSecret, tokenUrl);\n\t}\n throw new Error('Can not login, please supply a credentials properties file.');\n }\n\n private static parseServerUrl(serverUrl: string): string {\n if (serverUrl.endsWith('/')) {\n serverUrl = serverUrl.slice(0, -1);\n }\n if (serverUrl.endsWith('/tt-platform-ui/en/#')) {\n serverUrl = serverUrl.replace('/tt-platform-ui/en/#', '/tt-product-server');\n } else if (!serverUrl.endsWith('/tt-product-server')) {\n serverUrl += '/tt-product-server';\n }\n return serverUrl;\n }\n\n private static getValueOfInPropertiesFile(searchKey: string, lines: string[][]): string {\n for (const line of lines) {\n if (line[0] === searchKey) {\n return line[1].replace('\\\\:', ':');\n }\n }\n throw Error(`.properties files contains no ${searchKey}!`);\n }\n\n endpoint(): string {\n return this.parentEndpoint;\n }\n\n structurenavigator(): StructurenavigatorEndpoint {\n return new StructurenavigatorEndpoint(this.restClient, this.endpoint());\n }\n\n}"]}
1
+ {"version":3,"sources":["../semantha-product-sdk/structure-navigator/api/binary.ts","../semantha-product-sdk/structure-navigator/api/configuration.ts","../semantha-product-sdk/structure-navigator/api/configurations.ts","../semantha-product-sdk/structure-navigator/api/events.ts","../semantha-product-sdk/structure-navigator/api/screenshots.ts","../semantha-product-sdk/structure-navigator/api/documentstructure.ts","../semantha-product-sdk/structure-navigator/api/documentstructures.ts","../semantha-product-sdk/structure-navigator/api/domain.ts","../semantha-product-sdk/structure-navigator/api/domains.ts","../semantha-product-sdk/structure-navigator/api/structurenavigator.ts","../semantha-product-sdk/structure-navigator/api/structureNavigatorAPI.ts"],"names":["BinaryEndpoint","restClient","parentEndpoint","ConfigurationEndpoint","configurationid","body","ConfigurationsEndpoint","EventsEndpoint","params","ScreenshotsEndpoint","DocumentstructureEndpoint","documentstructureid","DocumentstructuresEndpoint","data","DomainEndpoint","domainname","DomainsEndpoint","StructurenavigatorEndpoint","PARENT_ENDPOINT","StructureNavigatorAPI","_StructureNavigatorAPI","serverUrl","apiKey","RestClient","clientId","clientSecret","tokenUrl","credentialsFilePath","lines","line","searchKey"],"mappings":"iEASO,IAAMA,CAAAA,CAAN,KAAqB,CAG1B,WAAA,CACmBC,CAAAA,CACAC,EACjB,CAFiB,IAAA,CAAA,UAAA,CAAAD,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,CAAAA,CAEjB,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AAUC,EAAcC,CAAQ,CAC/F,CACG,MAAM,IAAI,KAAA,CAAM,6DAA6D,CAC/E,CAEA,OAAe,cAAA,CAAeL,CAAAA,CAA2B,CACvD,OAAIA,EAAU,QAAA,CAAS,GAAG,CAAA,GACxBA,CAAAA,CAAYA,CAAAA,CAAU,KAAA,CAAM,CAAA,CAAG,EAAE,CAAA,CAAA,CAE/BA,CAAAA,CAAU,QAAA,CAAS,sBAAsB,CAAA,CAC3CA,CAAAA,CAAYA,EAAU,OAAA,CAAQ,sBAAA,CAAwB,oBAAoB,CAAA,CAChEA,CAAAA,CAAU,QAAA,CAAS,oBAAoB,CAAA,GACjDA,CAAAA,EAAa,oBAAA,CAAA,CAERA,CACT,CAEA,OAAe,0BAAA,CAA2BS,EAAmBF,CAAAA,CAA2B,CACtF,IAAA,IAAWC,CAAAA,IAAQD,CAAAA,CACjB,GAAIC,CAAAA,CAAK,CAAC,CAAA,GAAMC,CAAAA,CACd,OAAOD,CAAAA,CAAK,CAAC,CAAA,CAAE,QAAQ,KAAA,CAAO,GAAG,CAAA,CAGrC,MAAM,KAAA,CAAM,CAAA,8BAAA,EAAiCC,CAAS,CAAA,CAAA,CAAG,CAC3D,CAEA,QAAA,EAAmB,CACjB,OAAO,IAAA,CAAK,cACd,CAEA,kBAAA,EAAiD,CAC/C,OAAO,IAAIb,CAAAA,CAA2B,IAAA,CAAK,UAAA,CAAY,IAAA,CAAK,QAAA,EAAU,CACxE,CAEF","file":"chunk-VH2AB5TA.mjs","sourcesContent":["import { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator/domains/{domainname}/documentstructures/{documentstructureid}/binary\"\n * This is a generated file do not change manually!\n */\nexport class BinaryEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/binary\";\n }\n\n /**\n * Returns the input document.\n */\n async getAsXlsx(): Promise<Blob> {\n return (\n await this.restClient.get<Blob>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.XLSX),\n null,\n \"blob\"\n )\n ).toFile();\n }\n /**\n * Returns the input document.\n */\n async getAsDocx(): Promise<Blob> {\n return (\n await this.restClient.get<Blob>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.DOCX),\n null,\n \"blob\"\n )\n ).toFile();\n }\n /**\n * Returns the input document.\n */\n async getAsPdf(): Promise<Blob> {\n return (\n await this.restClient.get<Blob>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.PDF),\n null,\n \"blob\"\n )\n ).toFile();\n }\n}\n","import { Configuration } from '../model';\nimport { ConfigurationUpdate } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator/domains/{domainname}/configurations/{configurationid}\"\n * This is a generated file do not change manually!\n */\nexport class ConfigurationEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly configurationid: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/configurations\" + `/${this.configurationid}`;\n }\n\n /**\n * Returns the configuration for the given id.\n */\n async get(): Promise<Configuration> {\n return (\n await this.restClient.get<Configuration>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON)\n )\n ).toModel();\n }\n\n /**\n * Delete a given configuration. Needs roles: 'Advanced User', 'Domain Admin' or 'Expert User'\n */\n async delete() {\n return await this.restClient.delete(this.ENDPOINT);\n }\n\n /**\n * Make changes to an existing configuration. Needs roles: 'Advanced User', 'Domain Admin' or 'Expert User'\n *\n * @param body ConfigurationUpdate - \n */\n async patch(\n body: ConfigurationUpdate,\n ): Promise<Configuration> {\n return (\n await this.restClient.patch<Configuration>(\n this.ENDPOINT,\n body\n )\n ).toModel();\n }\n}\n","import { Configuration } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator/domains/{domainname}/configurations\"\n * This is a generated file do not change manually!\n */\nexport class ConfigurationsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/configurations\";\n }\n\n /**\n * Returns all configurations.\n */\n async get(): Promise<Configuration[]> {\n return (\n await this.restClient.get<Configuration[]>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON)\n )\n ).toModel();\n }\n\n /**\n * Delete all configurations. Needs roles: 'Advanced User', 'Domain Admin' or 'Expert User'\n */\n async delete() {\n return await this.restClient.delete(this.ENDPOINT);\n }\n\n /**\n * Creates a new configuration. Needs roles: 'Advanced User', 'Domain Admin' or 'Expert User'\n *\n * @param body Configuration? - \n */\n async post(\n body?: Configuration,\n ): Promise<Configuration> {\n return (\n await this.restClient.post<Configuration>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON),\n body\n )\n ).toModel();\n }\n}\n","import { Event } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator/domains/{domainname}/documentstructures/{documentstructureid}/events\"\n * This is a generated file do not change manually!\n */\nexport class EventsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/events\";\n }\n\n /**\n * Returns all events of given document structure\n */\n async get(): Promise<Event[]> {\n return (\n await this.restClient.get<Event[]>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON)\n )\n ).toModel();\n }\n\n /**\n * Creates a new event for a document structure.\n *\n * @param body Event? - \n */\n async post(\n body: Event,\n params?: {\n lasteventid?: string,\n }): Promise<Event> {\n return (\n await this.restClient.post<Event>(\n this.ENDPOINT,\n params,\n this.restClient.toHeader(MediaType.JSON),\n body\n )\n ).toModel();\n }\n}\n","import { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator/domains/{domainname}/documentstructures/{documentstructureid}/screenshots\"\n * This is a generated file do not change manually!\n */\nexport class ScreenshotsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/screenshots\";\n }\n\n /**\n * Returns a 'screenshot' of a page of the given document structure\n *\n * @param page number? - Number of the page to create a screenshot. Zero based\n * @param x number? - X position of the area to screenshot.\n * @param y number? - Y position of the area to screenshot.\n * @param width number? - Width of the area to screenshot.\n * @param height number? - Height of the area to screenshot.\n */\n async getAsPng(params?: {\n page?: number,\n x?: number,\n y?: number,\n width?: number,\n height?: number,\n }): Promise<Blob> {\n return (\n await this.restClient.get<Blob>(\n this.ENDPOINT,\n params,\n this.restClient.toHeader(MediaType.PNG),\n null,\n \"blob\"\n )\n ).toFile();\n }\n}\n","import { BinaryEndpoint } from './binary';\nimport { DocumentStructure } from '../model';\nimport { DocumentStructureOverview } from '../model';\nimport { DocumentStructureReplaceSections } from '../model';\nimport { DocumentStructureUpdate } from '../model';\nimport { EventsEndpoint } from './events';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\nimport { ScreenshotsEndpoint } from './screenshots';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator/domains/{domainname}/documentstructures/{documentstructureid}\"\n * This is a generated file do not change manually!\n */\nexport class DocumentstructureEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly documentstructureid: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documentstructures\" + `/${this.documentstructureid}`;\n }\n\n binary(): BinaryEndpoint {\n return new BinaryEndpoint(this.restClient, this.ENDPOINT);\n }\n\n events(): EventsEndpoint {\n return new EventsEndpoint(this.restClient, this.ENDPOINT);\n }\n\n screenshots(): ScreenshotsEndpoint {\n return new ScreenshotsEndpoint(this.restClient, this.ENDPOINT);\n }\n\n /**\n * Returns the document structure for the given id.\n */\n async get(): Promise<DocumentStructure> {\n return (\n await this.restClient.get<DocumentStructure>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON)\n )\n ).toModel();\n }\n /**\n * Returns the document structure for the given id.\n */\n async getAsReqifz(): Promise<Blob> {\n return (\n await this.restClient.get<Blob>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.REQIFZ),\n null,\n \"blob\"\n )\n ).toFile();\n }\n\n /**\n * Delete a given document structure.\n */\n async delete() {\n return await this.restClient.delete(this.ENDPOINT);\n }\n\n /**\n * Make changes to an existing document structure.\n *\n * @param body DocumentStructureUpdate - \n */\n async patch(\n body: DocumentStructureUpdate,\n ): Promise<DocumentStructureOverview> {\n return (\n await this.restClient.patch<DocumentStructureOverview>(\n this.ENDPOINT,\n body\n )\n ).toModel();\n }\n\n /**\n * Replace paragraphs of an existing document structure.\n *\n * @param body DocumentStructureReplaceSections - \n */\n async put(\n body: DocumentStructureReplaceSections,\n ): Promise<DocumentStructureOverview> {\n return (\n await this.restClient.put<DocumentStructureOverview>(\n this.ENDPOINT,\n body\n )\n ).toModel();\n }\n}\n","import { DocumentStructureOverview } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator/domains/{domainname}/documentstructures\"\n * This is a generated file do not change manually!\n */\nexport class DocumentstructuresEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documentstructures\";\n }\n\n /**\n * Returns an overview of all available document structures.\n *\n * @param customfield string? - \n * @param customfieldvalues string? - \n */\n async get(params?: {\n customfield?: string,\n customfieldvalues?: string,\n }): Promise<DocumentStructureOverview[]> {\n return (\n await this.restClient.get<DocumentStructureOverview[]>(\n this.ENDPOINT,\n params,\n this.restClient.toHeader(MediaType.JSON)\n )\n ).toModel();\n }\n\n /**\n * Delete all document structures. Needs role: 'Domain Admin'\n */\n async delete() {\n return await this.restClient.delete(this.ENDPOINT);\n }\n\n /**\n * Creates a new document structure.\n *\n * @param file Blob? - \n * @param name string? - \n * @param publicaccess boolean? - \n * @param configurationid string? - \n */\n async post(data: {\n file?: Blob,\n name?: string,\n publicaccess?: boolean,\n configurationid?: string,\n }): Promise<DocumentStructureOverview> {\n return (\n await this.restClient.post<DocumentStructureOverview>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON, \"multipart/form-data\"),\n data\n )\n ).toModel();\n }\n}\n","import { ConfigurationEndpoint } from './configuration';\nimport { ConfigurationsEndpoint } from './configurations';\nimport { DocumentstructureEndpoint } from './documentstructure';\nimport { DocumentstructuresEndpoint } from './documentstructures';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator/domains/{domainname}\"\n * This is a generated file do not change manually!\n */\nexport class DomainEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly domainname: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\" + `/${this.domainname}`;\n }\n\n configurations(): ConfigurationsEndpoint;\n configurations(configurationid: string): ConfigurationEndpoint\n \n configurations(configurationid?: string): ConfigurationEndpoint | ConfigurationsEndpoint {\n if(configurationid !== undefined && configurationid !== null) {\n\t return new ConfigurationEndpoint(this.restClient, this.ENDPOINT, configurationid);\n } else {\n\t return new ConfigurationsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n\n documentstructures(): DocumentstructuresEndpoint;\n documentstructures(documentstructureid: string): DocumentstructureEndpoint\n \n documentstructures(documentstructureid?: string): DocumentstructureEndpoint | DocumentstructuresEndpoint {\n if(documentstructureid !== undefined && documentstructureid !== null) {\n\t return new DocumentstructureEndpoint(this.restClient, this.ENDPOINT, documentstructureid);\n } else {\n\t return new DocumentstructuresEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator/domains\"\n * This is a generated file do not change manually!\n */\nexport class DomainsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\";\n }\n}\n","import { DomainEndpoint } from './domain';\nimport { DomainsEndpoint } from './domains';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/structurenavigator\"\n * This is a generated file do not change manually!\n */\nexport class StructurenavigatorEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/structurenavigator\";\n }\n\n domains(): DomainsEndpoint;\n domains(domainname: string): DomainEndpoint\n \n domains(domainname?: string): DomainEndpoint | DomainsEndpoint {\n if(domainname !== undefined && domainname !== null) {\n\t return new DomainEndpoint(this.restClient, this.ENDPOINT, domainname);\n } else {\n\t return new DomainsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import * as fs from 'fs';\n\nimport { StructurenavigatorEndpoint } from './structurenavigator';\nimport { RestClient } from '../../rest';\n\nconst PARENT_ENDPOINT = '/api';\n\n/**\n * Entry point to the StructureNavigator API.\n *\n * @author semantha\n * Calls the /structurenavigator, endpoints.\n *\n * Note:\n * The constructor is not meant to be invoked directly\n * use `loginXXX()` with your credentials instead.\n *\n * this is a generated class do not change manually!\n */\nexport class StructureNavigatorAPI {\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string\n ) {\n }\n\n /**\n * Access to the StructureNavigator API\n *\n * @param serverUrl: string - URL to the StructureNavigator server.\n * @param apiKey: string - A valid bearer token for accessing the given url.\n *\n * @return StructureNavigatorAPI: Entry point to the StructureNavigator API.\n */\n static loginWithApiKey(\n serverUrl: string,\n apiKey: string\n ): StructureNavigatorAPI {\n if(!apiKey) {\n throw new Error('You need to supply an API key to login.');\n }\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new StructureNavigatorAPI(new RestClient(this.parseServerUrl(serverUrl), apiKey), PARENT_ENDPOINT);\n }\n\n\n /**\n * Access to the StructureNavigator API, when there is a auth proxy in place to handle the addition of the Authorization header\n *\n * @param serverUrl: string - URL to the StructureNavigator server.\n *\n * @return StructureNavigatorAPI: Entry point to the StructureNavigator API.\n */\n static loginWithAuthProxy(\n serverUrl: string\n ): StructureNavigatorAPI {\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new StructureNavigatorAPI(new RestClient(this.parseServerUrl(serverUrl)), PARENT_ENDPOINT);\n }\n\n /**\n * Access to the StructureNavigator API\n *\n * @param serverUrl: string - URL to the StructureNavigator server.\n * @param clientId: string - OAuth2 client id.\n * @param clientSecret: string - OAuth2 client secret.\n * @param tokenUrl: string OAuth2 url to get a valid access token\n *\n * @return StructureNavigatorAPI: Entry point to the StructureNavigator API.\n */\n static loginWithCredentials(\n serverUrl: string,\n clientId: string,\n clientSecret: string,\n tokenUrl: string\n ): StructureNavigatorAPI {\n serverUrl = this.parseServerUrl(serverUrl);\n return new StructureNavigatorAPI(new RestClient(serverUrl, undefined, clientId, clientSecret, tokenUrl), PARENT_ENDPOINT);\n }\n\t\n /**\n * Access to the StructureNavigator API\n *\n * @param credentialsFilePath: string - Path to a properties file providing client credentials.\n *\n * @return StructureNavigatorAPI: Entry point to the StructureNavigator API.\n */\n static loginWithCredentialsFile(credentialsFilePath: string) : StructureNavigatorAPI {\n if (credentialsFilePath.endsWith('.properties') || credentialsFilePath.endsWith('.PROPERTIES')) {\n const rawData = fs.readFileSync(credentialsFilePath, 'utf8');\n const lines = rawData\n\t .split(/[\\n|\\r\\n]/)\n\t .filter(line => line.length !== 0)\n\t .map(line => line.split('='));\n\t const serverUrl = this.getValueOfInPropertiesFile('serverUrl', lines);\n\t const clientId = this.getValueOfInPropertiesFile('clientId', lines);\n\t const clientSecret = this.getValueOfInPropertiesFile('clientSecret', lines);\n\t const tokenUrl = this.getValueOfInPropertiesFile('tokenUrl', lines);\n\t return StructureNavigatorAPI.loginWithCredentials(serverUrl, clientId, clientSecret, tokenUrl);\n\t}\n throw new Error('Can not login, please supply a credentials properties file.');\n }\n\n private static parseServerUrl(serverUrl: string): string {\n if (serverUrl.endsWith('/')) {\n serverUrl = serverUrl.slice(0, -1);\n }\n if (serverUrl.endsWith('/tt-platform-ui/en/#')) {\n serverUrl = serverUrl.replace('/tt-platform-ui/en/#', '/tt-product-server');\n } else if (!serverUrl.endsWith('/tt-product-server')) {\n serverUrl += '/tt-product-server';\n }\n return serverUrl;\n }\n\n private static getValueOfInPropertiesFile(searchKey: string, lines: string[][]): string {\n for (const line of lines) {\n if (line[0] === searchKey) {\n return line[1].replace('\\\\:', ':');\n }\n }\n throw Error(`.properties files contains no ${searchKey}!`);\n }\n\n endpoint(): string {\n return this.parentEndpoint;\n }\n\n structurenavigator(): StructurenavigatorEndpoint {\n return new StructurenavigatorEndpoint(this.restClient, this.endpoint());\n }\n\n}"]}
@@ -16,8 +16,10 @@ declare class DocumentEndpoint {
16
16
  constructor(restClient: RestClient, parentEndpoint: string, sourcedocid: string);
17
17
  /**
18
18
  * @param body DocumentChatRequest? -
19
+ * @param polarionToken string? - The personal access token for polarion
20
+ * @param polarionURL string? - The url of the polarion server to talk to
19
21
  */
20
- post(body?: DocumentChatRequest): Promise<DocumentChatResponse>;
22
+ post(body?: DocumentChatRequest, polarionToken?: string, polarionURL?: string): Promise<DocumentChatResponse>;
21
23
  }
22
24
 
23
25
  /**
@@ -16,8 +16,10 @@ declare class DocumentEndpoint {
16
16
  constructor(restClient: RestClient, parentEndpoint: string, sourcedocid: string);
17
17
  /**
18
18
  * @param body DocumentChatRequest? -
19
+ * @param polarionToken string? - The personal access token for polarion
20
+ * @param polarionURL string? - The url of the polarion server to talk to
19
21
  */
20
- post(body?: DocumentChatRequest): Promise<DocumentChatResponse>;
22
+ post(body?: DocumentChatRequest, polarionToken?: string, polarionURL?: string): Promise<DocumentChatResponse>;
21
23
  }
22
24
 
23
25
  /**
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk2DHIHJB5_js=require('../../chunk-2DHIHJB5.js'),h=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 h__namespace=/*#__PURE__*/_interopNamespace(h);var o=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.sourcedocid=n;this.ENDPOINT=this.parentEndpoint+`/documents/${this.sourcedocid}`;}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documents";}ENDPOINT};var p=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;documents(t){return t!=null?new o(this.restClient,this.ENDPOINT,t):new s(this.restClient,this.ENDPOINT)}};var a=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documentchat";}ENDPOINT;domains(t){return t!=null?new p(this.restClient,this.ENDPOINT,t):new a(this.restClient,this.ENDPOINT)}};var c="/api",u=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),c)}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)),c)}static loginWithCredentials(t,e,n,d){return t=this.parseServerUrl(t),new r(new chunk2DHIHJB5_js.c(t,void 0,e,n,d),c)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=h__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(m=>m.length!==0).map(m=>m.split("=")),d=this.getValueOfInPropertiesFile("serverUrl",n),f=this.getValueOfInPropertiesFile("clientId",n),g=this.getValueOfInPropertiesFile("clientSecret",n),E=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(d,f,g,E)}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}documentchat(){return new l(this.restClient,this.endpoint())}};exports.DocumentChatAPI=u;exports.DocumentEndpoint=o;exports.DocumentchatEndpoint=l;exports.DocumentsEndpoint=s;exports.DomainEndpoint=p;exports.DomainsEndpoint=a;//# sourceMappingURL=index.js.map
1
+ 'use strict';var chunk4CX7MUVC_js=require('../../chunk-4CX7MUVC.js'),h=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 h__namespace=/*#__PURE__*/_interopNamespace(h);var s=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.sourcedocid=n;this.ENDPOINT=this.parentEndpoint+`/documents/${this.sourcedocid}`;}ENDPOINT;async post(t,e,n){let i=this.restClient.toHeader("application/json");return e!==void 0&&(i["Polarion-Token"]=e),n!==void 0&&(i["Polarion-URL"]=n),(await this.restClient.post(this.ENDPOINT,{},i,t)).toModel()}};var p=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documents";}ENDPOINT};var a=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;documents(t){return t!=null?new s(this.restClient,this.ENDPOINT,t):new p(this.restClient,this.ENDPOINT)}};var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var d=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documentchat";}ENDPOINT;domains(t){return t!=null?new a(this.restClient,this.ENDPOINT,t):new l(this.restClient,this.ENDPOINT)}};var m="/api",u=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),m)}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)),m)}static loginWithCredentials(t,e,n,i){return t=this.parseServerUrl(t),new r(new chunk4CX7MUVC_js.c(t,void 0,e,n,i),m)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=h__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(c=>c.length!==0).map(c=>c.split("=")),i=this.getValueOfInPropertiesFile("serverUrl",n),f=this.getValueOfInPropertiesFile("clientId",n),g=this.getValueOfInPropertiesFile("clientSecret",n),E=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(i,f,g,E)}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}documentchat(){return new d(this.restClient,this.endpoint())}};exports.DocumentChatAPI=u;exports.DocumentEndpoint=s;exports.DocumentchatEndpoint=d;exports.DocumentsEndpoint=p;exports.DomainEndpoint=a;exports.DomainsEndpoint=l;//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../semantha-product-sdk/document-chat/api/document.ts","../../../semantha-product-sdk/document-chat/api/documents.ts","../../../semantha-product-sdk/document-chat/api/domain.ts","../../../semantha-product-sdk/document-chat/api/domains.ts","../../../semantha-product-sdk/document-chat/api/documentchat.ts","../../../semantha-product-sdk/document-chat/api/documentChatAPI.ts"],"names":["DocumentEndpoint","restClient","parentEndpoint","sourcedocid","body","DocumentsEndpoint","DomainEndpoint","domainname","DomainsEndpoint","DocumentchatEndpoint","PARENT_ENDPOINT","DocumentChatAPI","_DocumentChatAPI","serverUrl","apiKey","RestClient","clientId","clientSecret","tokenUrl","credentialsFilePath","lines","h","line","searchKey"],"mappings":"2bAWO,IAAMA,CAAAA,CAAN,KAAuB,CAG5B,WAAA,CACmBC,EACAC,CAAAA,CACAC,CAAAA,CACjB,CAHiB,IAAA,CAAA,UAAA,CAAAF,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,EACA,IAAA,CAAA,WAAA,CAAAC,CAAA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oBAAoB,CAAA,CAChEA,EAAU,QAAA,CAAS,oBAAoB,IACjDA,CAAAA,EAAa,oBAAA,CAAA,CAERA,CACT,CAEA,OAAe,0BAAA,CAA2BU,CAAAA,CAAmBH,CAAAA,CAA2B,CACtF,QAAWE,CAAAA,IAAQF,CAAAA,CACjB,GAAIE,CAAAA,CAAK,CAAC,CAAA,GAAMC,EACd,OAAOD,CAAAA,CAAK,CAAC,CAAA,CAAE,OAAA,CAAQ,KAAA,CAAO,GAAG,CAAA,CAGrC,MAAM,KAAA,CAAM,CAAA,8BAAA,EAAiCC,CAAS,CAAA,CAAA,CAAG,CAC3D,CAEA,QAAA,EAAmB,CACjB,OAAO,IAAA,CAAK,cACd,CAEA,YAAA,EAAqC,CACnC,OAAO,IAAId,CAAAA,CAAqB,IAAA,CAAK,WAAY,IAAA,CAAK,QAAA,EAAU,CAClE,CAEF","file":"index.js","sourcesContent":["import { DocumentChatRequest } from '../model';\nimport { DocumentChatResponse } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}/documents/{sourcedocid}\"\n * This is a generated file do not change manually!\n */\nexport class DocumentEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly sourcedocid: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documents\" + `/${this.sourcedocid}`;\n }\n\n /**\n * @param body DocumentChatRequest? - \n */\n async post(\n body?: DocumentChatRequest,\n ): Promise<DocumentChatResponse> {\n return (\n await this.restClient.post<DocumentChatResponse>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON),\n body\n )\n ).toModel();\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}/documents\"\n * This is a generated file do not change manually!\n */\nexport class DocumentsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documents\";\n }\n}\n","import { DocumentEndpoint } from './document';\nimport { DocumentsEndpoint } from './documents';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}\"\n * This is a generated file do not change manually!\n */\nexport class DomainEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly domainname: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\" + `/${this.domainname}`;\n }\n\n documents(): DocumentsEndpoint;\n documents(sourcedocid: string): DocumentEndpoint\n \n documents(sourcedocid?: string): DocumentEndpoint | DocumentsEndpoint {\n if(sourcedocid !== undefined && sourcedocid !== null) {\n\t return new DocumentEndpoint(this.restClient, this.ENDPOINT, sourcedocid);\n } else {\n\t return new DocumentsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains\"\n * This is a generated file do not change manually!\n */\nexport class DomainsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\";\n }\n}\n","import { DomainEndpoint } from './domain';\nimport { DomainsEndpoint } from './domains';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat\"\n * This is a generated file do not change manually!\n */\nexport class DocumentchatEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documentchat\";\n }\n\n domains(): DomainsEndpoint;\n domains(domainname: string): DomainEndpoint\n \n domains(domainname?: string): DomainEndpoint | DomainsEndpoint {\n if(domainname !== undefined && domainname !== null) {\n\t return new DomainEndpoint(this.restClient, this.ENDPOINT, domainname);\n } else {\n\t return new DomainsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import * as fs from 'fs';\n\nimport { DocumentchatEndpoint } from './documentchat';\nimport { RestClient } from '../../rest';\n\nconst PARENT_ENDPOINT = '/api';\n\n/**\n * Entry point to the DocumentChat API.\n *\n * @author semantha\n * Calls the /documentchat, endpoints.\n *\n * Note:\n * The constructor is not meant to be invoked directly\n * use `loginXXX()` with your credentials instead.\n *\n * this is a generated class do not change manually!\n */\nexport class DocumentChatAPI {\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string\n ) {\n }\n\n /**\n * Access to the DocumentChat API\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n * @param apiKey: string - A valid bearer token for accessing the given url.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithApiKey(\n serverUrl: string,\n apiKey: string\n ): DocumentChatAPI {\n if(!apiKey) {\n throw new Error('You need to supply an API key to login.');\n }\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new DocumentChatAPI(new RestClient(this.parseServerUrl(serverUrl), apiKey), PARENT_ENDPOINT);\n }\n\n\n /**\n * Access to the DocumentChat API, when there is a auth proxy in place to handle the addition of the Authorization header\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithAuthProxy(\n serverUrl: string\n ): DocumentChatAPI {\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new DocumentChatAPI(new RestClient(this.parseServerUrl(serverUrl)), PARENT_ENDPOINT);\n }\n\n /**\n * Access to the DocumentChat API\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n * @param clientId: string - OAuth2 client id.\n * @param clientSecret: string - OAuth2 client secret.\n * @param tokenUrl: string OAuth2 url to get a valid access token\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithCredentials(\n serverUrl: string,\n clientId: string,\n clientSecret: string,\n tokenUrl: string\n ): DocumentChatAPI {\n serverUrl = this.parseServerUrl(serverUrl);\n return new DocumentChatAPI(new RestClient(serverUrl, undefined, clientId, clientSecret, tokenUrl), PARENT_ENDPOINT);\n }\n\t\n /**\n * Access to the DocumentChat API\n *\n * @param credentialsFilePath: string - Path to a properties file providing client credentials.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithCredentialsFile(credentialsFilePath: string) : DocumentChatAPI {\n if (credentialsFilePath.endsWith('.properties') || credentialsFilePath.endsWith('.PROPERTIES')) {\n const rawData = fs.readFileSync(credentialsFilePath, 'utf8');\n const lines = rawData\n\t .split(/[\\n|\\r\\n]/)\n\t .filter(line => line.length !== 0)\n\t .map(line => line.split('='));\n\t const serverUrl = this.getValueOfInPropertiesFile('serverUrl', lines);\n\t const clientId = this.getValueOfInPropertiesFile('clientId', lines);\n\t const clientSecret = this.getValueOfInPropertiesFile('clientSecret', lines);\n\t const tokenUrl = this.getValueOfInPropertiesFile('tokenUrl', lines);\n\t return DocumentChatAPI.loginWithCredentials(serverUrl, clientId, clientSecret, tokenUrl);\n\t}\n throw new Error('Can not login, please supply a credentials properties file.');\n }\n\n private static parseServerUrl(serverUrl: string): string {\n if (serverUrl.endsWith('/')) {\n serverUrl = serverUrl.slice(0, -1);\n }\n if (serverUrl.endsWith('/tt-platform-ui/en/#')) {\n serverUrl = serverUrl.replace('/tt-platform-ui/en/#', '/tt-product-server');\n } else if (!serverUrl.endsWith('/tt-product-server')) {\n serverUrl += '/tt-product-server';\n }\n return serverUrl;\n }\n\n private static getValueOfInPropertiesFile(searchKey: string, lines: string[][]): string {\n for (const line of lines) {\n if (line[0] === searchKey) {\n return line[1].replace('\\\\:', ':');\n }\n }\n throw Error(`.properties files contains no ${searchKey}!`);\n }\n\n endpoint(): string {\n return this.parentEndpoint;\n }\n\n documentchat(): DocumentchatEndpoint {\n return new DocumentchatEndpoint(this.restClient, this.endpoint());\n }\n\n}"]}
1
+ {"version":3,"sources":["../../../semantha-product-sdk/document-chat/api/document.ts","../../../semantha-product-sdk/document-chat/api/documents.ts","../../../semantha-product-sdk/document-chat/api/domain.ts","../../../semantha-product-sdk/document-chat/api/domains.ts","../../../semantha-product-sdk/document-chat/api/documentchat.ts","../../../semantha-product-sdk/document-chat/api/documentChatAPI.ts"],"names":["DocumentEndpoint","restClient","parentEndpoint","sourcedocid","body","polarionToken","polarionURL","headers","DocumentsEndpoint","DomainEndpoint","domainname","DomainsEndpoint","DocumentchatEndpoint","PARENT_ENDPOINT","DocumentChatAPI","_DocumentChatAPI","serverUrl","apiKey","RestClient","clientId","clientSecret","tokenUrl","credentialsFilePath","lines","h","line","searchKey"],"mappings":"2bAWO,IAAMA,CAAAA,CAAN,KAAuB,CAG5B,WAAA,CACmBC,CAAAA,CACAC,EACAC,CAAAA,CACjB,CAHiB,IAAA,CAAA,UAAA,CAAAF,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,CAAAA,CACA,iBAAAC,CAAAA,CAEjB,IAAA,CAAK,QAAA,CAAW,IAAA,CAAK,cAAA,CAAiB,CAAA,WAAA,EAAmB,KAAK,WAAW,CAAA,EAC3E,CARiB,QAAA,CAejB,MAAM,IAAA,CACJC,EACFC,CAAAA,CAAwBC,CAAAA,CAAqD,CAC3E,IAAMC,CAAAA,CAAU,IAAA,CAAK,WAAW,QAAA,CAAA,kBAAuB,CAAA,CACvD,OAAIF,CAAAA,GAAkB,MAAA,GACpBE,CAAAA,CAAQ,gBAAgB,CAAA,CAAIF,CAAAA,CAAAA,CAE1BC,CAAAA,GAAgB,MAAA,GAClBC,CAAAA,CAAQ,cAAc,CAAA,CAAID,CAAAA,CAAAA,CAAAA,CAG1B,MAAM,IAAA,CAAK,UAAA,CAAW,IAAA,CACpB,IAAA,CAAK,QAAA,CACL,EAAC,CACDC,CAAAA,CACAH,CACF,CAAA,EACA,OAAA,EACJ,CACF,ECtCO,IAAMI,CAAAA,CAAN,KAAwB,CAG7B,WAA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,CAAE,OAAA,CAAQ,MAAO,GAAG,CAAA,CAGrC,MAAM,KAAA,CAAM,CAAA,8BAAA,EAAiCC,CAAS,GAAG,CAC3D,CAEA,QAAA,EAAmB,CACjB,OAAO,IAAA,CAAK,cACd,CAEA,YAAA,EAAqC,CACnC,OAAO,IAAId,CAAAA,CAAqB,IAAA,CAAK,UAAA,CAAY,IAAA,CAAK,QAAA,EAAU,CAClE,CAEF","file":"index.js","sourcesContent":["import { DocumentChatRequest } from '../model';\nimport { DocumentChatResponse } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}/documents/{sourcedocid}\"\n * This is a generated file do not change manually!\n */\nexport class DocumentEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly sourcedocid: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documents\" + `/${this.sourcedocid}`;\n }\n\n /**\n * @param body DocumentChatRequest? - \n * @param polarionToken string? - The personal access token for polarion\n * @param polarionURL string? - The url of the polarion server to talk to\n */\n async post(\n body?: DocumentChatRequest,\n polarionToken?: string, polarionURL?: string): Promise<DocumentChatResponse> {\n const headers = this.restClient.toHeader(MediaType.JSON);\n if (polarionToken !== undefined) {\n headers['Polarion-Token'] = polarionToken;\n }\n if (polarionURL !== undefined) {\n headers['Polarion-URL'] = polarionURL;\n }\n return (\n await this.restClient.post<DocumentChatResponse>(\n this.ENDPOINT,\n {},\n headers,\n body\n )\n ).toModel();\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}/documents\"\n * This is a generated file do not change manually!\n */\nexport class DocumentsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documents\";\n }\n}\n","import { DocumentEndpoint } from './document';\nimport { DocumentsEndpoint } from './documents';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}\"\n * This is a generated file do not change manually!\n */\nexport class DomainEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly domainname: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\" + `/${this.domainname}`;\n }\n\n documents(): DocumentsEndpoint;\n documents(sourcedocid: string): DocumentEndpoint\n \n documents(sourcedocid?: string): DocumentEndpoint | DocumentsEndpoint {\n if(sourcedocid !== undefined && sourcedocid !== null) {\n\t return new DocumentEndpoint(this.restClient, this.ENDPOINT, sourcedocid);\n } else {\n\t return new DocumentsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains\"\n * This is a generated file do not change manually!\n */\nexport class DomainsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\";\n }\n}\n","import { DomainEndpoint } from './domain';\nimport { DomainsEndpoint } from './domains';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat\"\n * This is a generated file do not change manually!\n */\nexport class DocumentchatEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documentchat\";\n }\n\n domains(): DomainsEndpoint;\n domains(domainname: string): DomainEndpoint\n \n domains(domainname?: string): DomainEndpoint | DomainsEndpoint {\n if(domainname !== undefined && domainname !== null) {\n\t return new DomainEndpoint(this.restClient, this.ENDPOINT, domainname);\n } else {\n\t return new DomainsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import * as fs from 'fs';\n\nimport { DocumentchatEndpoint } from './documentchat';\nimport { RestClient } from '../../rest';\n\nconst PARENT_ENDPOINT = '/api';\n\n/**\n * Entry point to the DocumentChat API.\n *\n * @author semantha\n * Calls the /documentchat, endpoints.\n *\n * Note:\n * The constructor is not meant to be invoked directly\n * use `loginXXX()` with your credentials instead.\n *\n * this is a generated class do not change manually!\n */\nexport class DocumentChatAPI {\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string\n ) {\n }\n\n /**\n * Access to the DocumentChat API\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n * @param apiKey: string - A valid bearer token for accessing the given url.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithApiKey(\n serverUrl: string,\n apiKey: string\n ): DocumentChatAPI {\n if(!apiKey) {\n throw new Error('You need to supply an API key to login.');\n }\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new DocumentChatAPI(new RestClient(this.parseServerUrl(serverUrl), apiKey), PARENT_ENDPOINT);\n }\n\n\n /**\n * Access to the DocumentChat API, when there is a auth proxy in place to handle the addition of the Authorization header\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithAuthProxy(\n serverUrl: string\n ): DocumentChatAPI {\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new DocumentChatAPI(new RestClient(this.parseServerUrl(serverUrl)), PARENT_ENDPOINT);\n }\n\n /**\n * Access to the DocumentChat API\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n * @param clientId: string - OAuth2 client id.\n * @param clientSecret: string - OAuth2 client secret.\n * @param tokenUrl: string OAuth2 url to get a valid access token\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithCredentials(\n serverUrl: string,\n clientId: string,\n clientSecret: string,\n tokenUrl: string\n ): DocumentChatAPI {\n serverUrl = this.parseServerUrl(serverUrl);\n return new DocumentChatAPI(new RestClient(serverUrl, undefined, clientId, clientSecret, tokenUrl), PARENT_ENDPOINT);\n }\n\t\n /**\n * Access to the DocumentChat API\n *\n * @param credentialsFilePath: string - Path to a properties file providing client credentials.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithCredentialsFile(credentialsFilePath: string) : DocumentChatAPI {\n if (credentialsFilePath.endsWith('.properties') || credentialsFilePath.endsWith('.PROPERTIES')) {\n const rawData = fs.readFileSync(credentialsFilePath, 'utf8');\n const lines = rawData\n\t .split(/[\\n|\\r\\n]/)\n\t .filter(line => line.length !== 0)\n\t .map(line => line.split('='));\n\t const serverUrl = this.getValueOfInPropertiesFile('serverUrl', lines);\n\t const clientId = this.getValueOfInPropertiesFile('clientId', lines);\n\t const clientSecret = this.getValueOfInPropertiesFile('clientSecret', lines);\n\t const tokenUrl = this.getValueOfInPropertiesFile('tokenUrl', lines);\n\t return DocumentChatAPI.loginWithCredentials(serverUrl, clientId, clientSecret, tokenUrl);\n\t}\n throw new Error('Can not login, please supply a credentials properties file.');\n }\n\n private static parseServerUrl(serverUrl: string): string {\n if (serverUrl.endsWith('/')) {\n serverUrl = serverUrl.slice(0, -1);\n }\n if (serverUrl.endsWith('/tt-platform-ui/en/#')) {\n serverUrl = serverUrl.replace('/tt-platform-ui/en/#', '/tt-product-server');\n } else if (!serverUrl.endsWith('/tt-product-server')) {\n serverUrl += '/tt-product-server';\n }\n return serverUrl;\n }\n\n private static getValueOfInPropertiesFile(searchKey: string, lines: string[][]): string {\n for (const line of lines) {\n if (line[0] === searchKey) {\n return line[1].replace('\\\\:', ':');\n }\n }\n throw Error(`.properties files contains no ${searchKey}!`);\n }\n\n endpoint(): string {\n return this.parentEndpoint;\n }\n\n documentchat(): DocumentchatEndpoint {\n return new DocumentchatEndpoint(this.restClient, this.endpoint());\n }\n\n}"]}
@@ -1,2 +1,2 @@
1
- import {c as c$1}from'../../chunk-HYOHQM5J.mjs';import*as h from'fs';var o=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.sourcedocid=n;this.ENDPOINT=this.parentEndpoint+`/documents/${this.sourcedocid}`;}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documents";}ENDPOINT};var p=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;documents(t){return t!=null?new o(this.restClient,this.ENDPOINT,t):new s(this.restClient,this.ENDPOINT)}};var a=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documentchat";}ENDPOINT;domains(t){return t!=null?new p(this.restClient,this.ENDPOINT,t):new a(this.restClient,this.ENDPOINT)}};var c="/api",u=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),c)}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)),c)}static loginWithCredentials(t,e,n,d){return t=this.parseServerUrl(t),new r(new c$1(t,void 0,e,n,d),c)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=h.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(m=>m.length!==0).map(m=>m.split("=")),d=this.getValueOfInPropertiesFile("serverUrl",n),f=this.getValueOfInPropertiesFile("clientId",n),g=this.getValueOfInPropertiesFile("clientSecret",n),E=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(d,f,g,E)}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}documentchat(){return new l(this.restClient,this.endpoint())}};export{u as DocumentChatAPI,o as DocumentEndpoint,l as DocumentchatEndpoint,s as DocumentsEndpoint,p as DomainEndpoint,a as DomainsEndpoint};//# sourceMappingURL=index.mjs.map
1
+ import {c}from'../../chunk-FA37ZZXB.mjs';import*as h from'fs';var s=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.sourcedocid=n;this.ENDPOINT=this.parentEndpoint+`/documents/${this.sourcedocid}`;}ENDPOINT;async post(t,e,n){let i=this.restClient.toHeader("application/json");return e!==void 0&&(i["Polarion-Token"]=e),n!==void 0&&(i["Polarion-URL"]=n),(await this.restClient.post(this.ENDPOINT,{},i,t)).toModel()}};var p=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documents";}ENDPOINT};var a=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;documents(t){return t!=null?new s(this.restClient,this.ENDPOINT,t):new p(this.restClient,this.ENDPOINT)}};var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var d=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documentchat";}ENDPOINT;domains(t){return t!=null?new a(this.restClient,this.ENDPOINT,t):new l(this.restClient,this.ENDPOINT)}};var m="/api",u=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(this.parseServerUrl(t),e),m)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new r(new c(this.parseServerUrl(t)),m)}static loginWithCredentials(t,e,n,i){return t=this.parseServerUrl(t),new r(new c(t,void 0,e,n,i),m)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=h.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(c=>c.length!==0).map(c=>c.split("=")),i=this.getValueOfInPropertiesFile("serverUrl",n),f=this.getValueOfInPropertiesFile("clientId",n),g=this.getValueOfInPropertiesFile("clientSecret",n),E=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(i,f,g,E)}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}documentchat(){return new d(this.restClient,this.endpoint())}};export{u as DocumentChatAPI,s as DocumentEndpoint,d as DocumentchatEndpoint,p as DocumentsEndpoint,a as DomainEndpoint,l as DomainsEndpoint};//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../semantha-product-sdk/document-chat/api/document.ts","../../../semantha-product-sdk/document-chat/api/documents.ts","../../../semantha-product-sdk/document-chat/api/domain.ts","../../../semantha-product-sdk/document-chat/api/domains.ts","../../../semantha-product-sdk/document-chat/api/documentchat.ts","../../../semantha-product-sdk/document-chat/api/documentChatAPI.ts"],"names":["DocumentEndpoint","restClient","parentEndpoint","sourcedocid","body","DocumentsEndpoint","DomainEndpoint","domainname","DomainsEndpoint","DocumentchatEndpoint","PARENT_ENDPOINT","DocumentChatAPI","_DocumentChatAPI","serverUrl","apiKey","RestClient","clientId","clientSecret","tokenUrl","credentialsFilePath","lines","line","searchKey"],"mappings":"qEAWO,IAAMA,CAAAA,CAAN,KAAuB,CAG5B,WAAA,CACmBC,EACAC,CAAAA,CACAC,CAAAA,CACjB,CAHiB,IAAA,CAAA,UAAA,CAAAF,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,EACA,IAAA,CAAA,WAAA,CAAAC,CAAAA,CAEjB,IAAA,CAAK,QAAA,CAAW,IAAA,CAAK,cAAA,CAAiB,cAAmB,IAAA,CAAK,WAAW,CAAA,EAC3E,CARiB,QAAA,CAajB,MAAM,KACJC,CAAAA,CAC+B,CAC/B,QACE,MAAM,IAAA,CAAK,WAAW,IAAA,CACpB,IAAA,CAAK,QAAA,CACL,EAAC,CACD,IAAA,CAAK,WAAW,QAAA,CAAA,kBAAuB,CAAA,CACvCA,CACF,CAAA,EACA,OAAA,EACJ,CACF,EC7BO,IAAMC,CAAAA,CAAN,KAAwB,CAG7B,WAAA,CACmBJ,EACAC,CAAAA,CACjB,CAFiB,gBAAAD,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,EAEjB,IAAA,CAAK,QAAA,CAAW,IAAA,CAAK,cAAA,CAAiB,aACxC,CAPiB,QAQnB,ECPO,IAAMI,CAAAA,CAAN,KAAqB,CAG1B,WAAA,CACmBL,EACAC,CAAAA,CACAK,CAAAA,CACjB,CAHiB,IAAA,CAAA,UAAA,CAAAN,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,EACA,IAAA,CAAA,UAAA,CAAAK,CAAAA,CAEjB,IAAA,CAAK,QAAA,CAAW,IAAA,CAAK,cAAA,CAAiB,YAAiB,IAAA,CAAK,UAAU,CAAA,EACxE,CARiB,QAAA,CAajB,SAAA,CAAUJ,EAA4D,CACpE,OAAgCA,CAAAA,EAAgB,IAAA,CACxC,IAAIH,CAAAA,CAAiB,KAAK,UAAA,C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ACG,MAAM,IAAI,KAAA,CAAM,6DAA6D,CAC/E,CAEA,OAAe,cAAA,CAAeL,CAAAA,CAA2B,CACvD,OAAIA,CAAAA,CAAU,QAAA,CAAS,GAAG,CAAA,GACxBA,CAAAA,CAAYA,CAAAA,CAAU,MAAM,CAAA,CAAG,EAAE,CAAA,CAAA,CAE/BA,CAAAA,CAAU,QAAA,CAAS,sBAAsB,EAC3CA,CAAAA,CAAYA,CAAAA,CAAU,OAAA,CAAQ,sBAAA,CAAwB,oBAAoB,CAAA,CAChEA,EAAU,QAAA,CAAS,oBAAoB,IACjDA,CAAAA,EAAa,oBAAA,CAAA,CAERA,CACT,CAEA,OAAe,0BAAA,CAA2BS,CAAAA,CAAmBF,CAAAA,CAA2B,CACtF,QAAWC,CAAAA,IAAQD,CAAAA,CACjB,GAAIC,CAAAA,CAAK,CAAC,CAAA,GAAMC,EACd,OAAOD,CAAAA,CAAK,CAAC,CAAA,CAAE,OAAA,CAAQ,KAAA,CAAO,GAAG,CAAA,CAGrC,MAAM,KAAA,CAAM,CAAA,8BAAA,EAAiCC,CAAS,CAAA,CAAA,CAAG,CAC3D,CAEA,QAAA,EAAmB,CACjB,OAAO,IAAA,CAAK,cACd,CAEA,YAAA,EAAqC,CACnC,OAAO,IAAIb,CAAAA,CAAqB,IAAA,CAAK,WAAY,IAAA,CAAK,QAAA,EAAU,CAClE,CAEF","file":"index.mjs","sourcesContent":["import { DocumentChatRequest } from '../model';\nimport { DocumentChatResponse } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}/documents/{sourcedocid}\"\n * This is a generated file do not change manually!\n */\nexport class DocumentEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly sourcedocid: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documents\" + `/${this.sourcedocid}`;\n }\n\n /**\n * @param body DocumentChatRequest? - \n */\n async post(\n body?: DocumentChatRequest,\n ): Promise<DocumentChatResponse> {\n return (\n await this.restClient.post<DocumentChatResponse>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON),\n body\n )\n ).toModel();\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}/documents\"\n * This is a generated file do not change manually!\n */\nexport class DocumentsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documents\";\n }\n}\n","import { DocumentEndpoint } from './document';\nimport { DocumentsEndpoint } from './documents';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}\"\n * This is a generated file do not change manually!\n */\nexport class DomainEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly domainname: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\" + `/${this.domainname}`;\n }\n\n documents(): DocumentsEndpoint;\n documents(sourcedocid: string): DocumentEndpoint\n \n documents(sourcedocid?: string): DocumentEndpoint | DocumentsEndpoint {\n if(sourcedocid !== undefined && sourcedocid !== null) {\n\t return new DocumentEndpoint(this.restClient, this.ENDPOINT, sourcedocid);\n } else {\n\t return new DocumentsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains\"\n * This is a generated file do not change manually!\n */\nexport class DomainsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\";\n }\n}\n","import { DomainEndpoint } from './domain';\nimport { DomainsEndpoint } from './domains';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat\"\n * This is a generated file do not change manually!\n */\nexport class DocumentchatEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documentchat\";\n }\n\n domains(): DomainsEndpoint;\n domains(domainname: string): DomainEndpoint\n \n domains(domainname?: string): DomainEndpoint | DomainsEndpoint {\n if(domainname !== undefined && domainname !== null) {\n\t return new DomainEndpoint(this.restClient, this.ENDPOINT, domainname);\n } else {\n\t return new DomainsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import * as fs from 'fs';\n\nimport { DocumentchatEndpoint } from './documentchat';\nimport { RestClient } from '../../rest';\n\nconst PARENT_ENDPOINT = '/api';\n\n/**\n * Entry point to the DocumentChat API.\n *\n * @author semantha\n * Calls the /documentchat, endpoints.\n *\n * Note:\n * The constructor is not meant to be invoked directly\n * use `loginXXX()` with your credentials instead.\n *\n * this is a generated class do not change manually!\n */\nexport class DocumentChatAPI {\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string\n ) {\n }\n\n /**\n * Access to the DocumentChat API\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n * @param apiKey: string - A valid bearer token for accessing the given url.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithApiKey(\n serverUrl: string,\n apiKey: string\n ): DocumentChatAPI {\n if(!apiKey) {\n throw new Error('You need to supply an API key to login.');\n }\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new DocumentChatAPI(new RestClient(this.parseServerUrl(serverUrl), apiKey), PARENT_ENDPOINT);\n }\n\n\n /**\n * Access to the DocumentChat API, when there is a auth proxy in place to handle the addition of the Authorization header\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithAuthProxy(\n serverUrl: string\n ): DocumentChatAPI {\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new DocumentChatAPI(new RestClient(this.parseServerUrl(serverUrl)), PARENT_ENDPOINT);\n }\n\n /**\n * Access to the DocumentChat API\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n * @param clientId: string - OAuth2 client id.\n * @param clientSecret: string - OAuth2 client secret.\n * @param tokenUrl: string OAuth2 url to get a valid access token\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithCredentials(\n serverUrl: string,\n clientId: string,\n clientSecret: string,\n tokenUrl: string\n ): DocumentChatAPI {\n serverUrl = this.parseServerUrl(serverUrl);\n return new DocumentChatAPI(new RestClient(serverUrl, undefined, clientId, clientSecret, tokenUrl), PARENT_ENDPOINT);\n }\n\t\n /**\n * Access to the DocumentChat API\n *\n * @param credentialsFilePath: string - Path to a properties file providing client credentials.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithCredentialsFile(credentialsFilePath: string) : DocumentChatAPI {\n if (credentialsFilePath.endsWith('.properties') || credentialsFilePath.endsWith('.PROPERTIES')) {\n const rawData = fs.readFileSync(credentialsFilePath, 'utf8');\n const lines = rawData\n\t .split(/[\\n|\\r\\n]/)\n\t .filter(line => line.length !== 0)\n\t .map(line => line.split('='));\n\t const serverUrl = this.getValueOfInPropertiesFile('serverUrl', lines);\n\t const clientId = this.getValueOfInPropertiesFile('clientId', lines);\n\t const clientSecret = this.getValueOfInPropertiesFile('clientSecret', lines);\n\t const tokenUrl = this.getValueOfInPropertiesFile('tokenUrl', lines);\n\t return DocumentChatAPI.loginWithCredentials(serverUrl, clientId, clientSecret, tokenUrl);\n\t}\n throw new Error('Can not login, please supply a credentials properties file.');\n }\n\n private static parseServerUrl(serverUrl: string): string {\n if (serverUrl.endsWith('/')) {\n serverUrl = serverUrl.slice(0, -1);\n }\n if (serverUrl.endsWith('/tt-platform-ui/en/#')) {\n serverUrl = serverUrl.replace('/tt-platform-ui/en/#', '/tt-product-server');\n } else if (!serverUrl.endsWith('/tt-product-server')) {\n serverUrl += '/tt-product-server';\n }\n return serverUrl;\n }\n\n private static getValueOfInPropertiesFile(searchKey: string, lines: string[][]): string {\n for (const line of lines) {\n if (line[0] === searchKey) {\n return line[1].replace('\\\\:', ':');\n }\n }\n throw Error(`.properties files contains no ${searchKey}!`);\n }\n\n endpoint(): string {\n return this.parentEndpoint;\n }\n\n documentchat(): DocumentchatEndpoint {\n return new DocumentchatEndpoint(this.restClient, this.endpoint());\n }\n\n}"]}
1
+ {"version":3,"sources":["../../../semantha-product-sdk/document-chat/api/document.ts","../../../semantha-product-sdk/document-chat/api/documents.ts","../../../semantha-product-sdk/document-chat/api/domain.ts","../../../semantha-product-sdk/document-chat/api/domains.ts","../../../semantha-product-sdk/document-chat/api/documentchat.ts","../../../semantha-product-sdk/document-chat/api/documentChatAPI.ts"],"names":["DocumentEndpoint","restClient","parentEndpoint","sourcedocid","body","polarionToken","polarionURL","headers","DocumentsEndpoint","DomainEndpoint","domainname","DomainsEndpoint","DocumentchatEndpoint","PARENT_ENDPOINT","DocumentChatAPI","_DocumentChatAPI","serverUrl","apiKey","RestClient","clientId","clientSecret","tokenUrl","credentialsFilePath","lines","line","searchKey"],"mappings":"8DAWO,IAAMA,CAAAA,CAAN,KAAuB,CAG5B,WAAA,CACmBC,CAAAA,CACAC,EACAC,CAAAA,CACjB,CAHiB,IAAA,CAAA,UAAA,CAAAF,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,CAAAA,CACA,iBAAAC,CAAAA,CAEjB,IAAA,CAAK,QAAA,CAAW,IAAA,CAAK,cAAA,CAAiB,CAAA,WAAA,EAAmB,KAAK,WAAW,CAAA,EAC3E,CARiB,QAAA,CAejB,MAAM,IAAA,CACJC,EACFC,CAAAA,CAAwBC,CAAAA,CAAqD,CAC3E,IAAMC,CAAAA,CAAU,IAAA,CAAK,WAAW,QAAA,CAAA,kBAAuB,CAAA,CACvD,OAAIF,CAAAA,GAAkB,MAAA,GACpBE,CAAA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AU,OAAA,CAAQ,sBAAA,CAAwB,oBAAoB,CAAA,CAChEA,CAAAA,CAAU,QAAA,CAAS,oBAAoB,CAAA,GACjDA,CAAAA,EAAa,sBAERA,CACT,CAEA,OAAe,0BAAA,CAA2BS,CAAAA,CAAmBF,CAAAA,CAA2B,CACtF,IAAA,IAAWC,CAAAA,IAAQD,CAAAA,CACjB,GAAIC,CAAAA,CAAK,CAAC,IAAMC,CAAAA,CACd,OAAOD,CAAAA,CAAK,CAAC,CAAA,CAAE,OAAA,CAAQ,MAAO,GAAG,CAAA,CAGrC,MAAM,KAAA,CAAM,CAAA,8BAAA,EAAiCC,CAAS,GAAG,CAC3D,CAEA,QAAA,EAAmB,CACjB,OAAO,IAAA,CAAK,cACd,CAEA,YAAA,EAAqC,CACnC,OAAO,IAAIb,CAAAA,CAAqB,IAAA,CAAK,UAAA,CAAY,IAAA,CAAK,QAAA,EAAU,CAClE,CAEF","file":"index.mjs","sourcesContent":["import { DocumentChatRequest } from '../model';\nimport { DocumentChatResponse } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}/documents/{sourcedocid}\"\n * This is a generated file do not change manually!\n */\nexport class DocumentEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly sourcedocid: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documents\" + `/${this.sourcedocid}`;\n }\n\n /**\n * @param body DocumentChatRequest? - \n * @param polarionToken string? - The personal access token for polarion\n * @param polarionURL string? - The url of the polarion server to talk to\n */\n async post(\n body?: DocumentChatRequest,\n polarionToken?: string, polarionURL?: string): Promise<DocumentChatResponse> {\n const headers = this.restClient.toHeader(MediaType.JSON);\n if (polarionToken !== undefined) {\n headers['Polarion-Token'] = polarionToken;\n }\n if (polarionURL !== undefined) {\n headers['Polarion-URL'] = polarionURL;\n }\n return (\n await this.restClient.post<DocumentChatResponse>(\n this.ENDPOINT,\n {},\n headers,\n body\n )\n ).toModel();\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}/documents\"\n * This is a generated file do not change manually!\n */\nexport class DocumentsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documents\";\n }\n}\n","import { DocumentEndpoint } from './document';\nimport { DocumentsEndpoint } from './documents';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}\"\n * This is a generated file do not change manually!\n */\nexport class DomainEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly domainname: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\" + `/${this.domainname}`;\n }\n\n documents(): DocumentsEndpoint;\n documents(sourcedocid: string): DocumentEndpoint\n \n documents(sourcedocid?: string): DocumentEndpoint | DocumentsEndpoint {\n if(sourcedocid !== undefined && sourcedocid !== null) {\n\t return new DocumentEndpoint(this.restClient, this.ENDPOINT, sourcedocid);\n } else {\n\t return new DocumentsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains\"\n * This is a generated file do not change manually!\n */\nexport class DomainsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\";\n }\n}\n","import { DomainEndpoint } from './domain';\nimport { DomainsEndpoint } from './domains';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat\"\n * This is a generated file do not change manually!\n */\nexport class DocumentchatEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documentchat\";\n }\n\n domains(): DomainsEndpoint;\n domains(domainname: string): DomainEndpoint\n \n domains(domainname?: string): DomainEndpoint | DomainsEndpoint {\n if(domainname !== undefined && domainname !== null) {\n\t return new DomainEndpoint(this.restClient, this.ENDPOINT, domainname);\n } else {\n\t return new DomainsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import * as fs from 'fs';\n\nimport { DocumentchatEndpoint } from './documentchat';\nimport { RestClient } from '../../rest';\n\nconst PARENT_ENDPOINT = '/api';\n\n/**\n * Entry point to the DocumentChat API.\n *\n * @author semantha\n * Calls the /documentchat, endpoints.\n *\n * Note:\n * The constructor is not meant to be invoked directly\n * use `loginXXX()` with your credentials instead.\n *\n * this is a generated class do not change manually!\n */\nexport class DocumentChatAPI {\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string\n ) {\n }\n\n /**\n * Access to the DocumentChat API\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n * @param apiKey: string - A valid bearer token for accessing the given url.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithApiKey(\n serverUrl: string,\n apiKey: string\n ): DocumentChatAPI {\n if(!apiKey) {\n throw new Error('You need to supply an API key to login.');\n }\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new DocumentChatAPI(new RestClient(this.parseServerUrl(serverUrl), apiKey), PARENT_ENDPOINT);\n }\n\n\n /**\n * Access to the DocumentChat API, when there is a auth proxy in place to handle the addition of the Authorization header\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithAuthProxy(\n serverUrl: string\n ): DocumentChatAPI {\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new DocumentChatAPI(new RestClient(this.parseServerUrl(serverUrl)), PARENT_ENDPOINT);\n }\n\n /**\n * Access to the DocumentChat API\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n * @param clientId: string - OAuth2 client id.\n * @param clientSecret: string - OAuth2 client secret.\n * @param tokenUrl: string OAuth2 url to get a valid access token\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithCredentials(\n serverUrl: string,\n clientId: string,\n clientSecret: string,\n tokenUrl: string\n ): DocumentChatAPI {\n serverUrl = this.parseServerUrl(serverUrl);\n return new DocumentChatAPI(new RestClient(serverUrl, undefined, clientId, clientSecret, tokenUrl), PARENT_ENDPOINT);\n }\n\t\n /**\n * Access to the DocumentChat API\n *\n * @param credentialsFilePath: string - Path to a properties file providing client credentials.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithCredentialsFile(credentialsFilePath: string) : DocumentChatAPI {\n if (credentialsFilePath.endsWith('.properties') || credentialsFilePath.endsWith('.PROPERTIES')) {\n const rawData = fs.readFileSync(credentialsFilePath, 'utf8');\n const lines = rawData\n\t .split(/[\\n|\\r\\n]/)\n\t .filter(line => line.length !== 0)\n\t .map(line => line.split('='));\n\t const serverUrl = this.getValueOfInPropertiesFile('serverUrl', lines);\n\t const clientId = this.getValueOfInPropertiesFile('clientId', lines);\n\t const clientSecret = this.getValueOfInPropertiesFile('clientSecret', lines);\n\t const tokenUrl = this.getValueOfInPropertiesFile('tokenUrl', lines);\n\t return DocumentChatAPI.loginWithCredentials(serverUrl, clientId, clientSecret, tokenUrl);\n\t}\n throw new Error('Can not login, please supply a credentials properties file.');\n }\n\n private static parseServerUrl(serverUrl: string): string {\n if (serverUrl.endsWith('/')) {\n serverUrl = serverUrl.slice(0, -1);\n }\n if (serverUrl.endsWith('/tt-platform-ui/en/#')) {\n serverUrl = serverUrl.replace('/tt-platform-ui/en/#', '/tt-product-server');\n } else if (!serverUrl.endsWith('/tt-product-server')) {\n serverUrl += '/tt-product-server';\n }\n return serverUrl;\n }\n\n private static getValueOfInPropertiesFile(searchKey: string, lines: string[][]): string {\n for (const line of lines) {\n if (line[0] === searchKey) {\n return line[1].replace('\\\\:', ':');\n }\n }\n throw Error(`.properties files contains no ${searchKey}!`);\n }\n\n endpoint(): string {\n return this.parentEndpoint;\n }\n\n documentchat(): DocumentchatEndpoint {\n return new DocumentchatEndpoint(this.restClient, this.endpoint());\n }\n\n}"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkOGW7UVWP_js=require('../../chunk-OGW7UVWP.js');require('../../chunk-2DHIHJB5.js');Object.defineProperty(exports,"BoxEndpoint",{enumerable:true,get:function(){return chunkOGW7UVWP_js.a}});Object.defineProperty(exports,"BoxesEndpoint",{enumerable:true,get:function(){return chunkOGW7UVWP_js.b}});Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkOGW7UVWP_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkOGW7UVWP_js.d}});Object.defineProperty(exports,"FileBoxAPI",{enumerable:true,get:function(){return chunkOGW7UVWP_js.f}});Object.defineProperty(exports,"FileboxEndpoint",{enumerable:true,get:function(){return chunkOGW7UVWP_js.e}});//# sourceMappingURL=index.js.map
1
+ 'use strict';var chunkTNOEPM5N_js=require('../../chunk-TNOEPM5N.js');require('../../chunk-4CX7MUVC.js');Object.defineProperty(exports,"BoxEndpoint",{enumerable:true,get:function(){return chunkTNOEPM5N_js.a}});Object.defineProperty(exports,"BoxesEndpoint",{enumerable:true,get:function(){return chunkTNOEPM5N_js.b}});Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkTNOEPM5N_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkTNOEPM5N_js.d}});Object.defineProperty(exports,"FileBoxAPI",{enumerable:true,get:function(){return chunkTNOEPM5N_js.f}});Object.defineProperty(exports,"FileboxEndpoint",{enumerable:true,get:function(){return chunkTNOEPM5N_js.e}});//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- export{a as BoxEndpoint,b as BoxesEndpoint,c as DomainEndpoint,d as DomainsEndpoint,f as FileBoxAPI,e as FileboxEndpoint}from'../../chunk-FUYAWPCE.mjs';import'../../chunk-HYOHQM5J.mjs';//# sourceMappingURL=index.mjs.map
1
+ export{a as BoxEndpoint,b as BoxesEndpoint,c as DomainEndpoint,d as DomainsEndpoint,f as FileBoxAPI,e as FileboxEndpoint}from'../../chunk-P2K3VXP2.mjs';import'../../chunk-FA37ZZXB.mjs';//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkOGW7UVWP_js=require('../chunk-OGW7UVWP.js');require('../chunk-2DHIHJB5.js');var chunkZSFNB534_js=require('../chunk-ZSFNB534.js');Object.defineProperty(exports,"BoxEndpoint",{enumerable:true,get:function(){return chunkOGW7UVWP_js.a}});Object.defineProperty(exports,"BoxesEndpoint",{enumerable:true,get:function(){return chunkOGW7UVWP_js.b}});Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkOGW7UVWP_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkOGW7UVWP_js.d}});Object.defineProperty(exports,"FileBoxAPI",{enumerable:true,get:function(){return chunkOGW7UVWP_js.f}});Object.defineProperty(exports,"FileboxEndpoint",{enumerable:true,get:function(){return chunkOGW7UVWP_js.e}});Object.defineProperty(exports,"FileTypeEnumValues",{enumerable:true,get:function(){return chunkZSFNB534_js.a}});Object.defineProperty(exports,"isFileTypeEnumValue",{enumerable:true,get:function(){return chunkZSFNB534_js.b}});//# sourceMappingURL=index.js.map
1
+ 'use strict';var chunkTNOEPM5N_js=require('../chunk-TNOEPM5N.js'),chunkZSFNB534_js=require('../chunk-ZSFNB534.js');require('../chunk-4CX7MUVC.js');Object.defineProperty(exports,"BoxEndpoint",{enumerable:true,get:function(){return chunkTNOEPM5N_js.a}});Object.defineProperty(exports,"BoxesEndpoint",{enumerable:true,get:function(){return chunkTNOEPM5N_js.b}});Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkTNOEPM5N_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkTNOEPM5N_js.d}});Object.defineProperty(exports,"FileBoxAPI",{enumerable:true,get:function(){return chunkTNOEPM5N_js.f}});Object.defineProperty(exports,"FileboxEndpoint",{enumerable:true,get:function(){return chunkTNOEPM5N_js.e}});Object.defineProperty(exports,"FileTypeEnumValues",{enumerable:true,get:function(){return chunkZSFNB534_js.a}});Object.defineProperty(exports,"isFileTypeEnumValue",{enumerable:true,get:function(){return chunkZSFNB534_js.b}});//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- export{a as BoxEndpoint,b as BoxesEndpoint,c as DomainEndpoint,d as DomainsEndpoint,f as FileBoxAPI,e as FileboxEndpoint}from'../chunk-FUYAWPCE.mjs';import'../chunk-HYOHQM5J.mjs';export{a as FileTypeEnumValues,b as isFileTypeEnumValue}from'../chunk-DURTIKAP.mjs';//# sourceMappingURL=index.mjs.map
1
+ export{a as BoxEndpoint,b as BoxesEndpoint,c as DomainEndpoint,d as DomainsEndpoint,f as FileBoxAPI,e as FileboxEndpoint}from'../chunk-P2K3VXP2.mjs';export{a as FileTypeEnumValues,b as isFileTypeEnumValue}from'../chunk-DURTIKAP.mjs';import'../chunk-FA37ZZXB.mjs';//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map