@semantha/sdk 11.11.1 → 12.1.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/index.d.mts CHANGED
@@ -1300,7 +1300,7 @@ declare function isMessageResponseRoleEnumValue(value: any): value is MessageRes
1300
1300
  *
1301
1301
  * This is a generated file do not change manually!
1302
1302
  */
1303
- declare const MessageResponseTypeEnumValues: readonly ["ANSWER", "THINKING", "ERROR", "APPROVAL_REQUEST"];
1303
+ declare const MessageResponseTypeEnumValues: readonly ["ANSWER", "REASONING", "ERROR", "APPROVAL_REQUEST"];
1304
1304
  type MessageResponseTypeEnum = (typeof MessageResponseTypeEnumValues)[number];
1305
1305
  declare function isMessageResponseTypeEnumValue(value: any): value is MessageResponseTypeEnum;
1306
1306
 
@@ -2411,7 +2411,7 @@ declare class SseEndpoint {
2411
2411
  constructor(restClient: RestClient, parentEndpoint: string);
2412
2412
  /**
2413
2413
  * Stream a chat response via Server-Sent Events
2414
- * Streaming variant of the chat endpoint with identical semantics (same {id} prompt-variant selection, request body, and Polarion header credentials). The response is a text/event-stream: an 'event: delta' per output-text chunk (data: {"content":"..."}), a terminal 'event: done' carrying the conversationId (data: {"conversationId":"..."}), and 'event: error' (data: {"message":"..."}) if generation fails after the stream has started. Requires a generative model that supports streaming (the stateful Responses backend).
2414
+ * Streaming variant of the chat endpoint with identical semantics (same {id} prompt-variant selection, request body, and Polarion header credentials). The response is a text/event-stream: an 'event: delta' per message chunk (data: {"content":"...","type":"ANSWER"}), a terminal 'event: done' carrying the conversationId (data: {"conversationId":"..."}), and 'event: error' (data: {"message":"..."}) if the stream itself fails after it has started. A turn that failed upstream is not a stream failure: it streams a delta of type ERROR carrying a message for the user, followed by 'event: done'. When the domain's generative model is configured to show reasoning (gpt service option 'showReasoning', on by default when 'reasoningEffort' is set), the model's reasoning streams as deltas of type REASONING, typically before the answer; it is not part of the answer and must be shown apart from it or hidden. Absent or unknown types must be read as ANSWER. Requires a generative model that supports streaming (the stateful Responses backend).
2415
2415
  *
2416
2416
  * @param body Chat? -
2417
2417
  * @param xPolarionAccessToken string? - Polarion personal access token; must be provided together with the base url header. Takes precedence over the deprecated ChatDTO body fields.
@@ -2435,7 +2435,7 @@ declare class ChatEndpoint {
2435
2435
  sse(): SseEndpoint;
2436
2436
  /**
2437
2437
  * Chat with the generative model
2438
- * The chat endpoint allows you to interact with the generative model in a conversational manner. The path {id} selects the chat variant: pass '00000000-0000-0000-0000-000000000001' for document QA (attributes required) or '00000000-0000-0000-0000-000000000002' for MCP-augmented chat (attributes optional). Other values are treated as legacy and fall back to document QA. Callers that authenticate via Polarion pass their credentials in the X-Polarion-Access-Token and X-Polarion-Base-Url headers (same contract as the conversation GET endpoints). MCP servers are attached per request via the ChatDTO mcpServers entries (label plus optional authToken and tools subset).
2438
+ * The chat endpoint allows you to interact with the generative model in a conversational manner. The path {id} selects the chat variant: pass '00000000-0000-0000-0000-000000000001' for document QA (attributes required) or '00000000-0000-0000-0000-000000000002' for MCP-augmented chat (attributes optional). Other values are treated as legacy and fall back to document QA. Callers that authenticate via Polarion pass their credentials in the X-Polarion-Access-Token and X-Polarion-Base-Url headers (same contract as the conversation GET endpoints). MCP servers are attached per request via the ChatDTO mcpServers entries (label plus optional authToken and tools subset). Each returned message is typed: the ANSWER, an ERROR explaining a failed turn, an APPROVAL_REQUEST, or - when the domain's generative model is configured to show reasoning (gpt service option 'showReasoning', on by default when 'reasoningEffort' is set) - the model's REASONING, which precedes the answer and must be shown apart from it or hidden.
2439
2439
  *
2440
2440
  * @param body Chat? -
2441
2441
  * @param xPolarionAccessToken string? - Polarion personal access token; must be provided together with the base url header.
@@ -2458,7 +2458,7 @@ declare class ConversationEndpoint {
2458
2458
  constructor(restClient: RestClient, parentEndpoint: string, conversationid: string);
2459
2459
  /**
2460
2460
  * Retrieve the message history of a chat conversation
2461
- * Returns the full message history (oldest first) of the conversation identified by the conversationId that was returned from the chat endpoint, so a UI can restore a chat window after it was closed. Only the owner of the conversation may read it. Callers that authenticate via Polarion pass their credentials in the X-Polarion-Access-Token and X-Polarion-Base-Url headers; other callers are identified by their security context.
2461
+ * Returns the full message history (oldest first) of the conversation identified by the conversationId that was returned from the chat endpoint, so a UI can restore a chat window after it was closed. Messages are typed as in the chat endpoint, so a turn's REASONING, if the model reported any, is restored before its answer. Only the owner of the conversation may read it. Callers that authenticate via Polarion pass their credentials in the X-Polarion-Access-Token and X-Polarion-Base-Url headers; other callers are identified by their security context.
2462
2462
  *
2463
2463
  * @param xPolarionAccessToken string? - Polarion personal access token; must be provided together with the base url header.
2464
2464
  * @param xPolarionBaseUrl string? - Base url of the Polarion instance to validate the token against.
@@ -3134,8 +3134,14 @@ declare class McptoolsEndpoint {
3134
3134
  /**
3135
3135
  * List MCP tools activated for this domain.
3136
3136
  * Returns the MCP servers that have been activated for the given domain. Chat callers may reference any of these by `label` in the `enabledMcpTools` field of the chat request body. The list is the intersection of the platform's global MCP server pool and the domain's activation set. The activation set is managed via the `enabledMcpServerTools` field of the domain settings endpoint or seeded in the domain's configuration before server start.
3137
+ *
3138
+ * @param includeCapabilities boolean? - Describe every allowed tool in human-readable form, for callers that show capabilities rather than tool names. The platform asks each activated MCP server once and caches the answer, so the first such request per server is slower; an unreachable server yields entries with a name and nothing else.
3139
+ * @param includeExamples boolean? - Add generated example questions to every capability. Implies `includeCapabilities`, since the examples belong to a capability. They are written by the domain's generative model from the tool descriptions alone and cached per tool set, so the first such request per tool set costs a model call; a domain without a generative model yields capabilities without examples.
3137
3140
  */
3138
- get(): Promise<McpToolDescriptor[]>;
3141
+ get(params?: {
3142
+ includeCapabilities?: boolean;
3143
+ includeExamples?: boolean;
3144
+ }): Promise<McpToolDescriptor[]>;
3139
3145
  }
3140
3146
 
3141
3147
  /**
package/dist/index.d.ts CHANGED
@@ -1300,7 +1300,7 @@ declare function isMessageResponseRoleEnumValue(value: any): value is MessageRes
1300
1300
  *
1301
1301
  * This is a generated file do not change manually!
1302
1302
  */
1303
- declare const MessageResponseTypeEnumValues: readonly ["ANSWER", "THINKING", "ERROR", "APPROVAL_REQUEST"];
1303
+ declare const MessageResponseTypeEnumValues: readonly ["ANSWER", "REASONING", "ERROR", "APPROVAL_REQUEST"];
1304
1304
  type MessageResponseTypeEnum = (typeof MessageResponseTypeEnumValues)[number];
