@semantha/sdk 12.2.0 → 12.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -2359,7 +2359,7 @@ declare class ReferencedocumentsEndpoint {
|
|
|
2359
2359
|
stream(): ReferencedocumentsStreamEndpoint;
|
|
2360
2360
|
/**
|
|
2361
2361
|
* Get all reference documents a.k.a. library items.
|
|
2362
|
-
* Supports server side pagination and filtering for <strong>application/json</strong> media type only by using <strong>offset</strong> and <strong>limit</strong> query parameter.<br><strong>Filter parameters:</strong> name, createdbefore, createdafter, tags, documentclassids, metadata.<br>Without <strong>offset</strong> and <strong>limit</strong> parameter, data can be filtered only by <strong>tags</strong> and <strong>documentclassids</strong>.
|
|
2362
|
+
* Supports server side pagination and filtering for <strong>application/json</strong> media type only by using <strong>offset</strong> and <strong>limit</strong> query parameter.<br><strong>Filter parameters:</strong> name, createdbefore, createdafter, tags, hastags, documentclassids, metadata.<br>Without <strong>offset</strong> and <strong>limit</strong> parameter, data can be filtered only by <strong>tags</strong> and <strong>documentclassids</strong>.
|
|
2363
2363
|
*
|
|
2364
2364
|
* @param documentids string? - List of document Ids for target. The limit here is 65000 IDs. The IDs can be passed as a comma separated string.
|
|
2365
2365
|
* @param name string? - Filter documents for a given name
|
|
@@ -2368,6 +2368,7 @@ declare class ReferencedocumentsEndpoint {
|
|
|
2368
2368
|
* @param updatedafter number? - Filter for documents which are updated after a given UNIX timestamp. The updatedafter filter only works when also using the parameters offset and limit.
|
|
2369
2369
|
* @param updatedbefore number? - Filter for documents which are updated before a given UNIX timestamp. The updatedbefore filter only works when also using the parameters offset and limit.
|
|
2370
2370
|
* @param tags string? - List of tags to filter the reference library. You can combine the tags using a comma (OR) and using a plus sign (AND).
|
|
2371
|
+
* @param hastags string? - Filters the returned reference documents by whether they have at least one tag. If true, only documents with tags are returned; if false, only documents without tags are returned. If omitted or empty, documents are not filtered by tag presence. Any other value is rejected. Both tags assigned directly to the document and tags derived from its documentclass are considered. The hastags filter only works when also using the parameters offset and limit.
|
|
2371
2372
|
* @param documentclassids string? - List of documentclass IDs for the target. The limit here is 1000 IDs. The IDs are passed as a comma separated list. Each value can be either the documentclass UUID `id` or its numeric `shortId`; numeric values are resolved server-side to the matching documentclass UUID. UUIDs and shortIds may be mixed in the same request.
|
|
2372
2373
|
* @param withoutdocumentclass boolean? - Filters the returned reference documents to include only documents that are not linked to a documentclass. The parameter is of type boolean and is set to false by default.
|
|
2373
2374
|
* @param mincharacters number? - Filters the returned reference documents to include only documents that have a minimum of characters
|
|
@@ -2388,6 +2389,7 @@ declare class ReferencedocumentsEndpoint {
|
|
|
2388
2389
|
updatedafter?: number;
|
|
2389
2390
|
updatedbefore?: number;
|
|
2390
2391
|
tags?: string;
|
|
2392
|
+
hastags?: string;
|
|
2391
2393
|
documentclassids?: string;
|
|
2392
2394
|
withoutdocumentclass?: boolean;
|
|
2393
2395
|
mincharacters?: number;
|
|
@@ -2402,7 +2404,7 @@ declare class ReferencedocumentsEndpoint {
|
|
|
2402
2404
|
}): Promise<ReferenceDocumentsResponseContainer>;
|
|
2403
2405
|
/**
|
|
2404
2406
|
* Get all reference documents a.k.a. library items.
|
|
2405
|
-
* Supports server side pagination and filtering for <strong>application/json</strong> media type only by using <strong>offset</strong> and <strong>limit</strong> query parameter.<br><strong>Filter parameters:</strong> name, createdbefore, createdafter, tags, documentclassids, metadata.<br>Without <strong>offset</strong> and <strong>limit</strong> parameter, data can be filtered only by <strong>tags</strong> and <strong>documentclassids</strong>.
|
|
2407
|
+
* Supports server side pagination and filtering for <strong>application/json</strong> media type only by using <strong>offset</strong> and <strong>limit</strong> query parameter.<br><strong>Filter parameters:</strong> name, createdbefore, createdafter, tags, hastags, documentclassids, metadata.<br>Without <strong>offset</strong> and <strong>limit</strong> parameter, data can be filtered only by <strong>tags</strong> and <strong>documentclassids</strong>.
|
|
2406
2408
|
*
|
|
2407
2409
|
* @param documentids string? - List of document Ids for target. The limit here is 65000 IDs. The IDs can be passed as a comma separated string.
|
|
2408
2410
|
* @param name string? - Filter documents for a given name
|
|
@@ -2411,6 +2413,7 @@ declare class ReferencedocumentsEndpoint {
|
|
|
2411
2413
|
* @param updatedafter number? - Filter for documents which are updated after a given UNIX timestamp. The updatedafter filter only works when also using the parameters offset and limit.
|
|
2412
2414
|
* @param updatedbefore number? - Filter for documents which are updated before a given UNIX timestamp. The updatedbefore filter only works when also using the parameters offset and limit.
|
|
2413
2415
|
* @param tags string? - List of tags to filter the reference library. You can combine the tags using a comma (OR) and using a plus sign (AND).
|
|
2416
|
+
* @param hastags string? - Filters the returned reference documents by whether they have at least one tag. If true, only documents with tags are returned; if false, only documents without tags are returned. If omitted or empty, documents are not filtered by tag presence. Any other value is rejected. Both tags assigned directly to the document and tags derived from its documentclass are considered. The hastags filter only works when also using the parameters offset and limit.
|
|
2414
2417
|
* @param documentclassids string? - List of documentclass IDs for the target. The limit here is 1000 IDs. The IDs are passed as a comma separated list. Each value can be either the documentclass UUID `id` or its numeric `shortId`; numeric values are resolved server-side to the matching documentclass UUID. UUIDs and shortIds may be mixed in the same request.
|
|
2415
2418
|
* @param withoutdocumentclass boolean? - Filters the returned reference documents to include only documents that are not linked to a documentclass. The parameter is of type boolean and is set to false by default.
|
|
2416
2419
|
* @param mincharacters number? - Filters the returned reference documents to include only documents that have a minimum of characters
|
|
@@ -2431,6 +2434,7 @@ declare class ReferencedocumentsEndpoint {
|
|
|
2431
2434
|
updatedafter?: number;
|
|
2432
2435
|
updatedbefore?: number;
|
|
2433
2436
|
tags?: string;
|
|
2437
|
+
hastags?: string;
|
|
2434
2438
|
documentclassids?: string;
|
|
2435
2439
|
withoutdocumentclass?: boolean;
|
|
2436
2440
|
mincharacters?: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -2359,7 +2359,7 @@ declare class ReferencedocumentsEndpoint {
|
|
|
2359
2359
|
stream(): ReferencedocumentsStreamEndpoint;
|
|
2360
2360
|
/**
|
|
2361
2361
|
* Get all reference documents a.k.a. library items.
|
|
2362
|
-
* Supports server side pagination and filtering for <strong>application/json</strong> media type only by using <strong>offset</strong> and <strong>limit</strong> query parameter.<br><strong>Filter parameters:</strong> name, createdbefore, createdafter, tags, documentclassids, metadata.<br>Without <strong>offset</strong> and <strong>limit</strong> parameter, data can be filtered only by <strong>tags</strong> and <strong>documentclassids</strong>.
|
|
2362
|
+
* Supports server side pagination and filtering for <strong>application/json</strong> media type only by using <strong>offset</strong> and <strong>limit</strong> query parameter.<br><strong>Filter parameters:</strong> name, createdbefore, createdafter, tags, hastags, documentclassids, metadata.<br>Without <strong>offset</strong> and <strong>limit</strong> parameter, data can be filtered only by <strong>tags</strong> and <strong>documentclassids</strong>.
|
|
2363
2363
|
*
|
|
2364
2364
|
* @param documentids string? - List of document Ids for target. The limit here is 65000 IDs. The IDs can be passed as a comma separated string.
|
|
2365
2365
|
* @param name string? - Filter documents for a given name
|
|
@@ -2368,6 +2368,7 @@ declare class ReferencedocumentsEndpoint {
|
|
|
2368
2368
|
* @param updatedafter number? - Filter for documents which are updated after a given UNIX timestamp. The updatedafter filter only works when also using the parameters offset and limit.
|
|
2369
2369
|
* @param updatedbefore number? - Filter for documents which are updated before a given UNIX timestamp. The updatedbefore filter only works when also using the parameters offset and limit.
|
|
2370
2370
|
* @param tags string? - List of tags to filter the reference library. You can combine the tags using a comma (OR) and using a plus sign (AND).
|
|
2371
|
+
* @param hastags string? - Filters the returned reference documents by whether they have at least one tag. If true, only documents with tags are returned; if false, only documents without tags are returned. If omitted or empty, documents are not filtered by tag presence. Any other value is rejected. Both tags assigned directly to the document and tags derived from its documentclass are considered. The hastags filter only works when also using the parameters offset and limit.
|
|
2371
2372
|
* @param documentclassids string? - List of documentclass IDs for the target. The limit here is 1000 IDs. The IDs are passed as a comma separated list. Each value can be either the documentclass UUID `id` or its numeric `shortId`; numeric values are resolved server-side to the matching documentclass UUID. UUIDs and shortIds may be mixed in the same request.
|
|
2372
2373
|
* @param withoutdocumentclass boolean? - Filters the returned reference documents to include only documents that are not linked to a documentclass. The parameter is of type boolean and is set to false by default.
|
|
2373
2374
|
* @param mincharacters number? - Filters the returned reference documents to include only documents that have a minimum of characters
|
|
@@ -2388,6 +2389,7 @@ declare class ReferencedocumentsEndpoint {
|
|
|
2388
2389
|
updatedafter?: number;
|
|
2389
2390
|
updatedbefore?: number;
|
|
2390
2391
|
tags?: string;
|
|
2392
|
+
hastags?: string;
|
|
2391
2393
|
documentclassids?: string;
|
|
2392
2394
|
withoutdocumentclass?: boolean;
|
|
2393
2395
|
mincharacters?: number;
|
|
@@ -2402,7 +2404,7 @@ declare class ReferencedocumentsEndpoint {
|
|
|
2402
2404
|
}): Promise<ReferenceDocumentsResponseContainer>;
|
|
2403
2405
|
/**
|
|
2404
2406
|
* Get all reference documents a.k.a. library items.
|
|
2405
|
-
* Supports server side pagination and filtering for <strong>application/json</strong> media type only by using <strong>offset</strong> and <strong>limit</strong> query parameter.<br><strong>Filter parameters:</strong> name, createdbefore, createdafter, tags, documentclassids, metadata.<br>Without <strong>offset</strong> and <strong>limit</strong> parameter, data can be filtered only by <strong>tags</strong> and <strong>documentclassids</strong>.
|
|
2407
|
+
* Supports server side pagination and filtering for <strong>application/json</strong> media type only by using <strong>offset</strong> and <strong>limit</strong> query parameter.<br><strong>Filter parameters:</strong> name, createdbefore, createdafter, tags, hastags, documentclassids, metadata.<br>Without <strong>offset</strong> and <strong>limit</strong> parameter, data can be filtered only by <strong>tags</strong> and <strong>documentclassids</strong>.
|
|
2406
2408
|
*
|
|
2407
2409
|
* @param documentids string? - List of document Ids for target. The limit here is 65000 IDs. The IDs can be passed as a comma separated string.
|
|
2408
2410
|
* @param name string? - Filter documents for a given name
|
|
@@ -2411,6 +2413,7 @@ declare class ReferencedocumentsEndpoint {
|
|
|
2411
2413
|
* @param updatedafter number? - Filter for documents which are updated after a given UNIX timestamp. The updatedafter filter only works when also using the parameters offset and limit.
|
|
2412
2414
|
* @param updatedbefore number? - Filter for documents which are updated before a given UNIX timestamp. The updatedbefore filter only works when also using the parameters offset and limit.
|
|
2413
2415
|
* @param tags string? - List of tags to filter the reference library. You can combine the tags using a comma (OR) and using a plus sign (AND).
|
|
2416
|
+
* @param hastags string? - Filters the returned reference documents by whether they have at least one tag. If true, only documents with tags are returned; if false, only documents without tags are returned. If omitted or empty, documents are not filtered by tag presence. Any other value is rejected. Both tags assigned directly to the document and tags derived from its documentclass are considered. The hastags filter only works when also using the parameters offset and limit.
|
|
2414
2417
|
* @param documentclassids string? - List of documentclass IDs for the target. The limit here is 1000 IDs. The IDs are passed as a comma separated list. Each value can be either the documentclass UUID `id` or its numeric `shortId`; numeric values are resolved server-side to the matching documentclass UUID. UUIDs and shortIds may be mixed in the same request.
|
|
2415
2418
|
* @param withoutdocumentclass boolean? - Filters the returned reference documents to include only documents that are not linked to a documentclass. The parameter is of type boolean and is set to false by default.
|
|
2416
2419
|
* @param mincharacters number? - Filters the returned reference documents to include only documents that have a minimum of characters
|
|
@@ -2431,6 +2434,7 @@ declare class ReferencedocumentsEndpoint {
|
|
|
2431
2434
|
updatedafter?: number;
|
|
2432
2435
|
updatedbefore?: number;
|
|
2433
2436
|
tags?: string;
|
|
2437
|
+
hastags?: string;
|
|
2434
2438
|
documentclassids?: string;
|
|
2435
2439
|
withoutdocumentclass?: boolean;
|
|
2436
2440
|
mincharacters?: number;
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
'use strict';var h=require('axios'),St=require('fs');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var h__default=/*#__PURE__*/_interopDefault(h);var St__namespace=/*#__PURE__*/_interopNamespace(St);var Mt=["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","CONTENT_TOO_LARGE","INTERNAL_SERVER_ERROR","GATEWAY_TIMEOUT","DOCUMENTTYPE_NOT_FOUND","DOCUMENTTYPE_NAME_EXISTS","DOCUMENTTYPE_NOT_EDITABLE","COMPARE_DOC_IS_EMPTY","COMPARE_WRONG_LANGUAGE","COMPARE_NO_REFERENCES","DOMAIN_NOT_FOUND","TOO_MANY_TOKENS","NO_FILE_FOUND","FILE_TYPE_NOT_SUPPORTED","FILE_PASSWORDPROTECTED","MISSING_SERVICE_DEFINITION","SERVICE_CALL_ERROR","GENERATIVE_MODEL_ERROR","USED_AS_LINKED_EXTRACTOR","CYCLICAL_DEPENDENCY_LINKED_EXTRACTOR","FILE_TOO_BIG","TOO_MANY_ROWS","REGEX_INVALID","GENERATIVE_MODEL_CONTEXT_EXCEEDED","PROMPT_NOT_DELETABLE","JPEG2000_NOT_SUPPORTED","TRANSLATION_ERROR","RESOURCE_NOT_FOUND","PARENT_RESOURCE_NOT_FOUND","RESOURCE_PARAMETER_CONSTRAINT_VIOLATION","PLATFORM_UNREACHABLE","FILE_SIZE_TOOBIG","USER_REPOSITORY_NOT_CONFIGURED","PDF_NOT_CONFIGURED","INVALID_USER_PASSWORD","UNKNOWN_FINGERPRINTER_ID","JSON_ARRAY_EMPTY","TOKENS_ILLEGAL_TYPE","NO_JSON","INVALID_JSON_FORMAT","JSON_OBJECT_HAS_NO_DOCUMENTS","DOCUMENTS_ARE_NO_JSON_ARRAY","DOCUMENTS_JSON_ARRAY_EMPTY","DOCUMENTS_VALUE_ERROR","DOCUMENTS_TYPE_ERROR","DOCUMENTS_TOO_FEW_DOCUMENTS","REQ_NO_JSON_ARRAY","SENTENCE_LIST_NOT_TWO","IMAGE_NOT_PROVIDED","IMAGE_INVALID_FORMAT","MODEL_NAME_INVALID","THRESHOLD_INVALID","IMAGE_BUFFER_EMPTY","INVALID_MODEL_ID","IMAGE_NOT_PROVIDED_IFP","IMAGE_INVALID_DATA","IMAGE_INVALID_FORMAT_IFP"];function Yt(r){return Mt.includes(r)}var At=["REQUIRED","OPTIONAL","NONE"];function Gt(r){return At.includes(r)}var _t=["USER","ASSISTANT","SYSTEM"];function
|
|
2
|
-
`)){if(
|
|
3
|
-
`),n,o):void 0}async function*wt(r){let t=r.getReader(),e=new TextDecoder,n="",o=
|
|
1
|
+
'use strict';var h=require('axios'),St=require('fs');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var h__default=/*#__PURE__*/_interopDefault(h);var St__namespace=/*#__PURE__*/_interopNamespace(St);var Mt=["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","CONTENT_TOO_LARGE","INTERNAL_SERVER_ERROR","GATEWAY_TIMEOUT","DOCUMENTTYPE_NOT_FOUND","DOCUMENTTYPE_NAME_EXISTS","DOCUMENTTYPE_NOT_EDITABLE","COMPARE_DOC_IS_EMPTY","COMPARE_WRONG_LANGUAGE","COMPARE_NO_REFERENCES","DOMAIN_NOT_FOUND","TOO_MANY_TOKENS","NO_FILE_FOUND","FILE_TYPE_NOT_SUPPORTED","FILE_PASSWORDPROTECTED","MISSING_SERVICE_DEFINITION","SERVICE_CALL_ERROR","GENERATIVE_MODEL_ERROR","USED_AS_LINKED_EXTRACTOR","CYCLICAL_DEPENDENCY_LINKED_EXTRACTOR","FILE_TOO_BIG","TOO_MANY_ROWS","REGEX_INVALID","GENERATIVE_MODEL_CONTEXT_EXCEEDED","PROMPT_NOT_DELETABLE","JPEG2000_NOT_SUPPORTED","TRANSLATION_ERROR","RESOURCE_NOT_FOUND","PARENT_RESOURCE_NOT_FOUND","RESOURCE_PARAMETER_CONSTRAINT_VIOLATION","PLATFORM_UNREACHABLE","FILE_SIZE_TOOBIG","USER_REPOSITORY_NOT_CONFIGURED","PDF_NOT_CONFIGURED","INVALID_USER_PASSWORD","UNKNOWN_FINGERPRINTER_ID","JSON_ARRAY_EMPTY","TOKENS_ILLEGAL_TYPE","NO_JSON","INVALID_JSON_FORMAT","JSON_OBJECT_HAS_NO_DOCUMENTS","DOCUMENTS_ARE_NO_JSON_ARRAY","DOCUMENTS_JSON_ARRAY_EMPTY","DOCUMENTS_VALUE_ERROR","DOCUMENTS_TYPE_ERROR","DOCUMENTS_TOO_FEW_DOCUMENTS","REQ_NO_JSON_ARRAY","SENTENCE_LIST_NOT_TWO","IMAGE_NOT_PROVIDED","IMAGE_INVALID_FORMAT","MODEL_NAME_INVALID","THRESHOLD_INVALID","IMAGE_BUFFER_EMPTY","INVALID_MODEL_ID","IMAGE_NOT_PROVIDED_IFP","IMAGE_INVALID_DATA","IMAGE_INVALID_FORMAT_IFP"];function Yt(r){return Mt.includes(r)}var At=["REQUIRED","OPTIONAL","NONE"];function Gt(r){return At.includes(r)}var _t=["USER","ASSISTANT","SYSTEM"];function Wt(r){return _t.includes(r)}var Ht=["ANSWER","REASONING","ERROR","APPROVAL_REQUEST"];function jt(r){return Ht.includes(r)}var Lt=["USER","ASSISTANT","SYSTEM"];function Kt(r){return Lt.includes(r)}var Bt=["fingerprint","keyword","document","document_fingerprint","fingerprint_keyword","auto","fingerprint_exact","document_fingerprint_exact"];function Zt(r){return Bt.includes(r)}var kt=["COMPARE","SEARCH","LIBRARY","POLARION","AITASKS","INTERNAL"];function ee(r){return kt.includes(r)}var Jt=["COMPARE","SEARCH","LIBRARY","POLARION","AITASKS","INTERNAL"];function ne(r){return Jt.includes(r)}var Ft=["COMPARE","SEARCH","LIBRARY","POLARION","AITASKS","INTERNAL"];function oe(r){return Ft.includes(r)}var Vt=["fingerprint","keyword","document","document_fingerprint","fingerprint_keyword","auto","fingerprint_exact","document_fingerprint_exact"];function ae(r){return Vt.includes(r)}var Ut=["similarity","extraction"];function le(r){return Ut.includes(r)}var u=class{constructor(t){this.response=t;}response;async toModel(){return (await this.response).data}async toFile(){let t=await this.response,e=t?.headers["content-disposition"],n="file";if(e){let o=e.match(/filename="?([^"]+)"?/);o&&o[1]&&(n=o[1]);}return new File([t.data],n)}async getStatusCode(){return (await this.response).status}async getStatusText(){return (await this.response).statusText}},Rt=class{constructor(t,e,n,o){this.event=t;this.data=e;this.id=n;this.retry=o;}event;data;id;retry;json(){return JSON.parse(this.data)}};function xt(r){let t,e=[],n,o,s=false;for(let l of r.split(`
|
|
2
|
+
`)){if(l===""||l.startsWith(":"))continue;let p=l.indexOf(":"),a=p===-1?l:l.slice(0,p),m=p===-1?"":l.slice(p+1);switch(m.startsWith(" ")&&(m=m.slice(1)),s=true,a){case "event":t=m;break;case "data":e.push(m);break;case "id":n=m;break;case "retry":{let d=Number(m);Number.isNaN(d)||(o=d);break}}}return s?new Rt(t,e.join(`
|
|
3
|
+
`),n,o):void 0}async function*wt(r){let t=r.getReader(),e=new TextDecoder,n="",o=false,s=p=>{let a=o&&p.startsWith(`
|
|
4
|
+
`)?p.slice(1):p;p&&(o=p.endsWith("\r")),n+=a.replace(/\r\n/g,`
|
|
4
5
|
`).replace(/\r/g,`
|
|
5
|
-
`);let a=n.indexOf(`
|
|
6
|
+
`);},l=function*(p){let a=n.indexOf(`
|
|
6
7
|
|
|
7
|
-
`);for(;a!==-1;){let
|
|
8
|
+
`);for(;a!==-1;){let m=xt(n.slice(0,a));n=n.slice(a+2),m&&(yield m),a=n.indexOf(`
|
|
8
9
|
|
|
9
|
-
`);}if(s){let p=xt(n);n="",p&&(yield p);}};try{let{value:s,done:a}=await t.read();for(;!a;)n+=e.decode(s,{stream:!0}),yield*o(!1),{value:s,done:a}=await t.read();n+=e.decode(),yield*o(!0);}finally{await t.cancel().catch(()=>{}),t.releaseLock();}}var i=(l=>(l.JSON="application/json",l.XLSX="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",l.PDF="application/pdf",l.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",l.ZIP="application/zip",l.REQIFZ="application/reqifz",l.PNG="image/png",l.BINARY="application/octet-stream",l.TEXT_PLAIN="text/plain",l.EVENT_STREAM="text/event-stream",l))(i||{}),c=class r{constructor(t,e,n,o,s){this.serverUrl=t;this.apiKey=e;this.clientId=n;this.client_secret=o;this.tokenUrl=s;this.expireTime=0,this.accessToken="",this.skipAuthHeader=!!t&&!(e||n||o||s);}static LEEWAY=30;static MAX_ERROR_BODY_LENGTH=500;expireTime;accessToken;skipAuthHeader;async buildHeadersForJsonRequest(){return this.skipAuthHeader?{Accept:"application/json"}:{Accept:"application/json",Authorization:`Bearer ${await this.getToken()}`}}async buildHeadersForRequest(){return this.skipAuthHeader?{}:{Authorization:`Bearer ${await this.getToken()}`}}async getToken(){if(this.apiKey)return this.apiKey;if(this.clientId&&this.client_secret&&this.tokenUrl&&(this.accessToken==""||this.expireTime<performance.now())){let t={grant_type:"client_credentials",client_id:this.clientId,client_secret:this.client_secret,scope:"openid"},e=await h__default.default.post(this.tokenUrl,t,{headers:{accept:"application/json","content-type":"application/x-www-form-urlencoded"}});if(e.status>=h__default.default.HttpStatusCode.BadRequest)return "";this.accessToken=e.data.id_token??e.data.access_token,this.expireTime=performance.now()+(e.data.expires_in-r.LEEWAY);}return this.accessToken}toRequestData(t,e){if(!e?.["Content-Type"]?.startsWith("multipart/form-data")||(delete e["Content-Type"],!t||typeof t!="object"||t instanceof FormData))return t;let n=new FormData;for(let[o,s]of Object.entries(t))s!=null&&(s instanceof Blob?n.append(o,s,s.name??o):typeof s=="object"?n.append(o,JSON.stringify(s)):n.append(o,String(s)));return n}async request(t,e,n){if(!n.headers)n.headers=await this.buildHeadersForJsonRequest();else {let s=await this.buildHeadersForRequest();n.headers={...n.headers,...s};}let o=this.toRequestData(n.data,n.headers);return new u(h__default.default.request({method:t,url:this.serverUrl+e,headers:{...n.headers,"User-Agent":"semantha TypeScript SDK; "},data:o,params:n.params,responseType:n.responseType}))}async get(t,e,n,o,s="json"){return this.request("GET",t,{params:e,headers:n,data:o,responseType:s})}async post(t,e,n,o,s="json"){if(!n)n=await this.buildHeadersForJsonRequest();else {let a=await this.buildHeadersForRequest();n={...n,...a};}return new u(h__default.default.post(this.serverUrl+t,this.toRequestData(o,n),{params:e,headers:n,responseType:s}))}async postEventStream(t,e,n,o,s){let a=await this.buildHeadersForRequest(),p={...n,...a,Accept:"text/event-stream"};o!=null&&!p["Content-Type"]&&(p["Content-Type"]="application/json");let m=await fetch(this.serverUrl+t+this.toQueryString(e),{method:"POST",headers:p,body:o!=null?JSON.stringify(o):void 0,signal:s});if(!m.ok){let d=await r.readErrorBody(m);throw new Error(`Event stream request to ${t} failed with status ${m.status} ${m.statusText}${d}`)}if(!m.body)throw new Error(`Event stream request to ${t} returned an empty response body`);return wt(m.body)}static async readErrorBody(t){let e;try{e=(await t.text()).trim();}catch{return ""}return e?`: ${e.length>r.MAX_ERROR_BODY_LENGTH?`${e.slice(0,r.MAX_ERROR_BODY_LENGTH)}\u2026`:e}`:""}toQueryString(t){if(!t)return "";let e=new URLSearchParams;for(let[o,s]of Object.entries(t))s!=null&&e.append(o,String(s));let n=e.toString();return n?`?${n}`:""}async delete(t,e,n,o){return this.request("DELETE",t,{data:e,params:n,headers:o})}async patch(t,e,n){return this.request("PATCH",t,{data:e,headers:n})}async put(t,e,n){return this.request("PUT",t,{data:e,headers:n})}toHeader(t,e){return e?{Accept:t,"Content-Type":e}:{Accept:t}}};var E=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/answers";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}};var N=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var f=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/namedentities";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var y=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/synonyms";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var g=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;namedentities(){return new f(this.restClient,this.ENDPOINT)}synonyms(){return new y(this.restClient,this.ENDPOINT)}};var C=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var T=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/model";}ENDPOINT;domains(t){return t!=null?new g(this.restClient,this.ENDPOINT,t):new C(this.restClient,this.ENDPOINT)}};var P=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documentclasses";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var D=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documenttypes";}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 O=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/referencedocuments";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(t){return await this.restClient.delete(this.ENDPOINT,t)}async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}};var I=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/references";}ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}};var R=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;documentclasses(){return new P(this.restClient,this.ENDPOINT)}documenttypes(){return new D(this.restClient,this.ENDPOINT)}referencedocuments(){return new O(this.restClient,this.ENDPOINT)}references(){return new I(this.restClient,this.ENDPOINT)}};var v=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/bulk";}ENDPOINT;domains(t){return t!=null?new R(this.restClient,this.ENDPOINT,t):new N(this.restClient,this.ENDPOINT)}model(){return new T(this.restClient,this.ENDPOINT)}};var x=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/celltypes";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var w=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/sse";}ENDPOINT;async postAsEventStream(t,e,n){let o=this.restClient.toHeader("text/event-stream");return e!==void 0&&(o["X-Polarion-Access-Token"]=e),n!==void 0&&(o["X-Polarion-Base-Url"]=n),this.restClient.postEventStream(this.ENDPOINT,{},o,t)}};var b=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/chats/${this.id}`;}ENDPOINT;sse(){return new w(this.restClient,this.ENDPOINT)}async post(t,e,n){let o=this.restClient.toHeader("application/json");return e!==void 0&&(o["X-Polarion-Access-Token"]=e),n!==void 0&&(o["X-Polarion-Base-Url"]=n),(await this.restClient.post(this.ENDPOINT,{},o,t)).toModel()}};var S=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.conversationid=n;this.ENDPOINT=this.parentEndpoint+`/conversations/${this.conversationid}`;}ENDPOINT;async get(t,e){let n=this.restClient.toHeader("application/json");return t!==void 0&&(n["X-Polarion-Access-Token"]=t),e!==void 0&&(n["X-Polarion-Base-Url"]=e),(await this.restClient.get(this.ENDPOINT,{},n)).toModel()}async delete(t,e){let n=this.restClient.toHeader("application/json");return t!==void 0&&(n["X-Polarion-Access-Token"]=t),e!==void 0&&(n["X-Polarion-Base-Url"]=e),await this.restClient.delete(this.ENDPOINT,void 0,void 0,n)}};var M=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/conversations";}ENDPOINT;async get(t,e,n){let o=this.restClient.toHeader("application/json");return e!==void 0&&(o["X-Polarion-Access-Token"]=e),n!==void 0&&(o["X-Polarion-Base-Url"]=n),(await this.restClient.get(this.ENDPOINT,t,o)).toModel()}};var A=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/chats";}ENDPOINT;conversations(t){return t!=null?new S(this.restClient,this.ENDPOINT,t):new M(this.restClient,this.ENDPOINT)}};var _=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/clone";}ENDPOINT;async post(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+"/conversions";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toFile()}};var L=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/currentuser";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var k=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/customfields";}ENDPOINT;async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var B=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documentclasses";}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()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var J=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/tags";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var F=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/referencedocuments";}ENDPOINT;tags(){return new J(this.restClient,this.ENDPOINT)}async delete(t){return await this.restClient.delete(this.ENDPOINT,t)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var V=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documentannotations";}ENDPOINT;async postAsDocx(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/vnd.openxmlformats-officedocument.wordprocessingml.document","multipart/form-data"),t)).toFile()}async postAsPdf(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/pdf","multipart/form-data"),t)).toFile()}};var U=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/documentclasses/${this.id}`;}ENDPOINT;customfields(){return new k(this.restClient,this.ENDPOINT)}documentclasses(){return new B(this.restClient,this.ENDPOINT)}referencedocuments(){return new F(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(t){return await this.restClient.delete(this.ENDPOINT,void 0,t)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var Y=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/tree";}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+"/documentclasses";}ENDPOINT;tree(){return new Y(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var G=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documents";}ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}async postAsPng(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("image/png","multipart/form-data"),t)).toFile()}async postAsReqifz(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/reqifz","multipart/form-data"),t)).toFile()}};var q=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/documenttypes/${this.id}`;}ENDPOINT;clone(){return new _(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 patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var $=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documenttypes";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var W=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/mcptools";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var j=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/prompts/${this.id}`;}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}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 z=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/validation";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var K=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/prompts";}ENDPOINT;validation(){return new z(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 post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var Q=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/images/${this.id}`;}ENDPOINT;async getAsBinary(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/octet-stream"),null,"blob")).toFile()}};var Z=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/images";}ENDPOINT};var tt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/markdown";}ENDPOINT;async getAsPlainText(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("text/plain"))).toModel()}};var et=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/paragraphs/${this.id}`;}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var rt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/paragraphs";}ENDPOINT};var nt=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/sentences/${this.id}`;}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var it=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/sentences";}ENDPOINT};var ot=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.documentid=n;this.ENDPOINT=this.parentEndpoint+`/referencedocuments/${this.documentid}`;}ENDPOINT;images(t){return t!=null?new Q(this.restClient,this.ENDPOINT,t):new Z(this.restClient,this.ENDPOINT)}markdown(){return new tt(this.restClient,this.ENDPOINT)}paragraphs(t){return t!=null?new et(this.restClient,this.ENDPOINT,t):new rt(this.restClient,this.ENDPOINT)}sentences(t){return t!=null?new nt(this.restClient,this.ENDPOINT,t):new it(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(t){return await this.restClient.delete(this.ENDPOINT,void 0,t)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var st=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/stream";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var at=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/statistic";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var pt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/referencedocuments";}ENDPOINT;statistic(){return new at(this.restClient,this.ENDPOINT)}stream(){return new st(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async getAsXlsx(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),null,"blob")).toFile()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}async postJson(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}};var lt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/references";}ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","multipart/form-data"),t,"blob")).toFile()}async postAsDocx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.wordprocessingml.document","multipart/form-data"),t)).toFile()}async postAsPdf(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/pdf","multipart/form-data"),t)).toFile()}};var mt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/settings";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var dt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/referencedocuments";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var ct=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.tagname=n;this.ENDPOINT=this.parentEndpoint+`/tags/${this.tagname}`;}ENDPOINT;referencedocuments(){return new dt(this.restClient,this.ENDPOINT)}};var ut=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/tags";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var ht=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/texttypes";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var Et=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/translations";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var Nt=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;answers(){return new E(this.restClient,this.ENDPOINT)}chats(t){return t!=null?new b(this.restClient,this.ENDPOINT,t):new A(this.restClient,this.ENDPOINT)}documentannotations(){return new V(this.restClient,this.ENDPOINT)}documentclasses(t){return t!=null?new U(this.restClient,this.ENDPOINT,t):new X(this.restClient,this.ENDPOINT)}documents(){return new G(this.restClient,this.ENDPOINT)}documenttypes(t){return t!=null?new q(this.restClient,this.ENDPOINT,t):new $(this.restClient,this.ENDPOINT)}mcptools(){return new W(this.restClient,this.ENDPOINT)}prompts(t){return t!=null?new j(this.restClient,this.ENDPOINT,t):new K(this.restClient,this.ENDPOINT)}referencedocuments(t){return t!=null?new ot(this.restClient,this.ENDPOINT,t):new pt(this.restClient,this.ENDPOINT)}references(){return new lt(this.restClient,this.ENDPOINT)}settings(){return new mt(this.restClient,this.ENDPOINT)}tags(t){return t!=null?new ct(this.restClient,this.ENDPOINT,t):new ut(this.restClient,this.ENDPOINT)}texttypes(){return new ht(this.restClient,this.ENDPOINT)}translations(){return new Et(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var ft=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var yt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/info";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var gt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/namedentities";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var Ct=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/namedentities/${this.id}`;}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 put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var Tt=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/synonyms/${this.id}`;}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 put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var Pt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/synonyms";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var Dt=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;namedentities(t){return t!=null?new Ct(this.restClient,this.ENDPOINT,t):new gt(this.restClient,this.ENDPOINT)}synonyms(t){return t!=null?new Tt(this.restClient,this.ENDPOINT,t):new Pt(this.restClient,this.ENDPOINT)}};var Ot=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var It=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/model";}ENDPOINT;domains(t){return t!=null?new Dt(this.restClient,this.ENDPOINT,t):new Ot(this.restClient,this.ENDPOINT)}};var vt="/api/v3",bt=class r{constructor(t,e){this.restClient=t;this.parentEndpoint=e;}static loginWithApiKey(t,e){if(!e)throw new Error("You need to supply an API key to login.");if(!t)throw new Error("You need to supply a server url to login.");return new r(new c(this.parseServerUrl(t),e),vt)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new r(new c(this.parseServerUrl(t)),vt)}static loginWithCredentials(t,e,n,o){return t=this.parseServerUrl(t),new r(new c(t,void 0,e,n,o),vt)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=St__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(m=>m.length!==0).map(m=>m.split("=")),o=this.getValueOfInPropertiesFile("serverUrl",n),s=this.getValueOfInPropertiesFile("clientId",n),a=this.getValueOfInPropertiesFile("clientSecret",n),p=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(o,s,a,p)}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-platform-server"):t.endsWith("/tt-platform-server")||(t+="/tt-platform-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}bulk(){return new v(this.restClient,this.endpoint())}celltypes(){return new x(this.restClient,this.endpoint())}conversions(){return new H(this.restClient,this.endpoint())}currentuser(){return new L(this.restClient,this.endpoint())}domains(t){return t!=null?new Nt(this.restClient,this.endpoint(),t):new ft(this.restClient,this.endpoint())}info(){return new yt(this.restClient,this.endpoint())}model(){return new It(this.restClient,this.endpoint())}};exports.AnswersEndpoint=E;exports.BulkDomainsEndpoint=N;exports.BulkEndpoint=v;exports.BulkModelEndpoint=T;exports.BulkdomainsDocumentclassesEndpoint=P;exports.BulkdomainsDocumenttypesEndpoint=D;exports.BulkdomainsDomainEndpoint=R;exports.BulkdomainsReferencedocumentsEndpoint=O;exports.BulkdomainsReferencesEndpoint=I;exports.BulkmodelDomainEndpoint=g;exports.BulkmodelDomainsEndpoint=C;exports.BulkmodelNamedentitiesEndpoint=f;exports.BulkmodelSynonymsEndpoint=y;exports.CelltypesEndpoint=x;exports.ChatEndpoint=b;exports.ChatsEndpoint=A;exports.CloneEndpoint=_;exports.ConversationEndpoint=S;exports.ConversationsEndpoint=M;exports.ConversionsEndpoint=H;exports.CurrentuserEndpoint=L;exports.DocclassCustomfieldsEndpoint=k;exports.DocclassDocumentclassesEndpoint=B;exports.DocclassReferencedocumentsEndpoint=F;exports.DocclassTagsEndpoint=J;exports.DocumentannotationsEndpoint=V;exports.DocumentclassEndpoint=U;exports.DocumentclassesEndpoint=X;exports.DocumentsEndpoint=G;exports.DocumenttypeEndpoint=q;exports.DocumenttypesEndpoint=$;exports.DomainEndpoint=Nt;exports.DomainsEndpoint=ft;exports.ErrorFieldCodeEnumValues=Mt;exports.ImageEndpoint=Q;exports.ImagesEndpoint=Z;exports.InfoEndpoint=yt;exports.MarkdownEndpoint=tt;exports.McpToolDescriptorAuthEnumValues=At;exports.McptoolsEndpoint=W;exports.MediaType=i;exports.MessageResponseRoleEnumValues=_t;exports.MessageResponseTypeEnumValues=Ht;exports.MessageRoleEnumValues=Lt;exports.ModeEnumValues=kt;exports.ModelDomainEndpoint=Dt;exports.ModelDomainsEndpoint=Ot;exports.ModelEndpoint=It;exports.ModelNamedentitiesEndpoint=gt;exports.ModelNamedentityEndpoint=Ct;exports.ModelSynonymEndpoint=Tt;exports.ModelSynonymsEndpoint=Pt;exports.ParagraphEndpoint=et;exports.ParagraphsEndpoint=rt;exports.PromptEndpoint=j;exports.PromptLabelEnumValues=Bt;exports.PromptOverviewPromptLabelEnumValues=Jt;exports.PromptPromptLabelEnumValues=Ft;exports.PromptValidationEndpoint=z;exports.PromptsEndpoint=K;exports.ReferencedocumentEndpoint=ot;exports.ReferencedocumentsEndpoint=pt;exports.ReferencedocumentsStreamEndpoint=st;exports.ReferencesEndpoint=lt;exports.RestClient=c;exports.RestResponse=u;exports.SemanthaAPI=bt;exports.SentenceEndpoint=nt;exports.SentencesEndpoint=it;exports.ServerSentEvent=Rt;exports.SettingsDefaultSimilarityModeEnumValues=Vt;exports.SettingsEndpoint=mt;exports.SseEndpoint=w;exports.StatisticEndpoint=at;exports.TagEndpoint=ct;exports.TagReferencedocumentsEndpoint=dt;exports.TagsEndpoint=ut;exports.TexttypesEndpoint=ht;exports.TranslationsEndpoint=Et;exports.TreeEndpoint=Y;exports.TypeEnumValues=Ut;exports.isErrorFieldCodeEnumValue=Yt;exports.isMcpToolDescriptorAuthEnumValue=Gt;exports.isMessageResponseRoleEnumValue=$t;exports.isMessageResponseTypeEnumValue=jt;exports.isMessageRoleEnumValue=Kt;exports.isModeEnumValue=Zt;exports.isPromptLabelEnumValue=ee;exports.isPromptOverviewPromptLabelEnumValue=ne;exports.isPromptPromptLabelEnumValue=oe;exports.isSettingsDefaultSimilarityModeEnumValue=ae;exports.isTypeEnumValue=le;exports.parseServerSentEvents=wt;//# sourceMappingURL=index.js.map
|
|
10
|
+
`);}if(p){let m=xt(n);n="",m&&(yield m);}};try{let{value:p,done:a}=await t.read();for(;!a;)s(e.decode(p,{stream:!0})),yield*l(!1),{value:p,done:a}=await t.read();s(e.decode()),yield*l(!0);}finally{await t.cancel().catch(()=>{}),t.releaseLock();}}var i=(d=>(d.JSON="application/json",d.XLSX="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",d.PDF="application/pdf",d.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",d.ZIP="application/zip",d.REQIFZ="application/reqifz",d.PNG="image/png",d.BINARY="application/octet-stream",d.TEXT_PLAIN="text/plain",d.EVENT_STREAM="text/event-stream",d))(i||{}),c=class r{constructor(t,e,n,o,s){this.serverUrl=t;this.apiKey=e;this.clientId=n;this.client_secret=o;this.tokenUrl=s;this.expireTime=0,this.accessToken="",this.skipAuthHeader=!!t&&!(e||n||o||s);}serverUrl;apiKey;clientId;client_secret;tokenUrl;static LEEWAY=30;static MAX_ERROR_BODY_LENGTH=500;expireTime;accessToken;skipAuthHeader;async buildHeadersForJsonRequest(){return this.skipAuthHeader?{Accept:"application/json"}:{Accept:"application/json",Authorization:`Bearer ${await this.getToken()}`}}async buildHeadersForRequest(){return this.skipAuthHeader?{}:{Authorization:`Bearer ${await this.getToken()}`}}async getToken(){if(this.apiKey)return this.apiKey;if(this.clientId&&this.client_secret&&this.tokenUrl&&(this.accessToken==""||this.expireTime<performance.now())){let t={grant_type:"client_credentials",client_id:this.clientId,client_secret:this.client_secret,scope:"openid"},e=await h__default.default.post(this.tokenUrl,t,{headers:{accept:"application/json","content-type":"application/x-www-form-urlencoded"}});if(e.status>=h__default.default.HttpStatusCode.BadRequest)return "";this.accessToken=e.data.id_token??e.data.access_token,this.expireTime=performance.now()+(e.data.expires_in-r.LEEWAY);}return this.accessToken}toRequestData(t,e){if(!e?.["Content-Type"]?.startsWith("multipart/form-data")||(delete e["Content-Type"],!t||typeof t!="object"||t instanceof FormData))return t;let n=new FormData;for(let[o,s]of Object.entries(t))s!=null&&(s instanceof Blob?n.append(o,s,s.name??o):typeof s=="object"?n.append(o,JSON.stringify(s)):n.append(o,String(s)));return n}async request(t,e,n){if(!n.headers)n.headers=await this.buildHeadersForJsonRequest();else {let s=await this.buildHeadersForRequest();n.headers={...n.headers,...s};}let o=this.toRequestData(n.data,n.headers);return new u(h__default.default.request({method:t,url:this.serverUrl+e,headers:{...n.headers,"User-Agent":"semantha TypeScript SDK; "},data:o,params:n.params,responseType:n.responseType}))}async get(t,e,n,o,s="json"){return this.request("GET",t,{params:e,headers:n,data:o,responseType:s})}async post(t,e,n,o,s="json"){if(!n)n=await this.buildHeadersForJsonRequest();else {let l=await this.buildHeadersForRequest();n={...n,...l};}return new u(h__default.default.post(this.serverUrl+t,this.toRequestData(o,n),{params:e,headers:n,responseType:s}))}async postEventStream(t,e,n,o,s){let l=await this.buildHeadersForRequest(),p={...n,...l,Accept:"text/event-stream"};o!=null&&!p["Content-Type"]&&(p["Content-Type"]="application/json");let a=await fetch(this.serverUrl+t+this.toQueryString(e),{method:"POST",headers:p,body:o!=null?JSON.stringify(o):void 0,signal:s});if(!a.ok){let m=await r.readErrorBody(a);throw new Error(`Event stream request to ${t} failed with status ${a.status} ${a.statusText}${m}`)}if(!a.body)throw new Error(`Event stream request to ${t} returned an empty response body`);return wt(a.body)}static async readErrorBody(t){let e;try{e=(await t.text()).trim();}catch{return ""}return e?`: ${e.length>r.MAX_ERROR_BODY_LENGTH?`${e.slice(0,r.MAX_ERROR_BODY_LENGTH)}\u2026`:e}`:""}toQueryString(t){if(!t)return "";let e=new URLSearchParams;for(let[o,s]of Object.entries(t))s!=null&&e.append(o,String(s));let n=e.toString();return n?`?${n}`:""}async delete(t,e,n,o){return this.request("DELETE",t,{data:e,params:n,headers:o})}async patch(t,e,n){return this.request("PATCH",t,{data:e,headers:n})}async put(t,e,n){return this.request("PUT",t,{data:e,headers:n})}toHeader(t,e){return e?{Accept:t,"Content-Type":e}:{Accept:t}}};var E=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/answers";}restClient;parentEndpoint;ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}};var N=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}restClient;parentEndpoint;ENDPOINT};var f=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/namedentities";}restClient;parentEndpoint;ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var y=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/synonyms";}restClient;parentEndpoint;ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var g=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}restClient;parentEndpoint;domainname;ENDPOINT;namedentities(){return new f(this.restClient,this.ENDPOINT)}synonyms(){return new y(this.restClient,this.ENDPOINT)}};var C=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}restClient;parentEndpoint;ENDPOINT};var T=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/model";}restClient;parentEndpoint;ENDPOINT;domains(t){return t!=null?new g(this.restClient,this.ENDPOINT,t):new C(this.restClient,this.ENDPOINT)}};var P=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documentclasses";}restClient;parentEndpoint;ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var D=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documenttypes";}restClient;parentEndpoint;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 O=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/referencedocuments";}restClient;parentEndpoint;ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(t){return await this.restClient.delete(this.ENDPOINT,t)}async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}};var I=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/references";}restClient;parentEndpoint;ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}};var R=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}restClient;parentEndpoint;domainname;ENDPOINT;documentclasses(){return new P(this.restClient,this.ENDPOINT)}documenttypes(){return new D(this.restClient,this.ENDPOINT)}referencedocuments(){return new O(this.restClient,this.ENDPOINT)}references(){return new I(this.restClient,this.ENDPOINT)}};var v=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/bulk";}restClient;parentEndpoint;ENDPOINT;domains(t){return t!=null?new R(this.restClient,this.ENDPOINT,t):new N(this.restClient,this.ENDPOINT)}model(){return new T(this.restClient,this.ENDPOINT)}};var x=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/celltypes";}restClient;parentEndpoint;ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var w=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/sse";}restClient;parentEndpoint;ENDPOINT;async postAsEventStream(t,e,n){let o=this.restClient.toHeader("text/event-stream");return e!==void 0&&(o["X-Polarion-Access-Token"]=e),n!==void 0&&(o["X-Polarion-Base-Url"]=n),this.restClient.postEventStream(this.ENDPOINT,{},o,t)}};var b=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/chats/${this.id}`;}restClient;parentEndpoint;id;ENDPOINT;sse(){return new w(this.restClient,this.ENDPOINT)}async post(t,e,n){let o=this.restClient.toHeader("application/json");return e!==void 0&&(o["X-Polarion-Access-Token"]=e),n!==void 0&&(o["X-Polarion-Base-Url"]=n),(await this.restClient.post(this.ENDPOINT,{},o,t)).toModel()}};var S=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.conversationid=n;this.ENDPOINT=this.parentEndpoint+`/conversations/${this.conversationid}`;}restClient;parentEndpoint;conversationid;ENDPOINT;async get(t,e){let n=this.restClient.toHeader("application/json");return t!==void 0&&(n["X-Polarion-Access-Token"]=t),e!==void 0&&(n["X-Polarion-Base-Url"]=e),(await this.restClient.get(this.ENDPOINT,{},n)).toModel()}async delete(t,e){let n=this.restClient.toHeader("application/json");return t!==void 0&&(n["X-Polarion-Access-Token"]=t),e!==void 0&&(n["X-Polarion-Base-Url"]=e),await this.restClient.delete(this.ENDPOINT,void 0,void 0,n)}};var M=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/conversations";}restClient;parentEndpoint;ENDPOINT;async get(t,e,n){let o=this.restClient.toHeader("application/json");return e!==void 0&&(o["X-Polarion-Access-Token"]=e),n!==void 0&&(o["X-Polarion-Base-Url"]=n),(await this.restClient.get(this.ENDPOINT,t,o)).toModel()}};var A=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/chats";}restClient;parentEndpoint;ENDPOINT;conversations(t){return t!=null?new S(this.restClient,this.ENDPOINT,t):new M(this.restClient,this.ENDPOINT)}};var _=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/clone";}restClient;parentEndpoint;ENDPOINT;async post(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+"/conversions";}restClient;parentEndpoint;ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toFile()}};var L=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/currentuser";}restClient;parentEndpoint;ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var B=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/customfields";}restClient;parentEndpoint;ENDPOINT;async delete(){return await this.restClient.delete(this.ENDPOINT)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var k=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documentclasses";}restClient;parentEndpoint;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()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var J=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/tags";}restClient;parentEndpoint;ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var F=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/referencedocuments";}restClient;parentEndpoint;ENDPOINT;tags(){return new J(this.restClient,this.ENDPOINT)}async delete(t){return await this.restClient.delete(this.ENDPOINT,t)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var V=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documentannotations";}restClient;parentEndpoint;ENDPOINT;async postAsDocx(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/vnd.openxmlformats-officedocument.wordprocessingml.document","multipart/form-data"),t)).toFile()}async postAsPdf(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/pdf","multipart/form-data"),t)).toFile()}};var U=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/documentclasses/${this.id}`;}restClient;parentEndpoint;id;ENDPOINT;customfields(){return new B(this.restClient,this.ENDPOINT)}documentclasses(){return new k(this.restClient,this.ENDPOINT)}referencedocuments(){return new F(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(t){return await this.restClient.delete(this.ENDPOINT,void 0,t)}async put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var Y=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/tree";}restClient;parentEndpoint;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+"/documentclasses";}restClient;parentEndpoint;ENDPOINT;tree(){return new Y(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var G=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documents";}restClient;parentEndpoint;ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}async postAsPng(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("image/png","multipart/form-data"),t)).toFile()}async postAsReqifz(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/reqifz","multipart/form-data"),t)).toFile()}};var q=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/documenttypes/${this.id}`;}restClient;parentEndpoint;id;ENDPOINT;clone(){return new _(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 patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var W=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documenttypes";}restClient;parentEndpoint;ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var $=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/mcptools";}restClient;parentEndpoint;ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var j=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/prompts/${this.id}`;}restClient;parentEndpoint;id;ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}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 z=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/validation";}restClient;parentEndpoint;ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var K=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/prompts";}restClient;parentEndpoint;ENDPOINT;validation(){return new z(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 post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var Q=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/images/${this.id}`;}restClient;parentEndpoint;id;ENDPOINT;async getAsBinary(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/octet-stream"),null,"blob")).toFile()}};var Z=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/images";}restClient;parentEndpoint;ENDPOINT};var tt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/markdown";}restClient;parentEndpoint;ENDPOINT;async getAsPlainText(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("text/plain"))).toModel()}};var et=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/paragraphs/${this.id}`;}restClient;parentEndpoint;id;ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var rt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/paragraphs";}restClient;parentEndpoint;ENDPOINT};var nt=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/sentences/${this.id}`;}restClient;parentEndpoint;id;ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var it=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/sentences";}restClient;parentEndpoint;ENDPOINT};var ot=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.documentid=n;this.ENDPOINT=this.parentEndpoint+`/referencedocuments/${this.documentid}`;}restClient;parentEndpoint;documentid;ENDPOINT;images(t){return t!=null?new Q(this.restClient,this.ENDPOINT,t):new Z(this.restClient,this.ENDPOINT)}markdown(){return new tt(this.restClient,this.ENDPOINT)}paragraphs(t){return t!=null?new et(this.restClient,this.ENDPOINT,t):new rt(this.restClient,this.ENDPOINT)}sentences(t){return t!=null?new nt(this.restClient,this.ENDPOINT,t):new it(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async delete(t){return await this.restClient.delete(this.ENDPOINT,void 0,t)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var st=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/stream";}restClient;parentEndpoint;ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var at=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/statistic";}restClient;parentEndpoint;ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var pt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/referencedocuments";}restClient;parentEndpoint;ENDPOINT;statistic(){return new at(this.restClient,this.ENDPOINT)}stream(){return new st(this.restClient,this.ENDPOINT)}async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async getAsXlsx(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),null,"blob")).toFile()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}async postJson(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json"),t)).toModel()}};var lt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/references";}restClient;parentEndpoint;ENDPOINT;async post(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}async postAsXlsx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","multipart/form-data"),t,"blob")).toFile()}async postAsDocx(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/vnd.openxmlformats-officedocument.wordprocessingml.document","multipart/form-data"),t)).toFile()}async postAsPdf(t,e){return (await this.restClient.post(this.ENDPOINT,e,this.restClient.toHeader("application/pdf","multipart/form-data"),t)).toFile()}};var mt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/settings";}restClient;parentEndpoint;ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var dt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/referencedocuments";}restClient;parentEndpoint;ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var ct=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.tagname=n;this.ENDPOINT=this.parentEndpoint+`/tags/${this.tagname}`;}restClient;parentEndpoint;tagname;ENDPOINT;referencedocuments(){return new dt(this.restClient,this.ENDPOINT)}};var ut=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/tags";}restClient;parentEndpoint;ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var ht=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/texttypes";}restClient;parentEndpoint;ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var Et=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/translations";}restClient;parentEndpoint;ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var Nt=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}restClient;parentEndpoint;domainname;ENDPOINT;answers(){return new E(this.restClient,this.ENDPOINT)}chats(t){return t!=null?new b(this.restClient,this.ENDPOINT,t):new A(this.restClient,this.ENDPOINT)}documentannotations(){return new V(this.restClient,this.ENDPOINT)}documentclasses(t){return t!=null?new U(this.restClient,this.ENDPOINT,t):new X(this.restClient,this.ENDPOINT)}documents(){return new G(this.restClient,this.ENDPOINT)}documenttypes(t){return t!=null?new q(this.restClient,this.ENDPOINT,t):new W(this.restClient,this.ENDPOINT)}mcptools(){return new $(this.restClient,this.ENDPOINT)}prompts(t){return t!=null?new j(this.restClient,this.ENDPOINT,t):new K(this.restClient,this.ENDPOINT)}referencedocuments(t){return t!=null?new ot(this.restClient,this.ENDPOINT,t):new pt(this.restClient,this.ENDPOINT)}references(){return new lt(this.restClient,this.ENDPOINT)}settings(){return new mt(this.restClient,this.ENDPOINT)}tags(t){return t!=null?new ct(this.restClient,this.ENDPOINT,t):new ut(this.restClient,this.ENDPOINT)}texttypes(){return new ht(this.restClient,this.ENDPOINT)}translations(){return new Et(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var ft=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}restClient;parentEndpoint;ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var yt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/info";}restClient;parentEndpoint;ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var gt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/namedentities";}restClient;parentEndpoint;ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var Ct=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/namedentities/${this.id}`;}restClient;parentEndpoint;id;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 put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var Tt=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/synonyms/${this.id}`;}restClient;parentEndpoint;id;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 put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var Pt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/synonyms";}restClient;parentEndpoint;ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(){return await this.restClient.delete(this.ENDPOINT)}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var Dt=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}restClient;parentEndpoint;domainname;ENDPOINT;namedentities(t){return t!=null?new Ct(this.restClient,this.ENDPOINT,t):new gt(this.restClient,this.ENDPOINT)}synonyms(t){return t!=null?new Tt(this.restClient,this.ENDPOINT,t):new Pt(this.restClient,this.ENDPOINT)}};var Ot=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}restClient;parentEndpoint;ENDPOINT};var It=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/model";}restClient;parentEndpoint;ENDPOINT;domains(t){return t!=null?new Dt(this.restClient,this.ENDPOINT,t):new Ot(this.restClient,this.ENDPOINT)}};var vt="/api/v3",bt=class r{constructor(t,e){this.restClient=t;this.parentEndpoint=e;}restClient;parentEndpoint;static loginWithApiKey(t,e){if(!e)throw new Error("You need to supply an API key to login.");if(!t)throw new Error("You need to supply a server url to login.");return new r(new c(this.parseServerUrl(t),e),vt)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new r(new c(this.parseServerUrl(t)),vt)}static loginWithCredentials(t,e,n,o){return t=this.parseServerUrl(t),new r(new c(t,void 0,e,n,o),vt)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=St__namespace.readFileSync(t,"utf8").split(/[\n|\r\n]/).filter(a=>a.length!==0).map(a=>a.split("=")),o=this.getValueOfInPropertiesFile("serverUrl",n),s=this.getValueOfInPropertiesFile("clientId",n),l=this.getValueOfInPropertiesFile("clientSecret",n),p=this.getValueOfInPropertiesFile("tokenUrl",n);return r.loginWithCredentials(o,s,l,p)}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-platform-server"):t.endsWith("/tt-platform-server")||(t+="/tt-platform-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}bulk(){return new v(this.restClient,this.endpoint())}celltypes(){return new x(this.restClient,this.endpoint())}conversions(){return new H(this.restClient,this.endpoint())}currentuser(){return new L(this.restClient,this.endpoint())}domains(t){return t!=null?new Nt(this.restClient,this.endpoint(),t):new ft(this.restClient,this.endpoint())}info(){return new yt(this.restClient,this.endpoint())}model(){return new It(this.restClient,this.endpoint())}};exports.AnswersEndpoint=E;exports.BulkDomainsEndpoint=N;exports.BulkEndpoint=v;exports.BulkModelEndpoint=T;exports.BulkdomainsDocumentclassesEndpoint=P;exports.BulkdomainsDocumenttypesEndpoint=D;exports.BulkdomainsDomainEndpoint=R;exports.BulkdomainsReferencedocumentsEndpoint=O;exports.BulkdomainsReferencesEndpoint=I;exports.BulkmodelDomainEndpoint=g;exports.BulkmodelDomainsEndpoint=C;exports.BulkmodelNamedentitiesEndpoint=f;exports.BulkmodelSynonymsEndpoint=y;exports.CelltypesEndpoint=x;exports.ChatEndpoint=b;exports.ChatsEndpoint=A;exports.CloneEndpoint=_;exports.ConversationEndpoint=S;exports.ConversationsEndpoint=M;exports.ConversionsEndpoint=H;exports.CurrentuserEndpoint=L;exports.DocclassCustomfieldsEndpoint=B;exports.DocclassDocumentclassesEndpoint=k;exports.DocclassReferencedocumentsEndpoint=F;exports.DocclassTagsEndpoint=J;exports.DocumentannotationsEndpoint=V;exports.DocumentclassEndpoint=U;exports.DocumentclassesEndpoint=X;exports.DocumentsEndpoint=G;exports.DocumenttypeEndpoint=q;exports.DocumenttypesEndpoint=W;exports.DomainEndpoint=Nt;exports.DomainsEndpoint=ft;exports.ErrorFieldCodeEnumValues=Mt;exports.ImageEndpoint=Q;exports.ImagesEndpoint=Z;exports.InfoEndpoint=yt;exports.MarkdownEndpoint=tt;exports.McpToolDescriptorAuthEnumValues=At;exports.McptoolsEndpoint=$;exports.MediaType=i;exports.MessageResponseRoleEnumValues=_t;exports.MessageResponseTypeEnumValues=Ht;exports.MessageRoleEnumValues=Lt;exports.ModeEnumValues=Bt;exports.ModelDomainEndpoint=Dt;exports.ModelDomainsEndpoint=Ot;exports.ModelEndpoint=It;exports.ModelNamedentitiesEndpoint=gt;exports.ModelNamedentityEndpoint=Ct;exports.ModelSynonymEndpoint=Tt;exports.ModelSynonymsEndpoint=Pt;exports.ParagraphEndpoint=et;exports.ParagraphsEndpoint=rt;exports.PromptEndpoint=j;exports.PromptLabelEnumValues=kt;exports.PromptOverviewPromptLabelEnumValues=Jt;exports.PromptPromptLabelEnumValues=Ft;exports.PromptValidationEndpoint=z;exports.PromptsEndpoint=K;exports.ReferencedocumentEndpoint=ot;exports.ReferencedocumentsEndpoint=pt;exports.ReferencedocumentsStreamEndpoint=st;exports.ReferencesEndpoint=lt;exports.RestClient=c;exports.RestResponse=u;exports.SemanthaAPI=bt;exports.SentenceEndpoint=nt;exports.SentencesEndpoint=it;exports.ServerSentEvent=Rt;exports.SettingsDefaultSimilarityModeEnumValues=Vt;exports.SettingsEndpoint=mt;exports.SseEndpoint=w;exports.StatisticEndpoint=at;exports.TagEndpoint=ct;exports.TagReferencedocumentsEndpoint=dt;exports.TagsEndpoint=ut;exports.TexttypesEndpoint=ht;exports.TranslationsEndpoint=Et;exports.TreeEndpoint=Y;exports.TypeEnumValues=Ut;exports.isErrorFieldCodeEnumValue=Yt;exports.isMcpToolDescriptorAuthEnumValue=Gt;exports.isMessageResponseRoleEnumValue=Wt;exports.isMessageResponseTypeEnumValue=jt;exports.isMessageRoleEnumValue=Kt;exports.isModeEnumValue=Zt;exports.isPromptLabelEnumValue=ee;exports.isPromptOverviewPromptLabelEnumValue=ne;exports.isPromptPromptLabelEnumValue=oe;exports.isSettingsDefaultSimilarityModeEnumValue=ae;exports.isTypeEnumValue=le;exports.parseServerSentEvents=wt;//# sourceMappingURL=index.js.map
|
|
10
11
|
//# sourceMappingURL=index.js.map
|