@semantha/product-sdk 11.3.0 → 11.3.1

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 (41) hide show
  1. package/dist/{chunk-PMYUIYR3.js → chunk-3FXI4XXG.js} +2 -2
  2. package/dist/{chunk-PMYUIYR3.js.map → chunk-3FXI4XXG.js.map} +1 -1
  3. package/dist/chunk-5PB4IBX4.mjs +2 -0
  4. package/dist/chunk-5PB4IBX4.mjs.map +1 -0
  5. package/dist/{chunk-KLBX4FVS.js → chunk-B3MSOEJM.js} +2 -2
  6. package/dist/{chunk-KLBX4FVS.js.map → chunk-B3MSOEJM.js.map} +1 -1
  7. package/dist/{chunk-THA6X4VS.mjs → chunk-CIAODZK3.mjs} +2 -2
  8. package/dist/{chunk-THA6X4VS.mjs.map → chunk-CIAODZK3.mjs.map} +1 -1
  9. package/dist/{chunk-LBYB72RT.mjs → chunk-FRZZWIQF.mjs} +2 -2
  10. package/dist/{chunk-LBYB72RT.mjs.map → chunk-FRZZWIQF.mjs.map} +1 -1
  11. package/dist/chunk-MUWVKP6I.js +2 -0
  12. package/dist/chunk-MUWVKP6I.js.map +1 -0
  13. package/dist/{chunk-XRW3IJJB.js → chunk-UTBTTDZX.js} +2 -2
  14. package/dist/{chunk-XRW3IJJB.js.map → chunk-UTBTTDZX.js.map} +1 -1
  15. package/dist/{chunk-23JGNEMY.mjs → chunk-YB4SU52R.mjs} +2 -2
  16. package/dist/{chunk-23JGNEMY.mjs.map → chunk-YB4SU52R.mjs.map} +1 -1
  17. package/dist/file-box/api/index.js +1 -1
  18. package/dist/file-box/api/index.mjs +1 -1
  19. package/dist/file-box/index.js +1 -1
  20. package/dist/file-box/index.mjs +1 -1
  21. package/dist/requirements/api/index.js +1 -1
  22. package/dist/requirements/api/index.mjs +1 -1
  23. package/dist/rest/index.d.mts +1 -1
  24. package/dist/rest/index.d.ts +1 -1
  25. package/dist/rest/index.js +1 -1
  26. package/dist/rest/index.mjs +1 -1
  27. package/dist/structure-navigator/api/index.js +1 -1
  28. package/dist/structure-navigator/api/index.mjs +1 -1
  29. package/dist/structure-navigator/index.js +1 -1
  30. package/dist/structure-navigator/index.mjs +1 -1
  31. package/dist/table-extractor/api/index.js +1 -1
  32. package/dist/table-extractor/api/index.mjs +1 -1
  33. package/dist/tracking/api/index.js +1 -1
  34. package/dist/tracking/api/index.mjs +1 -1
  35. package/dist/tracking/index.js +1 -1
  36. package/dist/tracking/index.mjs +1 -1
  37. package/package.json +3 -3
  38. package/dist/chunk-KHRCSPJC.js +0 -2
  39. package/dist/chunk-KHRCSPJC.js.map +0 -1
  40. package/dist/chunk-PU2IRAN7.mjs +0 -2
  41. package/dist/chunk-PU2IRAN7.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../semantha-product-sdk/tracking/api/log.ts","../semantha-product-sdk/tracking/api/track.ts","../semantha-product-sdk/tracking/api/domain.ts","../semantha-product-sdk/tracking/api/domains.ts","../semantha-product-sdk/tracking/api/uitracking.ts","../semantha-product-sdk/tracking/api/trackingAPI.ts"],"names":["LogEndpoint","restClient","parentEndpoint","body","TrackEndpoint","DomainEndpoint","domainname","DomainsEndpoint","UitrackingEndpoint","PARENT_ENDPOINT","TrackingAPI","_TrackingAPI","serverUrl","apiKey","RestClient","clientId","clientSecret","tokenUrl","credentialsFilePath","lines","line","searchKey"],"mappings":"iEAUO,IAAMA,CAAAA,CAAN,KAAkB,CAGvB,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,OACxC,CAPiB,QAAA,CAYjB,MAAM,KACJC,CAAAA,CACe,CACf,OAAA,CACE,MAAM,IAAA,CAAK,UAAA,CAAW,KACpB,IAAA,CAAK,QAAA,CACL,EAAC,CACD,IAAA,CAAK,UAAA,CAAW,2BAAuB,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,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,UAAA,EAAiC,CAC/B,OAAO,IAAIb,CAAAA,CAAmB,IAAA,CAAK,UAAA,CAAY,IAAA,CAAK,QAAA,EAAU,CAChE,CAEF","file":"chunk-LBYB72RT.mjs","sourcesContent":["import { Logging } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/uitracking/domains/{domainname}/log\"\n * This is a generated file do not change manually!\n */\nexport class LogEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/log\";\n }\n\n /**\n * @param body Logging? - \n */\n async post(\n body?: Logging,\n ): Promise<void> {\n return (\n await this.restClient.post<void>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON),\n body\n )\n ).toModel();\n }\n}\n","import { RestClient } from '../../rest';\nimport { Tracking } from '../model';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/uitracking/domains/{domainname}/track\"\n * This is a generated file do not change manually!\n */\nexport class TrackEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/track\";\n }\n\n /**\n * @param body Tracking - \n */\n async patch(\n body: Tracking,\n ): Promise<void> {\n return (\n await this.restClient.patch<void>(\n this.ENDPOINT,\n body\n )\n ).toModel();\n }\n}\n","import { LogEndpoint } from './log';\nimport { RestClient } from '../../rest';\nimport { TrackEndpoint } from './track';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/uitracking/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 log(): LogEndpoint {\n return new LogEndpoint(this.restClient, this.ENDPOINT);\n }\n\n track(): TrackEndpoint {\n return new TrackEndpoint(this.restClient, this.ENDPOINT);\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/uitracking/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/uitracking\"\n * This is a generated file do not change manually!\n */\nexport class UitrackingEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/uitracking\";\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 { UitrackingEndpoint } from './uitracking';\nimport { RestClient } from '../../rest';\n\nconst PARENT_ENDPOINT = '/api';\n\n/**\n * Entry point to the Tracking API.\n *\n * @author semantha\n * Calls the /uitracking, 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 TrackingAPI {\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string\n ) {\n }\n\n /**\n * Access to the Tracking API\n *\n * @param serverUrl: string - URL to the Tracking server.\n * @param apiKey: string - A valid bearer token for accessing the given url.\n *\n * @return TrackingAPI: Entry point to the Tracking API.\n */\n static loginWithApiKey(\n serverUrl: string,\n apiKey: string\n ): TrackingAPI {\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 TrackingAPI(new RestClient(this.parseServerUrl(serverUrl), apiKey), PARENT_ENDPOINT);\n }\n\n\n /**\n * Access to the Tracking 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 Tracking server.\n *\n * @return TrackingAPI: Entry point to the Tracking API.\n */\n static loginWithAuthProxy(\n serverUrl: string\n ): TrackingAPI {\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new TrackingAPI(new RestClient(this.parseServerUrl(serverUrl)), PARENT_ENDPOINT);\n }\n\n /**\n * Access to the Tracking API\n *\n * @param serverUrl: string - URL to the Tracking 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 TrackingAPI: Entry point to the Tracking API.\n */\n static loginWithCredentials(\n serverUrl: string,\n clientId: string,\n clientSecret: string,\n tokenUrl: string\n ): TrackingAPI {\n serverUrl = this.parseServerUrl(serverUrl);\n return new TrackingAPI(new RestClient(serverUrl, undefined, clientId, clientSecret, tokenUrl), PARENT_ENDPOINT);\n }\n\t\n /**\n * Access to the Tracking API\n *\n * @param credentialsFilePath: string - Path to a properties file providing client credentials.\n *\n * @return TrackingAPI: Entry point to the Tracking API.\n */\n static loginWithCredentialsFile(credentialsFilePath: string) : TrackingAPI {\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 TrackingAPI.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 uitracking(): UitrackingEndpoint {\n return new UitrackingEndpoint(this.restClient, this.endpoint());\n }\n\n}"]}
