@semantha/product-sdk 10.1.1 → 10.4.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.
- package/dist/chunk-BE73RDIS.mjs.map +1 -1
- package/dist/chunk-CA66WME5.js.map +1 -1
- package/dist/chunk-CS7BBFY4.mjs.map +1 -1
- package/dist/chunk-DURTIKAP.mjs.map +1 -1
- package/dist/chunk-ECNCZBI6.js.map +1 -1
- package/dist/chunk-J6MTVURL.js.map +1 -1
- package/dist/chunk-JCDJ3B7Q.js.map +1 -1
- package/dist/chunk-KFGKXHFV.js.map +1 -1
- package/dist/chunk-OFG4XO3Z.mjs.map +1 -1
- package/dist/chunk-OHHE5EHF.mjs.map +1 -1
- package/dist/chunk-SJNRBLAC.mjs.map +1 -1
- package/dist/chunk-WFUCUDFC.js.map +1 -1
- package/dist/chunk-YXKZIGLW.mjs.map +1 -1
- package/dist/chunk-ZSFNB534.js.map +1 -1
- package/dist/requirements/api/index.d.mts +71 -38
- package/dist/requirements/api/index.d.ts +71 -38
- package/dist/requirements/api/index.js +1 -1
- package/dist/requirements/api/index.js.map +1 -1
- package/dist/requirements/api/index.mjs +1 -1
- package/dist/requirements/api/index.mjs.map +1 -1
- package/dist/requirements/model/index.d.mts +80 -66
- package/dist/requirements/model/index.d.ts +80 -66
- package/dist/requirements/model/index.js +1 -1
- package/dist/requirements/model/index.js.map +1 -1
- package/dist/requirements/model/index.mjs +1 -1
- package/dist/requirements/model/index.mjs.map +1 -1
- package/dist/table-extractor/api/index.js.map +1 -1
- package/dist/table-extractor/api/index.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -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":"0DAUaA,IAAAA,CAAAA,CAAN,KAAkB,CAGvB,WAAA,CACmBC,EACAC,CACjB,CAAA,CAFiB,IAAAD,CAAAA,UAAAA,CAAAA,CAAAA,CACA,IAAAC,CAAAA,cAAAA,CAAAA,CAAAA,CAEjB,KAAK,QAAW,CAAA,IAAA,CAAK,eAAiB,OACxC,CAPiB,SAYjB,MAAM,IAAA,CACJC,CACe,CAAA,CACf,OACE,CAAA,MAAM,KAAK,UAAW,CAAA,IAAA,CACpB,KAAK,QACL,CAAA,GACA,IAAK,CAAA,UAAA,CAAW,QAAuB,CAAA,kBAAA,CAAA,CACvCA,CACF,CAAA,EACA,SACJ,CACF,EC1BO,IAAMC,CAAN,CAAA,KAAoB,CAGzB,WACmBH,CAAAA,CAAAA,CACAC,CACjB,CAAA,CAFiB,IAAAD,CAAAA,UAAAA,CAAAA,CAAAA,CACA,oBAAAC,CAEjB,CAAA,IAAA,CAAK,SAAW,IAAK,CAAA,cAAA,CAAiB,SACxC,CAPiB,QAAA,CAYjB,MAAM,KAAA,CACJC,CACe,CAAA,CACf,QACI,MAAM,IAAA,CAAK,WAAW,KACpB,CAAA,IAAA,CAAK,SACLA,CACF,CAAA,EACF,OAAQ,EACZ,CACF,MCtBaE,CAAN,CAAA,KAAqB,CAG1B,WACmBJ,CAAAA,CAAAA,CACAC,EACAI,CACjB,CAAA,CAHiB,IAAAL,CAAAA,UAAAA,CAAAA,CAAAA,CACA,IAAAC,CAAAA,cAAAA,CAAAA,CAAAA,CACA,gBAAAI,CAEjB,CAAA,IAAA,CAAK,QAAW,CAAA,IAAA,CAAK,cAAiB,CAAA,CAAA,SAAA,EAAiB,KAAK,UAAU,CAAA,EACxE,CARi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A,CAAG,EAAE,CAE/BA,CAAAA,CAAAA,CAAAA,CAAU,QAAS,CAAA,sBAAsB,CAC3CA,CAAAA,CAAAA,CAAYA,EAAU,OAAQ,CAAA,sBAAA,CAAwB,oBAAoB,CAAA,CAChEA,CAAU,CAAA,QAAA,CAAS,oBAAoB,CACjDA,GAAAA,CAAAA,EAAa,sBAERA,CACT,CAEA,OAAe,0BAA2BS,CAAAA,CAAAA,CAAmBF,CAA2B,CAAA,CACtF,IAAWC,IAAAA,CAAAA,IAAQD,EACjB,GAAIC,CAAAA,CAAK,CAAC,CAAMC,GAAAA,CAAAA,CACd,OAAOD,CAAK,CAAA,CAAC,CAAE,CAAA,OAAA,CAAQ,KAAO,CAAA,GAAG,EAGrC,MAAM,KAAA,CAAM,iCAAiCC,CAAS,CAAA,CAAA,CAAG,CAC3D,CAEA,QAAA,EAAmB,CACjB,OAAO,IAAK,CAAA,cACd,CAEA,UAAiC,EAAA,CAC/B,OAAO,IAAIb,CAAmB,CAAA,IAAA,CAAK,WAAY,IAAK,CAAA,QAAA,EAAU,CAChE,CAEF","file":"chunk-SJNRBLAC.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 * 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":"0DAUO,IAAMA,CAAAA,CAAN,KAAkB,CAGvB,WAAA,CACmBC,EACAC,CAAAA,CACjB,CAFiB,IAAA,CAAA,UAAA,CAAAD,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,CAAAA,CAEjB,KAAK,QAAA,CAAW,IAAA,CAAK,eAAiB,OACxC,CAPiB,SAYjB,MAAM,IAAA,CACJC,CAAAA,CACe,CACf,OAAA,CACE,MAAM,KAAK,UAAA,CAAW,IAAA,CACpB,KAAK,QAAA,CACL,GACA,IAAA,CAAK,UAAA,CAAW,QAAA,CAAA,kBAAuB,CAAA,CACvCA,CACF,CAAA,EACA,SACJ,CACF,EC1BO,IAAMC,CAAAA,CAAN,KAAoB,CAGzB,WAAA,CACmBH,CAAAA,CACAC,CAAAA,CACjB,CAFiB,IAAA,CAAA,UAAA,CAAAD,CAAAA,CACA,oBAAAC,CAAAA,CAEjB,IAAA,CAAK,SAAW,IAAA,CAAK,cAAA,CAAiB,SACxC,CAPiB,QAAA,CAYjB,MAAM,KAAA,CACJC,CAAAA,CACe,CACf,QACI,MAAM,IAAA,CAAK,WAAW,KAAA,CACpB,IAAA,CAAK,SACLA,CACF,CAAA,EACF,OAAA,EACJ,CACF,MCtBaE,CAAAA,CAAN,KAAqB,CAG1B,WAAA,CACmBJ,CAAAA,CACAC,EACAI,CAAAA,CACjB,CAHiB,IAAA,CAAA,UAAA,CAAAL,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,CAAAA,CACA,gBAAAI,CAAAA,CAEjB,IAAA,CAAK,QAAA,CAAW,IAAA,CAAK,cAAA,CAAiB,CAAA,SAAA,EAAiB,KAAK,UAAU,CAAA,EACxE,CARiB,QAAA,CAUjB,GAAA,EAAmB,CACjB,OAAO,IAAIN,CAAAA,CAAY,KAAK,UAAA,CAAY,IAAA,CAAK,QAAQ,CACvD,CAEA,KAA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wB,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,EACjB,GAAIC,CAAAA,CAAK,CAAC,CAAA,GAAMC,CAAAA,CACd,OAAOD,CAAAA,CAAK,CAAC,CAAA,CAAE,OAAA,CAAQ,KAAA,CAAO,GAAG,EAGrC,MAAM,KAAA,CAAM,iCAAiCC,CAAS,CAAA,CAAA,CAAG,CAC3D,CAEA,QAAA,EAAmB,CACjB,OAAO,IAAA,CAAK,cACd,CAEA,UAAA,EAAiC,CAC/B,OAAO,IAAIb,CAAAA,CAAmB,IAAA,CAAK,WAAY,IAAA,CAAK,QAAA,EAAU,CAChE,CAEF","file":"chunk-SJNRBLAC.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 * 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 +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,CAAN,CAAA,KAAsB,CAC3B,WAA6BC,CAAAA,CAAAA,CAAqC,CAArC,IAAA,CAAA,QAAA,CAAAA,EAAsC,CAEnE,MAAM,OAAsB,EAAA,CAC1B,OAAQ,CAAA,MAAM,IAAK,CAAA,QAAA,EAAU,IAC/B,CAEA,M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ACL,IAAMF,CAAAA,CAAa,MAAM,IAAA,CAAK,sBAAuB,EAAA,CACrDE,CAAU,CAAA,CAAE,GAAGA,CAAAA,CAAS,GAAGF,CAAW,EACxC,CACA,OAAO,IAAIlB,CAAAA,CAAgBc,kBAAM,CAAA,IAAA,CAAQ,IAAK,CAAA,SAAA,CAAYE,CAAKH,CAAAA,CAAAA,CAAM,CAAE,MAAA,CAAAM,EAAQ,OAAAC,CAAAA,CAAAA,CAAS,YAAAC,CAAAA,CAAa,CAAC,CAAC,CACzG,CAEA,MAAM,MAAA,CAAOL,CAAaH,CAAAA,CAAAA,CAAyC,CACjE,OAAO,KAAK,OAAc,CAAA,QAAA,CAAUG,CAAK,CAAA,CAAE,IAAAH,CAAAA,CAAK,CAAC,CACnD,CAEA,MAAM,KAASG,CAAAA,CAAAA,CAAaH,CAAsC,CAAA,CAChE,OAAO,IAAK,CAAA,OAAA,CAAW,OAASG,CAAAA,CAAAA,CAAK,CAAE,IAAA,CAAAH,CAAK,CAAC,CAC/C,CAEA,MAAM,GAAA,CAAOG,CAAaH,CAAAA,CAAAA,CAAqC,CAC7D,OAAO,IAAA,CAAK,OAAW,CAAA,KAAA,CAAOG,CAAK,CAAA,CAAE,IAAAH,CAAAA,CAAK,CAAC,CAC7C,CAEA,QAAA,CAASS,CAA2BC,CAAAA,CAAAA,CAAiD,CACnF,OAAIA,CAAAA,CACK,CAAE,MAAA,CAAQD,CAAgB,CAAA,cAAA,CAAgBC,CAAY,CAAA,CAExD,CAAE,MAAA,CAAQD,CAAe,CAClC,CACF","file":"chunk-WFUCUDFC.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}\n\nexport class RestClient {\n // in seconds\n private static readonly LEEWAY = 30;\n\n private expireTime: number;\n private accessToken: string;\n\n constructor(\n private readonly serverUrl: string,\n private readonly apiKey?: string,\n private readonly clientId?: string,\n private readonly client_secret?: string,\n private readonly tokenUrl?: string\n ) {\n this.expireTime = 0.0;\n this.accessToken = '';\n }\n\n async buildHeadersForJsonRequest(): Promise<{ [key: string]: string }> {\n return {\n Accept: 'application/json',\n Authorization: `Bearer ${await this.getToken()}`\n };\n }\n\n async buildHeadersForRequest(): Promise<{ [key: string]: string }> {\n return {\n Authorization: `Bearer ${await this.getToken()}`\n };\n }\n\n async getToken(): Promise<string> {\n if (this.apiKey) {\n return this.apiKey;\n }\n if (\n this.clientId &&\n this.client_secret &&\n this.tokenUrl &&\n (this.accessToken == '' || this.expireTime < performance.now())\n ) {\n const data = {\n grant_type: 'client_credentials',\n client_id: this.clientId,\n client_secret: this.client_secret,\n scope: 'openid'\n };\n const response = await axios.post(this.tokenUrl, data, {\n headers: { accept: 'application/json', 'content-type': 'application/x-www-form-urlencoded' }\n });\n if (response.status >= axios.HttpStatusCode.BadRequest) {\n // example for error response: {\"error\":\"invalid_client\",\"error_description\":\"Invalid client or Invalid client credentials\"}\n // we have no token -> this leads to a permission error\n return '';\n }\n this.accessToken = response.data['id_token'] ?? response.data['access_token'];\n this.expireTime = performance.now() + (response.data['expires_in'] - RestClient.LEEWAY);\n }\n return this.accessToken;\n }\n\n private async request<R>(\n method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE',\n url: string,\n 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>(url: string, params?: any, headers?: { [key: string]: string }, data?: any, responseType: ResponseType = 'json'): 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): Promise<RestResponse<void>> {\n return this.request<void>('DELETE', url, { data });\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
|
+
{"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,KAAK,QAAA,CACrCC,CAAAA,CAAqBD,CAAAA,EAAU,OAAA,CAAQ,qBAAqB,CAAA,CAC9DE,CAAAA,CAAW,MAAA,CACf,GAAID,CAAAA,CAAoB,CACtB,IAAME,CAAAA,CAAQF,CAAAA,CAAmB,MAAM,sBAAsB,CAAA,CACzDE,CAAAA,EAASA,CAAAA,CAAM,CAAC,CAAA,GAClBD,CAAAA,CAAWC,CAAAA,CAAM,CAAC,CAAA,EAEtB,CACA,OAAO,IAAI,IAAA,CAAK,CAACH,CAAAA,CAAS,IAAI,CAAA,CAAGE,CAAQ,CAC3C,CAEA,MAAM,aAAA,EAAiC,CACrC,OAAA,CAAQ,MAAM,IAAA,CAAK,QAAA,EAAU,MAC/B,CAEA,MAAM,aAAA,EAAiC,CACrC,OAAA,CAAQ,MAAM,IAAA,CAAK,QAAA,EAAU,UAC/B,CACF,EC1BO,IAAKE,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,KAAO,kBAAA,CACPA,CAAAA,CAAA,IAAA,CAAO,mEAAA,CACPA,CAAAA,CAAA,GAAA,CAAM,iBAAA,CACNA,CAAAA,CAAA,IAAA,CAAO,yEAAA,CACPA,CAAAA,CAAA,GAAA,CAAM,iBAAA,CACNA,CAAAA,CAAA,OAAS,oBAAA,CACTA,CAAAA,CAAA,GAAA,CAAM,WAAA,CACNA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AAY,CAAA,CAExD,CAAE,MAAA,CAAQD,CAAe,CAClC,CACF","file":"chunk-WFUCUDFC.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}\n\nexport class RestClient {\n // in seconds\n private static readonly LEEWAY = 30;\n\n private expireTime: number;\n private accessToken: string;\n\n constructor(\n private readonly serverUrl: string,\n private readonly apiKey?: string,\n private readonly clientId?: string,\n private readonly client_secret?: string,\n private readonly tokenUrl?: string\n ) {\n this.expireTime = 0.0;\n this.accessToken = '';\n }\n\n async buildHeadersForJsonRequest(): Promise<{ [key: string]: string }> {\n return {\n Accept: 'application/json',\n Authorization: `Bearer ${await this.getToken()}`\n };\n }\n\n async buildHeadersForRequest(): Promise<{ [key: string]: string }> {\n return {\n Authorization: `Bearer ${await this.getToken()}`\n };\n }\n\n async getToken(): Promise<string> {\n if (this.apiKey) {\n return this.apiKey;\n }\n if (\n this.clientId &&\n this.client_secret &&\n this.tokenUrl &&\n (this.accessToken == '' || this.expireTime < performance.now())\n ) {\n const data = {\n grant_type: 'client_credentials',\n client_id: this.clientId,\n client_secret: this.client_secret,\n scope: 'openid'\n };\n const response = await axios.post(this.tokenUrl, data, {\n headers: { accept: 'application/json', 'content-type': 'application/x-www-form-urlencoded' }\n });\n if (response.status >= axios.HttpStatusCode.BadRequest) {\n // example for error response: {\"error\":\"invalid_client\",\"error_description\":\"Invalid client or Invalid client credentials\"}\n // we have no token -> this leads to a permission error\n return '';\n }\n this.accessToken = response.data['id_token'] ?? response.data['access_token'];\n this.expireTime = performance.now() + (response.data['expires_in'] - RestClient.LEEWAY);\n }\n return this.accessToken;\n }\n\n private async request<R>(\n method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE',\n url: string,\n 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>(url: string, params?: any, headers?: { [key: string]: string }, data?: any, responseType: ResponseType = 'json'): 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): Promise<RestResponse<void>> {\n return this.request<void>('DELETE', url, { data });\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 +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":"0DAUaA,IAAAA,CAAAA,CAAN,KAAkB,CAGvB,WAAA,CACmBC,EACAC,CACAC,CAAAA,CAAAA,CACjB,CAHiB,IAAA,CAAA,UAAA,CAAAF,CACA,CAAA,IAAA,CAAA,cAAA,CAAAC,EACA,IAAAC,CAAAA,EAAAA,CAAAA,CAAAA,CAEjB,IAAK,CAAA,QAAA,CAAW,IAAK,CAAA,cAAA,CAAiB,UAAe,IAAK,CAAA,EAAE,CAC9D,EAAA,CARiB,QAUjB,CAAA,MAAM,KAAoB,CACxB,OAAA,CACE,MAAM,IAAK,CAAA,UAAA,CAAW,IACpB,IAAK,CAAA,QAAA,CACL,EAAC,CACD,IAAK,CAAA,UAAA,CAAW,2BAAuB,CACzC,CAAA,EACA,OAAQ,EACZ,CACF,MCnBaC,CAAN,CAAA,KAAoB,CAGzB,WAAA,CACmBH,CACAC,CAAAA,CAAAA,CACjB,CAFiB,IAAA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AO,IAAK,CAAA,cACd,CAEA,OAA2B,EAAA,CACzB,OAAO,IAAIb,CAAgB,CAAA,IAAA,CAAK,WAAY,IAAK,CAAA,QAAA,EAAU,CAC7D,CAEF","file":"chunk-YXKZIGLW.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 * 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,EACAC,CAAAA,CACAC,CAAAA,CACjB,CAHiB,IAAA,CAAA,UAAA,CAAAF,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,EACA,IAAA,CAAA,EAAA,CAAAC,CAAAA,CAEjB,IAAA,CAAK,QAAA,CAAW,IAAA,CAAK,cAAA,CAAiB,UAAe,IAA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,CAAmBF,CAAAA,CAA2B,CACtF,QAAWC,CAAAA,IAAQD,CAAAA,CACjB,GAAIC,CAAAA,CAAK,CAAC,CAAA,GAAMC,EACd,OAAOD,CAAAA,CAAK,CAAC,CAAA,CAAE,OAAA,CAAQ,KAAA,CAAO,GAAG,CAAA,CAGrC,MAAM,KAAA,CAAM,CAAA,8BAAA,EAAiCC,CAAS,CAAA,CAAA,CAAG,CAC3D,CAEA,QAAA,EAAmB,CACjB,OAAO,IAAA,CAAK,cACd,CAEA,OAAA,EAA2B,CACzB,OAAO,IAAIb,CAAAA,CAAgB,IAAA,CAAK,WAAY,IAAA,CAAK,QAAA,EAAU,CAC7D,CAEF","file":"chunk-YXKZIGLW.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 * 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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../semantha-product-sdk/file-box/model/fileTypeEnum.ts"],"names":["FileTypeEnumValues","isFileTypeEnumValue","value"],"mappings":"aAKO,IAAMA,CAAqB,
|
|
1
|
+
{"version":3,"sources":["../semantha-product-sdk/file-box/model/fileTypeEnum.ts"],"names":["FileTypeEnumValues","isFileTypeEnumValue","value"],"mappings":"aAKO,IAAMA,CAAAA,CAAqB,CAChC,OAAA,CACA,WACF,EAGO,SAASC,CAAAA,CAAoBC,CAAAA,CAAmC,CACrE,OAAOF,CAAAA,CAAmB,QAAA,CAASE,CAAK,CAC1C","file":"chunk-ZSFNB534.js","sourcesContent":["/**\n * @author semantha\n *\n * This is a generated file do not change manually!\n */\nexport const FileTypeEnumValues = [\n 'INPUT',\n 'REFERENCE'\n] as const;\nexport type FileTypeEnum = (typeof FileTypeEnumValues)[number];\n\nexport function isFileTypeEnumValue(value: any): value is FileTypeEnum {\n return FileTypeEnumValues.includes(value);\n}\n\n"]}
|
|
@@ -1,7 +1,70 @@
|
|
|
1
1
|
import { RestClient, RestResponse } from '../../rest/index.mjs';
|
|
2
|
-
import { AnalysesReport, Analysis, FormDataContentDisposition, AnalysisInput, AnalysisCreation,
|
|
2
|
+
import { PromptResult, AiTaskInput, AnalysesReport, Analysis, FormDataContentDisposition, AnalysisInput, AnalysisCreation, AnalysisResultOverview, AnalysisResultsStatsResponseContainer, AnalysisResultsResponseContainer, Entity, Classification, AnalysisResultComment, CurrentUser, Evaluation, ExcelTemplateDetails, ModeEnum, ExtendedReference, AnalysisResult } from '../model/index.mjs';
|
|
3
3
|
import 'axios';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @author semantha
|
|
7
|
+
*
|
|
8
|
+
* Class to access resource "/api/requirements/domains/{domainname}/aitasks/{analysisid}/results/export"
|
|
9
|
+
* This is a generated file do not change manually!
|
|
10
|
+
*/
|
|
11
|
+
declare class AitasksresultsExportEndpoint {
|
|
12
|
+
private readonly restClient;
|
|
13
|
+
private readonly parentEndpoint;
|
|
14
|
+
private readonly ENDPOINT;
|
|
15
|
+
constructor(restClient: RestClient, parentEndpoint: string);
|
|
16
|
+
postAsXlsx(params?: {
|
|
17
|
+
templateid?: string;
|
|
18
|
+
}): Promise<Blob>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @author semantha
|
|
23
|
+
*
|
|
24
|
+
* Class to access resource "/api/requirements/domains/{domainname}/aitasks/{analysisid}/results"
|
|
25
|
+
* This is a generated file do not change manually!
|
|
26
|
+
*/
|
|
27
|
+
declare class AitasksResultsEndpoint {
|
|
28
|
+
private readonly restClient;
|
|
29
|
+
private readonly parentEndpoint;
|
|
30
|
+
private readonly ENDPOINT;
|
|
31
|
+
constructor(restClient: RestClient, parentEndpoint: string);
|
|
32
|
+
export(): AitasksresultsExportEndpoint;
|
|
33
|
+
get(): Promise<PromptResult[]>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @author semantha
|
|
38
|
+
*
|
|
39
|
+
* Class to access resource "/api/requirements/domains/{domainname}/aitasks/{analysisid}"
|
|
40
|
+
* This is a generated file do not change manually!
|
|
41
|
+
*/
|
|
42
|
+
declare class AitaskEndpoint {
|
|
43
|
+
private readonly restClient;
|
|
44
|
+
private readonly parentEndpoint;
|
|
45
|
+
private readonly analysisid;
|
|
46
|
+
private readonly ENDPOINT;
|
|
47
|
+
constructor(restClient: RestClient, parentEndpoint: string, analysisid: string);
|
|
48
|
+
results(): AitasksResultsEndpoint;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @author semantha
|
|
53
|
+
*
|
|
54
|
+
* Class to access resource "/api/requirements/domains/{domainname}/aitasks"
|
|
55
|
+
* This is a generated file do not change manually!
|
|
56
|
+
*/
|
|
57
|
+
declare class AitasksEndpoint {
|
|
58
|
+
private readonly restClient;
|
|
59
|
+
private readonly parentEndpoint;
|
|
60
|
+
private readonly ENDPOINT;
|
|
61
|
+
constructor(restClient: RestClient, parentEndpoint: string);
|
|
62
|
+
/**
|
|
63
|
+
* @param body AiTaskInput? -
|
|
64
|
+
*/
|
|
65
|
+
post(body?: AiTaskInput): Promise<void>;
|
|
66
|
+
}
|
|
67
|
+
|
|
5
68
|
/**
|
|
6
69
|
* @author semantha
|
|
7
70
|
*
|
|
@@ -55,8 +118,6 @@ declare class AnalysesEndpoint {
|
|
|
55
118
|
* @param goodmatchesthreshold number? -
|
|
56
119
|
* @param matchallreferences boolean? -
|
|
57
120
|
* @param showdocscore boolean? -
|
|
58
|
-
* @param type string? -
|
|
59
|
-
* @param promptid string? -
|
|
60
121
|
*/
|
|
61
122
|
post(data: {
|
|
62
123
|
file?: FormDataContentDisposition;
|
|
@@ -70,8 +131,6 @@ declare class AnalysesEndpoint {
|
|
|
70
131
|
goodmatchesthreshold?: number;
|
|
71
132
|
matchallreferences?: boolean;
|
|
72
133
|
showdocscore?: boolean;
|
|
73
|
-
type?: string;
|
|
74
|
-
promptid?: string;
|
|
75
134
|
}): Promise<void>;
|
|
76
135
|
/**
|
|
77
136
|
* @param body AnalysisCreation? -
|
|
@@ -79,37 +138,6 @@ declare class AnalysesEndpoint {
|
|
|
79
138
|
postJson(body?: AnalysisCreation): Promise<void>;
|
|
80
139
|
}
|
|
81
140
|
|
|
82
|
-
/**
|
|
83
|
-
* @author semantha
|
|
84
|
-
*
|
|
85
|
-
* Class to access resource "/api/requirements/domains/{domainname}/analyses/{analysisid}/results/answers/export"
|
|
86
|
-
* This is a generated file do not change manually!
|
|
87
|
-
*/
|
|
88
|
-
declare class AnalysisExportEndpoint {
|
|
89
|
-
private readonly restClient;
|
|
90
|
-
private readonly parentEndpoint;
|
|
91
|
-
private readonly ENDPOINT;
|
|
92
|
-
constructor(restClient: RestClient, parentEndpoint: string);
|
|
93
|
-
postAsXlsx(params?: {
|
|
94
|
-
templateid?: string;
|
|
95
|
-
}): Promise<Blob>;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @author semantha
|
|
100
|
-
*
|
|
101
|
-
* Class to access resource "/api/requirements/domains/{domainname}/analyses/{analysisid}/results/answers"
|
|
102
|
-
* This is a generated file do not change manually!
|
|
103
|
-
*/
|
|
104
|
-
declare class AnalysisAnswersEndpoint {
|
|
105
|
-
private readonly restClient;
|
|
106
|
-
private readonly parentEndpoint;
|
|
107
|
-
private readonly ENDPOINT;
|
|
108
|
-
constructor(restClient: RestClient, parentEndpoint: string);
|
|
109
|
-
export(): AnalysisExportEndpoint;
|
|
110
|
-
get(): Promise<PromptResult[]>;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
141
|
/**
|
|
114
142
|
* @author semantha
|
|
115
143
|
*
|
|
@@ -121,7 +149,6 @@ declare class AnalysisResultsEndpoint {
|
|
|
121
149
|
private readonly parentEndpoint;
|
|
122
150
|
private readonly ENDPOINT;
|
|
123
151
|
constructor(restClient: RestClient, parentEndpoint: string);
|
|
124
|
-
answers(): AnalysisAnswersEndpoint;
|
|
125
152
|
get(params?: {
|
|
126
153
|
withdetails?: boolean;
|
|
127
154
|
}): Promise<AnalysisResultOverview[]>;
|
|
@@ -147,6 +174,8 @@ declare class StatsEndpoint {
|
|
|
147
174
|
classifications?: string;
|
|
148
175
|
additionaldataname?: string;
|
|
149
176
|
additionaldatavalues?: string;
|
|
177
|
+
samescorematches?: boolean;
|
|
178
|
+
sort?: string;
|
|
150
179
|
}): Promise<AnalysisResultsStatsResponseContainer>;
|
|
151
180
|
}
|
|
152
181
|
|
|
@@ -171,6 +200,8 @@ declare class PagedresultsEndpoint {
|
|
|
171
200
|
classifications?: string;
|
|
172
201
|
additionaldataname?: string;
|
|
173
202
|
additionaldatavalues?: string;
|
|
203
|
+
samescorematches?: boolean;
|
|
204
|
+
sort?: string;
|
|
174
205
|
limit: number;
|
|
175
206
|
offset: number;
|
|
176
207
|
}): Promise<AnalysisResultsResponseContainer>;
|
|
@@ -473,6 +504,8 @@ declare class DomainEndpoint {
|
|
|
473
504
|
private readonly domainname;
|
|
474
505
|
private readonly ENDPOINT;
|
|
475
506
|
constructor(restClient: RestClient, parentEndpoint: string, domainname: string);
|
|
507
|
+
aitasks(): AitasksEndpoint;
|
|
508
|
+
aitasks(analysisid: string): AitaskEndpoint;
|
|
476
509
|
analyses(): AnalysesEndpoint;
|
|
477
510
|
analyses(analysisid: string): AnalysisEndpoint;
|
|
478
511
|
bulk(): BulkEndpoint;
|
|
@@ -565,4 +598,4 @@ declare class RequirementsAPI {
|
|
|
565
598
|
requirements(): RequirementsEndpoint;
|
|
566
599
|
}
|
|
567
600
|
|
|
568
|
-
export {
|
|
601
|
+
export { AitaskEndpoint, AitasksEndpoint, AitasksResultsEndpoint, AitasksresultsExportEndpoint, AnalysesEndpoint, AnalysisEndpoint, AnalysisResultsEndpoint, BulkEndpoint, ClassificationsEndpoint, CommentsEndpoint, CurrentuserEndpoint, DomainEndpoint, DomainsEndpoint, EvaluationEndpoint, EvaluationsEndpoint, ExceltemplateEndpoint, ExceltemplatesEndpoint, ExportEndpoint, NewEndpoint, PagedresultsEndpoint, ReferencesEndpoint, ReportEndpoint, RequirementsAPI, RequirementsEndpoint, ResultEndpoint, ResultsEndpoint, RolesEndpoint, StatsEndpoint };
|
|
@@ -1,7 +1,70 @@
|
|
|
1
1
|
import { RestClient, RestResponse } from '../../rest/index.js';
|
|
2
|
-
import { AnalysesReport, Analysis, FormDataContentDisposition, AnalysisInput, AnalysisCreation,
|
|
2
|
+
import { PromptResult, AiTaskInput, AnalysesReport, Analysis, FormDataContentDisposition, AnalysisInput, AnalysisCreation, AnalysisResultOverview, AnalysisResultsStatsResponseContainer, AnalysisResultsResponseContainer, Entity, Classification, AnalysisResultComment, CurrentUser, Evaluation, ExcelTemplateDetails, ModeEnum, ExtendedReference, AnalysisResult } from '../model/index.js';
|
|
3
3
|
import 'axios';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @author semantha
|
|
7
|
+
*
|
|
8
|
+
* Class to access resource "/api/requirements/domains/{domainname}/aitasks/{analysisid}/results/export"
|
|
9
|
+
* This is a generated file do not change manually!
|
|
10
|
+
*/
|
|
11
|
+
declare class AitasksresultsExportEndpoint {
|
|
12
|
+
private readonly restClient;
|
|
13
|
+
private readonly parentEndpoint;
|
|
14
|
+
private readonly ENDPOINT;
|
|
15
|
+
constructor(restClient: RestClient, parentEndpoint: string);
|
|
16
|
+
postAsXlsx(params?: {
|
|
17
|
+
templateid?: string;
|
|
18
|
+
}): Promise<Blob>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @author semantha
|
|
23
|
+
*
|
|
24
|
+
* Class to access resource "/api/requirements/domains/{domainname}/aitasks/{analysisid}/results"
|
|
25
|
+
* This is a generated file do not change manually!
|
|
26
|
+
*/
|
|
27
|
+
declare class AitasksResultsEndpoint {
|
|
28
|
+
private readonly restClient;
|
|
29
|
+
private readonly parentEndpoint;
|
|
30
|
+
private readonly ENDPOINT;
|
|
31
|
+
constructor(restClient: RestClient, parentEndpoint: string);
|
|
32
|
+
export(): AitasksresultsExportEndpoint;
|
|
33
|
+
get(): Promise<PromptResult[]>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @author semantha
|
|
38
|
+
*
|
|
39
|
+
* Class to access resource "/api/requirements/domains/{domainname}/aitasks/{analysisid}"
|
|
40
|
+
* This is a generated file do not change manually!
|
|
41
|
+
*/
|
|
42
|
+
declare class AitaskEndpoint {
|
|
43
|
+
private readonly restClient;
|
|
44
|
+
private readonly parentEndpoint;
|
|
45
|
+
private readonly analysisid;
|
|
46
|
+
private readonly ENDPOINT;
|
|
47
|
+
constructor(restClient: RestClient, parentEndpoint: string, analysisid: string);
|
|
48
|
+
results(): AitasksResultsEndpoint;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @author semantha
|
|
53
|
+
*
|
|
54
|
+
* Class to access resource "/api/requirements/domains/{domainname}/aitasks"
|
|
55
|
+
* This is a generated file do not change manually!
|
|
56
|
+
*/
|
|
57
|
+
declare class AitasksEndpoint {
|
|
58
|
+
private readonly restClient;
|
|
59
|
+
private readonly parentEndpoint;
|
|
60
|
+
private readonly ENDPOINT;
|
|
61
|
+
constructor(restClient: RestClient, parentEndpoint: string);
|
|
62
|
+
/**
|
|
63
|
+
* @param body AiTaskInput? -
|
|
64
|
+
*/
|
|
65
|
+
post(body?: AiTaskInput): Promise<void>;
|
|
66
|
+
}
|
|
67
|
+
|
|
5
68
|
/**
|
|
6
69
|
* @author semantha
|
|
7
70
|
*
|
|
@@ -55,8 +118,6 @@ declare class AnalysesEndpoint {
|
|
|
55
118
|
* @param goodmatchesthreshold number? -
|
|
56
119
|
* @param matchallreferences boolean? -
|
|
57
120
|
* @param showdocscore boolean? -
|
|
58
|
-
* @param type string? -
|
|
59
|
-
* @param promptid string? -
|
|
60
121
|
*/
|
|
61
122
|
post(data: {
|
|
62
123
|
file?: FormDataContentDisposition;
|
|
@@ -70,8 +131,6 @@ declare class AnalysesEndpoint {
|
|
|
70
131
|
goodmatchesthreshold?: number;
|
|
71
132
|
matchallreferences?: boolean;
|
|
72
133
|
showdocscore?: boolean;
|
|
73
|
-
type?: string;
|
|
74
|
-
promptid?: string;
|
|
75
134
|
}): Promise<void>;
|
|
76
135
|
/**
|
|
77
136
|
* @param body AnalysisCreation? -
|
|
@@ -79,37 +138,6 @@ declare class AnalysesEndpoint {
|
|
|
79
138
|
postJson(body?: AnalysisCreation): Promise<void>;
|
|
80
139
|
}
|
|
81
140
|
|
|
82
|
-
/**
|
|
83
|
-
* @author semantha
|
|
84
|
-
*
|
|
85
|
-
* Class to access resource "/api/requirements/domains/{domainname}/analyses/{analysisid}/results/answers/export"
|
|
86
|
-
* This is a generated file do not change manually!
|
|
87
|
-
*/
|
|
88
|
-
declare class AnalysisExportEndpoint {
|
|
89
|
-
private readonly restClient;
|
|
90
|
-
private readonly parentEndpoint;
|
|
91
|
-
private readonly ENDPOINT;
|
|
92
|
-
constructor(restClient: RestClient, parentEndpoint: string);
|
|
93
|
-
postAsXlsx(params?: {
|
|
94
|
-
templateid?: string;
|
|
95
|
-
}): Promise<Blob>;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @author semantha
|
|
100
|
-
*
|
|
101
|
-
* Class to access resource "/api/requirements/domains/{domainname}/analyses/{analysisid}/results/answers"
|
|
102
|
-
* This is a generated file do not change manually!
|
|
103
|
-
*/
|
|
104
|
-
declare class AnalysisAnswersEndpoint {
|
|
105
|
-
private readonly restClient;
|
|
106
|
-
private readonly parentEndpoint;
|
|
107
|
-
private readonly ENDPOINT;
|
|
108
|
-
constructor(restClient: RestClient, parentEndpoint: string);
|
|
109
|
-
export(): AnalysisExportEndpoint;
|
|
110
|
-
get(): Promise<PromptResult[]>;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
141
|
/**
|
|
114
142
|
* @author semantha
|
|
115
143
|
*
|
|
@@ -121,7 +149,6 @@ declare class AnalysisResultsEndpoint {
|
|
|
121
149
|
private readonly parentEndpoint;
|
|
122
150
|
private readonly ENDPOINT;
|
|
123
151
|
constructor(restClient: RestClient, parentEndpoint: string);
|
|
124
|
-
answers(): AnalysisAnswersEndpoint;
|
|
125
152
|
get(params?: {
|
|
126
153
|
withdetails?: boolean;
|
|
127
154
|
}): Promise<AnalysisResultOverview[]>;
|
|
@@ -147,6 +174,8 @@ declare class StatsEndpoint {
|
|
|
147
174
|
classifications?: string;
|
|
148
175
|
additionaldataname?: string;
|
|
149
176
|
additionaldatavalues?: string;
|
|
177
|
+
samescorematches?: boolean;
|
|
178
|
+
sort?: string;
|
|
150
179
|
}): Promise<AnalysisResultsStatsResponseContainer>;
|
|
151
180
|
}
|
|
152
181
|
|
|
@@ -171,6 +200,8 @@ declare class PagedresultsEndpoint {
|
|
|
171
200
|
classifications?: string;
|
|
172
201
|
additionaldataname?: string;
|
|
173
202
|
additionaldatavalues?: string;
|
|
203
|
+
samescorematches?: boolean;
|
|
204
|
+
sort?: string;
|
|
174
205
|
limit: number;
|
|
175
206
|
offset: number;
|
|
176
207
|
}): Promise<AnalysisResultsResponseContainer>;
|
|
@@ -473,6 +504,8 @@ declare class DomainEndpoint {
|
|
|
473
504
|
private readonly domainname;
|
|
474
505
|
private readonly ENDPOINT;
|
|
475
506
|
constructor(restClient: RestClient, parentEndpoint: string, domainname: string);
|
|
507
|
+
aitasks(): AitasksEndpoint;
|
|
508
|
+
aitasks(analysisid: string): AitaskEndpoint;
|
|
476
509
|
analyses(): AnalysesEndpoint;
|
|
477
510
|
analyses(analysisid: string): AnalysisEndpoint;
|
|
478
511
|
bulk(): BulkEndpoint;
|
|
@@ -565,4 +598,4 @@ declare class RequirementsAPI {
|
|
|
565
598
|
requirements(): RequirementsEndpoint;
|
|
566
599
|
}
|
|
567
600
|
|
|
568
|
-
export {
|
|
601
|
+
export { AitaskEndpoint, AitasksEndpoint, AitasksResultsEndpoint, AitasksresultsExportEndpoint, AnalysesEndpoint, AnalysisEndpoint, AnalysisResultsEndpoint, BulkEndpoint, ClassificationsEndpoint, CommentsEndpoint, CurrentuserEndpoint, DomainEndpoint, DomainsEndpoint, EvaluationEndpoint, EvaluationsEndpoint, ExceltemplateEndpoint, ExceltemplatesEndpoint, ExportEndpoint, NewEndpoint, PagedresultsEndpoint, ReferencesEndpoint, ReportEndpoint, RequirementsAPI, RequirementsEndpoint, ResultEndpoint, ResultsEndpoint, RolesEndpoint, StatsEndpoint };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunkWFUCUDFC_js=require('../../chunk-WFUCUDFC.js'),J=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 J__namespace=/*#__PURE__*/_interopNamespace(J);var a=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 l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/analyses";}ENDPOINT;report(){return new a(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 p=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t){return (await this.restClient.post(this.ENDPOINT,t,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),{},"blob")).toFile()}};var m=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/answers";}ENDPOINT;export(){return new p(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var d=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;answers(){return new m(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var E=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 N=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;stats(){return new E(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var h=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 N(this.restClient,this.ENDPOINT)}results(){return new d(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 u=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 u(this.restClient,this.ENDPOINT)}};var c=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 y=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/classifications";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var C=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 f=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/roles";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var g=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/currentuser";}ENDPOINT;roles(){return new f(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var P=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 T=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 O=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 D=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/exceltemplates";}ENDPOINT;new(){return new O(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 I=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 v=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 C(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 R=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;analyses(t){return t!=null?new h(this.restClient,this.ENDPOINT,t):new l(this.restClient,this.ENDPOINT)}bulk(){return new c(this.restClient,this.ENDPOINT)}classifications(){return new y(this.restClient,this.ENDPOINT)}evaluations(t){return t!=null?new P(this.restClient,this.ENDPOINT,t):new o(this.restClient,this.ENDPOINT)}exceltemplates(t){return t!=null?new T(this.restClient,this.ENDPOINT,t):new D(this.restClient,this.ENDPOINT)}references(){return new I(this.restClient,this.ENDPOINT)}results(t){return t!=null?new v(this.restClient,this.ENDPOINT,t):new s(this.restClient,this.ENDPOINT)}};var x=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var w=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/requirements";}ENDPOINT;currentuser(){return new g(this.restClient,this.ENDPOINT)}domains(t){return t!=null?new R(this.restClient,this.ENDPOINT,t):new x(this.restClient,this.ENDPOINT)}};var b="/api",H=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 chunkWFUCUDFC_js.c(this.parseServerUrl(t),e),b)}static loginWithCredentials(t,e,n,A){return t=this.parseServerUrl(t),new r(new chunkWFUCUDFC_js.c(t,void 0,e,n,A),b)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=J__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(M=>M.length!==0).map(M=>M.split("=")),A=this.getValueOfInPropertiesFile("serverUrl",n),F=this.getValueOfInPropertiesFile("clientId",n),W=this.getValueOfInPropertiesFile("clientSecret",n),X=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(A,F,W,X)}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 w(this.restClient,this.endpoint())}};exports.AnalysesEndpoint=l;exports.AnalysisAnswersEndpoint=m;exports.AnalysisEndpoint=h;exports.AnalysisExportEndpoint=p;exports.AnalysisResultsEndpoint=d;exports.BulkEndpoint=c;exports.ClassificationsEndpoint=y;exports.CommentsEndpoint=C;exports.CurrentuserEndpoint=g;exports.DomainEndpoint=R;exports.DomainsEndpoint=x;exports.EvaluationEndpoint=P;exports.EvaluationsEndpoint=o;exports.ExceltemplateEndpoint=T;exports.ExceltemplatesEndpoint=D;exports.ExportEndpoint=u;exports.NewEndpoint=O;exports.PagedresultsEndpoint=N;exports.ReferencesEndpoint=I;exports.ReportEndpoint=a;exports.RequirementsAPI=H;exports.RequirementsEndpoint=w;exports.ResultEndpoint=v;exports.ResultsEndpoint=s;exports.RolesEndpoint=f;exports.StatsEndpoint=E;//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';var chunkWFUCUDFC_js=require('../../chunk-WFUCUDFC.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 a=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 l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new a(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var p=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 l(this.restClient,this.ENDPOINT)}};var d=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 m=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 E=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/analyses";}ENDPOINT;report(){return new m(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 N=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 h=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 u=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;stats(){return new h(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var c=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/analyses/${this.analysisid}`;}ENDPOINT;pagedresults(){return new u(this.restClient,this.ENDPOINT)}results(){return new N(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 y=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 y(this.restClient,this.ENDPOINT)}};var C=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 f=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/classifications";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var g=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 P=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/roles";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var T=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/currentuser";}ENDPOINT;roles(){return new P(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var O=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 D=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 v=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 R=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 x=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 g(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 w=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 p(this.restClient,this.ENDPOINT,t):new d(this.restClient,this.ENDPOINT)}analyses(t){return t!=null?new c(this.restClient,this.ENDPOINT,t):new E(this.restClient,this.ENDPOINT)}bulk(){return new C(this.restClient,this.ENDPOINT)}classifications(){return new f(this.restClient,this.ENDPOINT)}evaluations(t){return t!=null?new O(this.restClient,this.ENDPOINT,t):new o(this.restClient,this.ENDPOINT)}exceltemplates(t){return t!=null?new D(this.restClient,this.ENDPOINT,t):new v(this.restClient,this.ENDPOINT)}references(){return new R(this.restClient,this.ENDPOINT)}results(t){return t!=null?new x(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 M=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/requirements";}ENDPOINT;currentuser(){return new T(this.restClient,this.ENDPOINT)}domains(t){return t!=null?new w(this.restClient,this.ENDPOINT,t):new A(this.restClient,this.ENDPOINT)}};var J="/api",k=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 chunkWFUCUDFC_js.c(this.parseServerUrl(t),e),J)}static loginWithCredentials(t,e,n,S){return t=this.parseServerUrl(t),new r(new chunkWFUCUDFC_js.c(t,void 0,e,n,S),J)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=F__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(b=>b.length!==0).map(b=>b.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 M(this.restClient,this.endpoint())}};exports.AitaskEndpoint=p;exports.AitasksEndpoint=d;exports.AitasksResultsEndpoint=l;exports.AitasksresultsExportEndpoint=a;exports.AnalysesEndpoint=E;exports.AnalysisEndpoint=c;exports.AnalysisResultsEndpoint=N;exports.BulkEndpoint=C;exports.ClassificationsEndpoint=f;exports.CommentsEndpoint=g;exports.CurrentuserEndpoint=T;exports.DomainEndpoint=w;exports.DomainsEndpoint=A;exports.EvaluationEndpoint=O;exports.EvaluationsEndpoint=o;exports.ExceltemplateEndpoint=D;exports.ExceltemplatesEndpoint=v;exports.ExportEndpoint=y;exports.NewEndpoint=I;exports.PagedresultsEndpoint=u;exports.ReferencesEndpoint=R;exports.ReportEndpoint=m;exports.RequirementsAPI=k;exports.RequirementsEndpoint=M;exports.ResultEndpoint=x;exports.ResultsEndpoint=s;exports.RolesEndpoint=P;exports.StatsEndpoint=h;//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|