1305
1305
  declare function isMessageResponseTypeEnumValue(value: any): value is MessageResponseTypeEnum;
1306
1306
 
@@ -2411,7 +2411,7 @@ declare class SseEndpoint {
2411
2411
  constructor(restClient: RestClient, parentEndpoint: string);
2412
2412
  /**
2413
2413
  * Stream a chat response via Server-Sent Events
2414
- * Streaming variant of the chat endpoint with identical semantics (same {id} prompt-variant selection, request body, and Polarion header credentials). The response is a text/event-stream: an 'event: delta' per output-text chunk (data: {"content":"..."}), a terminal 'event: done' carrying the conversationId (data: {"conversationId":"..."}), and 'event: error' (data: {"message":"..."}) if generation fails after the stream has started. Requires a generative model that supports streaming (the stateful Responses backend).
2414
+ * Streaming variant of the chat endpoint with identical semantics (same {id} prompt-variant selection, request body, and Polarion header credentials). The response is a text/event-stream: an 'event: delta' per message chunk (data: {"content":"...","type":"ANSWER"}), a terminal 'event: done' carrying the conversationId (data: {"conversationId":"..."}), and 'event: error' (data: {"message":"..."}) if the stream itself fails after it has started. A turn that failed upstream is not a stream failure: it streams a delta of type ERROR carrying a message for the user, followed by 'event: done'. When the domain's generative model is configured to show reasoning (gpt service option 'showReasoning', on by default when 'reasoningEffort' is set), the model's reasoning streams as deltas of type REASONING, typically before the answer; it is not part of the answer and must be shown apart from it or hidden. Absent or unknown types must be read as ANSWER. Requires a generative model that supports streaming (the stateful Responses backend).
2415
2415
  *
2416
2416
  * @param body Chat? -
2417
2417
  * @param xPolarionAccessToken string? - Polarion personal access token; must be provided together with the base url header. Takes precedence over the deprecated ChatDTO body fields.
@@ -2435,7 +2435,7 @@ declare class ChatEndpoint {
2435
2435
  sse(): SseEndpoint;
2436
2436
  /**
2437
2437
  * Chat with the generative model
2438
- * The chat endpoint allows you to interact with the generative model in a conversational manner. The path {id} selects the chat variant: pass '00000000-0000-0000-0000-000000000001' for document QA (attributes required) or '00000000-0000-0000-0000-000000000002' for MCP-augmented chat (attributes optional). Other values are treated as legacy and fall back to document QA. Callers that authenticate via Polarion pass their credentials in the X-Polarion-Access-Token and X-Polarion-Base-Url headers (same contract as the conversation GET endpoints). MCP servers are attached per request via the ChatDTO mcpServers entries (label plus optional authToken and tools subset).
2438
+ * The chat endpoint allows you to interact with the generative model in a conversational manner. The path {id} selects the chat variant: pass '00000000-0000-0000-0000-000000000001' for document QA (attributes required) or '00000000-0000-0000-0000-000000000002' for MCP-augmented chat (attributes optional). Other values are treated as legacy and fall back to document QA. Callers that authenticate via Polarion pass their credentials in the X-Polarion-Access-Token and X-Polarion-Base-Url headers (same contract as the conversation GET endpoints). MCP servers are attached per request via the ChatDTO mcpServers entries (label plus optional authToken and tools subset). Each returned message is typed: the ANSWER, an ERROR explaining a failed turn, an APPROVAL_REQUEST, or - when the domain's generative model is configured to show reasoning (gpt service option 'showReasoning', on by default when 'reasoningEffort' is set) - the model's REASONING, which precedes the answer and must be shown apart from it or hidden.
2439
2439
  *
2440
2440
  * @param body Chat? -
2441
2441
  * @param xPolarionAccessToken string? - Polarion personal access token; must be provided together with the base url header.
@@ -2458,7 +2458,7 @@ declare class ConversationEndpoint {
2458
2458
  constructor(restClient: RestClient, parentEndpoint: string, conversationid: string);
2459
2459
  /**
2460
2460
  * Retrieve the message history of a chat conversation
2461
- * Returns the full message history (oldest first) of the conversation identified by the conversationId that was returned from the chat endpoint, so a UI can restore a chat window after it was closed. Only the owner of the conversation may read it. Callers that authenticate via Polarion pass their credentials in the X-Polarion-Access-Token and X-Polarion-Base-Url headers; other callers are identified by their security context.
2461
+ * Returns the full message history (oldest first) of the conversation identified by the conversationId that was returned from the chat endpoint, so a UI can restore a chat window after it was closed. Messages are typed as in the chat endpoint, so a turn's REASONING, if the model reported any, is restored before its answer. Only the owner of the conversation may read it. Callers that authenticate via Polarion pass their credentials in the X-Polarion-Access-Token and X-Polarion-Base-Url headers; other callers are identified by their security context.
2462
2462
  *
2463
2463
  * @param xPolarionAccessToken string? - Polarion personal access token; must be provided together with the base url header.
2464
2464
  * @param xPolarionBaseUrl string? - Base url of the Polarion instance to validate the token against.
@@ -3134,8 +3134,14 @@ declare class McptoolsEndpoint {
3134
3134
  /**
3135
3135
  * List MCP tools activated for this domain.
3136
3136
  * Returns the MCP servers that have been activated for the given domain. Chat callers may reference any of these by `label` in the `enabledMcpTools` field of the chat request body. The list is the intersection of the platform's global MCP server pool and the domain's activation set. The activation set is managed via the `enabledMcpServerTools` field of the domain settings endpoint or seeded in the domain's configuration before server start.
3137
+ *
3138
+ * @param includeCapabilities boolean? - Describe every allowed tool in human-readable form, for callers that show capabilities rather than tool names. The platform asks each activated MCP server once and caches the answer, so the first such request per server is slower; an unreachable server yields entries with a name and nothing else.
3139
+ * @param includeExamples boolean? - Add generated example questions to every capability. Implies `includeCapabilities`, since the examples belong to a capability. They are written by the domain's generative model from the tool descriptions alone and cached per tool set, so the first such request per tool set costs a model call; a domain without a generative model yields capabilities without examples.
3137
3140
  */
3138
- get(): Promise<McpToolDescriptor[]>;
3141
+ get(params?: {
3142
+ includeCapabilities?: boolean;
3143
+ includeExamples?: boolean;
3144
+ }): Promise<McpToolDescriptor[]>;
3139
3145
  }
3140
3146
 
