@semantha/product-sdk 11.9.0 → 11.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-34CEU4KS.mjs +2 -0
- package/dist/{chunk-GJ5RRVHT.mjs.map → chunk-34CEU4KS.mjs.map} +1 -1
- package/dist/chunk-36CIB62T.mjs +10 -0
- package/dist/chunk-36CIB62T.mjs.map +1 -0
- package/dist/{chunk-CULSSUTK.js → chunk-5MXQ6XTH.js} +2 -2
- package/dist/{chunk-CULSSUTK.js.map → chunk-5MXQ6XTH.js.map} +1 -1
- package/dist/chunk-C255MF6C.js +10 -0
- package/dist/chunk-C255MF6C.js.map +1 -0
- package/dist/chunk-NVF34XUK.mjs +2 -0
- package/dist/{chunk-VH2AB5TA.mjs.map → chunk-NVF34XUK.mjs.map} +1 -1
- package/dist/chunk-PNXLWDZQ.mjs +2 -0
- package/dist/{chunk-P2K3VXP2.mjs.map → chunk-PNXLWDZQ.mjs.map} +1 -1
- package/dist/{chunk-7VUBZ76N.js → chunk-R6QPYMV4.js} +2 -2
- package/dist/{chunk-7VUBZ76N.js.map → chunk-R6QPYMV4.js.map} +1 -1
- package/dist/{chunk-TNOEPM5N.js → chunk-T3AKTUUR.js} +2 -2
- package/dist/{chunk-TNOEPM5N.js.map → chunk-T3AKTUUR.js.map} +1 -1
- package/dist/document-chat/api/index.d.mts +25 -2
- package/dist/document-chat/api/index.d.ts +25 -2
- package/dist/document-chat/api/index.js +1 -1
- package/dist/document-chat/api/index.js.map +1 -1
- package/dist/document-chat/api/index.mjs +1 -1
- package/dist/document-chat/api/index.mjs.map +1 -1
- package/dist/file-box/api/index.js +1 -1
- package/dist/file-box/api/index.mjs +1 -1
- package/dist/file-box/index.js +1 -1
- package/dist/file-box/index.mjs +1 -1
- package/dist/requirements/api/index.js +1 -1
- package/dist/requirements/api/index.mjs +1 -1
- package/dist/requirements/api/index.mjs.map +1 -1
- package/dist/rest/index.d.mts +32 -2
- package/dist/rest/index.d.ts +32 -2
- package/dist/rest/index.js +1 -1
- package/dist/rest/index.mjs +1 -1
- package/dist/structure-navigator/api/index.js +1 -1
- package/dist/structure-navigator/api/index.mjs +1 -1
- package/dist/structure-navigator/index.js +1 -1
- package/dist/structure-navigator/index.mjs +1 -1
- package/dist/table-extractor/api/index.js +1 -1
- package/dist/table-extractor/api/index.mjs +1 -1
- package/dist/table-extractor/api/index.mjs.map +1 -1
- package/dist/tracking/api/index.js +1 -1
- package/dist/tracking/api/index.mjs +1 -1
- package/dist/tracking/index.js +1 -1
- package/dist/tracking/index.mjs +1 -1
- package/package.json +4 -4
- package/dist/chunk-4CX7MUVC.js +0 -2
- package/dist/chunk-4CX7MUVC.js.map +0 -1
- package/dist/chunk-FA37ZZXB.mjs +0 -2
- package/dist/chunk-FA37ZZXB.mjs.map +0 -1
- package/dist/chunk-GJ5RRVHT.mjs +0 -2
- package/dist/chunk-P2K3VXP2.mjs +0 -2
- package/dist/chunk-VH2AB5TA.mjs +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../semantha-product-sdk/document-chat/api/document.ts","../../../semantha-product-sdk/document-chat/api/documents.ts","../../../semantha-product-sdk/document-chat/api/domain.ts","../../../semantha-product-sdk/document-chat/api/domains.ts","../../../semantha-product-sdk/document-chat/api/documentchat.ts","../../../semantha-product-sdk/document-chat/api/documentChatAPI.ts"],"names":["DocumentEndpoint","restClient","parentEndpoint","sourcedocid","body","polarionToken","polarionURL","headers","DocumentsEndpoint","DomainEndpoint","domainname","DomainsEndpoint","DocumentchatEndpoint","PARENT_ENDPOINT","DocumentChatAPI","_DocumentChatAPI","serverUrl","apiKey","RestClient","clientId","clientSecret","tokenUrl","credentialsFilePath","lines","h","line","searchKey"],"mappings":"2bAWO,IAAMA,CAAAA,CAAN,KAAuB,CAG5B,WAAA,CACmBC,CAAAA,CACAC,EACAC,CAAAA,CACjB,CAHiB,IAAA,CAAA,UAAA,CAAAF,CAAAA,CACA,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B,qBAAqBC,CAAAA,CAAWG,CAAAA,CAAUC,CAAAA,CAAcC,CAAQ,CACzF,CACG,MAAM,IAAI,KAAA,CAAM,6DAA6D,CAC/E,CAEA,OAAe,eAAeL,CAAAA,CAA2B,CACvD,OAAIA,CAAAA,CAAU,QAAA,CAAS,GAAG,IACxBA,CAAAA,CAAYA,CAAAA,CAAU,KAAA,CAAM,CAAA,CAAG,EAAE,CAAA,CAAA,CAE/BA,CAAAA,CAAU,QAAA,CAAS,sBAAsB,CAAA,CAC3CA,CAAAA,CAAYA,CAAAA,CAAU,OAAA,CAAQ,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,YAAA,EAAqC,CACnC,OAAO,IAAId,CAAAA,CAAqB,IAAA,CAAK,UAAA,CAAY,IAAA,CAAK,QAAA,EAAU,CAClE,CAEF","file":"index.js","sourcesContent":["import { DocumentChatRequest } from '../model';\nimport { DocumentChatResponse } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}/documents/{sourcedocid}\"\n * This is a generated file do not change manually!\n */\nexport class DocumentEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly sourcedocid: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documents\" + `/${this.sourcedocid}`;\n }\n\n /**\n * @param body DocumentChatRequest? - \n * @param polarionToken string? - The personal access token for polarion\n * @param polarionURL string? - The url of the polarion server to talk to\n */\n async post(\n body?: DocumentChatRequest,\n polarionToken?: string, polarionURL?: string): Promise<DocumentChatResponse> {\n const headers = this.restClient.toHeader(MediaType.JSON);\n if (polarionToken !== undefined) {\n headers['Polarion-Token'] = polarionToken;\n }\n if (polarionURL !== undefined) {\n headers['Polarion-URL'] = polarionURL;\n }\n return (\n await this.restClient.post<DocumentChatResponse>(\n this.ENDPOINT,\n {},\n headers,\n body\n )\n ).toModel();\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}/documents\"\n * This is a generated file do not change manually!\n */\nexport class DocumentsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documents\";\n }\n}\n","import { DocumentEndpoint } from './document';\nimport { DocumentsEndpoint } from './documents';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}\"\n * This is a generated file do not change manually!\n */\nexport class DomainEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly domainname: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\" + `/${this.domainname}`;\n }\n\n documents(): DocumentsEndpoint;\n documents(sourcedocid: string): DocumentEndpoint\n \n documents(sourcedocid?: string): DocumentEndpoint | DocumentsEndpoint {\n if(sourcedocid !== undefined && sourcedocid !== null) {\n\t return new DocumentEndpoint(this.restClient, this.ENDPOINT, sourcedocid);\n } else {\n\t return new DocumentsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains\"\n * This is a generated file do not change manually!\n */\nexport class DomainsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\";\n }\n}\n","import { DomainEndpoint } from './domain';\nimport { DomainsEndpoint } from './domains';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat\"\n * This is a generated file do not change manually!\n */\nexport class DocumentchatEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documentchat\";\n }\n\n domains(): DomainsEndpoint;\n domains(domainname: string): DomainEndpoint\n \n domains(domainname?: string): DomainEndpoint | DomainsEndpoint {\n if(domainname !== undefined && domainname !== null) {\n\t return new DomainEndpoint(this.restClient, this.ENDPOINT, domainname);\n } else {\n\t return new DomainsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import * as fs from 'fs';\n\nimport { DocumentchatEndpoint } from './documentchat';\nimport { RestClient } from '../../rest';\n\nconst PARENT_ENDPOINT = '/api';\n\n/**\n * Entry point to the DocumentChat API.\n *\n * @author semantha\n * Calls the /documentchat, endpoints.\n *\n * Note:\n * The constructor is not meant to be invoked directly\n * use `loginXXX()` with your credentials instead.\n *\n * this is a generated class do not change manually!\n */\nexport class DocumentChatAPI {\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string\n ) {\n }\n\n /**\n * Access to the DocumentChat API\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n * @param apiKey: string - A valid bearer token for accessing the given url.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithApiKey(\n serverUrl: string,\n apiKey: string\n ): DocumentChatAPI {\n if(!apiKey) {\n throw new Error('You need to supply an API key to login.');\n }\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new DocumentChatAPI(new RestClient(this.parseServerUrl(serverUrl), apiKey), PARENT_ENDPOINT);\n }\n\n\n /**\n * Access to the DocumentChat API, when there is a auth proxy in place to handle the addition of the Authorization header\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithAuthProxy(\n serverUrl: string\n ): DocumentChatAPI {\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new DocumentChatAPI(new RestClient(this.parseServerUrl(serverUrl)), PARENT_ENDPOINT);\n }\n\n /**\n * Access to the DocumentChat API\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n * @param clientId: string - OAuth2 client id.\n * @param clientSecret: string - OAuth2 client secret.\n * @param tokenUrl: string OAuth2 url to get a valid access token\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithCredentials(\n serverUrl: string,\n clientId: string,\n clientSecret: string,\n tokenUrl: string\n ): DocumentChatAPI {\n serverUrl = this.parseServerUrl(serverUrl);\n return new DocumentChatAPI(new RestClient(serverUrl, undefined, clientId, clientSecret, tokenUrl), PARENT_ENDPOINT);\n }\n\t\n /**\n * Access to the DocumentChat API\n *\n * @param credentialsFilePath: string - Path to a properties file providing client credentials.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithCredentialsFile(credentialsFilePath: string) : DocumentChatAPI {\n if (credentialsFilePath.endsWith('.properties') || credentialsFilePath.endsWith('.PROPERTIES')) {\n const rawData = fs.readFileSync(credentialsFilePath, 'utf8');\n const lines = rawData\n\t .split(/[\\n|\\r\\n]/)\n\t .filter(line => line.length !== 0)\n\t .map(line => line.split('='));\n\t const serverUrl = this.getValueOfInPropertiesFile('serverUrl', lines);\n\t const clientId = this.getValueOfInPropertiesFile('clientId', lines);\n\t const clientSecret = this.getValueOfInPropertiesFile('clientSecret', lines);\n\t const tokenUrl = this.getValueOfInPropertiesFile('tokenUrl', lines);\n\t return DocumentChatAPI.loginWithCredentials(serverUrl, clientId, clientSecret, tokenUrl);\n\t}\n throw new Error('Can not login, please supply a credentials properties file.');\n }\n\n private static parseServerUrl(serverUrl: string): string {\n if (serverUrl.endsWith('/')) {\n serverUrl = serverUrl.slice(0, -1);\n }\n if (serverUrl.endsWith('/tt-platform-ui/en/#')) {\n serverUrl = serverUrl.replace('/tt-platform-ui/en/#', '/tt-product-server');\n } else if (!serverUrl.endsWith('/tt-product-server')) {\n serverUrl += '/tt-product-server';\n }\n return serverUrl;\n }\n\n private static getValueOfInPropertiesFile(searchKey: string, lines: string[][]): string {\n for (const line of lines) {\n if (line[0] === searchKey) {\n return line[1].replace('\\\\:', ':');\n }\n }\n throw Error(`.properties files contains no ${searchKey}!`);\n }\n\n endpoint(): string {\n return this.parentEndpoint;\n }\n\n documentchat(): DocumentchatEndpoint {\n return new DocumentchatEndpoint(this.restClient, this.endpoint());\n }\n\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../../semantha-product-sdk/document-chat/api/sse.ts","../../../semantha-product-sdk/document-chat/api/document.ts","../../../semantha-product-sdk/document-chat/api/documents.ts","../../../semantha-product-sdk/document-chat/api/domain.ts","../../../semantha-product-sdk/document-chat/api/domains.ts","../../../semantha-product-sdk/document-chat/api/documentchat.ts","../../../semantha-product-sdk/document-chat/api/documentChatAPI.ts"],"names":["SseEndpoint","restClient","parentEndpoint","body","polarionToken","polarionURL","headers","DocumentEndpoint","sourcedocid","DocumentsEndpoint","DomainEndpoint","domainname","DomainsEndpoint","DocumentchatEndpoint","PARENT_ENDPOINT","DocumentChatAPI","_DocumentChatAPI","serverUrl","apiKey","RestClient","clientId","clientSecret","tokenUrl","credentialsFilePath","lines","f","line","searchKey"],"mappings":"2bAWO,IAAMA,CAAAA,CAAN,KAAkB,CAGvB,WAAA,CACmBC,CAAAA,CACAC,CAAAA,CACjB,CAFiB,IAAA,CAAA,UAAA,CAAAD,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,CAAAA,CAEjB,IAAA,CAAK,QA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A,CAAAA,CAAYA,CAAAA,CAAU,OAAA,CAAQ,sBAAA,CAAwB,oBAAoB,CAAA,CAChEA,CAAAA,CAAU,QAAA,CAAS,oBAAoB,CAAA,GACjDA,CAAAA,EAAa,oBAAA,CAAA,CAERA,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,KAAA,CAAO,GAAG,CAAA,CAGrC,MAAM,KAAA,CAAM,CAAA,8BAAA,EAAiCC,CAAS,CAAA,CAAA,CAAG,CAC3D,CAEA,QAAA,EAAmB,CACjB,OAAO,IAAA,CAAK,cACd,CAEA,YAAA,EAAqC,CACnC,OAAO,IAAId,CAAAA,CAAqB,IAAA,CAAK,UAAA,CAAY,IAAA,CAAK,QAAA,EAAU,CAClE,CAEF","file":"index.js","sourcesContent":["import { DocumentChatRequest } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\nimport { ServerSentEvent } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}/documents/{sourcedocid}/sse\"\n * This is a generated file do not change manually!\n */\nexport class SseEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/sse\";\n }\n\n /**\n * Chat with a document, streaming the answer via Server-Sent Events\n * Streaming variant of the document chat endpoint with identical semantics (same path parameters, headers, request body and settings). The response is a text/event-stream: an 'event: delta' per answer chunk (data: {\"content\":\"...\"}), a terminal 'event: done' carrying the conversationId (data: {\"conversationId\":\"...\"}), and 'event: error' (data: {\"message\":\"...\"}) if the stream fails after it has started.\n *\n * @param body DocumentChatRequest? - \n * @param polarionToken string? - The personal access token for polarion\n * @param polarionURL string? - The url of the polarion server to talk to\n */\n async postAsEventStream(\n body?: DocumentChatRequest,\n polarionToken?: string, polarionURL?: string): Promise<AsyncIterable<ServerSentEvent>> {\n const headers = this.restClient.toHeader(MediaType.EVENT_STREAM);\n if (polarionToken !== undefined) {\n headers['Polarion-Token'] = polarionToken;\n }\n if (polarionURL !== undefined) {\n headers['Polarion-URL'] = polarionURL;\n }\n return this.restClient.postEventStream(\n this.ENDPOINT,\n {},\n headers,\n body\n );\n }\n}\n","import { DocumentChatRequest } from '../model';\nimport { DocumentChatResponse } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\nimport { SseEndpoint } from './sse';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}/documents/{sourcedocid}\"\n * This is a generated file do not change manually!\n */\nexport class DocumentEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly sourcedocid: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documents\" + `/${this.sourcedocid}`;\n }\n\n sse(): SseEndpoint {\n return new SseEndpoint(this.restClient, this.ENDPOINT);\n }\n\n /**\n * @param body DocumentChatRequest? - \n * @param polarionToken string? - The personal access token for polarion\n * @param polarionURL string? - The url of the polarion server to talk to\n */\n async post(\n body?: DocumentChatRequest,\n polarionToken?: string, polarionURL?: string): Promise<DocumentChatResponse> {\n const headers = this.restClient.toHeader(MediaType.JSON);\n if (polarionToken !== undefined) {\n headers['Polarion-Token'] = polarionToken;\n }\n if (polarionURL !== undefined) {\n headers['Polarion-URL'] = polarionURL;\n }\n return (\n await this.restClient.post<DocumentChatResponse>(\n this.ENDPOINT,\n {},\n headers,\n body\n )\n ).toModel();\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}/documents\"\n * This is a generated file do not change manually!\n */\nexport class DocumentsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documents\";\n }\n}\n","import { DocumentEndpoint } from './document';\nimport { DocumentsEndpoint } from './documents';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}\"\n * This is a generated file do not change manually!\n */\nexport class DomainEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly domainname: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\" + `/${this.domainname}`;\n }\n\n documents(): DocumentsEndpoint;\n documents(sourcedocid: string): DocumentEndpoint\n \n documents(sourcedocid?: string): DocumentEndpoint | DocumentsEndpoint {\n if(sourcedocid !== undefined && sourcedocid !== null) {\n\t return new DocumentEndpoint(this.restClient, this.ENDPOINT, sourcedocid);\n } else {\n\t return new DocumentsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains\"\n * This is a generated file do not change manually!\n */\nexport class DomainsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\";\n }\n}\n","import { DomainEndpoint } from './domain';\nimport { DomainsEndpoint } from './domains';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat\"\n * This is a generated file do not change manually!\n */\nexport class DocumentchatEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documentchat\";\n }\n\n domains(): DomainsEndpoint;\n domains(domainname: string): DomainEndpoint\n \n domains(domainname?: string): DomainEndpoint | DomainsEndpoint {\n if(domainname !== undefined && domainname !== null) {\n\t return new DomainEndpoint(this.restClient, this.ENDPOINT, domainname);\n } else {\n\t return new DomainsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import * as fs from 'fs';\n\nimport { DocumentchatEndpoint } from './documentchat';\nimport { RestClient } from '../../rest';\n\nconst PARENT_ENDPOINT = '/api';\n\n/**\n * Entry point to the DocumentChat API.\n *\n * @author semantha\n * Calls the /documentchat, endpoints.\n *\n * Note:\n * The constructor is not meant to be invoked directly\n * use `loginXXX()` with your credentials instead.\n *\n * this is a generated class do not change manually!\n */\nexport class DocumentChatAPI {\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string\n ) {\n }\n\n /**\n * Access to the DocumentChat API\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n * @param apiKey: string - A valid bearer token for accessing the given url.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithApiKey(\n serverUrl: string,\n apiKey: string\n ): DocumentChatAPI {\n if(!apiKey) {\n throw new Error('You need to supply an API key to login.');\n }\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new DocumentChatAPI(new RestClient(this.parseServerUrl(serverUrl), apiKey), PARENT_ENDPOINT);\n }\n\n\n /**\n * Access to the DocumentChat API, when there is a auth proxy in place to handle the addition of the Authorization header\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithAuthProxy(\n serverUrl: string\n ): DocumentChatAPI {\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new DocumentChatAPI(new RestClient(this.parseServerUrl(serverUrl)), PARENT_ENDPOINT);\n }\n\n /**\n * Access to the DocumentChat API\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n * @param clientId: string - OAuth2 client id.\n * @param clientSecret: string - OAuth2 client secret.\n * @param tokenUrl: string OAuth2 url to get a valid access token\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithCredentials(\n serverUrl: string,\n clientId: string,\n clientSecret: string,\n tokenUrl: string\n ): DocumentChatAPI {\n serverUrl = this.parseServerUrl(serverUrl);\n return new DocumentChatAPI(new RestClient(serverUrl, undefined, clientId, clientSecret, tokenUrl), PARENT_ENDPOINT);\n }\n\t\n /**\n * Access to the DocumentChat API\n *\n * @param credentialsFilePath: string - Path to a properties file providing client credentials.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithCredentialsFile(credentialsFilePath: string) : DocumentChatAPI {\n if (credentialsFilePath.endsWith('.properties') || credentialsFilePath.endsWith('.PROPERTIES')) {\n const rawData = fs.readFileSync(credentialsFilePath, 'utf8');\n const lines = rawData\n\t .split(/[\\n|\\r\\n]/)\n\t .filter(line => line.length !== 0)\n\t .map(line => line.split('='));\n\t const serverUrl = this.getValueOfInPropertiesFile('serverUrl', lines);\n\t const clientId = this.getValueOfInPropertiesFile('clientId', lines);\n\t const clientSecret = this.getValueOfInPropertiesFile('clientSecret', lines);\n\t const tokenUrl = this.getValueOfInPropertiesFile('tokenUrl', lines);\n\t return DocumentChatAPI.loginWithCredentials(serverUrl, clientId, clientSecret, tokenUrl);\n\t}\n throw new Error('Can not login, please supply a credentials properties file.');\n }\n\n private static parseServerUrl(serverUrl: string): string {\n if (serverUrl.endsWith('/')) {\n serverUrl = serverUrl.slice(0, -1);\n }\n if (serverUrl.endsWith('/tt-platform-ui/en/#')) {\n serverUrl = serverUrl.replace('/tt-platform-ui/en/#', '/tt-product-server');\n } else if (!serverUrl.endsWith('/tt-product-server')) {\n serverUrl += '/tt-product-server';\n }\n return serverUrl;\n }\n\n private static getValueOfInPropertiesFile(searchKey: string, lines: string[][]): string {\n for (const line of lines) {\n if (line[0] === searchKey) {\n return line[1].replace('\\\\:', ':');\n }\n }\n throw Error(`.properties files contains no ${searchKey}!`);\n }\n\n endpoint(): string {\n return this.parentEndpoint;\n }\n\n documentchat(): DocumentchatEndpoint {\n return new DocumentchatEndpoint(this.restClient, this.endpoint());\n }\n\n}"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {e}from'../../chunk-36CIB62T.mjs';import*as f from'fs';var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/sse";}ENDPOINT;async postAsEventStream(t,e,n){let r=this.restClient.toHeader("text/event-stream");return e!==void 0&&(r["Polarion-Token"]=e),n!==void 0&&(r["Polarion-URL"]=n),this.restClient.postEventStream(this.ENDPOINT,{},r,t)}};var a=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.sourcedocid=n;this.ENDPOINT=this.parentEndpoint+`/documents/${this.sourcedocid}`;}ENDPOINT;sse(){return new s(this.restClient,this.ENDPOINT)}async post(t,e,n){let r=this.restClient.toHeader("application/json");return e!==void 0&&(r["Polarion-Token"]=e),n!==void 0&&(r["Polarion-URL"]=n),(await this.restClient.post(this.ENDPOINT,{},r,t)).toModel()}};var p=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documents";}ENDPOINT};var l=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;documents(t){return t!=null?new a(this.restClient,this.ENDPOINT,t):new p(this.restClient,this.ENDPOINT)}};var d=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+"/documentchat";}ENDPOINT;domains(t){return t!=null?new l(this.restClient,this.ENDPOINT,t):new d(this.restClient,this.ENDPOINT)}};var u="/api",h=class i{constructor(t,e){this.restClient=t;this.parentEndpoint=e;}static loginWithApiKey(t,e$1){if(!e$1)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 e(this.parseServerUrl(t),e$1),u)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new i(new e(this.parseServerUrl(t)),u)}static loginWithCredentials(t,e$1,n,r){return t=this.parseServerUrl(t),new i(new e(t,void 0,e$1,n,r),u)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=f.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(c=>c.length!==0).map(c=>c.split("=")),r=this.getValueOfInPropertiesFile("serverUrl",n),E=this.getValueOfInPropertiesFile("clientId",n),g=this.getValueOfInPropertiesFile("clientSecret",n),C=this.getValueOfInPropertiesFile("tokenUrl",n);return i.loginWithCredentials(r,E,g,C)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let n of e)if(n[0]===t)return n[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}documentchat(){return new m(this.restClient,this.endpoint())}};export{h as DocumentChatAPI,a as DocumentEndpoint,m as DocumentchatEndpoint,p as DocumentsEndpoint,l as DomainEndpoint,d as DomainsEndpoint,s as SseEndpoint};//# sourceMappingURL=index.mjs.map
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../semantha-product-sdk/document-chat/api/document.ts","../../../semantha-product-sdk/document-chat/api/documents.ts","../../../semantha-product-sdk/document-chat/api/domain.ts","../../../semantha-product-sdk/document-chat/api/domains.ts","../../../semantha-product-sdk/document-chat/api/documentchat.ts","../../../semantha-product-sdk/document-chat/api/documentChatAPI.ts"],"names":["DocumentEndpoint","restClient","parentEndpoint","sourcedocid","body","polarionToken","polarionURL","headers","DocumentsEndpoint","DomainEndpoint","domainname","DomainsEndpoint","DocumentchatEndpoint","PARENT_ENDPOINT","DocumentChatAPI","_DocumentChatAPI","serverUrl","apiKey","RestClient","clientId","clientSecret","tokenUrl","credentialsFilePath","lines","line","searchKey"],"mappings":"8DAWO,IAAMA,CAAAA,CAAN,KAAuB,CAG5B,WAAA,CACmBC,CAAAA,CACAC,EACAC,CAAAA,CACjB,CAHiB,IAAA,CAAA,UAAA,CAAAF,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,CAAAA,CACA,iBAAAC,CAAAA,CAEjB,IAAA,CAAK,QAAA,CAAW,IAAA,CAAK,cAAA,CAAiB,CAAA,WAAA,EAAmB,KAAK,WAAW,CAAA,EAC3E,CARiB,QAAA,CAejB,MAAM,IAAA,CACJC,EACFC,CAAAA,CAAwBC,CAAAA,CAAqD,CAC3E,IAAMC,CAAAA,CAAU,IAAA,CAAK,WAAW,QAAA,CAAA,kBAAuB,CAAA,CACvD,OAAIF,CAAAA,GAAkB,MAAA,GACpBE,CAAAA,CAAQ,gBAAgB,CAAA,CAAIF,CAAAA,CAAAA,CAE1BC,CAAAA,GAAgB,MAAA,GAClBC,CAAAA,CAAQ,cAAc,CAAA,CAAID,CAAAA,CAAAA,CAAAA,CAG1B,MAAM,IAAA,CAAK,UAAA,CAAW,IAAA,CACpB,IAAA,CAAK,QAAA,CACL,EAAC,CACDC,CAAAA,CACAH,CACF,CAAA,EACA,OAAA,EACJ,CACF,ECtCO,IAAMI,CAAAA,CAAN,KAAwB,CAG7B,WAAA,CACmBP,EACAC,CAAAA,CACjB,CAFiB,IAAA,CAAA,UAAA,CAAAD,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,CAAAA,CAEjB,KAAK,QAAA,CAAW,IAAA,CAAK,cAAA,CAAiB,aACxC,CAPiB,QAQnB,ECPO,IAAMO,CAAAA,CAAN,KAAqB,CAG1B,WAAA,CACmBR,CAAAA,CACAC,EACAQ,CAAAA,CACjB,CAHiB,IAAA,CAAA,UAAA,CAAAT,CAAAA,CACA,IAAA,CAAA,cAAA,CAAAC,CAA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EAC9DJ,CAAAA,CAAW,IAAA,CAAK,0BAAA,CAA2B,UAAA,CAAYI,CAAK,CAAA,CAC5DH,EAAe,IAAA,CAAK,0BAAA,CAA2B,cAAA,CAAgBG,CAAK,CAAA,CACpEF,CAAAA,CAAW,KAAK,0BAAA,CAA2B,UAAA,CAAYE,CAAK,CAAA,CAClE,OAAOR,CAAAA,CAAgB,qBAAqBC,CAAAA,CAAWG,CAAAA,CAAUC,CAAAA,CAAcC,CAAQ,CACzF,CACG,MAAM,IAAI,KAAA,CAAM,6DAA6D,CAC/E,CAEA,OAAe,eAAeL,CAAAA,CAA2B,CACvD,OAAIA,CAAAA,CAAU,QAAA,CAAS,GAAG,IACxBA,CAAAA,CAAYA,CAAAA,CAAU,KAAA,CAAM,CAAA,CAAG,EAAE,CAAA,CAAA,CAE/BA,CAAAA,CAAU,QAAA,CAAS,sBAAsB,CAAA,CAC3CA,CAAAA,CAAYA,CAAAA,CAAU,OAAA,CAAQ,sBAAA,CAAwB,oBAAoB,CAAA,CAChEA,CAAAA,CAAU,QAAA,CAAS,oBAAoB,CAAA,GACjDA,CAAAA,EAAa,sBAERA,CACT,CAEA,OAAe,0BAAA,CAA2BS,CAAAA,CAAmBF,CAAAA,CAA2B,CACtF,IAAA,IAAWC,CAAAA,IAAQD,CAAAA,CACjB,GAAIC,CAAAA,CAAK,CAAC,IAAMC,CAAAA,CACd,OAAOD,CAAAA,CAAK,CAAC,CAAA,CAAE,OAAA,CAAQ,MAAO,GAAG,CAAA,CAGrC,MAAM,KAAA,CAAM,CAAA,8BAAA,EAAiCC,CAAS,GAAG,CAC3D,CAEA,QAAA,EAAmB,CACjB,OAAO,IAAA,CAAK,cACd,CAEA,YAAA,EAAqC,CACnC,OAAO,IAAIb,CAAAA,CAAqB,IAAA,CAAK,UAAA,CAAY,IAAA,CAAK,QAAA,EAAU,CAClE,CAEF","file":"index.mjs","sourcesContent":["import { DocumentChatRequest } from '../model';\nimport { DocumentChatResponse } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}/documents/{sourcedocid}\"\n * This is a generated file do not change manually!\n */\nexport class DocumentEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly sourcedocid: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documents\" + `/${this.sourcedocid}`;\n }\n\n /**\n * @param body DocumentChatRequest? - \n * @param polarionToken string? - The personal access token for polarion\n * @param polarionURL string? - The url of the polarion server to talk to\n */\n async post(\n body?: DocumentChatRequest,\n polarionToken?: string, polarionURL?: string): Promise<DocumentChatResponse> {\n const headers = this.restClient.toHeader(MediaType.JSON);\n if (polarionToken !== undefined) {\n headers['Polarion-Token'] = polarionToken;\n }\n if (polarionURL !== undefined) {\n headers['Polarion-URL'] = polarionURL;\n }\n return (\n await this.restClient.post<DocumentChatResponse>(\n this.ENDPOINT,\n {},\n headers,\n body\n )\n ).toModel();\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}/documents\"\n * This is a generated file do not change manually!\n */\nexport class DocumentsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documents\";\n }\n}\n","import { DocumentEndpoint } from './document';\nimport { DocumentsEndpoint } from './documents';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}\"\n * This is a generated file do not change manually!\n */\nexport class DomainEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly domainname: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\" + `/${this.domainname}`;\n }\n\n documents(): DocumentsEndpoint;\n documents(sourcedocid: string): DocumentEndpoint\n \n documents(sourcedocid?: string): DocumentEndpoint | DocumentsEndpoint {\n if(sourcedocid !== undefined && sourcedocid !== null) {\n\t return new DocumentEndpoint(this.restClient, this.ENDPOINT, sourcedocid);\n } else {\n\t return new DocumentsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains\"\n * This is a generated file do not change manually!\n */\nexport class DomainsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\";\n }\n}\n","import { DomainEndpoint } from './domain';\nimport { DomainsEndpoint } from './domains';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat\"\n * This is a generated file do not change manually!\n */\nexport class DocumentchatEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documentchat\";\n }\n\n domains(): DomainsEndpoint;\n domains(domainname: string): DomainEndpoint\n \n domains(domainname?: string): DomainEndpoint | DomainsEndpoint {\n if(domainname !== undefined && domainname !== null) {\n\t return new DomainEndpoint(this.restClient, this.ENDPOINT, domainname);\n } else {\n\t return new DomainsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import * as fs from 'fs';\n\nimport { DocumentchatEndpoint } from './documentchat';\nimport { RestClient } from '../../rest';\n\nconst PARENT_ENDPOINT = '/api';\n\n/**\n * Entry point to the DocumentChat API.\n *\n * @author semantha\n * Calls the /documentchat, endpoints.\n *\n * Note:\n * The constructor is not meant to be invoked directly\n * use `loginXXX()` with your credentials instead.\n *\n * this is a generated class do not change manually!\n */\nexport class DocumentChatAPI {\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string\n ) {\n }\n\n /**\n * Access to the DocumentChat API\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n * @param apiKey: string - A valid bearer token for accessing the given url.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithApiKey(\n serverUrl: string,\n apiKey: string\n ): DocumentChatAPI {\n if(!apiKey) {\n throw new Error('You need to supply an API key to login.');\n }\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new DocumentChatAPI(new RestClient(this.parseServerUrl(serverUrl), apiKey), PARENT_ENDPOINT);\n }\n\n\n /**\n * Access to the DocumentChat API, when there is a auth proxy in place to handle the addition of the Authorization header\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithAuthProxy(\n serverUrl: string\n ): DocumentChatAPI {\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new DocumentChatAPI(new RestClient(this.parseServerUrl(serverUrl)), PARENT_ENDPOINT);\n }\n\n /**\n * Access to the DocumentChat API\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n * @param clientId: string - OAuth2 client id.\n * @param clientSecret: string - OAuth2 client secret.\n * @param tokenUrl: string OAuth2 url to get a valid access token\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithCredentials(\n serverUrl: string,\n clientId: string,\n clientSecret: string,\n tokenUrl: string\n ): DocumentChatAPI {\n serverUrl = this.parseServerUrl(serverUrl);\n return new DocumentChatAPI(new RestClient(serverUrl, undefined, clientId, clientSecret, tokenUrl), PARENT_ENDPOINT);\n }\n\t\n /**\n * Access to the DocumentChat API\n *\n * @param credentialsFilePath: string - Path to a properties file providing client credentials.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithCredentialsFile(credentialsFilePath: string) : DocumentChatAPI {\n if (credentialsFilePath.endsWith('.properties') || credentialsFilePath.endsWith('.PROPERTIES')) {\n const rawData = fs.readFileSync(credentialsFilePath, 'utf8');\n const lines = rawData\n\t .split(/[\\n|\\r\\n]/)\n\t .filter(line => line.length !== 0)\n\t .map(line => line.split('='));\n\t const serverUrl = this.getValueOfInPropertiesFile('serverUrl', lines);\n\t const clientId = this.getValueOfInPropertiesFile('clientId', lines);\n\t const clientSecret = this.getValueOfInPropertiesFile('clientSecret', lines);\n\t const tokenUrl = this.getValueOfInPropertiesFile('tokenUrl', lines);\n\t return DocumentChatAPI.loginWithCredentials(serverUrl, clientId, clientSecret, tokenUrl);\n\t}\n throw new Error('Can not login, please supply a credentials properties file.');\n }\n\n private static parseServerUrl(serverUrl: string): string {\n if (serverUrl.endsWith('/')) {\n serverUrl = serverUrl.slice(0, -1);\n }\n if (serverUrl.endsWith('/tt-platform-ui/en/#')) {\n serverUrl = serverUrl.replace('/tt-platform-ui/en/#', '/tt-product-server');\n } else if (!serverUrl.endsWith('/tt-product-server')) {\n serverUrl += '/tt-product-server';\n }\n return serverUrl;\n }\n\n private static getValueOfInPropertiesFile(searchKey: string, lines: string[][]): string {\n for (const line of lines) {\n if (line[0] === searchKey) {\n return line[1].replace('\\\\:', ':');\n }\n }\n throw Error(`.properties files contains no ${searchKey}!`);\n }\n\n endpoint(): string {\n return this.parentEndpoint;\n }\n\n documentchat(): DocumentchatEndpoint {\n return new DocumentchatEndpoint(this.restClient, this.endpoint());\n }\n\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../../semantha-product-sdk/document-chat/api/sse.ts","../../../semantha-product-sdk/document-chat/api/document.ts","../../../semantha-product-sdk/document-chat/api/documents.ts","../../../semantha-product-sdk/document-chat/api/domain.ts","../../../semantha-product-sdk/document-chat/api/domains.ts","../../../semantha-product-sdk/document-chat/api/documentchat.ts","../../../semantha-product-sdk/document-chat/api/documentChatAPI.ts"],"names":["SseEndpoint","restClient","parentEndpoint","body","polarionToken","polarionURL","headers","DocumentEndpoint","sourcedocid","DocumentsEndpoint","DomainEndpoint","domainname","DomainsEndpoint","DocumentchatEndpoint","PARENT_ENDPOINT","DocumentChatAPI","_DocumentChatAPI","serverUrl","apiKey","RestCl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DAA6D,CAC/E,CAEA,OAAe,cAAA,CAAeL,CAAAA,CAA2B,CACvD,OAAIA,CAAAA,CAAU,QAAA,CAAS,GAAG,CAAA,GACxBA,CAAAA,CAAYA,CAAAA,CAAU,MAAM,CAAA,CAAG,EAAE,CAAA,CAAA,CAE/BA,CAAAA,CAAU,QAAA,CAAS,sBAAsB,CAAA,CAC3CA,CAAAA,CAAYA,CAAAA,CAAU,OAAA,CAAQ,sBAAA,CAAwB,oBAAoB,CAAA,CAChEA,CAAAA,CAAU,QAAA,CAAS,oBAAoB,CAAA,GACjDA,CAAAA,EAAa,oBAAA,CAAA,CAERA,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,KAAA,CAAO,GAAG,CAAA,CAGrC,MAAM,KAAA,CAAM,CAAA,8BAAA,EAAiCC,CAAS,CAAA,CAAA,CAAG,CAC3D,CAEA,QAAA,EAAmB,CACjB,OAAO,IAAA,CAAK,cACd,CAEA,YAAA,EAAqC,CACnC,OAAO,IAAIb,CAAAA,CAAqB,IAAA,CAAK,UAAA,CAAY,IAAA,CAAK,QAAA,EAAU,CAClE,CAEF","file":"index.mjs","sourcesContent":["import { DocumentChatRequest } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\nimport { ServerSentEvent } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}/documents/{sourcedocid}/sse\"\n * This is a generated file do not change manually!\n */\nexport class SseEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/sse\";\n }\n\n /**\n * Chat with a document, streaming the answer via Server-Sent Events\n * Streaming variant of the document chat endpoint with identical semantics (same path parameters, headers, request body and settings). The response is a text/event-stream: an 'event: delta' per answer chunk (data: {\"content\":\"...\"}), a terminal 'event: done' carrying the conversationId (data: {\"conversationId\":\"...\"}), and 'event: error' (data: {\"message\":\"...\"}) if the stream fails after it has started.\n *\n * @param body DocumentChatRequest? - \n * @param polarionToken string? - The personal access token for polarion\n * @param polarionURL string? - The url of the polarion server to talk to\n */\n async postAsEventStream(\n body?: DocumentChatRequest,\n polarionToken?: string, polarionURL?: string): Promise<AsyncIterable<ServerSentEvent>> {\n const headers = this.restClient.toHeader(MediaType.EVENT_STREAM);\n if (polarionToken !== undefined) {\n headers['Polarion-Token'] = polarionToken;\n }\n if (polarionURL !== undefined) {\n headers['Polarion-URL'] = polarionURL;\n }\n return this.restClient.postEventStream(\n this.ENDPOINT,\n {},\n headers,\n body\n );\n }\n}\n","import { DocumentChatRequest } from '../model';\nimport { DocumentChatResponse } from '../model';\nimport { MediaType } from '../../rest';\nimport { RestClient } from '../../rest';\nimport { SseEndpoint } from './sse';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}/documents/{sourcedocid}\"\n * This is a generated file do not change manually!\n */\nexport class DocumentEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly sourcedocid: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documents\" + `/${this.sourcedocid}`;\n }\n\n sse(): SseEndpoint {\n return new SseEndpoint(this.restClient, this.ENDPOINT);\n }\n\n /**\n * @param body DocumentChatRequest? - \n * @param polarionToken string? - The personal access token for polarion\n * @param polarionURL string? - The url of the polarion server to talk to\n */\n async post(\n body?: DocumentChatRequest,\n polarionToken?: string, polarionURL?: string): Promise<DocumentChatResponse> {\n const headers = this.restClient.toHeader(MediaType.JSON);\n if (polarionToken !== undefined) {\n headers['Polarion-Token'] = polarionToken;\n }\n if (polarionURL !== undefined) {\n headers['Polarion-URL'] = polarionURL;\n }\n return (\n await this.restClient.post<DocumentChatResponse>(\n this.ENDPOINT,\n {},\n headers,\n body\n )\n ).toModel();\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}/documents\"\n * This is a generated file do not change manually!\n */\nexport class DocumentsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documents\";\n }\n}\n","import { DocumentEndpoint } from './document';\nimport { DocumentsEndpoint } from './documents';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains/{domainname}\"\n * This is a generated file do not change manually!\n */\nexport class DomainEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n private readonly domainname: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\" + `/${this.domainname}`;\n }\n\n documents(): DocumentsEndpoint;\n documents(sourcedocid: string): DocumentEndpoint\n \n documents(sourcedocid?: string): DocumentEndpoint | DocumentsEndpoint {\n if(sourcedocid !== undefined && sourcedocid !== null) {\n\t return new DocumentEndpoint(this.restClient, this.ENDPOINT, sourcedocid);\n } else {\n\t return new DocumentsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat/domains\"\n * This is a generated file do not change manually!\n */\nexport class DomainsEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/domains\";\n }\n}\n","import { DomainEndpoint } from './domain';\nimport { DomainsEndpoint } from './domains';\nimport { RestClient } from '../../rest';\n\n/**\n * @author semantha\n *\n * Class to access resource \"/api/documentchat\"\n * This is a generated file do not change manually!\n */\nexport class DocumentchatEndpoint {\n private readonly ENDPOINT: string;\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string,\n ) {\n this.ENDPOINT = this.parentEndpoint + \"/documentchat\";\n }\n\n domains(): DomainsEndpoint;\n domains(domainname: string): DomainEndpoint\n \n domains(domainname?: string): DomainEndpoint | DomainsEndpoint {\n if(domainname !== undefined && domainname !== null) {\n\t return new DomainEndpoint(this.restClient, this.ENDPOINT, domainname);\n } else {\n\t return new DomainsEndpoint(this.restClient, this.ENDPOINT);\n }\n }\n}\n","import * as fs from 'fs';\n\nimport { DocumentchatEndpoint } from './documentchat';\nimport { RestClient } from '../../rest';\n\nconst PARENT_ENDPOINT = '/api';\n\n/**\n * Entry point to the DocumentChat API.\n *\n * @author semantha\n * Calls the /documentchat, endpoints.\n *\n * Note:\n * The constructor is not meant to be invoked directly\n * use `loginXXX()` with your credentials instead.\n *\n * this is a generated class do not change manually!\n */\nexport class DocumentChatAPI {\n\n constructor(\n private readonly restClient: RestClient,\n private readonly parentEndpoint: string\n ) {\n }\n\n /**\n * Access to the DocumentChat API\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n * @param apiKey: string - A valid bearer token for accessing the given url.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithApiKey(\n serverUrl: string,\n apiKey: string\n ): DocumentChatAPI {\n if(!apiKey) {\n throw new Error('You need to supply an API key to login.');\n }\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new DocumentChatAPI(new RestClient(this.parseServerUrl(serverUrl), apiKey), PARENT_ENDPOINT);\n }\n\n\n /**\n * Access to the DocumentChat API, when there is a auth proxy in place to handle the addition of the Authorization header\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithAuthProxy(\n serverUrl: string\n ): DocumentChatAPI {\n if(!serverUrl) {\n throw new Error('You need to supply a server url to login.');\n }\n return new DocumentChatAPI(new RestClient(this.parseServerUrl(serverUrl)), PARENT_ENDPOINT);\n }\n\n /**\n * Access to the DocumentChat API\n *\n * @param serverUrl: string - URL to the DocumentChat server.\n * @param clientId: string - OAuth2 client id.\n * @param clientSecret: string - OAuth2 client secret.\n * @param tokenUrl: string OAuth2 url to get a valid access token\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithCredentials(\n serverUrl: string,\n clientId: string,\n clientSecret: string,\n tokenUrl: string\n ): DocumentChatAPI {\n serverUrl = this.parseServerUrl(serverUrl);\n return new DocumentChatAPI(new RestClient(serverUrl, undefined, clientId, clientSecret, tokenUrl), PARENT_ENDPOINT);\n }\n\t\n /**\n * Access to the DocumentChat API\n *\n * @param credentialsFilePath: string - Path to a properties file providing client credentials.\n *\n * @return DocumentChatAPI: Entry point to the DocumentChat API.\n */\n static loginWithCredentialsFile(credentialsFilePath: string) : DocumentChatAPI {\n if (credentialsFilePath.endsWith('.properties') || credentialsFilePath.endsWith('.PROPERTIES')) {\n const rawData = fs.readFileSync(credentialsFilePath, 'utf8');\n const lines = rawData\n\t .split(/[\\n|\\r\\n]/)\n\t .filter(line => line.length !== 0)\n\t .map(line => line.split('='));\n\t const serverUrl = this.getValueOfInPropertiesFile('serverUrl', lines);\n\t const clientId = this.getValueOfInPropertiesFile('clientId', lines);\n\t const clientSecret = this.getValueOfInPropertiesFile('clientSecret', lines);\n\t const tokenUrl = this.getValueOfInPropertiesFile('tokenUrl', lines);\n\t return DocumentChatAPI.loginWithCredentials(serverUrl, clientId, clientSecret, tokenUrl);\n\t}\n throw new Error('Can not login, please supply a credentials properties file.');\n }\n\n private static parseServerUrl(serverUrl: string): string {\n if (serverUrl.endsWith('/')) {\n serverUrl = serverUrl.slice(0, -1);\n }\n if (serverUrl.endsWith('/tt-platform-ui/en/#')) {\n serverUrl = serverUrl.replace('/tt-platform-ui/en/#', '/tt-product-server');\n } else if (!serverUrl.endsWith('/tt-product-server')) {\n serverUrl += '/tt-product-server';\n }\n return serverUrl;\n }\n\n private static getValueOfInPropertiesFile(searchKey: string, lines: string[][]): string {\n for (const line of lines) {\n if (line[0] === searchKey) {\n return line[1].replace('\\\\:', ':');\n }\n }\n throw Error(`.properties files contains no ${searchKey}!`);\n }\n\n endpoint(): string {\n return this.parentEndpoint;\n }\n\n documentchat(): DocumentchatEndpoint {\n return new DocumentchatEndpoint(this.restClient, this.endpoint());\n }\n\n}"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkT3AKTUUR_js=require('../../chunk-T3AKTUUR.js');require('../../chunk-C255MF6C.js');Object.defineProperty(exports,"BoxEndpoint",{enumerable:true,get:function(){return chunkT3AKTUUR_js.a}});Object.defineProperty(exports,"BoxesEndpoint",{enumerable:true,get:function(){return chunkT3AKTUUR_js.b}});Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkT3AKTUUR_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkT3AKTUUR_js.d}});Object.defineProperty(exports,"FileBoxAPI",{enumerable:true,get:function(){return chunkT3AKTUUR_js.f}});Object.defineProperty(exports,"FileboxEndpoint",{enumerable:true,get:function(){return chunkT3AKTUUR_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-
|
|
1
|
+
export{a as BoxEndpoint,b as BoxesEndpoint,c as DomainEndpoint,d as DomainsEndpoint,f as FileBoxAPI,e as FileboxEndpoint}from'../../chunk-PNXLWDZQ.mjs';import'../../chunk-36CIB62T.mjs';//# sourceMappingURL=index.mjs.map
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/file-box/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkT3AKTUUR_js=require('../chunk-T3AKTUUR.js');require('../chunk-C255MF6C.js');var chunkZSFNB534_js=require('../chunk-ZSFNB534.js');Object.defineProperty(exports,"BoxEndpoint",{enumerable:true,get:function(){return chunkT3AKTUUR_js.a}});Object.defineProperty(exports,"BoxesEndpoint",{enumerable:true,get:function(){return chunkT3AKTUUR_js.b}});Object.defineProperty(exports,"DomainEndpoint",{enumerable:true,get:function(){return chunkT3AKTUUR_js.c}});Object.defineProperty(exports,"DomainsEndpoint",{enumerable:true,get:function(){return chunkT3AKTUUR_js.d}});Object.defineProperty(exports,"FileBoxAPI",{enumerable:true,get:function(){return chunkT3AKTUUR_js.f}});Object.defineProperty(exports,"FileboxEndpoint",{enumerable:true,get:function(){return chunkT3AKTUUR_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
|
package/dist/file-box/index.mjs
CHANGED
|
@@ -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-
|
|
1
|
+
export{a as BoxEndpoint,b as BoxesEndpoint,c as DomainEndpoint,d as DomainsEndpoint,f as FileBoxAPI,e as FileboxEndpoint}from'../chunk-PNXLWDZQ.mjs';import'../chunk-36CIB62T.mjs';export{a as FileTypeEnumValues,b as isFileTypeEnumValue}from'../chunk-DURTIKAP.mjs';//# sourceMappingURL=index.mjs.map
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunk4CX7MUVC_js=require('../../chunk-4CX7MUVC.js'),W=require('fs');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var W__namespace=/*#__PURE__*/_interopNamespace(W);var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var p=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t){return (await this.restClient.post(this.ENDPOINT,t,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),{},"blob")).toFile()}};var m=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new p(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var d=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/aitasks/${this.analysisid}`;}ENDPOINT;pagedresults(){return new l(this.restClient,this.ENDPOINT)}results(){return new m(this.restClient,this.ENDPOINT)}};var E=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/aitasks";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var u=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/report";}ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var N=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/analyses";}ENDPOINT;report(){return new u(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}async postJson(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var h=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var c=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/stats";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var y=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;stats(){return new c(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var C=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/analyses/${this.analysisid}`;}ENDPOINT;pagedresults(){return new y(this.restClient,this.ENDPOINT)}results(){return new h(this.restClient,this.ENDPOINT)}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var f=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new f(this.restClient,this.ENDPOINT)}};var g=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/bulk";}ENDPOINT;results(){return new s(this.restClient,this.ENDPOINT)}};var P=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/classifications";}ENDPOINT};var T=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/comments";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var O=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/roles";}ENDPOINT};var D=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/currentuser";}ENDPOINT;roles(){return new O(this.restClient,this.ENDPOINT)}};var v=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/evaluations/${this.id}`;}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/evaluations";}ENDPOINT;async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var I=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/exceltemplates/${this.id}`;}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var R=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/new";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var x=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/exceltemplates";}ENDPOINT;new(){return new R(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var w=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/references";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}};var A=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.resultid=n;this.ENDPOINT=this.parentEndpoint+`/results/${this.resultid}`;}ENDPOINT;comments(){return new T(this.restClient,this.ENDPOINT)}evaluations(){return new o(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var M=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;aitasks(t){return t!=null?new d(this.restClient,this.ENDPOINT,t):new E(this.restClient,this.ENDPOINT)}analyses(t){return t!=null?new C(this.restClient,this.ENDPOINT,t):new N(this.restClient,this.ENDPOINT)}bulk(){return new g(this.restClient,this.ENDPOINT)}classifications(){return new P(this.restClient,this.ENDPOINT)}evaluations(t){return t!=null?new v(this.restClient,this.ENDPOINT,t):new o(this.restClient,this.ENDPOINT)}exceltemplates(t){return t!=null?new I(this.restClient,this.ENDPOINT,t):new x(this.restClient,this.ENDPOINT)}references(){return new w(this.restClient,this.ENDPOINT)}results(t){return t!=null?new A(this.restClient,this.ENDPOINT,t):new s(this.restClient,this.ENDPOINT)}};var b=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var S=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/requirements";}ENDPOINT;currentuser(){return new D(this.restClient,this.ENDPOINT)}domains(t){return t!=null?new M(this.restClient,this.ENDPOINT,t):new b(this.restClient,this.ENDPOINT)}};var J="/api",F=class r{constructor(t,e){this.restClient=t;this.parentEndpoint=e;}static loginWithApiKey(t,e){if(!e)throw new Error("You need to supply an API key to login.");if(!t)throw new Error("You need to supply a server url to login.");return new r(new chunk4CX7MUVC_js.c(this.parseServerUrl(t),e),J)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new r(new chunk4CX7MUVC_js.c(this.parseServerUrl(t)),J)}static loginWithCredentials(t,e,n,H){return t=this.parseServerUrl(t),new r(new chunk4CX7MUVC_js.c(t,void 0,e,n,H),J)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=W__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(k=>k.length!==0).map(k=>k.split("=")),H=this.getValueOfInPropertiesFile("serverUrl",n),X=this.getValueOfInPropertiesFile("clientId",n),B=this.getValueOfInPropertiesFile("clientSecret",n),$=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(H,X,B,$)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let n of e)if(n[0]===t)return n[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}requirements(){return new S(this.restClient,this.endpoint())}};exports.AitaskEndpoint=d;exports.AitasksEndpoint=E;exports.AitasksPagedresultsEndpoint=l;exports.AitasksResultsEndpoint=m;exports.AitasksresultsExportEndpoint=p;exports.AnalysesEndpoint=N;exports.AnalysisEndpoint=C;exports.AnalysisResultsEndpoint=h;exports.BulkEndpoint=g;exports.ClassificationsEndpoint=P;exports.CommentsEndpoint=T;exports.CurrentuserEndpoint=D;exports.DomainEndpoint=M;exports.DomainsEndpoint=b;exports.EvaluationEndpoint=v;exports.EvaluationsEndpoint=o;exports.ExceltemplateEndpoint=I;exports.ExceltemplatesEndpoint=x;exports.ExportEndpoint=f;exports.NewEndpoint=R;exports.PagedresultsEndpoint=y;exports.ReferencesEndpoint=w;exports.ReportEndpoint=u;exports.RequirementsAPI=F;exports.RequirementsEndpoint=S;exports.ResultEndpoint=A;exports.ResultsEndpoint=s;exports.RolesEndpoint=O;exports.StatsEndpoint=c;//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';var chunkC255MF6C_js=require('../../chunk-C255MF6C.js'),W=require('fs');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var W__namespace=/*#__PURE__*/_interopNamespace(W);var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var p=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t){return (await this.restClient.post(this.ENDPOINT,t,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),{},"blob")).toFile()}};var m=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new p(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var d=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/aitasks/${this.analysisid}`;}ENDPOINT;pagedresults(){return new l(this.restClient,this.ENDPOINT)}results(){return new m(this.restClient,this.ENDPOINT)}};var E=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/aitasks";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var u=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/report";}ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var N=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/analyses";}ENDPOINT;report(){return new u(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}async postJson(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var h=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var c=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/stats";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var y=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;stats(){return new c(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var C=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/analyses/${this.analysisid}`;}ENDPOINT;pagedresults(){return new y(this.restClient,this.ENDPOINT)}results(){return new h(this.restClient,this.ENDPOINT)}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var f=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new f(this.restClient,this.ENDPOINT)}};var g=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/bulk";}ENDPOINT;results(){return new s(this.restClient,this.ENDPOINT)}};var P=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/classifications";}ENDPOINT};var T=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/comments";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var O=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/roles";}ENDPOINT};var D=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/currentuser";}ENDPOINT;roles(){return new O(this.restClient,this.ENDPOINT)}};var v=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/evaluations/${this.id}`;}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/evaluations";}ENDPOINT;async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var I=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/exceltemplates/${this.id}`;}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var R=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/new";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var x=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/exceltemplates";}ENDPOINT;new(){return new R(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var w=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/references";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}};var A=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.resultid=n;this.ENDPOINT=this.parentEndpoint+`/results/${this.resultid}`;}ENDPOINT;comments(){return new T(this.restClient,this.ENDPOINT)}evaluations(){return new o(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var M=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;aitasks(t){return t!=null?new d(this.restClient,this.ENDPOINT,t):new E(this.restClient,this.ENDPOINT)}analyses(t){return t!=null?new C(this.restClient,this.ENDPOINT,t):new N(this.restClient,this.ENDPOINT)}bulk(){return new g(this.restClient,this.ENDPOINT)}classifications(){return new P(this.restClient,this.ENDPOINT)}evaluations(t){return t!=null?new v(this.restClient,this.ENDPOINT,t):new o(this.restClient,this.ENDPOINT)}exceltemplates(t){return t!=null?new I(this.restClient,this.ENDPOINT,t):new x(this.restClient,this.ENDPOINT)}references(){return new w(this.restClient,this.ENDPOINT)}results(t){return t!=null?new A(this.restClient,this.ENDPOINT,t):new s(this.restClient,this.ENDPOINT)}};var b=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var S=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/requirements";}ENDPOINT;currentuser(){return new D(this.restClient,this.ENDPOINT)}domains(t){return t!=null?new M(this.restClient,this.ENDPOINT,t):new b(this.restClient,this.ENDPOINT)}};var J="/api",F=class r{constructor(t,e){this.restClient=t;this.parentEndpoint=e;}static loginWithApiKey(t,e){if(!e)throw new Error("You need to supply an API key to login.");if(!t)throw new Error("You need to supply a server url to login.");return new r(new chunkC255MF6C_js.e(this.parseServerUrl(t),e),J)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new r(new chunkC255MF6C_js.e(this.parseServerUrl(t)),J)}static loginWithCredentials(t,e,n,H){return t=this.parseServerUrl(t),new r(new chunkC255MF6C_js.e(t,void 0,e,n,H),J)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=W__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(k=>k.length!==0).map(k=>k.split("=")),H=this.getValueOfInPropertiesFile("serverUrl",n),X=this.getValueOfInPropertiesFile("clientId",n),B=this.getValueOfInPropertiesFile("clientSecret",n),$=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(H,X,B,$)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let n of e)if(n[0]===t)return n[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}requirements(){return new S(this.restClient,this.endpoint())}};exports.AitaskEndpoint=d;exports.AitasksEndpoint=E;exports.AitasksPagedresultsEndpoint=l;exports.AitasksResultsEndpoint=m;exports.AitasksresultsExportEndpoint=p;exports.AnalysesEndpoint=N;exports.AnalysisEndpoint=C;exports.AnalysisResultsEndpoint=h;exports.BulkEndpoint=g;exports.ClassificationsEndpoint=P;exports.CommentsEndpoint=T;exports.CurrentuserEndpoint=D;exports.DomainEndpoint=M;exports.DomainsEndpoint=b;exports.EvaluationEndpoint=v;exports.EvaluationsEndpoint=o;exports.ExceltemplateEndpoint=I;exports.ExceltemplatesEndpoint=x;exports.ExportEndpoint=f;exports.NewEndpoint=R;exports.PagedresultsEndpoint=y;exports.ReferencesEndpoint=w;exports.ReportEndpoint=u;exports.RequirementsAPI=F;exports.RequirementsEndpoint=S;exports.ResultEndpoint=A;exports.ResultsEndpoint=s;exports.RolesEndpoint=O;exports.StatsEndpoint=c;//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {c as c$1}from'../../chunk-FA37ZZXB.mjs';import*as W from'fs';var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var p=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t){return (await this.restClient.post(this.ENDPOINT,t,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),{},"blob")).toFile()}};var m=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new p(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var d=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/aitasks/${this.analysisid}`;}ENDPOINT;pagedresults(){return new l(this.restClient,this.ENDPOINT)}results(){return new m(this.restClient,this.ENDPOINT)}};var E=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/aitasks";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var u=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/report";}ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var N=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/analyses";}ENDPOINT;report(){return new u(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}async postJson(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var h=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var c=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/stats";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var y=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;stats(){return new c(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var C=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/analyses/${this.analysisid}`;}ENDPOINT;pagedresults(){return new y(this.restClient,this.ENDPOINT)}results(){return new h(this.restClient,this.ENDPOINT)}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var f=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new f(this.restClient,this.ENDPOINT)}};var g=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/bulk";}ENDPOINT;results(){return new s(this.restClient,this.ENDPOINT)}};var P=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/classifications";}ENDPOINT};var T=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/comments";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var O=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/roles";}ENDPOINT};var D=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/currentuser";}ENDPOINT;roles(){return new O(this.restClient,this.ENDPOINT)}};var v=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/evaluations/${this.id}`;}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/evaluations";}ENDPOINT;async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var I=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/exceltemplates/${this.id}`;}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var R=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/new";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var x=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/exceltemplates";}ENDPOINT;new(){return new R(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var w=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/references";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}};var A=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.resultid=n;this.ENDPOINT=this.parentEndpoint+`/results/${this.resultid}`;}ENDPOINT;comments(){return new T(this.restClient,this.ENDPOINT)}evaluations(){return new o(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var M=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;aitasks(t){return t!=null?new d(this.restClient,this.ENDPOINT,t):new E(this.restClient,this.ENDPOINT)}analyses(t){return t!=null?new C(this.restClient,this.ENDPOINT,t):new N(this.restClient,this.ENDPOINT)}bulk(){return new g(this.restClient,this.ENDPOINT)}classifications(){return new P(this.restClient,this.ENDPOINT)}evaluations(t){return t!=null?new v(this.restClient,this.ENDPOINT,t):new o(this.restClient,this.ENDPOINT)}exceltemplates(t){return t!=null?new I(this.restClient,this.ENDPOINT,t):new x(this.restClient,this.ENDPOINT)}references(){return new w(this.restClient,this.ENDPOINT)}results(t){return t!=null?new A(this.restClient,this.ENDPOINT,t):new s(this.restClient,this.ENDPOINT)}};var b=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var S=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/requirements";}ENDPOINT;currentuser(){return new D(this.restClient,this.ENDPOINT)}domains(t){return t!=null?new M(this.restClient,this.ENDPOINT,t):new b(this.restClient,this.ENDPOINT)}};var J="/api",F=class r{constructor(t,e){this.restClient=t;this.parentEndpoint=e;}static loginWithApiKey(t,e){if(!e)throw new Error("You need to supply an API key to login.");if(!t)throw new Error("You need to supply a server url to login.");return new r(new c$1(this.parseServerUrl(t),e),J)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new r(new c$1(this.parseServerUrl(t)),J)}static loginWithCredentials(t,e,n,H){return t=this.parseServerUrl(t),new r(new c$1(t,void 0,e,n,H),J)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=W.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(k=>k.length!==0).map(k=>k.split("=")),H=this.getValueOfInPropertiesFile("serverUrl",n),X=this.getValueOfInPropertiesFile("clientId",n),B=this.getValueOfInPropertiesFile("clientSecret",n),$=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(H,X,B,$)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let n of e)if(n[0]===t)return n[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}requirements(){return new S(this.restClient,this.endpoint())}};export{d as AitaskEndpoint,E as AitasksEndpoint,l as AitasksPagedresultsEndpoint,m as AitasksResultsEndpoint,p as AitasksresultsExportEndpoint,N as AnalysesEndpoint,C as AnalysisEndpoint,h as AnalysisResultsEndpoint,g as BulkEndpoint,P as ClassificationsEndpoint,T as CommentsEndpoint,D as CurrentuserEndpoint,M as DomainEndpoint,b as DomainsEndpoint,v as EvaluationEndpoint,o as EvaluationsEndpoint,I as ExceltemplateEndpoint,x as ExceltemplatesEndpoint,f as ExportEndpoint,R as NewEndpoint,y as PagedresultsEndpoint,w as ReferencesEndpoint,u as ReportEndpoint,F as RequirementsAPI,S as RequirementsEndpoint,A as ResultEndpoint,s as ResultsEndpoint,O as RolesEndpoint,c as StatsEndpoint};//# sourceMappingURL=index.mjs.map
|
|
1
|
+
import {e}from'../../chunk-36CIB62T.mjs';import*as W from'fs';var l=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var p=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t){return (await this.restClient.post(this.ENDPOINT,t,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),{},"blob")).toFile()}};var m=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new p(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var d=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/aitasks/${this.analysisid}`;}ENDPOINT;pagedresults(){return new l(this.restClient,this.ENDPOINT)}results(){return new m(this.restClient,this.ENDPOINT)}};var E=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/aitasks";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var u=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/report";}ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var N=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/analyses";}ENDPOINT;report(){return new u(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}async postJson(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var h=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var c=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/stats";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var y=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/pagedresults";}ENDPOINT;stats(){return new c(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var C=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.analysisid=n;this.ENDPOINT=this.parentEndpoint+`/analyses/${this.analysisid}`;}ENDPOINT;pagedresults(){return new y(this.restClient,this.ENDPOINT)}results(){return new h(this.restClient,this.ENDPOINT)}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var f=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/export";}ENDPOINT;async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t,"blob")).toFile()}};var s=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/results";}ENDPOINT;export(){return new f(this.restClient,this.ENDPOINT)}};var g=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/bulk";}ENDPOINT;results(){return new s(this.restClient,this.ENDPOINT)}};var P=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/classifications";}ENDPOINT};var T=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/comments";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var O=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/roles";}ENDPOINT};var D=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/currentuser";}ENDPOINT;roles(){return new O(this.restClient,this.ENDPOINT)}};var v=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/evaluations/${this.id}`;}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var o=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/evaluations";}ENDPOINT;async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var I=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/exceltemplates/${this.id}`;}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var R=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/new";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var x=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/exceltemplates";}ENDPOINT;new(){return new R(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var w=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/references";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}};var A=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.resultid=n;this.ENDPOINT=this.parentEndpoint+`/results/${this.resultid}`;}ENDPOINT;comments(){return new T(this.restClient,this.ENDPOINT)}evaluations(){return new o(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var M=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;aitasks(t){return t!=null?new d(this.restClient,this.ENDPOINT,t):new E(this.restClient,this.ENDPOINT)}analyses(t){return t!=null?new C(this.restClient,this.ENDPOINT,t):new N(this.restClient,this.ENDPOINT)}bulk(){return new g(this.restClient,this.ENDPOINT)}classifications(){return new P(this.restClient,this.ENDPOINT)}evaluations(t){return t!=null?new v(this.restClient,this.ENDPOINT,t):new o(this.restClient,this.ENDPOINT)}exceltemplates(t){return t!=null?new I(this.restClient,this.ENDPOINT,t):new x(this.restClient,this.ENDPOINT)}references(){return new w(this.restClient,this.ENDPOINT)}results(t){return t!=null?new A(this.restClient,this.ENDPOINT,t):new s(this.restClient,this.ENDPOINT)}};var b=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var S=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/requirements";}ENDPOINT;currentuser(){return new D(this.restClient,this.ENDPOINT)}domains(t){return t!=null?new M(this.restClient,this.ENDPOINT,t):new b(this.restClient,this.ENDPOINT)}};var J="/api",F=class r{constructor(t,e){this.restClient=t;this.parentEndpoint=e;}static loginWithApiKey(t,e$1){if(!e$1)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 e(this.parseServerUrl(t),e$1),J)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new r(new e(this.parseServerUrl(t)),J)}static loginWithCredentials(t,e$1,n,H){return t=this.parseServerUrl(t),new r(new e(t,void 0,e$1,n,H),J)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=W.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(k=>k.length!==0).map(k=>k.split("=")),H=this.getValueOfInPropertiesFile("serverUrl",n),X=this.getValueOfInPropertiesFile("clientId",n),B=this.getValueOfInPropertiesFile("clientSecret",n),$=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(H,X,B,$)}throw new Error("Can not login, please supply a credentials properties file.")}static parseServerUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/tt-platform-ui/en/#")?t=t.replace("/tt-platform-ui/en/#","/tt-product-server"):t.endsWith("/tt-product-server")||(t+="/tt-product-server"),t}static getValueOfInPropertiesFile(t,e){for(let n of e)if(n[0]===t)return n[1].replace("\\:",":");throw Error(`.properties files contains no ${t}!`)}endpoint(){return this.parentEndpoint}requirements(){return new S(this.restClient,this.endpoint())}};export{d as AitaskEndpoint,E as AitasksEndpoint,l as AitasksPagedresultsEndpoint,m as AitasksResultsEndpoint,p as AitasksresultsExportEndpoint,N as AnalysesEndpoint,C as AnalysisEndpoint,h as AnalysisResultsEndpoint,g as BulkEndpoint,P as ClassificationsEndpoint,T as CommentsEndpoint,D as CurrentuserEndpoint,M as DomainEndpoint,b as DomainsEndpoint,v as EvaluationEndpoint,o as EvaluationsEndpoint,I as ExceltemplateEndpoint,x as ExceltemplatesEndpoint,f as ExportEndpoint,R as NewEndpoint,y as PagedresultsEndpoint,w as ReferencesEndpoint,u as ReportEndpoint,F as RequirementsAPI,S as RequirementsEndpoint,A as ResultEndpoint,s as ResultsEndpoint,O as RolesEndpoint,c as StatsEndpoint};//# sourceMappingURL=index.mjs.map
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|