1
+ {"version":3,"sources":["../semantha-product-sdk/tracking/api/log.ts","../semantha-product-sdk/tracking/api/track.ts","../semantha-product-sdk/tracking/api/domain.ts","../semantha-product-sdk/tracking/api/domains.ts","../semantha-product-sdk/tracking/api/uitracking.ts","../semantha-product-sdk/tracking/api/trackingAPI.ts"],"names":["LogEndpoint","restClient","parentEndpoint","body","TrackEndpoint","DomainEndpoint","domainname","DomainsEndpoint","UitrackingEndpoint","PARENT_ENDPOINT","TrackingAPI","_TrackingAPI","serverUrl","apiKey","RestClient","clientId","clientSecret","tokenUrl","credentialsFilePath","lines","line","searchKey"],"mappings":"iEAUO,IAAMA,CAAAA,CAAN,KAAkB,CAGvB,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,OACxC,CAPiB,QAAA,CAYjB,MAAM,KACJC,CAAAA,CACe,CACf,OAAA,CACE,MAAM,IAAA,CAAK,UAAA,CAAW,KACpB,IAAA,CAAK,QAAA,CACL,EAAC,CACD,IAAA,CAAK,UAAA,CAAW,2BAAuB,CAAA,CACvCA,CACF,CAAA,EACA,OAAA,EACJ,CACF,EC1BO,IAAMC,CAAAA,CAAN,KAAoB,CAGzB,WAAA,CACmBH,CAAAA,CACAC,EACjB,CAFiB,IAAA,CAAA,UAAA,CAAAD,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,CAAAA,CAEjB,IAAA,CAAK,SAAW,IAAA,CAAK,cAAA,CAAiB,SACxC,CAPiB,QAAA,CAYjB,MAAM,MACJC,CAAAA,CACe,CACf,OAAA,CACI,MAAM,IAAA,CAAK,UAAA,CAAW,MACpB,IAAA,CAAK,QAAA,CACLA,CACF,CAAA,EACF,OAAA,EACJ,CACF,ECtBO,IAAME,CAAAA,CAAN,KAAqB,CAG1B,WAAA,CACmBJ,EACAC,CAAAA,CACAI,CAAAA,CACjB,CAHiB,IAAA,CAAA,UAAA,CAAAL,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,EACA,IAAA,CAAA,UAAA,CAAAI,CAAAA,CAEjB,IAAA,CAAK,QAAA,CAAW,IAAA,CAAK,cAAA,CAAiB,YAAiB,IAAA,CAAK,UAAU,CAAA,EACxE,CARiB,QAAA,CAUjB,GAAA,EAAmB,CACjB,OAAO,IAAIN,CAAAA,CAAY,IAAA,CAAK,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,CAAAA,CAAcC,CAAQ,CACrF,CACG,MAAM,IAAI,KAAA,CAAM,6DAA6D,CAC/E,CAEA,OAAe,cAAA,CAAeL,EAA2B,CACvD,OAAIA,CAAAA,CAAU,QAAA,CAAS,GAAG,CAAA,GACxBA,EAAYA,CAAAA,CAAU,KAAA,CAAM,CAAA,CAAG,EAAE,CAAA,CAAA,CAE/BA,CAAAA,CAAU,SAAS,sBAAsB,CAAA,CAC3CA,CAAAA,CAAYA,CAAAA,CAAU,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,UAAA,EAAiC,CAC/B,OAAO,IAAIb,CAAAA,CAAmB,IAAA,CAAK,UAAA,CAAY,IAAA,CAAK,QAAA,EAAU,CAChE,CAEF","file":"chunk-FRZZWIQF.mjs","sourcesContent":["import { Logging } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/uitracking/domains/{domainname}/log\"\n * This is a generated file do not change manually!\n */\nexport class LogEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/log\";\n }\n\n /**\n * @param body Logging? - \n */\n async post(\n body?: Logging,\n ): Promise<void> {\n return (\n await this.restClient.post<void>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON),\n body\n )\n ).toModel();\n }\n}\n","import { RestClient } from '../../rest';\nimport { Tracking } from '../model';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/uitracking/domains/{domainname}/track\"\n * This is a generated file do not change manually!\n */\nexport class TrackEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/track\";\n }\n\n /**\n * @param body Tracking - \n */\n async patch(\n body: Tracking,\n ): Promise<void> {\n return (\n await this.restClient.patch<void>(\n this.ENDPOINT,\n body\n )\n ).toModel();\n }\n}\n","import { LogEndpoint } from './log';\nimport { RestClient } from '../../rest';\nimport { TrackEndpoint } from './track';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/uitracking/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 log(): LogEndpoint {\n return new LogEndpoint(this.restClient, this.ENDPOINT);\n }\n\n track(): TrackEndpoint {\n return new TrackEndpoint(this.restClient, this.ENDPOINT);\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/uitracking/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/uitracking\"\n * This is a generated file do not change manually!\n */\nexport class UitrackingEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/uitracking\";\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 { UitrackingEndpoint } from './uitracking';\nimport { RestClient } from '../../rest';\n\nconst PARENT_ENDPOINT = '/api';\n\n/**\n * Entry point to the Tracking API.\n *\n * @author semantha\n * Calls the /uitracking, 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 TrackingAPI {\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string\n ) {\n }\n\n /**\n * Access to the Tracking API\n *\n * @param serverUrl: string - URL to the Tracking server.\n * @param apiKey: string - A valid bearer token for accessing the given url.\n *\n * @return TrackingAPI: Entry point to the Tracking API.\n */\n static loginWithApiKey(\n serverUrl: string,\n apiKey: string\n ): TrackingAPI {\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 TrackingAPI(new RestClient(this.parseServerUrl(serverUrl), apiKey), PARENT_ENDPOINT);\n }\n\n\n /**\n * Access to the Tracking 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 Tracking server.\n *\n * @return TrackingAPI: Entry point to the Tracking API.\n */\n static loginWithAuthProxy(\n serverUrl: string\n ): TrackingAPI {\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new TrackingAPI(new RestClient(this.parseServerUrl(serverUrl)), PARENT_ENDPOINT);\n }\n\n /**\n * Access to the Tracking API\n *\n * @param serverUrl: string - URL to the Tracking 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 TrackingAPI: Entry point to the Tracking API.\n */\n static loginWithCredentials(\n serverUrl: string,\n clientId: string,\n clientSecret: string,\n tokenUrl: string\n ): TrackingAPI {\n serverUrl = this.parseServerUrl(serverUrl);\n return new TrackingAPI(new RestClient(serverUrl, undefined, clientId, clientSecret, tokenUrl), PARENT_ENDPOINT);\n }\n\t\n /**\n * Access to the Tracking API\n *\n * @param credentialsFilePath: string - Path to a properties file providing client credentials.\n *\n * @return TrackingAPI: Entry point to the Tracking API.\n */\n static loginWithCredentialsFile(credentialsFilePath: string) : TrackingAPI {\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 TrackingAPI.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 uitracking(): UitrackingEndpoint {\n return new UitrackingEndpoint(this.restClient, this.endpoint());\n }\n\n}"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';var o=require('axios');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var o__default=/*#__PURE__*/_interopDefault(o);var a=class{constructor(s){this.response=s;}async toModel(){return (await this.response).data}async toFile(){let s=await this.response,e=s?.headers["content-disposition"],t="file";if(e){let r=e.match(/filename="?([^"]+)"?/);r&&r[1]&&(t=r[1]);}return new File([s.data],t)}async getStatusCode(){return (await this.response).status}async getStatusText(){return (await this.response).statusText}};var d=(i=>(i.JSON="application/json",i.XLSX="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",i.PDF="application/pdf",i.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",i.ZIP="application/zip",i.REQIFZ="application/reqifz",i.PNG="image/png",i.BINARY="application/octet-stream",i.TEXT_PLAIN="text/plain",i))(d||{}),c=class p{constructor(s,e,t,r,n){this.serverUrl=s;this.apiKey=e;this.clientId=t;this.client_secret=r;this.tokenUrl=n;this.expireTime=0,this.accessToken="",this.skipAuthHeader=!!s&&!(e||t||r||n);}static LEEWAY=30;expireTime;accessToken;skipAuthHeader;async buildHeadersForJsonRequest(){return this.skipAuthHeader?{Accept:"application/json"}:{Accept:"application/json",Authorization:`Bearer ${await this.getToken()}`}}async buildHeadersForRequest(){return this.skipAuthHeader?{}:{Authorization:`Bearer ${await this.getToken()}`}}async getToken(){if(this.apiKey)return this.apiKey;if(this.clientId&&this.client_secret&&this.tokenUrl&&(this.accessToken==""||this.expireTime<performance.now())){let s={grant_type:"client_credentials",client_id:this.clientId,client_secret:this.client_secret,scope:"openid"},e=await o__default.default.post(this.tokenUrl,s,{headers:{accept:"application/json","content-type":"application/x-www-form-urlencoded"}});if(e.status>=o__default.default.HttpStatusCode.BadRequest)return "";this.accessToken=e.data.id_token??e.data.access_token,this.expireTime=performance.now()+(e.data.expires_in-p.LEEWAY);}return this.accessToken}async request(s,e,t){if(!t.headers)t.headers=await this.buildHeadersForJsonRequest();else {let r=await this.buildHeadersForRequest();t.headers={...t.headers,...r};}return new a(o__default.default.request({method:s,url:this.serverUrl+e,headers:{...t.headers,"User-Agent":"semantha TypeScript SDK; "},data:t.data,params:t.params,responseType:t.responseType}))}async get(s,e,t,r,n="json"){return this.request("GET",s,{params:e,headers:t,data:r,responseType:n})}async post(s,e,t,r,n="json"){if(!t)t=await this.buildHeadersForJsonRequest();else {let u=await this.buildHeadersForRequest();t={...t,...u};}return new a(o__default.default.post(this.serverUrl+s,r,{params:e,headers:t,responseType:n}))}async delete(s,e,t){return this.request("DELETE",s,{data:e,params:t})}async patch(s,e){return this.request("PATCH",s,{data:e})}async put(s,e){return this.request("PUT",s,{data:e})}toHeader(s,e){return e?{Accept:s,"Content-Type":e}:{Accept:s}}};exports.a=a;exports.b=d;exports.c=c;//# sourceMappingURL=chunk-MUWVKP6I.js.map
2
+ //# sourceMappingURL=chunk-MUWVKP6I.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../semantha-product-sdk/rest/restResponse.ts","../semantha-product-sdk/rest/restClient.ts"],"names":["RestResponse","response","contentDisposition","filename","match","MediaType","RestClient","_RestClient","serverUrl","apiKey","clientId","client_secret","tokenUrl","data","axios","method","url","config","authHeader","params","headers","responseType","acceptMimeType","contentType"],"mappings":"oJAEO,IAAMA,CAAAA,CAAN,KAAsB,CAC3B,WAAA,CAA6BC,CAAAA,CAAqC,CAArC,IAAA,CAAA,QAAA,CAAAA,EAAsC,CAEnE,MAAM,OAAA,EAAsB,CAC1B,OAAA,CAAQ,MAAM,IAAA,CAAK,QAAA,EAAU,IAC/B,CAEA,MAAM,MAAA,EAAwB,CAC5B,IAAMA,CAAAA,CAA0B,MAAM,IAAA,CAAK,QAAA,CACrCC,EAAqBD,CAAAA,EAA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QD,CAAe,CAClC,CACF","file":"chunk-MUWVKP6I.js","sourcesContent":["import { AxiosResponse } from 'axios';\n\nexport class RestResponse<T> {\n constructor(private readonly response: Promise<AxiosResponse<T>>) {}\n\n async toModel(): Promise<T> {\n return (await this.response).data;\n }\n\n async toFile(): Promise<File> {\n const response: AxiosResponse = await this.response;\n const contentDisposition = response?.headers['content-disposition'];\n let filename = 'file';\n if (contentDisposition) {\n const match = contentDisposition.match(/filename=\"?([^\"]+)\"?/);\n if (match && match[1]) {\n filename = match[1];\n }\n }\n return new File([response.data], filename);\n }\n\n async getStatusCode(): Promise<number> {\n return (await this.response).status;\n }\n\n async getStatusText(): Promise<string> {\n return (await this.response).statusText;\n }\n}\n","import axios, { AxiosRequestConfig, AxiosResponse, ResponseType } from 'axios';\nimport { RestResponse } from './restResponse';\n\nexport enum MediaType {\n JSON = 'application/json',\n XLSX = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n PDF = 'application/pdf',\n DOCX = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n ZIP = 'application/zip',\n REQIFZ = 'application/reqifz',\n PNG = 'image/png',\n BINARY = 'application/octet-stream',\n TEXT_PLAIN = 'text/plain'\n}\n\nexport class RestClient {\n // in seconds\n private static readonly LEEWAY = 30;\n\n private expireTime: number;\n private accessToken: string;\n private skipAuthHeader: boolean;\n\n constructor(\n private readonly serverUrl: string,\n private readonly apiKey?: string,\n private readonly clientId?: string,\n private readonly client_secret?: string,\n private readonly tokenUrl?: string\n ) {\n this.expireTime = 0.0;\n this.accessToken = '';\n this.skipAuthHeader = !!serverUrl && !(apiKey || clientId || client_secret || tokenUrl);\n }\n\n async buildHeadersForJsonRequest(): Promise<{ [key: string]: string }> {\n if (this.skipAuthHeader) {\n return {\n Accept: 'application/json'\n };\n }\n return {\n Accept: 'application/json',\n Authorization: `Bearer ${await this.getToken()}`\n };\n }\n\n async buildHeadersForRequest(): Promise<{ [key: string]: string }> {\n if (this.skipAuthHeader) {\n return {};\n }\n return {\n Authorization: `Bearer ${await this.getToken()}`\n };\n }\n\n async getToken(): Promise<string> {\n if (this.apiKey) {\n return this.apiKey;\n }\n if (\n this.clientId &&\n this.client_secret &&\n this.tokenUrl &&\n (this.accessToken == '' || this.expireTime < performance.now())\n ) {\n const data = {\n grant_type: 'client_credentials',\n client_id: this.clientId,\n client_secret: this.client_secret,\n scope: 'openid'\n };\n const response = await axios.post(this.tokenUrl, data, {\n headers: { accept: 'application/json', 'content-type': 'application/x-www-form-urlencoded' }\n });\n if (response.status >= axios.HttpStatusCode.BadRequest) {\n // example for error response: {\"error\":\"invalid_client\",\"error_description\":\"Invalid client or Invalid client credentials\"}\n // we have no token -> this leads to a permission error\n return '';\n }\n this.accessToken = response.data['id_token'] ?? response.data['access_token'];\n this.expireTime = performance.now() + (response.data['expires_in'] - RestClient.LEEWAY);\n }\n return this.accessToken;\n }\n\n private async request<R>(\n method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE',\n url: string,\n config: { params?: any; headers?: { [key: string]: string }; data?: any; responseType?: ResponseType }\n ): Promise<RestResponse<R>> {\n if (!config.headers) {\n config.headers = await this.buildHeadersForJsonRequest();\n } else {\n const authHeader = await this.buildHeadersForRequest();\n config.headers = { ...config.headers, ...authHeader };\n }\n return new RestResponse<R>(\n axios.request<R>({\n method: method,\n url: this.serverUrl + url,\n headers: { ...config.headers, 'User-Agent': 'semantha TypeScript SDK; ' },\n data: config.data,\n params: config.params,\n responseType: config.responseType\n })\n );\n }\n\n async get<R>(\n url: string,\n params?: any,\n headers?: { [key: string]: string },\n data?: any,\n responseType: ResponseType = 'json'\n ): Promise<RestResponse<R>> {\n return this.request<R>('GET', url, { params, headers, data, responseType });\n }\n\n async post<R>(\n url: string,\n params?: any,\n headers?: { [key: string]: string },\n data?: any,\n responseType: ResponseType = 'json'\n ): Promise<RestResponse<R>> {\n if (!headers) {\n headers = await this.buildHeadersForJsonRequest();\n } else {\n const authHeader = await this.buildHeadersForRequest();\n headers = { ...headers, ...authHeader };\n }\n return new RestResponse<R>(axios.post<R>(this.serverUrl + url, data, { params, headers, responseType }));\n }\n\n async delete(url: string, data?: any, params?: any): Promise<RestResponse<void>> {\n return this.request<void>('DELETE', url, { data, params });\n }\n\n async patch<R>(url: string, data?: any): Promise<RestResponse<R>> {\n return this.request<R>('PATCH', url, { data });\n }\n\n async put<R>(url: string, data: any): Promise<RestResponse<R>> {\n return this.request<R>('PUT', url, { data });\n }\n\n toHeader(acceptMimeType: MediaType, contentType?: string): { [key: string]: string } {\n if (contentType) {\n return { Accept: acceptMimeType, 'Content-Type': contentType };\n }\n return { Accept: acceptMimeType };\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkKHRCSPJC_js=require('./chunk-KHRCSPJC.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,r){this.restClient=t;this.parentEndpoint=r;this.ENDPOINT=this.parentEndpoint+"/log";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var s=class{constructor(t,r){this.restClient=t;this.parentEndpoint=r;this.ENDPOINT=this.parentEndpoint+"/track";}ENDPOINT;async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var a=class{constructor(t,r,i){this.restClient=t;this.parentEndpoint=r;this.domainname=i;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;log(){return new o(this.restClient,this.ENDPOINT)}track(){return new s(this.restClient,this.ENDPOINT)}};var p=class{constructor(t,r){this.restClient=t;this.parentEndpoint=r;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var l=class{constructor(t,r){this.restClient=t;this.parentEndpoint=r;this.ENDPOINT=this.parentEndpoint+"/uitracking";}ENDPOINT;domains(t){return t!=null?new a(this.restClient,this.ENDPOINT,t):new p(this.restClient,this.ENDPOINT)}};var c="/api",m=class n{constructor(t,r){this.restClient=t;this.parentEndpoint=r;}static loginWithApiKey(t,r){if(!r)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 n(new chunkKHRCSPJC_js.c(this.parseServerUrl(t),r),c)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new n(new chunkKHRCSPJC_js.c(this.parseServerUrl(t)),c)}static loginWithCredentials(t,r,i,d){return t=this.parseServerUrl(t),new n(new chunkKHRCSPJC_js.c(t,void 0,r,i,d),c)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let i=h__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(g=>g.length!==0).map(g=>g.split("=")),d=this.getValueOfInPropertiesFile("serverUrl",i),f=this.getValueOfInPropertiesFile("clientId",i),u=this.getValueOfInPropertiesFile("clientSecret",i),E=this.getValueOfInPropertiesFile("tokenUrl",i);return n.loginWithCredentials(d,f,u,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,r){for(let i of r)if(i[0]===t)return i[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}uitracking(){return new l(this.restClient,this.endpoint())}};exports.a=o;exports.b=s;exports.c=a;exports.d=p;exports.e=l;exports.f=m;//# sourceMappingURL=chunk-XRW3IJJB.js.map
2
- //# sourceMappingURL=chunk-XRW3IJJB.js.map
1
+ 'use strict';var chunkMUWVKP6I_js=require('./chunk-MUWVKP6I.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,r){this.restClient=t;this.parentEndpoint=r;this.ENDPOINT=this.parentEndpoint+"/log";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var s=class{constructor(t,r){this.restClient=t;this.parentEndpoint=r;this.ENDPOINT=this.parentEndpoint+"/track";}ENDPOINT;async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var a=class{constructor(t,r,i){this.restClient=t;this.parentEndpoint=r;this.domainname=i;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;log(){return new o(this.restClient,this.ENDPOINT)}track(){return new s(this.restClient,this.ENDPOINT)}};var p=class{constructor(t,r){this.restClient=t;this.parentEndpoint=r;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var l=class{constructor(t,r){this.restClient=t;this.parentEndpoint=r;this.ENDPOINT=this.parentEndpoint+"/uitracking";}ENDPOINT;domains(t){return t!=null?new a(this.restClient,this.ENDPOINT,t):new p(this.restClient,this.ENDPOINT)}};var c="/api",m=class n{constructor(t,r){this.restClient=t;this.parentEndpoint=r;}static loginWithApiKey(t,r){if(!r)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 n(new chunkMUWVKP6I_js.c(this.parseServerUrl(t),r),c)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new n(new chunkMUWVKP6I_js.c(this.parseServerUrl(t)),c)}static loginWithCredentials(t,r,i,d){return t=this.parseServerUrl(t),new n(new chunkMUWVKP6I_js.c(t,void 0,r,i,d),c)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let i=h__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(g=>g.length!==0).map(g=>g.split("=")),d=this.getValueOfInPropertiesFile("serverUrl",i),f=this.getValueOfInPropertiesFile("clientId",i),u=this.getValueOfInPropertiesFile("clientSecret",i),E=this.getValueOfInPropertiesFile("tokenUrl",i);return n.loginWithCredentials(d,f,u,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,r){for(let i of r)if(i[0]===t)return i[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}uitracking(){return new l(this.restClient,this.endpoint())}};exports.a=o;exports.b=s;exports.c=a;exports.d=p;exports.e=l;exports.f=m;//# sourceMappingURL=chunk-UTBTTDZX.js.map
2
+ //# sourceMappingURL=chunk-UTBTTDZX.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../semantha-product-sdk/tracking/api/log.ts","../semantha-product-sdk/tracking/api/track.ts","../semantha-product-sdk/tracking/api/domain.ts","../semantha-product-sdk/tracking/api/domains.ts","../semantha-product-sdk/tracking/api/uitracking.ts","../semantha-product-sdk/tracking/api/trackingAPI.ts"],"names":["LogEndpoint","restClient","parentEndpoint","body","TrackEndpoint","DomainEndpoint","domainname","DomainsEndpoint","UitrackingEndpoint","PARENT_ENDPOINT","TrackingAPI","_TrackingAPI","serverUrl","apiKey","RestClient","clientId","clientSecret","tokenUrl","credentialsFilePath","lines","h","line","searchKey"],"mappings":"ubAUO,IAAMA,CAAAA,CAAN,KAAkB,CAGvB,WAAA,CACmBC,CAAAA,CACAC,EACjB,CAFiB,IAAA,CAAA,UAAA,CAAAD,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,CAAAA,CAEjB,I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AU,SAAS,sBAAsB,CAAA,CAC3CA,CAAAA,CAAYA,CAAAA,CAAU,OAAA,CAAQ,sBAAA,CAAwB,oBAAoB,CAAA,CAChEA,CAAAA,CAAU,QAAA,CAAS,oBAAoB,CAAA,GACjDA,CAAAA,EAAa,sBAERA,CACT,CAEA,OAAe,0BAAA,CAA2BU,CAAAA,CAAmBH,CAAAA,CAA2B,CACtF,IAAA,IAAWE,CAAAA,IAAQF,CAAAA,CACjB,GAAIE,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,UAAA,EAAiC,CAC/B,OAAO,IAAId,CAAAA,CAAmB,IAAA,CAAK,UAAA,CAAY,IAAA,CAAK,QAAA,EAAU,CAChE,CAEF","file":"chunk-XRW3IJJB.js","sourcesContent":["import { Logging } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/uitracking/domains/{domainname}/log\"\n * This is a generated file do not change manually!\n */\nexport class LogEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/log\";\n }\n\n /**\n * @param body Logging? - \n */\n async post(\n body?: Logging,\n ): Promise<void> {\n return (\n await this.restClient.post<void>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON),\n body\n )\n ).toModel();\n }\n}\n","import { RestClient } from '../../rest';\nimport { Tracking } from '../model';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/uitracking/domains/{domainname}/track\"\n * This is a generated file do not change manually!\n */\nexport class TrackEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/track\";\n }\n\n /**\n * @param body Tracking - \n */\n async patch(\n body: Tracking,\n ): Promise<void> {\n return (\n await this.restClient.patch<void>(\n this.ENDPOINT,\n body\n )\n ).toModel();\n }\n}\n","import { LogEndpoint } from './log';\nimport { RestClient } from '../../rest';\nimport { TrackEndpoint } from './track';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/uitracking/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 log(): LogEndpoint {\n return new LogEndpoint(this.restClient, this.ENDPOINT);\n }\n\n track(): TrackEndpoint {\n return new TrackEndpoint(this.restClient, this.ENDPOINT);\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/uitracking/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/uitracking\"\n * This is a generated file do not change manually!\n */\nexport class UitrackingEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/uitracking\";\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 { UitrackingEndpoint } from './uitracking';\nimport { RestClient } from '../../rest';\n\nconst PARENT_ENDPOINT = '/api';\n\n/**\n * Entry point to the Tracking API.\n *\n * @author semantha\n * Calls the /uitracking, 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 TrackingAPI {\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string\n ) {\n }\n\n /**\n * Access to the Tracking API\n *\n * @param serverUrl: string - URL to the Tracking server.\n * @param apiKey: string - A valid bearer token for accessing the given url.\n *\n * @return TrackingAPI: Entry point to the Tracking API.\n */\n static loginWithApiKey(\n serverUrl: string,\n apiKey: string\n ): TrackingAPI {\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 TrackingAPI(new RestClient(this.parseServerUrl(serverUrl), apiKey), PARENT_ENDPOINT);\n }\n\n\n /**\n * Access to the Tracking 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 Tracking server.\n *\n * @return TrackingAPI: Entry point to the Tracking API.\n */\n static loginWithAuthProxy(\n serverUrl: string\n ): TrackingAPI {\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new TrackingAPI(new RestClient(this.parseServerUrl(serverUrl)), PARENT_ENDPOINT);\n }\n\n /**\n * Access to the Tracking API\n *\n * @param serverUrl: string - URL to the Tracking 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 TrackingAPI: Entry point to the Tracking API.\n */\n static loginWithCredentials(\n serverUrl: string,\n clientId: string,\n clientSecret: string,\n tokenUrl: string\n ): TrackingAPI {\n serverUrl = this.parseServerUrl(serverUrl);\n return new TrackingAPI(new RestClient(serverUrl, undefined, clientId, clientSecret, tokenUrl), PARENT_ENDPOINT);\n }\n\t\n /**\n * Access to the Tracking API\n *\n * @param credentialsFilePath: string - Path to a properties file providing client credentials.\n *\n * @return TrackingAPI: Entry point to the Tracking API.\n */\n static loginWithCredentialsFile(credentialsFilePath: string) : TrackingAPI {\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 TrackingAPI.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 uitracking(): UitrackingEndpoint {\n return new UitrackingEndpoint(this.restClient, this.endpoint());\n }\n\n}"]}
1
+ {"version":3,"sources":["../semantha-product-sdk/tracking/api/log.ts","../semantha-product-sdk/tracking/api/track.ts","../semantha-product-sdk/tracking/api/domain.ts","../semantha-product-sdk/tracking/api/domains.ts","../semantha-product-sdk/tracking/api/uitracking.ts","../semantha-product-sdk/tracking/api/trackingAPI.ts"],"names":["LogEndpoint","restClient","parentEndpoint","body","TrackEndpoint","DomainEndpoint","domainname","DomainsEndpoint","UitrackingEndpoint","PARENT_ENDPOINT","TrackingAPI","_TrackingAPI","serverUrl","apiKey","RestClient","clientId","clientSecret","tokenUrl","credentialsFilePath","lines","h","line","searchKey"],"mappings":"ubAUO,IAAMA,CAAAA,CAAN,KAAkB,CAGvB,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,OACxC,CAPiB,QAAA,CAYjB,MAAM,KACJC,CAAAA,CACe,CACf,OAAA,CACE,MAAM,IAAA,CAAK,UAAA,CAAW,KACpB,IAAA,CAAK,QAAA,CACL,EAAC,CACD,IAAA,CAAK,UAAA,CAAW,2BAAuB,CAAA,CACvCA,CACF,CAAA,EACA,OAAA,EACJ,CACF,EC1BO,IAAMC,CAAAA,CAAN,KAAoB,CAGzB,WAAA,CACmBH,CAAAA,CACAC,EACjB,CAFiB,IAAA,CAAA,UAAA,CAAAD,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,CAAAA,CAEjB,IAAA,CAAK,SAAW,IAAA,CAAK,cAAA,CAAiB,SACxC,CAPiB,QAAA,CAYjB,MAAM,MACJC,CAAAA,CACe,CACf,OAAA,CACI,MAAM,IAAA,CAAK,UAAA,CAAW,MACpB,IAAA,CAAK,QAAA,CACLA,CACF,CAAA,EACF,OAAA,EACJ,CACF,ECtBO,IAAME,CAAAA,CAAN,KAAqB,CAG1B,WAAA,CACmBJ,EACAC,CAAAA,CACAI,CAAAA,CACjB,CAHiB,IAAA,CAAA,UAAA,CAAAL,CAAAA,CACA,IAAA,CAAA,cAAA,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AA,CAAYI,CAAK,CAAA,CAC5DH,CAAAA,CAAe,KAAK,0BAAA,CAA2B,cAAA,CAAgBG,CAAK,CAAA,CACpEF,CAAAA,CAAW,IAAA,CAAK,2BAA2B,UAAA,CAAYE,CAAK,CAAA,CAClE,OAAOR,CAAAA,CAAY,oBAAA,CAAqBC,EAAWG,CAAAA,CAAUC,CAAAA,CAAcC,CAAQ,CACrF,CACG,MAAM,IAAI,KAAA,CAAM,6DAA6D,CAC/E,CAEA,OAAe,cAAA,CAAeL,EAA2B,CACvD,OAAIA,CAAAA,CAAU,QAAA,CAAS,GAAG,CAAA,GACxBA,EAAYA,CAAAA,CAAU,KAAA,CAAM,CAAA,CAAG,EAAE,CAAA,CAAA,CAE/BA,CAAAA,CAAU,SAAS,sBAAsB,CAAA,CAC3CA,CAAAA,CAAYA,CAAAA,CAAU,OAAA,CAAQ,sBAAA,CAAwB,oBAAoB,CAAA,CAChEA,CAAAA,CAAU,QAAA,CAAS,oBAAoB,CAAA,GACjDA,CAAAA,EAAa,sBAERA,CACT,CAEA,OAAe,0BAAA,CAA2BU,CAAAA,CAAmBH,CAAAA,CAA2B,CACtF,IAAA,IAAWE,CAAAA,IAAQF,CAAAA,CACjB,GAAIE,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,UAAA,EAAiC,CAC/B,OAAO,IAAId,CAAAA,CAAmB,IAAA,CAAK,UAAA,CAAY,IAAA,CAAK,QAAA,EAAU,CAChE,CAEF","file":"chunk-UTBTTDZX.js","sourcesContent":["import { Logging } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/uitracking/domains/{domainname}/log\"\n * This is a generated file do not change manually!\n */\nexport class LogEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/log\";\n }\n\n /**\n * @param body Logging? - \n */\n async post(\n body?: Logging,\n ): Promise<void> {\n return (\n await this.restClient.post<void>(\n this.ENDPOINT,\n {},\n this.restClient.toHeader(MediaType.JSON),\n body\n )\n ).toModel();\n }\n}\n","import { RestClient } from '../../rest';\nimport { Tracking } from '../model';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/uitracking/domains/{domainname}/track\"\n * This is a generated file do not change manually!\n */\nexport class TrackEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/track\";\n }\n\n /**\n * @param body Tracking - \n */\n async patch(\n body: Tracking,\n ): Promise<void> {\n return (\n await this.restClient.patch<void>(\n this.ENDPOINT,\n body\n )\n ).toModel();\n }\n}\n","import { LogEndpoint } from './log';\nimport { RestClient } from '../../rest';\nimport { TrackEndpoint } from './track';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/uitracking/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 log(): LogEndpoint {\n return new LogEndpoint(this.restClient, this.ENDPOINT);\n }\n\n track(): TrackEndpoint {\n return new TrackEndpoint(this.restClient, this.ENDPOINT);\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/uitracking/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/uitracking\"\n * This is a generated file do not change manually!\n */\nexport class UitrackingEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/uitracking\";\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 { UitrackingEndpoint } from './uitracking';\nimport { RestClient } from '../../rest';\n\nconst PARENT_ENDPOINT = '/api';\n\n/**\n * Entry point to the Tracking API.\n *\n * @author semantha\n * Calls the /uitracking, 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 TrackingAPI {\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string\n ) {\n }\n\n /**\n * Access to the Tracking API\n *\n * @param serverUrl: string - URL to the Tracking server.\n * @param apiKey: string - A valid bearer token for accessing the given url.\n *\n * @return TrackingAPI: Entry point to the Tracking API.\n */\n static loginWithApiKey(\n serverUrl: string,\n apiKey: string\n ): TrackingAPI {\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 TrackingAPI(new RestClient(this.parseServerUrl(serverUrl), apiKey), PARENT_ENDPOINT);\n }\n\n\n /**\n * Access to the Tracking 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 Tracking server.\n *\n * @return TrackingAPI: Entry point to the Tracking API.\n */\n static loginWithAuthProxy(\n serverUrl: string\n ): TrackingAPI {\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new TrackingAPI(new RestClient(this.parseServerUrl(serverUrl)), PARENT_ENDPOINT);\n }\n\n /**\n * Access to the Tracking API\n *\n * @param serverUrl: string - URL to the Tracking 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 TrackingAPI: Entry point to the Tracking API.\n */\n static loginWithCredentials(\n serverUrl: string,\n clientId: string,\n clientSecret: string,\n tokenUrl: string\n ): TrackingAPI {\n serverUrl = this.parseServerUrl(serverUrl);\n return new TrackingAPI(new RestClient(serverUrl, undefined, clientId, clientSecret, tokenUrl), PARENT_ENDPOINT);\n }\n\t\n /**\n * Access to the Tracking API\n *\n * @param credentialsFilePath: string - Path to a properties file providing client credentials.\n *\n * @return TrackingAPI: Entry point to the Tracking API.\n */\n static loginWithCredentialsFile(credentialsFilePath: string) : TrackingAPI {\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 TrackingAPI.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 uitracking(): UitrackingEndpoint {\n return new UitrackingEndpoint(this.restClient, this.endpoint());\n }\n\n}"]}
@@ -1,2 +1,2 @@
1
- import {c}from'./chunk-PU2IRAN7.mjs';import*as h from'fs';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 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 c(this.parseServerUrl(t)),f)}static loginWithCredentials(t,e,r,d){return t=this.parseServerUrl(t),new i(new c(t,void 0,e,r,d),f)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let r=h.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())}};export{o as a,s as b,p as c,a as d,l as e,g as f};//# sourceMappingURL=chunk-23JGNEMY.mjs.map
2
- //# sourceMappingURL=chunk-23JGNEMY.mjs.map
1
+ import {c}from'./chunk-5PB4IBX4.mjs';import*as h from'fs';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 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 c(this.parseServerUrl(t)),f)}static loginWithCredentials(t,e,r,d){return t=this.parseServerUrl(t),new i(new c(t,void 0,e,r,d),f)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let r=h.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())}};export{o as a,s as b,p as c,a as d,l as e,g as f};//# sourceMappingURL=chunk-YB4SU52R.mjs.map
2
+ //# sourceMappingURL=chunk-YB4SU52R.mjs.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","line","searchKey"],"mappings":"0DAUO,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,C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IAAQD,CAAAA,CACjB,GAAIC,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,IAAIb,CAAAA,CAAgB,IAAA,CAAK,UAAA,CAAY,IAAA,CAAK,QAAA,EAAU,CAC7D,CAEF","file":"chunk-23JGNEMY.mjs","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","line","searchKey"],"mappings":"0DAUO,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,C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A,CAAK,UAAA,CAAY,IAAA,CAAK,QAAA,EAAU,CAC7D,CAEF","file":"chunk-YB4SU52R.mjs","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
- 'use strict';var chunkKLBX4FVS_js=require('../../chunk-KLBX4FVS.js');require('../../chunk-KHRCSPJC.js');Object.defineProperty(exports,"BoxEndpoint",{enumerable:true,get:function(){return chunkKLBX4FVS_js.a}});Object.defineProperty(exports,"BoxesEndpoint",{enumerable:true,get:function(){return chunkKLBX4FVS_js.b}});Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkKLBX4FVS_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkKLBX4FVS_js.d}});Object.defineProperty(exports,"FileBoxAPI",{enumerable:true,get:function(){return chunkKLBX4FVS_js.f}});Object.defineProperty(exports,"FileboxEndpoint",{enumerable:true,get:function(){return chunkKLBX4FVS_js.e}});//# sourceMappingURL=index.js.map
1
+ 'use strict';var chunkB3MSOEJM_js=require('../../chunk-B3MSOEJM.js');require('../../chunk-MUWVKP6I.js');Object.defineProperty(exports,"BoxEndpoint",{enumerable:true,get:function(){return chunkB3MSOEJM_js.a}});Object.defineProperty(exports,"BoxesEndpoint",{enumerable:true,get:function(){return chunkB3MSOEJM_js.b}});Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkB3MSOEJM_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkB3MSOEJM_js.d}});Object.defineProperty(exports,"FileBoxAPI",{enumerable:true,get:function(){return chunkB3MSOEJM_js.f}});Object.defineProperty(exports,"FileboxEndpoint",{enumerable:true,get:function(){return chunkB3MSOEJM_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-23JGNEMY.mjs';import'../../chunk-PU2IRAN7.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-YB4SU52R.mjs';import'../../chunk-5PB4IBX4.mjs';//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkKLBX4FVS_js=require('../chunk-KLBX4FVS.js'),chunkZSFNB534_js=require('../chunk-ZSFNB534.js');require('../chunk-KHRCSPJC.js');Object.defineProperty(exports,"BoxEndpoint",{enumerable:true,get:function(){return chunkKLBX4FVS_js.a}});Object.defineProperty(exports,"BoxesEndpoint",{enumerable:true,get:function(){return chunkKLBX4FVS_js.b}});Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkKLBX4FVS_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkKLBX4FVS_js.d}});Object.defineProperty(exports,"FileBoxAPI",{enumerable:true,get:function(){return chunkKLBX4FVS_js.f}});Object.defineProperty(exports,"FileboxEndpoint",{enumerable:true,get:function(){return chunkKLBX4FVS_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 chunkB3MSOEJM_js=require('../chunk-B3MSOEJM.js'),chunkZSFNB534_js=require('../chunk-ZSFNB534.js');require('../chunk-MUWVKP6I.js');Object.defineProperty(exports,"BoxEndpoint",{enumerable:true,get:function(){return chunkB3MSOEJM_js.a}});Object.defineProperty(exports,"BoxesEndpoint",{enumerable:true,get:function(){return chunkB3MSOEJM_js.b}});Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkB3MSOEJM_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkB3MSOEJM_js.d}});Object.defineProperty(exports,"FileBoxAPI",{enumerable:true,get:function(){return chunkB3MSOEJM_js.f}});Object.defineProperty(exports,"FileboxEndpoint",{enumerable:true,get:function(){return chunkB3MSOEJM_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-23JGNEMY.mjs';export{a as FileTypeEnumValues,b as isFileTypeEnumValue}from'../chunk-DURTIKAP.mjs';import'../chunk-PU2IRAN7.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-YB4SU52R.mjs';export{a as FileTypeEnumValues,b as isFileTypeEnumValue}from'../chunk-DURTIKAP.mjs';import'../chunk-5PB4IBX4.mjs';//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkKHRCSPJC_js=require('../../chunk-KHRCSPJC.js'),F=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 F__namespace=/*#__PURE__*/_interopNamespace(F);var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t){return (await this.restClient.post(this.ENDPOINT,t,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),{},"blob")).toFile()}};var p=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new l(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var d=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/aitasks/${this.analysisid}`;}ENDPOINT;results(){return new p(this.restClient,this.ENDPOINT)}};var m=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/aitasks";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var E=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/report";}ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var N=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/analyses";}ENDPOINT;report(){return new E(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}async postJson(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var h=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var u=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/stats";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var c=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;stats(){return new u(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var y=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/analyses/${this.analysisid}`;}ENDPOINT;pagedresults(){return new c(this.restClient,this.ENDPOINT)}results(){return new h(this.restClient,this.ENDPOINT)}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var C=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new C(this.restClient,this.ENDPOINT)}};var f=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/bulk";}ENDPOINT;results(){return new s(this.restClient,this.ENDPOINT)}};var g=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/classifications";}ENDPOINT};var P=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/comments";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var T=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/roles";}ENDPOINT};var O=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/currentuser";}ENDPOINT;roles(){return new T(this.restClient,this.ENDPOINT)}};var D=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/evaluations/${this.id}`;}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/evaluations";}ENDPOINT;async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var v=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/exceltemplates/${this.id}`;}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var I=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/new";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var R=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/exceltemplates";}ENDPOINT;new(){return new I(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var x=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/references";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var w=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.resultid=n;this.ENDPOINT=this.parentEndpoint+`/results/${this.resultid}`;}ENDPOINT;comments(){return new P(this.restClient,this.ENDPOINT)}evaluations(){return new o(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var A=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;aitasks(t){return t!=null?new d(this.restClient,this.ENDPOINT,t):new m(this.restClient,this.ENDPOINT)}analyses(t){return t!=null?new y(this.restClient,this.ENDPOINT,t):new N(this.restClient,this.ENDPOINT)}bulk(){return new f(this.restClient,this.ENDPOINT)}classifications(){return new g(this.restClient,this.ENDPOINT)}evaluations(t){return t!=null?new D(this.restClient,this.ENDPOINT,t):new o(this.restClient,this.ENDPOINT)}exceltemplates(t){return t!=null?new v(this.restClient,this.ENDPOINT,t):new R(this.restClient,this.ENDPOINT)}references(){return new x(this.restClient,this.ENDPOINT)}results(t){return t!=null?new w(this.restClient,this.ENDPOINT,t):new s(this.restClient,this.ENDPOINT)}};var M=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var b=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/requirements";}ENDPOINT;currentuser(){return new O(this.restClient,this.ENDPOINT)}domains(t){return t!=null?new A(this.restClient,this.ENDPOINT,t):new M(this.restClient,this.ENDPOINT)}};var k="/api",J=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 chunkKHRCSPJC_js.c(this.parseServerUrl(t),e),k)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new r(new chunkKHRCSPJC_js.c(this.parseServerUrl(t)),k)}static loginWithCredentials(t,e,n,S){return t=this.parseServerUrl(t),new r(new chunkKHRCSPJC_js.c(t,void 0,e,n,S),k)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=F__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(H=>H.length!==0).map(H=>H.split("=")),S=this.getValueOfInPropertiesFile("serverUrl",n),W=this.getValueOfInPropertiesFile("clientId",n),X=this.getValueOfInPropertiesFile("clientSecret",n),B=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(S,W,X,B)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let n of e)if(n[0]===t)return n[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}requirements(){return new b(this.restClient,this.endpoint())}};exports.AitaskEndpoint=d;exports.AitasksEndpoint=m;exports.AitasksResultsEndpoint=p;exports.AitasksresultsExportEndpoint=l;exports.AnalysesEndpoint=N;exports.AnalysisEndpoint=y;exports.AnalysisResultsEndpoint=h;exports.BulkEndpoint=f;exports.ClassificationsEndpoint=g;exports.CommentsEndpoint=P;exports.CurrentuserEndpoint=O;exports.DomainEndpoint=A;exports.DomainsEndpoint=M;exports.EvaluationEndpoint=D;exports.EvaluationsEndpoint=o;exports.ExceltemplateEndpoint=v;exports.ExceltemplatesEndpoint=R;exports.ExportEndpoint=C;exports.NewEndpoint=I;exports.PagedresultsEndpoint=c;exports.ReferencesEndpoint=x;exports.ReportEndpoint=E;exports.RequirementsAPI=J;exports.RequirementsEndpoint=b;exports.ResultEndpoint=w;exports.ResultsEndpoint=s;exports.RolesEndpoint=T;exports.StatsEndpoint=u;//# sourceMappingURL=index.js.map
1
+ 'use strict';var chunkMUWVKP6I_js=require('../../chunk-MUWVKP6I.js'),F=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 F__namespace=/*#__PURE__*/_interopNamespace(F);var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t){return (await this.restClient.post(this.ENDPOINT,t,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),{},"blob")).toFile()}};var p=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new l(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var d=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/aitasks/${this.analysisid}`;}ENDPOINT;results(){return new p(this.restClient,this.ENDPOINT)}};var m=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/aitasks";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var E=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/report";}ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var N=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/analyses";}ENDPOINT;report(){return new E(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}async postJson(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var h=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var u=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/stats";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var c=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;stats(){return new u(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var y=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/analyses/${this.analysisid}`;}ENDPOINT;pagedresults(){return new c(this.restClient,this.ENDPOINT)}results(){return new h(this.restClient,this.ENDPOINT)}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var C=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new C(this.restClient,this.ENDPOINT)}};var f=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/bulk";}ENDPOINT;results(){return new s(this.restClient,this.ENDPOINT)}};var g=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/classifications";}ENDPOINT};var P=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/comments";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var T=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/roles";}ENDPOINT};var O=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/currentuser";}ENDPOINT;roles(){return new T(this.restClient,this.ENDPOINT)}};var D=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/evaluations/${this.id}`;}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/evaluations";}ENDPOINT;async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var v=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/exceltemplates/${this.id}`;}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var I=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/new";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var R=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/exceltemplates";}ENDPOINT;new(){return new I(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var x=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/references";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var w=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.resultid=n;this.ENDPOINT=this.parentEndpoint+`/results/${this.resultid}`;}ENDPOINT;comments(){return new P(this.restClient,this.ENDPOINT)}evaluations(){return new o(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var A=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;aitasks(t){return t!=null?new d(this.restClient,this.ENDPOINT,t):new m(this.restClient,this.ENDPOINT)}analyses(t){return t!=null?new y(this.restClient,this.ENDPOINT,t):new N(this.restClient,this.ENDPOINT)}bulk(){return new f(this.restClient,this.ENDPOINT)}classifications(){return new g(this.restClient,this.ENDPOINT)}evaluations(t){return t!=null?new D(this.restClient,this.ENDPOINT,t):new o(this.restClient,this.ENDPOINT)}exceltemplates(t){return t!=null?new v(this.restClient,this.ENDPOINT,t):new R(this.restClient,this.ENDPOINT)}references(){return new x(this.restClient,this.ENDPOINT)}results(t){return t!=null?new w(this.restClient,this.ENDPOINT,t):new s(this.restClient,this.ENDPOINT)}};var M=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var b=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/requirements";}ENDPOINT;currentuser(){return new O(this.restClient,this.ENDPOINT)}domains(t){return t!=null?new A(this.restClient,this.ENDPOINT,t):new M(this.restClient,this.ENDPOINT)}};var k="/api",J=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 chunkMUWVKP6I_js.c(this.parseServerUrl(t),e),k)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new r(new chunkMUWVKP6I_js.c(this.parseServerUrl(t)),k)}static loginWithCredentials(t,e,n,S){return t=this.parseServerUrl(t),new r(new chunkMUWVKP6I_js.c(t,void 0,e,n,S),k)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=F__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(H=>H.length!==0).map(H=>H.split("=")),S=this.getValueOfInPropertiesFile("serverUrl",n),W=this.getValueOfInPropertiesFile("clientId",n),X=this.getValueOfInPropertiesFile("clientSecret",n),B=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(S,W,X,B)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let n of e)if(n[0]===t)return n[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}requirements(){return new b(this.restClient,this.endpoint())}};exports.AitaskEndpoint=d;exports.AitasksEndpoint=m;exports.AitasksResultsEndpoint=p;exports.AitasksresultsExportEndpoint=l;exports.AnalysesEndpoint=N;exports.AnalysisEndpoint=y;exports.AnalysisResultsEndpoint=h;exports.BulkEndpoint=f;exports.ClassificationsEndpoint=g;exports.CommentsEndpoint=P;exports.CurrentuserEndpoint=O;exports.DomainEndpoint=A;exports.DomainsEndpoint=M;exports.EvaluationEndpoint=D;exports.EvaluationsEndpoint=o;exports.ExceltemplateEndpoint=v;exports.ExceltemplatesEndpoint=R;exports.ExportEndpoint=C;exports.NewEndpoint=I;exports.PagedresultsEndpoint=c;exports.ReferencesEndpoint=x;exports.ReportEndpoint=E;exports.RequirementsAPI=J;exports.RequirementsEndpoint=b;exports.ResultEndpoint=w;exports.ResultsEndpoint=s;exports.RolesEndpoint=T;exports.StatsEndpoint=u;//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import {c as c$1}from'../../chunk-PU2IRAN7.mjs';import*as F from'fs';var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t){return (await this.restClient.post(this.ENDPOINT,t,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),{},"blob")).toFile()}};var p=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new l(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var d=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/aitasks/${this.analysisid}`;}ENDPOINT;results(){return new p(this.restClient,this.ENDPOINT)}};var m=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/aitasks";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var E=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/report";}ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var N=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/analyses";}ENDPOINT;report(){return new E(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}async postJson(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var h=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var u=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/stats";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var c=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;stats(){return new u(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var y=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/analyses/${this.analysisid}`;}ENDPOINT;pagedresults(){return new c(this.restClient,this.ENDPOINT)}results(){return new h(this.restClient,this.ENDPOINT)}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var C=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new C(this.restClient,this.ENDPOINT)}};var f=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/bulk";}ENDPOINT;results(){return new s(this.restClient,this.ENDPOINT)}};var g=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/classifications";}ENDPOINT};var P=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/comments";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var T=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/roles";}ENDPOINT};var O=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/currentuser";}ENDPOINT;roles(){return new T(this.restClient,this.ENDPOINT)}};var D=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/evaluations/${this.id}`;}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/evaluations";}ENDPOINT;async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var v=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/exceltemplates/${this.id}`;}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var I=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/new";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var R=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/exceltemplates";}ENDPOINT;new(){return new I(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var x=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/references";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var w=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.resultid=n;this.ENDPOINT=this.parentEndpoint+`/results/${this.resultid}`;}ENDPOINT;comments(){return new P(this.restClient,this.ENDPOINT)}evaluations(){return new o(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var A=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;aitasks(t){return t!=null?new d(this.restClient,this.ENDPOINT,t):new m(this.restClient,this.ENDPOINT)}analyses(t){return t!=null?new y(this.restClient,this.ENDPOINT,t):new N(this.restClient,this.ENDPOINT)}bulk(){return new f(this.restClient,this.ENDPOINT)}classifications(){return new g(this.restClient,this.ENDPOINT)}evaluations(t){return t!=null?new D(this.restClient,this.ENDPOINT,t):new o(this.restClient,this.ENDPOINT)}exceltemplates(t){return t!=null?new v(this.restClient,this.ENDPOINT,t):new R(this.restClient,this.ENDPOINT)}references(){return new x(this.restClient,this.ENDPOINT)}results(t){return t!=null?new w(this.restClient,this.ENDPOINT,t):new s(this.restClient,this.ENDPOINT)}};var M=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var b=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/requirements";}ENDPOINT;currentuser(){return new O(this.restClient,this.ENDPOINT)}domains(t){return t!=null?new A(this.restClient,this.ENDPOINT,t):new M(this.restClient,this.ENDPOINT)}};var k="/api",J=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),k)}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)),k)}static loginWithCredentials(t,e,n,S){return t=this.parseServerUrl(t),new r(new c$1(t,void 0,e,n,S),k)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=F.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(H=>H.length!==0).map(H=>H.split("=")),S=this.getValueOfInPropertiesFile("serverUrl",n),W=this.getValueOfInPropertiesFile("clientId",n),X=this.getValueOfInPropertiesFile("clientSecret",n),B=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(S,W,X,B)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let n of e)if(n[0]===t)return n[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}requirements(){return new b(this.restClient,this.endpoint())}};export{d as AitaskEndpoint,m as AitasksEndpoint,p as AitasksResultsEndpoint,l as AitasksresultsExportEndpoint,N as AnalysesEndpoint,y as AnalysisEndpoint,h as AnalysisResultsEndpoint,f as BulkEndpoint,g as ClassificationsEndpoint,P as CommentsEndpoint,O as CurrentuserEndpoint,A as DomainEndpoint,M as DomainsEndpoint,D as EvaluationEndpoint,o as EvaluationsEndpoint,v as ExceltemplateEndpoint,R as ExceltemplatesEndpoint,C as ExportEndpoint,I as NewEndpoint,c as PagedresultsEndpoint,x as ReferencesEndpoint,E as ReportEndpoint,J as RequirementsAPI,b as RequirementsEndpoint,w as ResultEndpoint,s as ResultsEndpoint,T as RolesEndpoint,u as StatsEndpoint};//# sourceMappingURL=index.mjs.map
1
+ import {c as c$1}from'../../chunk-5PB4IBX4.mjs';import*as F from'fs';var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t){return (await this.restClient.post(this.ENDPOINT,t,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),{},"blob")).toFile()}};var p=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new l(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var d=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/aitasks/${this.analysisid}`;}ENDPOINT;results(){return new p(this.restClient,this.ENDPOINT)}};var m=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/aitasks";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var E=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/report";}ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var N=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/analyses";}ENDPOINT;report(){return new E(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}async postJson(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var h=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var u=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/stats";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var c=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;stats(){return new u(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var y=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/analyses/${this.analysisid}`;}ENDPOINT;pagedresults(){return new c(this.restClient,this.ENDPOINT)}results(){return new h(this.restClient,this.ENDPOINT)}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var C=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new C(this.restClient,this.ENDPOINT)}};var f=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/bulk";}ENDPOINT;results(){return new s(this.restClient,this.ENDPOINT)}};var g=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/classifications";}ENDPOINT};var P=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/comments";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var T=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/roles";}ENDPOINT};var O=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/currentuser";}ENDPOINT;roles(){return new T(this.restClient,this.ENDPOINT)}};var D=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/evaluations/${this.id}`;}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/evaluations";}ENDPOINT;async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var v=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/exceltemplates/${this.id}`;}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var I=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/new";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var R=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/exceltemplates";}ENDPOINT;new(){return new I(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var x=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/references";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var w=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.resultid=n;this.ENDPOINT=this.parentEndpoint+`/results/${this.resultid}`;}ENDPOINT;comments(){return new P(this.restClient,this.ENDPOINT)}evaluations(){return new o(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var A=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;aitasks(t){return t!=null?new d(this.restClient,this.ENDPOINT,t):new m(this.restClient,this.ENDPOINT)}analyses(t){return t!=null?new y(this.restClient,this.ENDPOINT,t):new N(this.restClient,this.ENDPOINT)}bulk(){return new f(this.restClient,this.ENDPOINT)}classifications(){return new g(this.restClient,this.ENDPOINT)}evaluations(t){return t!=null?new D(this.restClient,this.ENDPOINT,t):new o(this.restClient,this.ENDPOINT)}exceltemplates(t){return t!=null?new v(this.restClient,this.ENDPOINT,t):new R(this.restClient,this.ENDPOINT)}references(){return new x(this.restClient,this.ENDPOINT)}results(t){return t!=null?new w(this.restClient,this.ENDPOINT,t):new s(this.restClient,this.ENDPOINT)}};var M=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var b=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/requirements";}ENDPOINT;currentuser(){return new O(this.restClient,this.ENDPOINT)}domains(t){return t!=null?new A(this.restClient,this.ENDPOINT,t):new M(this.restClient,this.ENDPOINT)}};var k="/api",J=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),k)}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)),k)}static loginWithCredentials(t,e,n,S){return t=this.parseServerUrl(t),new r(new c$1(t,void 0,e,n,S),k)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=F.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(H=>H.length!==0).map(H=>H.split("=")),S=this.getValueOfInPropertiesFile("serverUrl",n),W=this.getValueOfInPropertiesFile("clientId",n),X=this.getValueOfInPropertiesFile("clientSecret",n),B=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(S,W,X,B)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let n of e)if(n[0]===t)return n[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}requirements(){return new b(this.restClient,this.endpoint())}};export{d as AitaskEndpoint,m as AitasksEndpoint,p as AitasksResultsEndpoint,l as AitasksresultsExportEndpoint,N as AnalysesEndpoint,y as AnalysisEndpoint,h as AnalysisResultsEndpoint,f as BulkEndpoint,g as ClassificationsEndpoint,P as CommentsEndpoint,O as CurrentuserEndpoint,A as DomainEndpoint,M as DomainsEndpoint,D as EvaluationEndpoint,o as EvaluationsEndpoint,v as ExceltemplateEndpoint,R as ExceltemplatesEndpoint,C as ExportEndpoint,I as NewEndpoint,c as PagedresultsEndpoint,x as ReferencesEndpoint,E as ReportEndpoint,J as RequirementsAPI,b as RequirementsEndpoint,w as ResultEndpoint,s as ResultsEndpoint,T as RolesEndpoint,u as StatsEndpoint};//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -45,7 +45,7 @@ declare class RestClient {
45
45
  post<R>(url: string, params?: any, headers?: {
46
46
  [key: string]: string;
47
47
  }, data?: any, responseType?: ResponseType): Promise<RestResponse<R>>;
48
- delete(url: string, data?: any): Promise<RestResponse<void>>;
48
+ delete(url: string, data?: any, params?: any): Promise<RestResponse<void>>;
49
49
  patch<R>(url: string, data?: any): Promise<RestResponse<R>>;
50
50
  put<R>(url: string, data: any): Promise<RestResponse<R>>;
51
51
  toHeader(acceptMimeType: MediaType, contentType?: string): {
@@ -45,7 +45,7 @@ declare class RestClient {
45
45
  post<R>(url: string, params?: any, headers?: {
46
46
  [key: string]: string;
47
47
  }, data?: any, responseType?: ResponseType): Promise<RestResponse<R>>;
48
- delete(url: string, data?: any): Promise<RestResponse<void>>;
48
+ delete(url: string, data?: any, params?: any): Promise<RestResponse<void>>;
49
49
  patch<R>(url: string, data?: any): Promise<RestResponse<R>>;
50
50
  put<R>(url: string, data: any): Promise<RestResponse<R>>;
51
51
  toHeader(acceptMimeType: MediaType, contentType?: string): {
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkKHRCSPJC_js=require('../chunk-KHRCSPJC.js');Object.defineProperty(exports,"MediaType",{enumerable:true,get:function(){return chunkKHRCSPJC_js.b}});Object.defineProperty(exports,"RestClient",{enumerable:true,get:function(){return chunkKHRCSPJC_js.c}});Object.defineProperty(exports,"RestResponse",{enumerable:true,get:function(){return chunkKHRCSPJC_js.a}});//# sourceMappingURL=index.js.map
1
+ 'use strict';var chunkMUWVKP6I_js=require('../chunk-MUWVKP6I.js');Object.defineProperty(exports,"MediaType",{enumerable:true,get:function(){return chunkMUWVKP6I_js.b}});Object.defineProperty(exports,"RestClient",{enumerable:true,get:function(){return chunkMUWVKP6I_js.c}});Object.defineProperty(exports,"RestResponse",{enumerable:true,get:function(){return chunkMUWVKP6I_js.a}});//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- export{b as MediaType,c as RestClient,a as RestResponse}from'../chunk-PU2IRAN7.mjs';//# sourceMappingURL=index.mjs.map
1
+ export{b as MediaType,c as RestClient,a as RestResponse}from'../chunk-5PB4IBX4.mjs';//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkPMYUIYR3_js=require('../../chunk-PMYUIYR3.js');require('../../chunk-KHRCSPJC.js');Object.defineProperty(exports,"BinaryEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.a}});Object.defineProperty(exports,"ConfigurationEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.b}});Object.defineProperty(exports,"ConfigurationsEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.c}});Object.defineProperty(exports,"DocumentstructureEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.f}});Object.defineProperty(exports,"DocumentstructuresEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.g}});Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.h}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.i}});Object.defineProperty(exports,"EventsEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.d}});Object.defineProperty(exports,"ScreenshotsEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.e}});Object.defineProperty(exports,"StructureNavigatorAPI",{enumerable:true,get:function(){return chunkPMYUIYR3_js.k}});Object.defineProperty(exports,"StructurenavigatorEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.j}});//# sourceMappingURL=index.js.map
1
+ 'use strict';var chunk3FXI4XXG_js=require('../../chunk-3FXI4XXG.js');require('../../chunk-MUWVKP6I.js');Object.defineProperty(exports,"BinaryEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.a}});Object.defineProperty(exports,"ConfigurationEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.b}});Object.defineProperty(exports,"ConfigurationsEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.c}});Object.defineProperty(exports,"DocumentstructureEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.f}});Object.defineProperty(exports,"DocumentstructuresEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.g}});Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.h}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.i}});Object.defineProperty(exports,"EventsEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.d}});Object.defineProperty(exports,"ScreenshotsEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.e}});Object.defineProperty(exports,"StructureNavigatorAPI",{enumerable:true,get:function(){return chunk3FXI4XXG_js.k}});Object.defineProperty(exports,"StructurenavigatorEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.j}});//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- export{a as BinaryEndpoint,b as ConfigurationEndpoint,c as ConfigurationsEndpoint,f as DocumentstructureEndpoint,g as DocumentstructuresEndpoint,h as DomainEndpoint,i as DomainsEndpoint,d as EventsEndpoint,e as ScreenshotsEndpoint,k as StructureNavigatorAPI,j as StructurenavigatorEndpoint}from'../../chunk-THA6X4VS.mjs';import'../../chunk-PU2IRAN7.mjs';//# sourceMappingURL=index.mjs.map
1
+ export{a as BinaryEndpoint,b as ConfigurationEndpoint,c as ConfigurationsEndpoint,f as DocumentstructureEndpoint,g as DocumentstructuresEndpoint,h as DomainEndpoint,i as DomainsEndpoint,d as EventsEndpoint,e as ScreenshotsEndpoint,k as StructureNavigatorAPI,j as StructurenavigatorEndpoint}from'../../chunk-CIAODZK3.mjs';import'../../chunk-5PB4IBX4.mjs';//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkPMYUIYR3_js=require('../chunk-PMYUIYR3.js'),chunkKFGKXHFV_js=require('../chunk-KFGKXHFV.js');require('../chunk-KHRCSPJC.js');Object.defineProperty(exports,"BinaryEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.a}});Object.defineProperty(exports,"ConfigurationEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.b}});Object.defineProperty(exports,"ConfigurationsEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.c}});Object.defineProperty(exports,"DocumentstructureEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.f}});Object.defineProperty(exports,"DocumentstructuresEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.g}});Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.h}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.i}});Object.defineProperty(exports,"EventsEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.d}});Object.defineProperty(exports,"ScreenshotsEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.e}});Object.defineProperty(exports,"StructureNavigatorAPI",{enumerable:true,get:function(){return chunkPMYUIYR3_js.k}});Object.defineProperty(exports,"StructurenavigatorEndpoint",{enumerable:true,get:function(){return chunkPMYUIYR3_js.j}});Object.defineProperty(exports,"BulkDocumentStructureStatusEnumValues",{enumerable:true,get:function(){return chunkKFGKXHFV_js.a}});Object.defineProperty(exports,"DocumentStructureOverviewStatusEnumValues",{enumerable:true,get:function(){return chunkKFGKXHFV_js.c}});Object.defineProperty(exports,"DocumentStructureStatusEnumValues",{enumerable:true,get:function(){return chunkKFGKXHFV_js.e}});Object.defineProperty(exports,"EventTypeEnumValues",{enumerable:true,get:function(){return chunkKFGKXHFV_js.g}});Object.defineProperty(exports,"isBulkDocumentStructureStatusEnumValue",{enumerable:true,get:function(){return chunkKFGKXHFV_js.b}});Object.defineProperty(exports,"isDocumentStructureOverviewStatusEnumValue",{enumerable:true,get:function(){return chunkKFGKXHFV_js.d}});Object.defineProperty(exports,"isDocumentStructureStatusEnumValue",{enumerable:true,get:function(){return chunkKFGKXHFV_js.f}});Object.defineProperty(exports,"isEventTypeEnumValue",{enumerable:true,get:function(){return chunkKFGKXHFV_js.h}});//# sourceMappingURL=index.js.map
1
+ 'use strict';var chunk3FXI4XXG_js=require('../chunk-3FXI4XXG.js'),chunkKFGKXHFV_js=require('../chunk-KFGKXHFV.js');require('../chunk-MUWVKP6I.js');Object.defineProperty(exports,"BinaryEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.a}});Object.defineProperty(exports,"ConfigurationEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.b}});Object.defineProperty(exports,"ConfigurationsEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.c}});Object.defineProperty(exports,"DocumentstructureEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.f}});Object.defineProperty(exports,"DocumentstructuresEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.g}});Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.h}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.i}});Object.defineProperty(exports,"EventsEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.d}});Object.defineProperty(exports,"ScreenshotsEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.e}});Object.defineProperty(exports,"StructureNavigatorAPI",{enumerable:true,get:function(){return chunk3FXI4XXG_js.k}});Object.defineProperty(exports,"StructurenavigatorEndpoint",{enumerable:true,get:function(){return chunk3FXI4XXG_js.j}});Object.defineProperty(exports,"BulkDocumentStructureStatusEnumValues",{enumerable:true,get:function(){return chunkKFGKXHFV_js.a}});Object.defineProperty(exports,"DocumentStructureOverviewStatusEnumValues",{enumerable:true,get:function(){return chunkKFGKXHFV_js.c}});Object.defineProperty(exports,"DocumentStructureStatusEnumValues",{enumerable:true,get:function(){return chunkKFGKXHFV_js.e}});Object.defineProperty(exports,"EventTypeEnumValues",{enumerable:true,get:function(){return chunkKFGKXHFV_js.g}});Object.defineProperty(exports,"isBulkDocumentStructureStatusEnumValue",{enumerable:true,get:function(){return chunkKFGKXHFV_js.b}});Object.defineProperty(exports,"isDocumentStructureOverviewStatusEnumValue",{enumerable:true,get:function(){return chunkKFGKXHFV_js.d}});Object.defineProperty(exports,"isDocumentStructureStatusEnumValue",{enumerable:true,get:function(){return chunkKFGKXHFV_js.f}});Object.defineProperty(exports,"isEventTypeEnumValue",{enumerable:true,get:function(){return chunkKFGKXHFV_js.h}});//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- export{a as BinaryEndpoint,b as ConfigurationEndpoint,c as ConfigurationsEndpoint,f as DocumentstructureEndpoint,g as DocumentstructuresEndpoint,h as DomainEndpoint,i as DomainsEndpoint,d as EventsEndpoint,e as ScreenshotsEndpoint,k as StructureNavigatorAPI,j as StructurenavigatorEndpoint}from'../chunk-THA6X4VS.mjs';export{a as BulkDocumentStructureStatusEnumValues,c as DocumentStructureOverviewStatusEnumValues,e as DocumentStructureStatusEnumValues,g as EventTypeEnumValues,b as isBulkDocumentStructureStatusEnumValue,d as isDocumentStructureOverviewStatusEnumValue,f as isDocumentStructureStatusEnumValue,h as isEventTypeEnumValue}from'../chunk-OFG4XO3Z.mjs';import'../chunk-PU2IRAN7.mjs';//# sourceMappingURL=index.mjs.map
1
+ export{a as BinaryEndpoint,b as ConfigurationEndpoint,c as ConfigurationsEndpoint,f as DocumentstructureEndpoint,g as DocumentstructuresEndpoint,h as DomainEndpoint,i as DomainsEndpoint,d as EventsEndpoint,e as ScreenshotsEndpoint,k as StructureNavigatorAPI,j as StructurenavigatorEndpoint}from'../chunk-CIAODZK3.mjs';export{a as BulkDocumentStructureStatusEnumValues,c as DocumentStructureOverviewStatusEnumValues,e as DocumentStructureStatusEnumValues,g as EventTypeEnumValues,b as isBulkDocumentStructureStatusEnumValue,d as isDocumentStructureOverviewStatusEnumValue,f as isDocumentStructureStatusEnumValue,h as isEventTypeEnumValue}from'../chunk-OFG4XO3Z.mjs';import'../chunk-5PB4IBX4.mjs';//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkKHRCSPJC_js=require('../../chunk-KHRCSPJC.js'),d=require('fs');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var d__namespace=/*#__PURE__*/_interopNamespace(d);var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/values";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/tableextractor";}ENDPOINT;values(){return new o(this.restClient,this.ENDPOINT)}};var p="/api",c=class i{constructor(t,e){this.restClient=t;this.parentEndpoint=e;}static loginWithApiKey(t,e){if(!e)throw new Error("You need to supply an API key to login.");if(!t)throw new Error("You need to supply a server url to login.");return new i(new chunkKHRCSPJC_js.c(this.parseServerUrl(t),e),p)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new i(new chunkKHRCSPJC_js.c(this.parseServerUrl(t)),p)}static loginWithCredentials(t,e,r,a){return t=this.parseServerUrl(t),new i(new chunkKHRCSPJC_js.c(t,void 0,e,r,a),p)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let r=d__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(l=>l.length!==0).map(l=>l.split("=")),a=this.getValueOfInPropertiesFile("serverUrl",r),u=this.getValueOfInPropertiesFile("clientId",r),g=this.getValueOfInPropertiesFile("clientSecret",r),f=this.getValueOfInPropertiesFile("tokenUrl",r);return i.loginWithCredentials(a,u,g,f)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let r of e)if(r[0]===t)return r[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}tableextractor(){return new s(this.restClient,this.endpoint())}};exports.TableExtractorAPI=c;exports.TableextractorEndpoint=s;exports.ValuesEndpoint=o;//# sourceMappingURL=index.js.map
1
+ 'use strict';var chunkMUWVKP6I_js=require('../../chunk-MUWVKP6I.js'),d=require('fs');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var d__namespace=/*#__PURE__*/_interopNamespace(d);var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/values";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/tableextractor";}ENDPOINT;values(){return new o(this.restClient,this.ENDPOINT)}};var p="/api",c=class i{constructor(t,e){this.restClient=t;this.parentEndpoint=e;}static loginWithApiKey(t,e){if(!e)throw new Error("You need to supply an API key to login.");if(!t)throw new Error("You need to supply a server url to login.");return new i(new chunkMUWVKP6I_js.c(this.parseServerUrl(t),e),p)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new i(new chunkMUWVKP6I_js.c(this.parseServerUrl(t)),p)}static loginWithCredentials(t,e,r,a){return t=this.parseServerUrl(t),new i(new chunkMUWVKP6I_js.c(t,void 0,e,r,a),p)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let r=d__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(l=>l.length!==0).map(l=>l.split("=")),a=this.getValueOfInPropertiesFile("serverUrl",r),u=this.getValueOfInPropertiesFile("clientId",r),g=this.getValueOfInPropertiesFile("clientSecret",r),f=this.getValueOfInPropertiesFile("tokenUrl",r);return i.loginWithCredentials(a,u,g,f)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let r of e)if(r[0]===t)return r[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}tableextractor(){return new s(this.restClient,this.endpoint())}};exports.TableExtractorAPI=c;exports.TableextractorEndpoint=s;exports.ValuesEndpoint=o;//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import {c as c$1}from'../../chunk-PU2IRAN7.mjs';import*as d from'fs';var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/values";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/tableextractor";}ENDPOINT;values(){return new o(this.restClient,this.ENDPOINT)}};var p="/api",c=class i{constructor(t,e){this.restClient=t;this.parentEndpoint=e;}static loginWithApiKey(t,e){if(!e)throw new Error("You need to supply an API key to login.");if(!t)throw new Error("You need to supply a server url to login.");return new i(new c$1(this.parseServerUrl(t),e),p)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new i(new c$1(this.parseServerUrl(t)),p)}static loginWithCredentials(t,e,r,a){return t=this.parseServerUrl(t),new i(new c$1(t,void 0,e,r,a),p)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let r=d.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(l=>l.length!==0).map(l=>l.split("=")),a=this.getValueOfInPropertiesFile("serverUrl",r),u=this.getValueOfInPropertiesFile("clientId",r),g=this.getValueOfInPropertiesFile("clientSecret",r),f=this.getValueOfInPropertiesFile("tokenUrl",r);return i.loginWithCredentials(a,u,g,f)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let r of e)if(r[0]===t)return r[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}tableextractor(){return new s(this.restClient,this.endpoint())}};export{c as TableExtractorAPI,s as TableextractorEndpoint,o as ValuesEndpoint};//# sourceMappingURL=index.mjs.map
1
+ import {c as c$1}from'../../chunk-5PB4IBX4.mjs';import*as d from'fs';var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/values";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/tableextractor";}ENDPOINT;values(){return new o(this.restClient,this.ENDPOINT)}};var p="/api",c=class i{constructor(t,e){this.restClient=t;this.parentEndpoint=e;}static loginWithApiKey(t,e){if(!e)throw new Error("You need to supply an API key to login.");if(!t)throw new Error("You need to supply a server url to login.");return new i(new c$1(this.parseServerUrl(t),e),p)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new i(new c$1(this.parseServerUrl(t)),p)}static loginWithCredentials(t,e,r,a){return t=this.parseServerUrl(t),new i(new c$1(t,void 0,e,r,a),p)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let r=d.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(l=>l.length!==0).map(l=>l.split("=")),a=this.getValueOfInPropertiesFile("serverUrl",r),u=this.getValueOfInPropertiesFile("clientId",r),g=this.getValueOfInPropertiesFile("clientSecret",r),f=this.getValueOfInPropertiesFile("tokenUrl",r);return i.loginWithCredentials(a,u,g,f)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let r of e)if(r[0]===t)return r[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}tableextractor(){return new s(this.restClient,this.endpoint())}};export{c as TableExtractorAPI,s as TableextractorEndpoint,o as ValuesEndpoint};//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkXRW3IJJB_js=require('../../chunk-XRW3IJJB.js');require('../../chunk-KHRCSPJC.js');Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkXRW3IJJB_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkXRW3IJJB_js.d}});Object.defineProperty(exports,"LogEndpoint",{enumerable:true,get:function(){return chunkXRW3IJJB_js.a}});Object.defineProperty(exports,"TrackEndpoint",{enumerable:true,get:function(){return chunkXRW3IJJB_js.b}});Object.defineProperty(exports,"TrackingAPI",{enumerable:true,get:function(){return chunkXRW3IJJB_js.f}});Object.defineProperty(exports,"UitrackingEndpoint",{enumerable:true,get:function(){return chunkXRW3IJJB_js.e}});//# sourceMappingURL=index.js.map
1
+ 'use strict';var chunkUTBTTDZX_js=require('../../chunk-UTBTTDZX.js');require('../../chunk-MUWVKP6I.js');Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkUTBTTDZX_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkUTBTTDZX_js.d}});Object.defineProperty(exports,"LogEndpoint",{enumerable:true,get:function(){return chunkUTBTTDZX_js.a}});Object.defineProperty(exports,"TrackEndpoint",{enumerable:true,get:function(){return chunkUTBTTDZX_js.b}});Object.defineProperty(exports,"TrackingAPI",{enumerable:true,get:function(){return chunkUTBTTDZX_js.f}});Object.defineProperty(exports,"UitrackingEndpoint",{enumerable:true,get:function(){return chunkUTBTTDZX_js.e}});//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- export{c as DomainEndpoint,d as DomainsEndpoint,a as LogEndpoint,b as TrackEndpoint,f as TrackingAPI,e as UitrackingEndpoint}from'../../chunk-LBYB72RT.mjs';import'../../chunk-PU2IRAN7.mjs';//# sourceMappingURL=index.mjs.map
1
+ export{c as DomainEndpoint,d as DomainsEndpoint,a as LogEndpoint,b as TrackEndpoint,f as TrackingAPI,e as UitrackingEndpoint}from'../../chunk-FRZZWIQF.mjs';import'../../chunk-5PB4IBX4.mjs';//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkXRW3IJJB_js=require('../chunk-XRW3IJJB.js'),chunkJCDJ3B7Q_js=require('../chunk-JCDJ3B7Q.js');require('../chunk-KHRCSPJC.js');Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkXRW3IJJB_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkXRW3IJJB_js.d}});Object.defineProperty(exports,"LogEndpoint",{enumerable:true,get:function(){return chunkXRW3IJJB_js.a}});Object.defineProperty(exports,"TrackEndpoint",{enumerable:true,get:function(){return chunkXRW3IJJB_js.b}});Object.defineProperty(exports,"TrackingAPI",{enumerable:true,get:function(){return chunkXRW3IJJB_js.f}});Object.defineProperty(exports,"UitrackingEndpoint",{enumerable:true,get:function(){return chunkXRW3IJJB_js.e}});Object.defineProperty(exports,"LoggingLevelEnumValues",{enumerable:true,get:function(){return chunkJCDJ3B7Q_js.a}});Object.defineProperty(exports,"isLoggingLevelEnumValue",{enumerable:true,get:function(){return chunkJCDJ3B7Q_js.b}});//# sourceMappingURL=index.js.map
1
+ 'use strict';var chunkUTBTTDZX_js=require('../chunk-UTBTTDZX.js'),chunkJCDJ3B7Q_js=require('../chunk-JCDJ3B7Q.js');require('../chunk-MUWVKP6I.js');Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkUTBTTDZX_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkUTBTTDZX_js.d}});Object.defineProperty(exports,"LogEndpoint",{enumerable:true,get:function(){return chunkUTBTTDZX_js.a}});Object.defineProperty(exports,"TrackEndpoint",{enumerable:true,get:function(){return chunkUTBTTDZX_js.b}});Object.defineProperty(exports,"TrackingAPI",{enumerable:true,get:function(){return chunkUTBTTDZX_js.f}});Object.defineProperty(exports,"UitrackingEndpoint",{enumerable:true,get:function(){return chunkUTBTTDZX_js.e}});Object.defineProperty(exports,"LoggingLevelEnumValues",{enumerable:true,get:function(){return chunkJCDJ3B7Q_js.a}});Object.defineProperty(exports,"isLoggingLevelEnumValue",{enumerable:true,get:function(){return chunkJCDJ3B7Q_js.b}});//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map