3141
3147
  /**
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var E=require('axios'),Ce=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 E__default=/*#__PURE__*/_interopDefault(E);var Ce__namespace=/*#__PURE__*/_interopNamespace(Ce);var Te=["STRING","CURRENCY","DATE","NUMBER","YEAR","BOOLEAN","INTEGER"];function Xe(r){return Te.includes(r)}var ge=["STRING","CURRENCY","DATE","NUMBER","YEAR","BOOLEAN","INTEGER"];function Ye(r){return ge.includes(r)}var Oe=["STRING","CURRENCY","DATE","NUMBER","YEAR","BOOLEAN","INTEGER"];function qe(r){return Oe.includes(r)}var Pe=["DELETE","INSERT","EQUAL"];function je(r){return Pe.includes(r)}var De=["sentence","paragraph"];function ze(r){return De.includes(r)}var Ie=["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 Ze(r){return Ie.includes(r)}var Re=["STRING","CURRENCY","DATE","NUMBER","YEAR","BOOLEAN","INTEGER"];function er(r){return Re.includes(r)}var xe=["REGEX","ANDREGEX","ANDNOTREGEX","NOTREGEX","REGEX_CASE_INSENSITIVE","ANDREGEX_CASE_INSENSITIVE","ANDNOTREGEX_CASE_INSENSITIVE","NOTREGEX_CASE_INSENSITIVE","SIMILAR","ANDSIMILAR","ANDNOTSIMILAR","NOTSIMILAR","LIBRARY","ANDLIBRARY","ANDNOTLIBRARY","NOTLIBRARY","PARAGRAPH_DETECTION","CONSTANT","INTERNAL","INTERNAL_2","INTERNAL_3","INTERNAL_4","INTERNAL_5","INTERNAL_6","INTERNAL_7","INTERNAL_8","INTERNAL_9","INTERNAL_10","RANGE","REGEX_PARAGRAPH_LASTMATCH","REGEX_DOCUMENT_LASTMATCH","INTERNAL_PARAGRAPH_LASTMATCH","INTERNAL_DOCUMENT_LASTMATCH","END_OF_DOCUMENT","START_OF_DOCUMENT","NEXT_HEADING","TEXT_TYPE"];function nr(r){return xe.includes(r)}var ve=["CLASS","OBJECT_PROPERTY","DATA_PROPERTY"];function or(r){return ve.includes(r)}var we=["REGEX","ANDREGEX","ANDNOTREGEX","NOTREGEX","REGEX_CASE_INSENSITIVE","ANDREGEX_CASE_INSENSITIVE","ANDNOTREGEX_CASE_INSENSITIVE","NOTREGEX_CASE_INSENSITIVE","SIMILAR","ANDSIMILAR","ANDNOTSIMILAR","NOTSIMILAR","LIBRARY","ANDLIBRARY","ANDNOTLIBRARY","NOTLIBRARY","PARAGRAPH_DETECTION","CONSTANT","INTERNAL","INTERNAL_2","INTERNAL_3","INTERNAL_4","INTERNAL_5","INTERNAL_6","INTERNAL_7","INTERNAL_8","INTERNAL_9","INTERNAL_10","RANGE","REGEX_PARAGRAPH_LASTMATCH","REGEX_DOCUMENT_LASTMATCH","INTERNAL_PARAGRAPH_LASTMATCH","INTERNAL_DOCUMENT_LASTMATCH","END_OF_DOCUMENT","START_OF_DOCUMENT","NEXT_HEADING","TEXT_TYPE"];function ar(r){return we.includes(r)}var Me=["REQUIRED","OPTIONAL","NONE"];function lr(r){return Me.includes(r)}var be=["USER","ASSISTANT","SYSTEM"];function dr(r){return be.includes(r)}var Se=["ANSWER","THINKING","ERROR","APPROVAL_REQUEST"];function cr(r){return Se.includes(r)}var Ae=["USER","ASSISTANT","SYSTEM"];function Nr(r){return Ae.includes(r)}var _e=["fingerprint","keyword","document","document_fingerprint","fingerprint_keyword","auto","fingerprint_exact","document_fingerprint_exact"];function fr(r){return _e.includes(r)}var He=["COMPARE","SEARCH","LIBRARY","POLARION","AITASKS","INTERNAL"];function Cr(r){return He.includes(r)}var Le=["COMPARE","SEARCH","LIBRARY","POLARION","AITASKS","INTERNAL"];function gr(r){return Le.includes(r)}var Je=["COMPARE","SEARCH","LIBRARY","POLARION","AITASKS","INTERNAL"];function Pr(r){return Je.includes(r)}var Be=["OPERATOR","FUNCTION"];function Ir(r){return Be.includes(r)}var Ve=["fingerprint","keyword","document","document_fingerprint","fingerprint_keyword","auto","fingerprint_exact","document_fingerprint_exact"];function xr(r){return Ve.includes(r)}var ke=["ANY","TOP1","TOP3","TOP5","TOP10"];function wr(r){return ke.includes(r)}var Fe=["TOP1","TOP3","TOP5","TOP10"];function br(r){return Fe.includes(r)}var Ge=["similarity","extraction"];function Ar(r){return Ge.includes(r)}var c=class{constructor(t){this.response=t;}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}},Ee=class{constructor(t,e,n,o){this.event=t;this.data=e;this.id=n;this.retry=o;}json(){return JSON.parse(this.data)}};function he(r){let t,e=[],n,o,s=false;for(let a of r.split(`
1
+ 'use strict';var E=require('axios'),Ce=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 E__default=/*#__PURE__*/_interopDefault(E);var Ce__namespace=/*#__PURE__*/_interopNamespace(Ce);var Te=["STRING","CURRENCY","DATE","NUMBER","YEAR","BOOLEAN","INTEGER"];function Xe(r){return Te.includes(r)}var ge=["STRING","CURRENCY","DATE","NUMBER","YEAR","BOOLEAN","INTEGER"];function Ye(r){return ge.includes(r)}var Oe=["STRING","CURRENCY","DATE","NUMBER","YEAR","BOOLEAN","INTEGER"];function qe(r){return Oe.includes(r)}var Pe=["DELETE","INSERT","EQUAL"];function je(r){return Pe.includes(r)}var De=["sentence","paragraph"];function Ke(r){return De.includes(r)}var Ie=["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 Ze(r){return Ie.includes(r)}var Re=["STRING","CURRENCY","DATE","NUMBER","YEAR","BOOLEAN","INTEGER"];function er(r){return Re.includes(r)}var xe=["REGEX","ANDREGEX","ANDNOTREGEX","NOTREGEX","REGEX_CASE_INSENSITIVE","ANDREGEX_CASE_INSENSITIVE","ANDNOTREGEX_CASE_INSENSITIVE","NOTREGEX_CASE_INSENSITIVE","SIMILAR","ANDSIMILAR","ANDNOTSIMILAR","NOTSIMILAR","LIBRARY","ANDLIBRARY","ANDNOTLIBRARY","NOTLIBRARY","PARAGRAPH_DETECTION","CONSTANT","INTERNAL","INTERNAL_2","INTERNAL_3","INTERNAL_4","INTERNAL_5","INTERNAL_6","INTERNAL_7","INTERNAL_8","INTERNAL_9","INTERNAL_10","RANGE","REGEX_PARAGRAPH_LASTMATCH","REGEX_DOCUMENT_LASTMATCH","INTERNAL_PARAGRAPH_LASTMATCH","INTERNAL_DOCUMENT_LASTMATCH","END_OF_DOCUMENT","START_OF_DOCUMENT","NEXT_HEADING","TEXT_TYPE"];function nr(r){return xe.includes(r)}var ve=["CLASS","OBJECT_PROPERTY","DATA_PROPERTY"];function or(r){return ve.includes(r)}var we=["REGEX","ANDREGEX","ANDNOTREGEX","NOTREGEX","REGEX_CASE_INSENSITIVE","ANDREGEX_CASE_INSENSITIVE","ANDNOTREGEX_CASE_INSENSITIVE","NOTREGEX_CASE_INSENSITIVE","SIMILAR","ANDSIMILAR","ANDNOTSIMILAR","NOTSIMILAR","LIBRARY","ANDLIBRARY","ANDNOTLIBRARY","NOTLIBRARY","PARAGRAPH_DETECTION","CONSTANT","INTERNAL","INTERNAL_2","INTERNAL_3","INTERNAL_4","INTERNAL_5","INTERNAL_6","INTERNAL_7","INTERNAL_8","INTERNAL_9","INTERNAL_10","RANGE","REGEX_PARAGRAPH_LASTMATCH","REGEX_DOCUMENT_LASTMATCH","INTERNAL_PARAGRAPH_LASTMATCH","INTERNAL_DOCUMENT_LASTMATCH","END_OF_DOCUMENT","START_OF_DOCUMENT","NEXT_HEADING","TEXT_TYPE"];function ar(r){return we.includes(r)}var Me=["REQUIRED","OPTIONAL","NONE"];function lr(r){return Me.includes(r)}var be=["USER","ASSISTANT","SYSTEM"];function dr(r){return be.includes(r)}var Se=["ANSWER","REASONING","ERROR","APPROVAL_REQUEST"];function cr(r){return Se.includes(r)}var Ae=["USER","ASSISTANT","SYSTEM"];function Nr(r){return Ae.includes(r)}var _e=["fingerprint","keyword","document","document_fingerprint","fingerprint_keyword","auto","fingerprint_exact","document_fingerprint_exact"];function fr(r){return _e.includes(r)}var He=["COMPARE","SEARCH","LIBRARY","POLARION","AITASKS","INTERNAL"];function Cr(r){return He.includes(r)}var Le=["COMPARE","SEARCH","LIBRARY","POLARION","AITASKS","INTERNAL"];function gr(r){return Le.includes(r)}var Je=["COMPARE","SEARCH","LIBRARY","POLARION","AITASKS","INTERNAL"];function Pr(r){return Je.includes(r)}var Be=["OPERATOR","FUNCTION"];function Ir(r){return Be.includes(r)}var Ve=["fingerprint","keyword","document","document_fingerprint","fingerprint_keyword","auto","fingerprint_exact","document_fingerprint_exact"];function xr(r){return Ve.includes(r)}var ke=["ANY","TOP1","TOP3","TOP5","TOP10"];function wr(r){return ke.includes(r)}var Fe=["TOP1","TOP3","TOP5","TOP10"];function br(r){return Fe.includes(r)}var Ge=["similarity","extraction"];function Ar(r){return Ge.includes(r)}var c=class{constructor(t){this.response=t;}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}},Ee=class{constructor(t,e,n,o){this.event=t;this.data=e;this.id=n;this.retry=o;}json(){return JSON.parse(this.data)}};function he(r){let t,e=[],n,o,s=false;for(let a of r.split(`
2
2
  `)){if(a===""||a.startsWith(":"))continue;let p=a.indexOf(":"),m=p===-1?a:a.slice(0,p),d=p===-1?"":a.slice(p+1);switch(d.startsWith(" ")&&(d=d.slice(1)),s=true,m){case "event":t=d;break;case "data":e.push(d);break;case "id":n=d;break;case "retry":{let l=Number(d);Number.isNaN(l)||(o=l);break}}}return s?new Ee(t,e.join(`
3
3
  `),n,o):void 0}async function*fe(r){let t=r.getReader(),e=new TextDecoder,n="",o=function*(s){n=n.replace(/\r\n/g,`
4
4
  `).replace(/\r/g,`
@@ -6,5 +6,5 @@
6
6
 
7
7
  `);for(;a!==-1;){let p=he(n.slice(0,a));n=n.slice(a+2),p&&(yield p),a=n.indexOf(`
8
8
 
9
- `);}if(s){let p=he(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||{}),u=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 E__default.default.post(this.tokenUrl,t,{headers:{accept:"application/json","content-type":"application/x-www-form-urlencoded"}});if(e.status>=E__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 c(E__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 c(E__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 fe(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 N=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 h=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+"/instances";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var y=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.classid=n;this.ENDPOINT=this.parentEndpoint+`/classes/${this.classid}`;}ENDPOINT;instances(){return new f(this.restClient,this.ENDPOINT)}};var C=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/classes";}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 T=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/dataproperties";}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 g=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/instances";}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+"/metadata";}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 P=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 D=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/rules";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var I=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/synonyms";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},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;classes(t){return t!=null?new y(this.restClient,this.ENDPOINT,t):new C(this.restClient,this.ENDPOINT)}dataproperties(){return new T(this.restClient,this.ENDPOINT)}instances(){return new g(this.restClient,this.ENDPOINT)}metadata(){return new O(this.restClient,this.ENDPOINT)}namedentities(){return new P(this.restClient,this.ENDPOINT)}rules(){return new D(this.restClient,this.ENDPOINT)}synonyms(){return new I(this.restClient,this.ENDPOINT)}};var x=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var v=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/model";}ENDPOINT;domains(t){return t!=null?new R(this.restClient,this.ENDPOINT,t):new x(this.restClient,this.ENDPOINT)}};var w=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 M=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 b=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","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 S=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 A=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 w(this.restClient,this.ENDPOINT)}documenttypes(){return new M(this.restClient,this.ENDPOINT)}referencedocuments(){return new b(this.restClient,this.ENDPOINT)}references(){return new S(this.restClient,this.ENDPOINT)}};var _=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/bulk";}ENDPOINT;domains(t){return t!=null?new A(this.restClient,this.ENDPOINT,t):new h(this.restClient,this.ENDPOINT)}model(){return new v(this.restClient,this.ENDPOINT)}};var H=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 L=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 J=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 L(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 B=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 V=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 k=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/chats";}ENDPOINT;conversations(t){return t!=null?new B(this.restClient,this.ENDPOINT,t):new V(this.restClient,this.ENDPOINT)}};var F=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/extractorclasses";}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+"/clone";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var X=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/conversions";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toFile()}};var U=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/roles";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var Y=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/currentuser";}ENDPOINT;roles(){return new U(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var $=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/diff";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}};var q=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 W=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 delete(t){return await this.restClient.delete(this.ENDPOINT,t)}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 K=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 get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(t){return await this.restClient.delete(this.ENDPOINT,t)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var z=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 Q=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 q(this.restClient,this.ENDPOINT)}documentclasses(){return new W(this.restClient,this.ENDPOINT)}referencedocuments(){return new K(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 Z=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 tt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documentclasses";}ENDPOINT;tree(){return new Z(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 et=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 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 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 rt=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 G(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 nt=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 it=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/mcptools";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var ot=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/modelclasses";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var st=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/modelinstances";}ENDPOINT;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()}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()}};var at=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 pt=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 lt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/prompts";}ENDPOINT;validation(){return new pt(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 mt=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 dt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/images";}ENDPOINT};var ut=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 ct=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 Et=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 ht=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/sentences";}ENDPOINT};var ft=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 mt(this.restClient,this.ENDPOINT,t):new dt(this.restClient,this.ENDPOINT)}markdown(){return new ut(this.restClient,this.ENDPOINT)}paragraphs(t){return t!=null?new ct(this.restClient,this.ENDPOINT,t):new Et(this.restClient,this.ENDPOINT)}sentences(t){return t!=null?new Nt(this.restClient,this.ENDPOINT,t):new ht(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 yt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/namedentities";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var Ct=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 Tt=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 gt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/referencedocuments";}ENDPOINT;namedentities(){return new yt(this.restClient,this.ENDPOINT)}statistic(){return new Tt(this.restClient,this.ENDPOINT)}stream(){return new Ct(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 Ot=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 Pt=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()}async delete(){return await this.restClient.delete(this.ENDPOINT)}};var It=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 Rt=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 xt=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 vt=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 wt=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","multipart/form-data"),t)).toModel()}};var Mt=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 N(this.restClient,this.ENDPOINT)}chats(t){return t!=null?new J(this.restClient,this.ENDPOINT,t):new k(this.restClient,this.ENDPOINT)}documentannotations(){return new z(this.restClient,this.ENDPOINT)}documentclasses(t){return t!=null?new Q(this.restClient,this.ENDPOINT,t):new tt(this.restClient,this.ENDPOINT)}documents(){return new et(this.restClient,this.ENDPOINT)}documenttypes(t){return t!=null?new rt(this.restClient,this.ENDPOINT,t):new nt(this.restClient,this.ENDPOINT)}mcptools(){return new it(this.restClient,this.ENDPOINT)}modelclasses(){return new ot(this.restClient,this.ENDPOINT)}modelinstances(){return new st(this.restClient,this.ENDPOINT)}prompts(t){return t!=null?new at(this.restClient,this.ENDPOINT,t):new lt(this.restClient,this.ENDPOINT)}referencedocuments(t){return t!=null?new ft(this.restClient,this.ENDPOINT,t):new gt(this.restClient,this.ENDPOINT)}references(){return new Ot(this.restClient,this.ENDPOINT)}settings(){return new Pt(this.restClient,this.ENDPOINT)}tags(t){return t!=null?new It(this.restClient,this.ENDPOINT,t):new Rt(this.restClient,this.ENDPOINT)}texttypes(){return new xt(this.restClient,this.ENDPOINT)}translations(){return new vt(this.restClient,this.ENDPOINT)}validation(){return new wt(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var bt=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 St=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 At=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/languages";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}};var _t=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/datatypes";}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+"/attributes";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var Lt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/dataproperties";}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 Jt=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/dataproperties/${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 Bt=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/extractorclasses/${this.id}`;}ENDPOINT;extractorclasses(){return new F(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 put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var Vt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/extractorclasses";}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()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var kt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/extractors";}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+"/formatters";}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+"/metadata";}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 Xt=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 Ut=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 Yt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/objectproperties";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var $t=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/metadata/${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 qt=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/regexes/${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 Wt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/regexes";}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 jt=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/relations/${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 Kt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/relations";}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 zt=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/rules/${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 Qt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/rulefunctions";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var Zt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/rules";}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 te=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 ee=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 re=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/attributes/${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 ne=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/attributes";}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 ie=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/instances";}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)}};var oe=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.classid=n;this.ENDPOINT=this.parentEndpoint+`/classes/${this.classid}`;}ENDPOINT;attributes(t){return t!=null?new re(this.restClient,this.ENDPOINT,t):new ne(this.restClient,this.ENDPOINT)}instances(){return new ie(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 put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var se=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/classes";}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 ae=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/instances/${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 pe=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/instances";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async getAsXlsx(){return (await this.restClient.get(this.ENDPOINT,{},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){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var le=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;attributes(){return new Ht(this.restClient,this.ENDPOINT)}classes(t){return t!=null?new oe(this.restClient,this.ENDPOINT,t):new se(this.restClient,this.ENDPOINT)}dataproperties(t){return t!=null?new Jt(this.restClient,this.ENDPOINT,t):new Lt(this.restClient,this.ENDPOINT)}extractorclasses(t){return t!=null?new Bt(this.restClient,this.ENDPOINT,t):new Vt(this.restClient,this.ENDPOINT)}extractors(){return new kt(this.restClient,this.ENDPOINT)}formatters(){return new Ft(this.restClient,this.ENDPOINT)}instances(t){return t!=null?new ae(this.restClient,this.ENDPOINT,t):new pe(this.restClient,this.ENDPOINT)}metadata(t){return t!=null?new $t(this.restClient,this.ENDPOINT,t):new Gt(this.restClient,this.ENDPOINT)}namedentities(t){return t!=null?new Ut(this.restClient,this.ENDPOINT,t):new Xt(this.restClient,this.ENDPOINT)}objectproperties(){return new Yt(this.restClient,this.ENDPOINT)}regexes(t){return t!=null?new qt(this.restClient,this.ENDPOINT,t):new Wt(this.restClient,this.ENDPOINT)}relations(t){return t!=null?new jt(this.restClient,this.ENDPOINT,t):new Kt(this.restClient,this.ENDPOINT)}rulefunctions(){return new Qt(this.restClient,this.ENDPOINT)}rules(t){return t!=null?new zt(this.restClient,this.ENDPOINT,t):new Zt(this.restClient,this.ENDPOINT)}synonyms(t){return t!=null?new te(this.restClient,this.ENDPOINT,t):new ee(this.restClient,this.ENDPOINT)}async getAsXlsx(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),null,"blob")).toFile()}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var me=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var de=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/extractortypes";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var ue=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/metadatatypes";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var ce=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/model";}ENDPOINT;datatypes(){return new _t(this.restClient,this.ENDPOINT)}domains(t){return t!=null?new le(this.restClient,this.ENDPOINT,t):new me(this.restClient,this.ENDPOINT)}extractortypes(){return new de(this.restClient,this.ENDPOINT)}metadatatypes(){return new ue(this.restClient,this.ENDPOINT)}};var Ne="/api/v3",ye=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 u(this.parseServerUrl(t),e),Ne)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new r(new u(this.parseServerUrl(t)),Ne)}static loginWithCredentials(t,e,n,o){return t=this.parseServerUrl(t),new r(new u(t,void 0,e,n,o),Ne)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=Ce__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 _(this.restClient,this.endpoint())}celltypes(){return new H(this.restClient,this.endpoint())}conversions(){return new X(this.restClient,this.endpoint())}currentuser(){return new Y(this.restClient,this.endpoint())}diff(){return new $(this.restClient,this.endpoint())}domains(t){return t!=null?new Mt(this.restClient,this.endpoint(),t):new bt(this.restClient,this.endpoint())}info(){return new St(this.restClient,this.endpoint())}languages(){return new At(this.restClient,this.endpoint())}model(){return new ce(this.restClient,this.endpoint())}};exports.AnswersEndpoint=N;exports.AttributeDatatypeEnumValues=Te;exports.AttributeOverviewDatatypeEnumValues=ge;exports.BulkDomainsEndpoint=h;exports.BulkEndpoint=_;exports.BulkModelEndpoint=v;exports.BulkdomainsDocumentclassesEndpoint=w;exports.BulkdomainsDocumenttypesEndpoint=M;exports.BulkdomainsDomainEndpoint=A;exports.BulkdomainsReferencedocumentsEndpoint=b;exports.BulkdomainsReferencesEndpoint=S;exports.BulkmodelClassEndpoint=y;exports.BulkmodelClassesEndpoint=C;exports.BulkmodelDatapropertiesEndpoint=T;exports.BulkmodelDomainEndpoint=R;exports.BulkmodelDomainsEndpoint=x;exports.BulkmodelInstancesEndpoint=g;exports.BulkmodelMetadataEndpoint=O;exports.BulkmodelNamedentitiesEndpoint=P;exports.BulkmodelRulesEndpoint=D;exports.BulkmodelSynonymsEndpoint=I;exports.BulkmodelclassInstancesEndpoint=f;exports.CelltypesEndpoint=H;exports.ChatEndpoint=J;exports.ChatsEndpoint=k;exports.ChildExtractorclassesEndpoint=F;exports.ClassBulkDatatypeEnumValues=Oe;exports.CloneEndpoint=G;exports.ConversationEndpoint=B;exports.ConversationsEndpoint=V;exports.ConversionsEndpoint=X;exports.CurrentuserEndpoint=Y;exports.DiffEndpoint=$;exports.DifferenceOperationEnumValues=Pe;exports.DocclassCustomfieldsEndpoint=q;exports.DocclassDocumentclassesEndpoint=W;exports.DocclassReferencedocumentsEndpoint=K;exports.DocclassTagsEndpoint=j;exports.DocumentannotationsEndpoint=z;exports.DocumentclassEndpoint=Q;exports.DocumentclassesEndpoint=tt;exports.DocumentmodeEnumValues=De;exports.DocumentsEndpoint=et;exports.DocumenttypeEndpoint=rt;exports.DocumenttypesEndpoint=nt;exports.DomainEndpoint=Mt;exports.DomainsEndpoint=bt;exports.ErrorFieldCodeEnumValues=Ie;exports.ExtractorAttributeDatatypeEnumValues=Re;exports.ExtractorTypeEnumValues=xe;exports.FieldTypeEnumValues=ve;exports.ImageEndpoint=mt;exports.ImagesEndpoint=dt;exports.InfoEndpoint=St;exports.LanguagesEndpoint=At;exports.MarkdownEndpoint=ut;exports.MatcherTypeEnumValues=we;exports.McpToolDescriptorAuthEnumValues=Me;exports.McptoolsEndpoint=it;exports.MediaType=i;exports.MessageResponseRoleEnumValues=be;exports.MessageResponseTypeEnumValues=Se;exports.MessageRoleEnumValues=Ae;exports.ModeEnumValues=_e;exports.ModelAttributesEndpoint=Ht;exports.ModelDatapropertiesEndpoint=Lt;exports.ModelDatapropertyEndpoint=Jt;exports.ModelDatatypesEndpoint=_t;exports.ModelDomainEndpoint=le;exports.ModelDomainsEndpoint=me;exports.ModelEndpoint=ce;exports.ModelExtractorclassEndpoint=Bt;exports.ModelExtractorclassesEndpoint=Vt;exports.ModelExtractorsEndpoint=kt;exports.ModelExtractortypesEndpoint=de;exports.ModelFormattersEndpoint=Ft;exports.ModelMetadataEndpoint=Gt;exports.ModelMetadatatypesEndpoint=ue;exports.ModelNamedentitiesEndpoint=Xt;exports.ModelNamedentityEndpoint=Ut;exports.ModelObjectpropertiesEndpoint=Yt;exports.ModelOnemetadataEndpoint=$t;exports.ModelRegexEndpoint=qt;exports.ModelRegexesEndpoint=Wt;exports.ModelRelationEndpoint=jt;exports.ModelRelationsEndpoint=Kt;exports.ModelRuleEndpoint=zt;exports.ModelRulefunctionsEndpoint=Qt;exports.ModelRulesEndpoint=Zt;exports.ModelSynonymEndpoint=te;exports.ModelSynonymsEndpoint=ee;exports.ModelclassesEndpoint=ot;exports.ModelinstancesEndpoint=st;exports.ModelontAttributeEndpoint=re;exports.ModelontAttributesEndpoint=ne;exports.ModelontClassEndpoint=oe;exports.ModelontClassesEndpoint=se;exports.ModelontInstanceEndpoint=ae;exports.ModelontInstancesEndpoint=pe;exports.ModelontclassInstancesEndpoint=ie;exports.NamedentitiesEndpoint=yt;exports.ParagraphEndpoint=ct;exports.ParagraphsEndpoint=Et;exports.PromptEndpoint=at;exports.PromptLabelEnumValues=He;exports.PromptOverviewPromptLabelEnumValues=Le;exports.PromptPromptLabelEnumValues=Je;exports.PromptValidationEndpoint=pt;exports.PromptsEndpoint=lt;exports.ReferencedocumentEndpoint=ft;exports.ReferencedocumentsEndpoint=gt;exports.ReferencedocumentsStreamEndpoint=Ct;exports.ReferencesEndpoint=Ot;exports.RestClient=u;exports.RestResponse=c;exports.RolesEndpoint=U;exports.RuleFunctionTypeEnumValues=Be;exports.SemanthaAPI=ye;exports.SentenceEndpoint=Nt;exports.SentencesEndpoint=ht;exports.ServerSentEvent=Ee;exports.SettingsDefaultSimilarityModeEnumValues=Ve;exports.SettingsEndpoint=Pt;exports.SettingsExtractionStrategyEnumValues=ke;exports.SettingsTaggingStrategyEnumValues=Fe;exports.SseEndpoint=L;exports.StatisticEndpoint=Tt;exports.TagEndpoint=It;exports.TagReferencedocumentsEndpoint=Dt;exports.TagsEndpoint=Rt;exports.TexttypesEndpoint=xt;exports.TranslationsEndpoint=vt;exports.TreeEndpoint=Z;exports.TypeEnumValues=Ge;exports.ValidationEndpoint=wt;exports.isAttributeDatatypeEnumValue=Xe;exports.isAttributeOverviewDatatypeEnumValue=Ye;exports.isClassBulkDatatypeEnumValue=qe;exports.isDifferenceOperationEnumValue=je;exports.isDocumentmodeEnumValue=ze;exports.isErrorFieldCodeEnumValue=Ze;exports.isExtractorAttributeDatatypeEnumValue=er;exports.isExtractorTypeEnumValue=nr;exports.isFieldTypeEnumValue=or;exports.isMatcherTypeEnumValue=ar;exports.isMcpToolDescriptorAuthEnumValue=lr;exports.isMessageResponseRoleEnumValue=dr;exports.isMessageResponseTypeEnumValue=cr;exports.isMessageRoleEnumValue=Nr;exports.isModeEnumValue=fr;exports.isPromptLabelEnumValue=Cr;exports.isPromptOverviewPromptLabelEnumValue=gr;exports.isPromptPromptLabelEnumValue=Pr;exports.isRuleFunctionTypeEnumValue=Ir;exports.isSettingsDefaultSimilarityModeEnumValue=xr;exports.isSettingsExtractionStrategyEnumValue=wr;exports.isSettingsTaggingStrategyEnumValue=br;exports.isTypeEnumValue=Ar;exports.parseServerSentEvents=fe;//# sourceMappingURL=index.js.map
9
+ `);}if(s){let p=he(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||{}),u=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 E__default.default.post(this.tokenUrl,t,{headers:{accept:"application/json","content-type":"application/x-www-form-urlencoded"}});if(e.status>=E__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 c(E__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 c(E__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 fe(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 N=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 h=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+"/instances";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var y=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.classid=n;this.ENDPOINT=this.parentEndpoint+`/classes/${this.classid}`;}ENDPOINT;instances(){return new f(this.restClient,this.ENDPOINT)}};var C=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/classes";}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 T=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/dataproperties";}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 g=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/instances";}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+"/metadata";}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 P=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 D=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/rules";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var I=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/synonyms";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},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;classes(t){return t!=null?new y(this.restClient,this.ENDPOINT,t):new C(this.restClient,this.ENDPOINT)}dataproperties(){return new T(this.restClient,this.ENDPOINT)}instances(){return new g(this.restClient,this.ENDPOINT)}metadata(){return new O(this.restClient,this.ENDPOINT)}namedentities(){return new P(this.restClient,this.ENDPOINT)}rules(){return new D(this.restClient,this.ENDPOINT)}synonyms(){return new I(this.restClient,this.ENDPOINT)}};var x=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var v=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/model";}ENDPOINT;domains(t){return t!=null?new R(this.restClient,this.ENDPOINT,t):new x(this.restClient,this.ENDPOINT)}};var w=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 M=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 b=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","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 S=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 A=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 w(this.restClient,this.ENDPOINT)}documenttypes(){return new M(this.restClient,this.ENDPOINT)}referencedocuments(){return new b(this.restClient,this.ENDPOINT)}references(){return new S(this.restClient,this.ENDPOINT)}};var _=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/bulk";}ENDPOINT;domains(t){return t!=null?new A(this.restClient,this.ENDPOINT,t):new h(this.restClient,this.ENDPOINT)}model(){return new v(this.restClient,this.ENDPOINT)}};var H=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 L=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 J=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 L(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 B=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 V=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 k=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/chats";}ENDPOINT;conversations(t){return t!=null?new B(this.restClient,this.ENDPOINT,t):new V(this.restClient,this.ENDPOINT)}};var F=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/extractorclasses";}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+"/clone";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var X=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/conversions";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toFile()}};var U=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/roles";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var Y=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/currentuser";}ENDPOINT;roles(){return new U(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var $=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/diff";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}};var q=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 W=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 delete(t){return await this.restClient.delete(this.ENDPOINT,t)}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 z=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 get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async delete(t){return await this.restClient.delete(this.ENDPOINT,t)}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var K=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 Q=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 q(this.restClient,this.ENDPOINT)}documentclasses(){return new W(this.restClient,this.ENDPOINT)}referencedocuments(){return new z(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 Z=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 tt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/documentclasses";}ENDPOINT;tree(){return new Z(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 et=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 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 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 rt=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 G(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 nt=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 it=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 ot=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/modelclasses";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var st=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/modelinstances";}ENDPOINT;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()}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()}};var at=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 pt=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 lt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/prompts";}ENDPOINT;validation(){return new pt(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 mt=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 dt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/images";}ENDPOINT};var ut=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 ct=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 Et=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 ht=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/sentences";}ENDPOINT};var ft=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 mt(this.restClient,this.ENDPOINT,t):new dt(this.restClient,this.ENDPOINT)}markdown(){return new ut(this.restClient,this.ENDPOINT)}paragraphs(t){return t!=null?new ct(this.restClient,this.ENDPOINT,t):new Et(this.restClient,this.ENDPOINT)}sentences(t){return t!=null?new Nt(this.restClient,this.ENDPOINT,t):new ht(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 yt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/namedentities";}ENDPOINT;async get(t){return (await this.restClient.get(this.ENDPOINT,t,this.restClient.toHeader("application/json"))).toModel()}};var Ct=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 Tt=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 gt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/referencedocuments";}ENDPOINT;namedentities(){return new yt(this.restClient,this.ENDPOINT)}statistic(){return new Tt(this.restClient,this.ENDPOINT)}stream(){return new Ct(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 Ot=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 Pt=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()}async delete(){return await this.restClient.delete(this.ENDPOINT)}};var It=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 Rt=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 xt=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 vt=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 wt=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","multipart/form-data"),t)).toModel()}};var Mt=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 N(this.restClient,this.ENDPOINT)}chats(t){return t!=null?new J(this.restClient,this.ENDPOINT,t):new k(this.restClient,this.ENDPOINT)}documentannotations(){return new K(this.restClient,this.ENDPOINT)}documentclasses(t){return t!=null?new Q(this.restClient,this.ENDPOINT,t):new tt(this.restClient,this.ENDPOINT)}documents(){return new et(this.restClient,this.ENDPOINT)}documenttypes(t){return t!=null?new rt(this.restClient,this.ENDPOINT,t):new nt(this.restClient,this.ENDPOINT)}mcptools(){return new it(this.restClient,this.ENDPOINT)}modelclasses(){return new ot(this.restClient,this.ENDPOINT)}modelinstances(){return new st(this.restClient,this.ENDPOINT)}prompts(t){return t!=null?new at(this.restClient,this.ENDPOINT,t):new lt(this.restClient,this.ENDPOINT)}referencedocuments(t){return t!=null?new ft(this.restClient,this.ENDPOINT,t):new gt(this.restClient,this.ENDPOINT)}references(){return new Ot(this.restClient,this.ENDPOINT)}settings(){return new Pt(this.restClient,this.ENDPOINT)}tags(t){return t!=null?new It(this.restClient,this.ENDPOINT,t):new Rt(this.restClient,this.ENDPOINT)}texttypes(){return new xt(this.restClient,this.ENDPOINT)}translations(){return new vt(this.restClient,this.ENDPOINT)}validation(){return new wt(this.restClient,this.ENDPOINT)}async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var bt=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 St=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 At=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/languages";}ENDPOINT;async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json","multipart/form-data"),t)).toModel()}};var _t=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/datatypes";}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+"/attributes";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var Lt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/dataproperties";}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 Jt=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/dataproperties/${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 Bt=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/extractorclasses/${this.id}`;}ENDPOINT;extractorclasses(){return new F(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 put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var Vt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/extractorclasses";}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()}async post(t){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var kt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/extractors";}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+"/formatters";}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+"/metadata";}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 Xt=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 Ut=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 Yt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/objectproperties";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var $t=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/metadata/${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 qt=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/regexes/${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 Wt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/regexes";}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 jt=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/relations/${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 zt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/relations";}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 Kt=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/rules/${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 Qt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/rulefunctions";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var Zt=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/rules";}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 te=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 ee=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 re=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/attributes/${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 ne=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/attributes";}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 ie=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/instances";}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)}};var oe=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.classid=n;this.ENDPOINT=this.parentEndpoint+`/classes/${this.classid}`;}ENDPOINT;attributes(t){return t!=null?new re(this.restClient,this.ENDPOINT,t):new ne(this.restClient,this.ENDPOINT)}instances(){return new ie(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 put(t){return (await this.restClient.put(this.ENDPOINT,t)).toModel()}};var se=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/classes";}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 ae=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.id=n;this.ENDPOINT=this.parentEndpoint+`/instances/${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 pe=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/instances";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}async getAsXlsx(){return (await this.restClient.get(this.ENDPOINT,{},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){return (await this.restClient.post(this.ENDPOINT,{},this.restClient.toHeader("application/json"),t)).toModel()}};var le=class{constructor(t,e,n){this.restClient=t;this.parentEndpoint=e;this.domainname=n;this.ENDPOINT=this.parentEndpoint+`/domains/${this.domainname}`;}ENDPOINT;attributes(){return new Ht(this.restClient,this.ENDPOINT)}classes(t){return t!=null?new oe(this.restClient,this.ENDPOINT,t):new se(this.restClient,this.ENDPOINT)}dataproperties(t){return t!=null?new Jt(this.restClient,this.ENDPOINT,t):new Lt(this.restClient,this.ENDPOINT)}extractorclasses(t){return t!=null?new Bt(this.restClient,this.ENDPOINT,t):new Vt(this.restClient,this.ENDPOINT)}extractors(){return new kt(this.restClient,this.ENDPOINT)}formatters(){return new Ft(this.restClient,this.ENDPOINT)}instances(t){return t!=null?new ae(this.restClient,this.ENDPOINT,t):new pe(this.restClient,this.ENDPOINT)}metadata(t){return t!=null?new $t(this.restClient,this.ENDPOINT,t):new Gt(this.restClient,this.ENDPOINT)}namedentities(t){return t!=null?new Ut(this.restClient,this.ENDPOINT,t):new Xt(this.restClient,this.ENDPOINT)}objectproperties(){return new Yt(this.restClient,this.ENDPOINT)}regexes(t){return t!=null?new qt(this.restClient,this.ENDPOINT,t):new Wt(this.restClient,this.ENDPOINT)}relations(t){return t!=null?new jt(this.restClient,this.ENDPOINT,t):new zt(this.restClient,this.ENDPOINT)}rulefunctions(){return new Qt(this.restClient,this.ENDPOINT)}rules(t){return t!=null?new Kt(this.restClient,this.ENDPOINT,t):new Zt(this.restClient,this.ENDPOINT)}synonyms(t){return t!=null?new te(this.restClient,this.ENDPOINT,t):new ee(this.restClient,this.ENDPOINT)}async getAsXlsx(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),null,"blob")).toFile()}async patch(t){return (await this.restClient.patch(this.ENDPOINT,t)).toModel()}};var me=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/domains";}ENDPOINT};var de=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/extractortypes";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var ue=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/metadatatypes";}ENDPOINT;async get(){return (await this.restClient.get(this.ENDPOINT,{},this.restClient.toHeader("application/json"))).toModel()}};var ce=class{constructor(t,e){this.restClient=t;this.parentEndpoint=e;this.ENDPOINT=this.parentEndpoint+"/model";}ENDPOINT;datatypes(){return new _t(this.restClient,this.ENDPOINT)}domains(t){return t!=null?new le(this.restClient,this.ENDPOINT,t):new me(this.restClient,this.ENDPOINT)}extractortypes(){return new de(this.restClient,this.ENDPOINT)}metadatatypes(){return new ue(this.restClient,this.ENDPOINT)}};var Ne="/api/v3",ye=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 u(this.parseServerUrl(t),e),Ne)}static loginWithAuthProxy(t){if(!t)throw new Error("You need to supply a server url to login.");return new r(new u(this.parseServerUrl(t)),Ne)}static loginWithCredentials(t,e,n,o){return t=this.parseServerUrl(t),new r(new u(t,void 0,e,n,o),Ne)}static loginWithCredentialsFile(t){if(t.endsWith(".properties")||t.endsWith(".PROPERTIES")){let n=Ce__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 _(this.restClient,this.endpoint())}celltypes(){return new H(this.restClient,this.endpoint())}conversions(){return new X(this.restClient,this.endpoint())}currentuser(){return new Y(this.restClient,this.endpoint())}diff(){return new $(this.restClient,this.endpoint())}domains(t){return t!=null?new Mt(this.restClient,this.endpoint(),t):new bt(this.restClient,this.endpoint())}info(){return new St(this.restClient,this.endpoint())}languages(){return new At(this.restClient,this.endpoint())}model(){return new ce(this.restClient,this.endpoint())}};exports.AnswersEndpoint=N;exports.AttributeDatatypeEnumValues=Te;exports.AttributeOverviewDatatypeEnumValues=ge;exports.BulkDomainsEndpoint=h;exports.BulkEndpoint=_;exports.BulkModelEndpoint=v;exports.BulkdomainsDocumentclassesEndpoint=w;exports.BulkdomainsDocumenttypesEndpoint=M;exports.BulkdomainsDomainEndpoint=A;exports.BulkdomainsReferencedocumentsEndpoint=b;exports.BulkdomainsReferencesEndpoint=S;exports.BulkmodelClassEndpoint=y;exports.BulkmodelClassesEndpoint=C;exports.BulkmodelDatapropertiesEndpoint=T;exports.BulkmodelDomainEndpoint=R;exports.BulkmodelDomainsEndpoint=x;exports.BulkmodelInstancesEndpoint=g;exports.BulkmodelMetadataEndpoint=O;exports.BulkmodelNamedentitiesEndpoint=P;exports.BulkmodelRulesEndpoint=D;exports.BulkmodelSynonymsEndpoint=I;exports.BulkmodelclassInstancesEndpoint=f;exports.CelltypesEndpoint=H;exports.ChatEndpoint=J;exports.ChatsEndpoint=k;exports.ChildExtractorclassesEndpoint=F;exports.ClassBulkDatatypeEnumValues=Oe;exports.CloneEndpoint=G;exports.ConversationEndpoint=B;exports.ConversationsEndpoint=V;exports.ConversionsEndpoint=X;exports.CurrentuserEndpoint=Y;exports.DiffEndpoint=$;exports.DifferenceOperationEnumValues=Pe;exports.DocclassCustomfieldsEndpoint=q;exports.DocclassDocumentclassesEndpoint=W;exports.DocclassReferencedocumentsEndpoint=z;exports.DocclassTagsEndpoint=j;exports.DocumentannotationsEndpoint=K;exports.DocumentclassEndpoint=Q;exports.DocumentclassesEndpoint=tt;exports.DocumentmodeEnumValues=De;exports.DocumentsEndpoint=et;exports.DocumenttypeEndpoint=rt;exports.DocumenttypesEndpoint=nt;exports.DomainEndpoint=Mt;exports.DomainsEndpoint=bt;exports.ErrorFieldCodeEnumValues=Ie;exports.ExtractorAttributeDatatypeEnumValues=Re;exports.ExtractorTypeEnumValues=xe;exports.FieldTypeEnumValues=ve;exports.ImageEndpoint=mt;exports.ImagesEndpoint=dt;exports.InfoEndpoint=St;exports.LanguagesEndpoint=At;exports.MarkdownEndpoint=ut;exports.MatcherTypeEnumValues=we;exports.McpToolDescriptorAuthEnumValues=Me;exports.McptoolsEndpoint=it;exports.MediaType=i;exports.MessageResponseRoleEnumValues=be;exports.MessageResponseTypeEnumValues=Se;exports.MessageRoleEnumValues=Ae;exports.ModeEnumValues=_e;exports.ModelAttributesEndpoint=Ht;exports.ModelDatapropertiesEndpoint=Lt;exports.ModelDatapropertyEndpoint=Jt;exports.ModelDatatypesEndpoint=_t;exports.ModelDomainEndpoint=le;exports.ModelDomainsEndpoint=me;exports.ModelEndpoint=ce;exports.ModelExtractorclassEndpoint=Bt;exports.ModelExtractorclassesEndpoint=Vt;exports.ModelExtractorsEndpoint=kt;exports.ModelExtractortypesEndpoint=de;exports.ModelFormattersEndpoint=Ft;exports.ModelMetadataEndpoint=Gt;exports.ModelMetadatatypesEndpoint=ue;exports.ModelNamedentitiesEndpoint=Xt;exports.ModelNamedentityEndpoint=Ut;exports.ModelObjectpropertiesEndpoint=Yt;exports.ModelOnemetadataEndpoint=$t;exports.ModelRegexEndpoint=qt;exports.ModelRegexesEndpoint=Wt;exports.ModelRelationEndpoint=jt;exports.ModelRelationsEndpoint=zt;exports.ModelRuleEndpoint=Kt;exports.ModelRulefunctionsEndpoint=Qt;exports.ModelRulesEndpoint=Zt;exports.ModelSynonymEndpoint=te;exports.ModelSynonymsEndpoint=ee;exports.ModelclassesEndpoint=ot;exports.ModelinstancesEndpoint=st;exports.ModelontAttributeEndpoint=re;exports.ModelontAttributesEndpoint=ne;exports.ModelontClassEndpoint=oe;exports.ModelontClassesEndpoint=se;exports.ModelontInstanceEndpoint=ae;exports.ModelontInstancesEndpoint=pe;exports.ModelontclassInstancesEndpoint=ie;exports.NamedentitiesEndpoint=yt;exports.ParagraphEndpoint=ct;exports.ParagraphsEndpoint=Et;exports.PromptEndpoint=at;exports.PromptLabelEnumValues=He;exports.PromptOverviewPromptLabelEnumValues=Le;exports.PromptPromptLabelEnumValues=Je;exports.PromptValidationEndpoint=pt;exports.PromptsEndpoint=lt;exports.ReferencedocumentEndpoint=ft;exports.ReferencedocumentsEndpoint=gt;exports.ReferencedocumentsStreamEndpoint=Ct;exports.ReferencesEndpoint=Ot;exports.RestClient=u;exports.RestResponse=c;exports.RolesEndpoint=U;exports.RuleFunctionTypeEnumValues=Be;exports.SemanthaAPI=ye;exports.SentenceEndpoint=Nt;exports.SentencesEndpoint=ht;exports.ServerSentEvent=Ee;exports.SettingsDefaultSimilarityModeEnumValues=Ve;exports.SettingsEndpoint=Pt;exports.SettingsExtractionStrategyEnumValues=ke;exports.SettingsTaggingStrategyEnumValues=Fe;exports.SseEndpoint=L;exports.StatisticEndpoint=Tt;exports.TagEndpoint=It;exports.TagReferencedocumentsEndpoint=Dt;exports.TagsEndpoint=Rt;exports.TexttypesEndpoint=xt;exports.TranslationsEndpoint=vt;exports.TreeEndpoint=Z;exports.TypeEnumValues=Ge;exports.ValidationEndpoint=wt;exports.isAttributeDatatypeEnumValue=Xe;exports.isAttributeOverviewDatatypeEnumValue=Ye;exports.isClassBulkDatatypeEnumValue=qe;exports.isDifferenceOperationEnumValue=je;exports.isDocumentmodeEnumValue=Ke;exports.isErrorFieldCodeEnumValue=Ze;exports.isExtractorAttributeDatatypeEnumValue=er;exports.isExtractorTypeEnumValue=nr;exports.isFieldTypeEnumValue=or;exports.isMatcherTypeEnumValue=ar;exports.isMcpToolDescriptorAuthEnumValue=lr;exports.isMessageResponseRoleEnumValue=dr;exports.isMessageResponseTypeEnumValue=cr;exports.isMessageRoleEnumValue=Nr;exports.isModeEnumValue=fr;exports.isPromptLabelEnumValue=Cr;exports.isPromptOverviewPromptLabelEnumValue=gr;exports.isPromptPromptLabelEnumValue=Pr;exports.isRuleFunctionTypeEnumValue=Ir;exports.isSettingsDefaultSimilarityModeEnumValue=xr;exports.isSettingsExtractionStrategyEnumValue=wr;exports.isSettingsTaggingStrategyEnumValue=br;exports.isTypeEnumValue=Ar;exports.parseServerSentEvents=fe;//# sourceMappingURL=index.js.map
10
10
  //# sourceMappingURL=index.js.map