From 7c3af17ac65fc6afc6249330e799c5aec90b1f77 Mon Sep 17 00:00:00 2001 From: Octavian Condre Date: Thu, 5 Sep 2024 15:53:29 +0300 Subject: [PATCH] LTLC-115969 Update UI extension, add greeting controller --- .../Controllers/GreetingController.cs | 36 + .../Resources/frontend/.npmrc | 5 - .../Resources/frontend/dist/bundle.js | 1 - .../frontend/dist/my-ui-extension-script.js | 1 + .../frontend/handlers/buttonsHandlers.ts | 154 ++ .../Resources/frontend/handlers/helpers.ts | 88 +- .../frontend/handlers/panelsHandlers.ts | 71 + .../handlers/projectDashboardHandlers.ts | 74 - .../frontend/handlers/projectFilesHandlers.ts | 41 - .../frontend/handlers/projectStagesHadlers.ts | 42 - .../handlers/projectTabbarHandlers.ts | 618 -------- .../handlers/projectTaskHistoryHandlers.ts | 96 -- .../handlers/projectToolbarHandlers.ts | 833 ---------- .../handlers/projectsListToolbarHandlers.ts | 42 - .../frontend/handlers/taskDetailsHandlers.ts | 85 - .../frontend/handlers/taskTabbarHandlers.ts | 29 - .../frontend/handlers/taskToolbarHandlers.ts | 483 ------ .../handlers/tasksListPreviewHandlers.ts | 49 - .../handlers/tasksListToolbarHandlers.ts | 69 - .../Resources/frontend/index.ts | 1401 +++-------------- .../Resources/frontend/package.json | 12 +- .../Resources/frontend/tsconfig.json | 1 + .../Resources/frontend/types.ts | 6 - .../Resources/frontend/webpack.config.js | 2 +- .../Rws.LC.UISampleApp.csproj | 2 +- .../Rws.LC.UISampleApp/descriptor.json | 4 +- 26 files changed, 482 insertions(+), 3763 deletions(-) create mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Controllers/GreetingController.cs delete mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/.npmrc delete mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/dist/bundle.js create mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/dist/my-ui-extension-script.js create mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/buttonsHandlers.ts create mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/panelsHandlers.ts delete mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectDashboardHandlers.ts delete mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectFilesHandlers.ts delete mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectStagesHadlers.ts delete mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectTabbarHandlers.ts delete mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectTaskHistoryHandlers.ts delete mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectToolbarHandlers.ts delete mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectsListToolbarHandlers.ts delete mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/taskDetailsHandlers.ts delete mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/taskTabbarHandlers.ts delete mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/taskToolbarHandlers.ts delete mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/tasksListPreviewHandlers.ts delete mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/tasksListToolbarHandlers.ts delete mode 100644 samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/types.ts diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Controllers/GreetingController.cs b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Controllers/GreetingController.cs new file mode 100644 index 0000000..14ec4cf --- /dev/null +++ b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Controllers/GreetingController.cs @@ -0,0 +1,36 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; +using System.Text.Json.Nodes; +using System.Threading; +using System.Threading.Tasks; + +namespace Rws.LC.UISampleApp.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class GreetingController : ControllerBase + { + /// + /// The logger. + /// + private ILogger logger; + + public GreetingController(ILogger logger) + { + this.logger = logger; + } + + /// + /// This endpoint always returns "Hello world!". + /// + /// The hardcoded greeting message. + [Authorize] + [HttpGet("")] + public ActionResult GetGreeting() + { + logger.LogInformation("Retrieving greeting."); + return Ok(new JsonObject() { { "greeting", "Hello, world!" } }); + } + } +} diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/.npmrc b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/.npmrc deleted file mode 100644 index cb5c09f..0000000 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/.npmrc +++ /dev/null @@ -1,5 +0,0 @@ -@sdl:registry=https://nexus.sdl.com/repository/npm-internal/ ---init-author-name=SDL ---init-author-email=noreply@sdl.com -email=noreply@sdl.com -//nexus.sdl.com/repository/npm-internal/:_authToken=NpmToken. \ No newline at end of file diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/dist/bundle.js b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/dist/bundle.js deleted file mode 100644 index a0d3867..0000000 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/dist/bundle.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{var e={462:function(e){var t;t=()=>(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{trados:()=>ke});var n=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};const o="https://lc-api.sdl.com/public-api/v1".replace(/\/+$/,"");class i{constructor(e={}){this.configuration=e}set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:o}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||c}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){const e=this.configuration.accessToken;if(e)return"function"==typeof e?e:()=>n(this,void 0,void 0,(function*(){return e}))}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const r=new i;class a{constructor(e=r){this.configuration=e,this.fetchApi=(e,t)=>n(this,void 0,void 0,(function*(){let n,o={url:e,init:t};for(const e of this.middleware)e.pre&&(o=(yield e.pre(Object.assign({fetch:this.fetchApi},o)))||o);try{n=yield(this.configuration.fetchApi||fetch)(o.url,o.init)}catch(e){for(const t of this.middleware)t.onError&&(n=(yield t.onError({fetch:this.fetchApi,url:o.url,init:o.init,error:e,response:n?n.clone():void 0}))||n);if(void 0===n)throw e instanceof Error?new u(e,"The request failed and the interceptors did not return an alternative response"):e}for(const e of this.middleware)e.post&&(n=(yield e.post({fetch:this.fetchApi,url:o.url,init:o.init,response:n.clone()}))||n);return n})),this.middleware=e.middleware}withMiddleware(...e){const t=this.clone();return t.middleware=t.middleware.concat(...e),t}withPreMiddleware(...e){const t=e.map((e=>({pre:e})));return this.withMiddleware(...t)}withPostMiddleware(...e){const t=e.map((e=>({post:e})));return this.withMiddleware(...t)}isJsonMime(e){return!!e&&a.jsonRegex.test(e)}request(e,t){return n(this,void 0,void 0,(function*(){const{url:n,init:o}=yield this.createFetchParams(e,t),i=yield this.fetchApi(n,o);if(i&&i.status>=200&&i.status<300)return i;throw new l(i,"Response returned an error code")}))}createFetchParams(e,t){return n(this,void 0,void 0,(function*(){let o=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(o+="?"+this.configuration.queryParamsStringify(e.query));const i=Object.assign({},this.configuration.headers,e.headers);Object.keys(i).forEach((e=>void 0===i[e]?delete i[e]:{}));const r="function"==typeof t?t:()=>n(this,void 0,void 0,(function*(){return t})),a={method:e.method,headers:i,body:e.body,credentials:this.configuration.credentials},l=Object.assign(Object.assign({},a),yield r({init:a,context:e}));let u;var d;return d=l.body,u="undefined"!=typeof FormData&&d instanceof FormData||l.body instanceof URLSearchParams||function(e){return"undefined"!=typeof Blob&&e instanceof Blob}(l.body)?l.body:this.isJsonMime(i["Content-Type"])?JSON.stringify(l.body):l.body,{url:o,init:Object.assign(Object.assign({},l),{body:u})}}))}clone(){const e=new(0,this.constructor)(this.configuration);return e.middleware=this.middleware.slice(),e}}a.jsonRegex=new RegExp("^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$","i");class l extends Error{constructor(e,t){super(t),this.response=e,this.name="ResponseError"}}class u extends Error{constructor(e,t){super(t),this.cause=e,this.name="FetchError"}}class d extends Error{constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}const s=",";function c(e,t=""){return Object.keys(e).map((n=>p(n,e[n],t))).filter((e=>e.length>0)).join("&")}function p(e,t,n=""){const o=n+(n.length?`[${e}]`:e);if(t instanceof Array){const e=t.map((e=>encodeURIComponent(String(e)))).join(`&${encodeURIComponent(o)}=`);return`${encodeURIComponent(o)}=${e}`}return t instanceof Set?p(e,Array.from(t),n):t instanceof Date?`${encodeURIComponent(o)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?c(t,o):`${encodeURIComponent(o)}=${encodeURIComponent(String(t))}`}function h(e){for(const t of e)if("multipart/form-data"===t.contentType)return!0;return!1}class w{constructor(e,t=(e=>e)){this.raw=e,this.transformer=t}value(){return n(this,void 0,void 0,(function*(){return this.transformer(yield this.raw.json())}))}}class f{constructor(e){this.raw=e}value(){return n(this,void 0,void 0,(function*(){}))}}class m{constructor(e){this.raw=e}value(){return n(this,void 0,void 0,(function*(){return yield this.raw.blob()}))}}var g=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class T extends a{listMyAccountsRaw(e,t){return g(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listMyAccounts().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listMyAccounts().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/accounts",method:"GET",headers:n,query:{}},t);return new w(o)}))}listMyAccounts(e,t){return g(this,void 0,void 0,(function*(){const n=yield this.listMyAccountsRaw(e,t);return yield n.value()}))}}var y=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class C extends a{getCustomFieldRaw(e,t){return y(this,void 0,void 0,(function*(){if(null==e.customFieldDefinitionId)throw new d("customFieldDefinitionId",'Required parameter "customFieldDefinitionId" was null or undefined when calling getCustomField().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getCustomField().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getCustomField().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/custom-field-definitions/{customFieldDefinitionId}".replace("{customFieldDefinitionId}",encodeURIComponent(String(e.customFieldDefinitionId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getCustomField(e,t){return y(this,void 0,void 0,(function*(){const n=yield this.getCustomFieldRaw(e,t);return yield n.value()}))}listCustomFieldsRaw(e,t){return y(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listCustomFields().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listCustomFields().');const n={};null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.sort&&(n.sort=e.sort),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/custom-field-definitions",method:"GET",headers:o,query:n},t);return new w(i)}))}listCustomFields(e,t){return y(this,void 0,void 0,(function*(){const n=yield this.listCustomFieldsRaw(e,t);return yield n.value()}))}}var v=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class I extends a{createCustomerRaw(e,t){return v(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling createCustomer().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling createCustomer().');if(null==e.customerCreateRequest)throw new d("customerCreateRequest",'Required parameter "customerCreateRequest" was null or undefined when calling createCustomer().');const n={};null!=e.fields&&(n.fields=e.fields);const o={"Content-Type":"application/json"};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/customers",method:"POST",headers:o,query:n,body:e.customerCreateRequest},t);return new w(i)}))}createCustomer(e,t){return v(this,void 0,void 0,(function*(){const n=yield this.createCustomerRaw(e,t);return yield n.value()}))}deleteCustomerRaw(e,t){return v(this,void 0,void 0,(function*(){if(null==e.customerId)throw new d("customerId",'Required parameter "customerId" was null or undefined when calling deleteCustomer().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling deleteCustomer().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteCustomer().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/customers/{customerId}".replace("{customerId}",encodeURIComponent(String(e.customerId))),method:"DELETE",headers:n,query:{}},t);return new f(o)}))}deleteCustomer(e,t){return v(this,void 0,void 0,(function*(){yield this.deleteCustomerRaw(e,t)}))}getCustomerRaw(e,t){return v(this,void 0,void 0,(function*(){if(null==e.customerId)throw new d("customerId",'Required parameter "customerId" was null or undefined when calling getCustomer().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getCustomer().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getCustomer().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/customers/{customerId}".replace("{customerId}",encodeURIComponent(String(e.customerId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getCustomer(e,t){return v(this,void 0,void 0,(function*(){const n=yield this.getCustomerRaw(e,t);return yield n.value()}))}listCustomersRaw(e,t){return v(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listCustomers().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listCustomers().');const n={};null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.sort&&(n.sort=e.sort),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/customers",method:"GET",headers:o,query:n},t);return new w(i)}))}listCustomers(e,t){return v(this,void 0,void 0,(function*(){const n=yield this.listCustomersRaw(e,t);return yield n.value()}))}updateCustomerRaw(e,t){return v(this,void 0,void 0,(function*(){if(null==e.customerId)throw new d("customerId",'Required parameter "customerId" was null or undefined when calling updateCustomer().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling updateCustomer().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateCustomer().');if(null==e.customerUpdateRequest)throw new d("customerUpdateRequest",'Required parameter "customerUpdateRequest" was null or undefined when calling updateCustomer().');const n={"Content-Type":"application/json"};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/customers/{customerId}".replace("{customerId}",encodeURIComponent(String(e.customerId))),method:"PUT",headers:n,query:{},body:e.customerUpdateRequest},t);return new f(o)}))}updateCustomer(e,t){return v(this,void 0,void 0,(function*(){yield this.updateCustomerRaw(e,t)}))}}var x=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class R extends a{pollUploadZipFileRaw(e,t){return x(this,void 0,void 0,(function*(){if(null==e.fileId)throw new d("fileId",'Required parameter "fileId" was null or undefined when calling pollUploadZipFile().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling pollUploadZipFile().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling pollUploadZipFile().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/files/{fileId}".replace("{fileId}",encodeURIComponent(String(e.fileId))),method:"GET",headers:n,query:{}},t);return new w(o)}))}pollUploadZipFile(e,t){return x(this,void 0,void 0,(function*(){const n=yield this.pollUploadZipFileRaw(e,t);return yield n.value()}))}uploadZipFileRaw(e,t){return x(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling uploadZipFile().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling uploadZipFile().');if(null==e.file)throw new d("file",'Required parameter "file" was null or undefined when calling uploadZipFile().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));let o,i=!1;i=h([{contentType:"multipart/form-data"}]),o=i?new FormData:new URLSearchParams,null!=e.file&&o.append("file",e.file);const r=yield this.request({path:"/files",method:"POST",headers:n,query:{},body:o},t);return new w(r)}))}uploadZipFile(e,t){return x(this,void 0,void 0,(function*(){const n=yield this.uploadZipFileRaw(e,t);return yield n.value()}))}}var L=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class q extends a{getFileProcessingConfigurationRaw(e,t){return L(this,void 0,void 0,(function*(){if(null==e.fileProcessingConfigurationId)throw new d("fileProcessingConfigurationId",'Required parameter "fileProcessingConfigurationId" was null or undefined when calling getFileProcessingConfiguration().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getFileProcessingConfiguration().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getFileProcessingConfiguration().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/file-processing-configurations/{fileProcessingConfigurationId}".replace("{fileProcessingConfigurationId}",encodeURIComponent(String(e.fileProcessingConfigurationId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getFileProcessingConfiguration(e,t){return L(this,void 0,void 0,(function*(){const n=yield this.getFileProcessingConfigurationRaw(e,t);return yield n.value()}))}getFileTypeSettingRaw(e,t){return L(this,void 0,void 0,(function*(){if(null==e.fileProcessingConfigurationId)throw new d("fileProcessingConfigurationId",'Required parameter "fileProcessingConfigurationId" was null or undefined when calling getFileTypeSetting().');if(null==e.fileTypeSettingId)throw new d("fileTypeSettingId",'Required parameter "fileTypeSettingId" was null or undefined when calling getFileTypeSetting().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getFileTypeSetting().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getFileTypeSetting().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/file-processing-configurations/{fileProcessingConfigurationId}/file-type-settings/{fileTypeSettingId}".replace("{fileProcessingConfigurationId}",encodeURIComponent(String(e.fileProcessingConfigurationId))).replace("{fileTypeSettingId}",encodeURIComponent(String(e.fileTypeSettingId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getFileTypeSetting(e,t){return L(this,void 0,void 0,(function*(){const n=yield this.getFileTypeSettingRaw(e,t);return yield n.value()}))}listFileProcessingConfigurationsRaw(e,t){return L(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listFileProcessingConfigurations().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listFileProcessingConfigurations().');const n={};null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.sort&&(n.sort=e.sort),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/file-processing-configurations",method:"GET",headers:o,query:n},t);return new w(i)}))}listFileProcessingConfigurations(e,t){return L(this,void 0,void 0,(function*(){const n=yield this.listFileProcessingConfigurationsRaw(e,t);return yield n.value()}))}listFileTypeSettingsRaw(e,t){return L(this,void 0,void 0,(function*(){if(null==e.fileProcessingConfigurationId)throw new d("fileProcessingConfigurationId",'Required parameter "fileProcessingConfigurationId" was null or undefined when calling listFileTypeSettings().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listFileTypeSettings().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listFileTypeSettings().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/file-processing-configurations/{fileProcessingConfigurationId}/file-type-settings".replace("{fileProcessingConfigurationId}",encodeURIComponent(String(e.fileProcessingConfigurationId))),method:"GET",headers:o,query:n},t);return new w(i)}))}listFileTypeSettings(e,t){return L(this,void 0,void 0,(function*(){const n=yield this.listFileTypeSettingsRaw(e,t);return yield n.value()}))}}var z=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class j extends a{getFolderRaw(e,t){return z(this,void 0,void 0,(function*(){if(null==e.folderId)throw new d("folderId",'Required parameter "folderId" was null or undefined when calling getFolder().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getFolder().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getFolder().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/folders/{folderId}".replace("{folderId}",encodeURIComponent(String(e.folderId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getFolder(e,t){return z(this,void 0,void 0,(function*(){const n=yield this.getFolderRaw(e,t);return yield n.value()}))}getRootFolderRaw(e,t){return z(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getRootFolder().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getRootFolder().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/folders/root",method:"GET",headers:o,query:n},t);return new w(i)}))}getRootFolder(e,t){return z(this,void 0,void 0,(function*(){const n=yield this.getRootFolderRaw(e,t);return yield n.value()}))}listFoldersRaw(e,t){return z(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listFolders().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listFolders().');const n={};null!=e.name&&(n.name=e.name),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/folders",method:"GET",headers:o,query:n},t);return new w(i)}))}listFolders(e,t){return z(this,void 0,void 0,(function*(){const n=yield this.listFoldersRaw(e,t);return yield n.value()}))}}var b=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class S extends a{getGroupRaw(e,t){return b(this,void 0,void 0,(function*(){if(null==e.groupId)throw new d("groupId",'Required parameter "groupId" was null or undefined when calling getGroup().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getGroup().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getGroup().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/groups/{groupId}".replace("{groupId}",encodeURIComponent(String(e.groupId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getGroup(e,t){return b(this,void 0,void 0,(function*(){const n=yield this.getGroupRaw(e,t);return yield n.value()}))}listGroupsRaw(e,t){return b(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listGroups().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listGroups().');const n={};null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.sort&&(n.sort=e.sort),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/groups",method:"GET",headers:o,query:n},t);return new w(i)}))}listGroups(e,t){return b(this,void 0,void 0,(function*(){const n=yield this.listGroupsRaw(e,t);return yield n.value()}))}}var k=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class F extends a{listLanguagesRaw(e,t){return k(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listLanguages().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listLanguages().');const n={};null!=e.languageCodes&&(n.languageCodes=e.languageCodes.join(s)),null!=e.type&&(n.type=e.type),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/languages",method:"GET",headers:o,query:n},t);return new w(i)}))}listLanguages(e,t){return k(this,void 0,void 0,(function*(){const n=yield this.listLanguagesRaw(e,t);return yield n.value()}))}}var E=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class P extends a{getLanguageProcessingRuleRaw(e,t){return E(this,void 0,void 0,(function*(){if(null==e.languageProcessingRuleId)throw new d("languageProcessingRuleId",'Required parameter "languageProcessingRuleId" was null or undefined when calling getLanguageProcessingRule().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getLanguageProcessingRule().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getLanguageProcessingRule().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/language-processing-rules/{languageProcessingRuleId}".replace("{languageProcessingRuleId}",encodeURIComponent(String(e.languageProcessingRuleId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getLanguageProcessingRule(e,t){return E(this,void 0,void 0,(function*(){const n=yield this.getLanguageProcessingRuleRaw(e,t);return yield n.value()}))}listLanguageProcessingRulesRaw(e,t){return E(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listLanguageProcessingRules().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listLanguageProcessingRules().');const n={};null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.sort&&(n.sort=e.sort),null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/language-processing-rules",method:"GET",headers:o,query:n},t);return new w(i)}))}listLanguageProcessingRules(e,t){return E(this,void 0,void 0,(function*(){const n=yield this.listLanguageProcessingRulesRaw(e,t);return yield n.value()}))}}var A=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class U extends a{getPricingModelRaw(e,t){return A(this,void 0,void 0,(function*(){if(null==e.pricingModelId)throw new d("pricingModelId",'Required parameter "pricingModelId" was null or undefined when calling getPricingModel().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getPricingModel().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getPricingModel().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/pricing-models/{pricingModelId}".replace("{pricingModelId}",encodeURIComponent(String(e.pricingModelId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getPricingModel(e,t){return A(this,void 0,void 0,(function*(){const n=yield this.getPricingModelRaw(e,t);return yield n.value()}))}listPricingModelsRaw(e,t){return A(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listPricingModels().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listPricingModels().');const n={};null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.sort&&(n.sort=e.sort),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/pricing-models",method:"GET",headers:o,query:n},t);return new w(i)}))}listPricingModels(e,t){return A(this,void 0,void 0,(function*(){const n=yield this.listPricingModelsRaw(e,t);return yield n.value()}))}}var M=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class G extends a{cancelProjectFileRaw(e,t){return M(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling cancelProjectFile().');if(null==e.fileId)throw new d("fileId",'Required parameter "fileId" was null or undefined when calling cancelProjectFile().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling cancelProjectFile().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling cancelProjectFile().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/projects/{projectId}/files/{fileId}/cancel".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{fileId}",encodeURIComponent(String(e.fileId))),method:"PUT",headers:n,query:{}},t);return new f(o)}))}cancelProjectFile(e,t){return M(this,void 0,void 0,(function*(){yield this.cancelProjectFileRaw(e,t)}))}completeProjectRaw(e,t){return M(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling completeProject().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling completeProject().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling completeProject().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/projects/{projectId}/complete".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"PUT",headers:n,query:{}},t);return new f(o)}))}completeProject(e,t){return M(this,void 0,void 0,(function*(){yield this.completeProjectRaw(e,t)}))}createProjectRaw(e,t){return M(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling createProject().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling createProject().');if(null==e.projectCreateRequest)throw new d("projectCreateRequest",'Required parameter "projectCreateRequest" was null or undefined when calling createProject().');const n={};null!=e.fields&&(n.fields=e.fields);const o={"Content-Type":"application/json"};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects",method:"POST",headers:o,query:n,body:e.projectCreateRequest},t);return new w(i)}))}createProject(e,t){return M(this,void 0,void 0,(function*(){const n=yield this.createProjectRaw(e,t);return yield n.value()}))}deleteProjectRaw(e,t){return M(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling deleteProject().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling deleteProject().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteProject().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/projects/{projectId}".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"DELETE",headers:n,query:{}},t);return new f(o)}))}deleteProject(e,t){return M(this,void 0,void 0,(function*(){yield this.deleteProjectRaw(e,t)}))}getProjectRaw(e,t){return M(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling getProject().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getProject().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getProject().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getProject(e,t){return M(this,void 0,void 0,(function*(){const n=yield this.getProjectRaw(e,t);return yield n.value()}))}getProjectConfigurationRaw(e,t){return M(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling getProjectConfiguration().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getProjectConfiguration().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getProjectConfiguration().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/configuration".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getProjectConfiguration(e,t){return M(this,void 0,void 0,(function*(){const n=yield this.getProjectConfigurationRaw(e,t);return yield n.value()}))}listProjectTasksRaw(e,t){return M(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling listProjectTasks().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listProjectTasks().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listProjectTasks().');const n={};null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.sort&&(n.sort=e.sort),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/tasks".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"GET",headers:o,query:n},t);return new w(i)}))}listProjectTasks(e,t){return M(this,void 0,void 0,(function*(){const n=yield this.listProjectTasksRaw(e,t);return yield n.value()}))}listProjectsRaw(e,t){return M(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listProjects().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listProjects().');const n={};null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.sort&&(n.sort=e.sort),null!=e.fields&&(n.fields=e.fields),null!=e.excludeOnline&&(n.excludeOnline=e.excludeOnline),null!=e.status&&(n.status=e.status),null!=e.createdFrom&&(n.createdFrom=e.createdFrom.toISOString()),null!=e.createdTo&&(n.createdTo=e.createdTo.toISOString()),null!=e.createdBy&&(n.createdBy=e.createdBy);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects",method:"GET",headers:o,query:n},t);return new w(i)}))}listProjects(e,t){return M(this,void 0,void 0,(function*(){const n=yield this.listProjectsRaw(e,t);return yield n.value()}))}startProjectRaw(e,t){return M(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling startProject().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling startProject().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling startProject().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/projects/{projectId}/start".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"PUT",headers:n,query:{}},t);return new f(o)}))}startProject(e,t){return M(this,void 0,void 0,(function*(){yield this.startProjectRaw(e,t)}))}updateCustomFieldRaw(e,t){return M(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling updateCustomField().');if(null==e.customFieldKey)throw new d("customFieldKey",'Required parameter "customFieldKey" was null or undefined when calling updateCustomField().');const n=yield this.request({path:"/projects/{projectId}/custom-fields/{customFieldKey}".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{customFieldKey}",encodeURIComponent(String(e.customFieldKey))),method:"PUT",headers:{"Content-Type":"application/json"},query:{},body:e.customFieldUpdateRequest},t);return new f(n)}))}updateCustomField(e,t){return M(this,void 0,void 0,(function*(){yield this.updateCustomFieldRaw(e,t)}))}updateProjectRaw(e,t){return M(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling updateProject().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling updateProject().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateProject().');if(null==e.projectUpdateRequest)throw new d("projectUpdateRequest",'Required parameter "projectUpdateRequest" was null or undefined when calling updateProject().');const n={"Content-Type":"application/json"};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/projects/{projectId}".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"PUT",headers:n,query:{},body:e.projectUpdateRequest},t);return new f(o)}))}updateProject(e,t){return M(this,void 0,void 0,(function*(){yield this.updateProjectRaw(e,t)}))}updateProjectConfigurationRaw(e,t){return M(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling updateProjectConfiguration().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling updateProjectConfiguration().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateProjectConfiguration().');const n={"Content-Type":"application/json"};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/projects/{projectId}/configuration".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"PUT",headers:n,query:{},body:e.projectConfigurationRequest},t);return new f(o)}))}updateProjectConfiguration(e,t){return M(this,void 0,void 0,(function*(){yield this.updateProjectConfigurationRaw(e,t)}))}}var V=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class X extends a{addProjectsToGroupRaw(e,t){return V(this,void 0,void 0,(function*(){if(null==e.projectGroupId)throw new d("projectGroupId",'Required parameter "projectGroupId" was null or undefined when calling addProjectsToGroup().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling addProjectsToGroup().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling addProjectsToGroup().');if(null==e.addProjectsToGroupRequest)throw new d("addProjectsToGroupRequest",'Required parameter "addProjectsToGroupRequest" was null or undefined when calling addProjectsToGroup().');const n={};null!=e.fields&&(n.fields=e.fields);const o={"Content-Type":"application/json"};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/project-groups/{projectGroupId}/projects".replace("{projectGroupId}",encodeURIComponent(String(e.projectGroupId))),method:"POST",headers:o,query:n,body:e.addProjectsToGroupRequest},t);return new w(i)}))}addProjectsToGroup(e,t){return V(this,void 0,void 0,(function*(){const n=yield this.addProjectsToGroupRaw(e,t);return yield n.value()}))}createProjectGroupRaw(e,t){return V(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling createProjectGroup().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling createProjectGroup().');if(null==e.projectGroupCreateRequest)throw new d("projectGroupCreateRequest",'Required parameter "projectGroupCreateRequest" was null or undefined when calling createProjectGroup().');const n={};null!=e.fields&&(n.fields=e.fields);const o={"Content-Type":"application/json"};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/project-groups",method:"POST",headers:o,query:n,body:e.projectGroupCreateRequest},t);return new w(i)}))}createProjectGroup(e,t){return V(this,void 0,void 0,(function*(){const n=yield this.createProjectGroupRaw(e,t);return yield n.value()}))}deleteProjectGroupRaw(e,t){return V(this,void 0,void 0,(function*(){if(null==e.projectGroupId)throw new d("projectGroupId",'Required parameter "projectGroupId" was null or undefined when calling deleteProjectGroup().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling deleteProjectGroup().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteProjectGroup().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/project-groups/{projectGroupId}".replace("{projectGroupId}",encodeURIComponent(String(e.projectGroupId))),method:"DELETE",headers:n,query:{}},t);return new f(o)}))}deleteProjectGroup(e,t){return V(this,void 0,void 0,(function*(){yield this.deleteProjectGroupRaw(e,t)}))}getProjectGroupRaw(e,t){return V(this,void 0,void 0,(function*(){if(null==e.projectGroupId)throw new d("projectGroupId",'Required parameter "projectGroupId" was null or undefined when calling getProjectGroup().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getProjectGroup().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getProjectGroup().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/project-groups/{projectGroupId}".replace("{projectGroupId}",encodeURIComponent(String(e.projectGroupId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getProjectGroup(e,t){return V(this,void 0,void 0,(function*(){const n=yield this.getProjectGroupRaw(e,t);return yield n.value()}))}listProjectGroupsRaw(e,t){return V(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listProjectGroups().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listProjectGroups().');const n={};null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/project-groups",method:"GET",headers:o,query:n},t);return new w(i)}))}listProjectGroups(e,t){return V(this,void 0,void 0,(function*(){const n=yield this.listProjectGroupsRaw(e,t);return yield n.value()}))}removeProjectsFromGroupRaw(e,t){return V(this,void 0,void 0,(function*(){if(null==e.projectGroupId)throw new d("projectGroupId",'Required parameter "projectGroupId" was null or undefined when calling removeProjectsFromGroup().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling removeProjectsFromGroup().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling removeProjectsFromGroup().');const n={"Content-Type":"application/json"};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/project-groups/{projectGroupId}/projects".replace("{projectGroupId}",encodeURIComponent(String(e.projectGroupId))),method:"DELETE",headers:n,query:{},body:e.removeProjectsFromGroupRequest},t);return new f(o)}))}removeProjectsFromGroup(e,t){return V(this,void 0,void 0,(function*(){yield this.removeProjectsFromGroupRaw(e,t)}))}updateProjectGroupRaw(e,t){return V(this,void 0,void 0,(function*(){if(null==e.projectGroupId)throw new d("projectGroupId",'Required parameter "projectGroupId" was null or undefined when calling updateProjectGroup().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling updateProjectGroup().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateProjectGroup().');if(null==e.projectGroupUpdateRequest)throw new d("projectGroupUpdateRequest",'Required parameter "projectGroupUpdateRequest" was null or undefined when calling updateProjectGroup().');const n={"Content-Type":"application/json"};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/project-groups/{projectGroupId}".replace("{projectGroupId}",encodeURIComponent(String(e.projectGroupId))),method:"PUT",headers:n,query:{},body:e.projectGroupUpdateRequest},t);return new f(o)}))}updateProjectGroup(e,t){return V(this,void 0,void 0,(function*(){yield this.updateProjectGroupRaw(e,t)}))}}var O=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class D extends a{createProjectTemplateRaw(e,t){return O(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling createProjectTemplate().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling createProjectTemplate().');if(null==e.projectTemplateCreateRequest)throw new d("projectTemplateCreateRequest",'Required parameter "projectTemplateCreateRequest" was null or undefined when calling createProjectTemplate().');const n={};null!=e.fields&&(n.fields=e.fields);const o={"Content-Type":"application/json"};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/project-templates",method:"POST",headers:o,query:n,body:e.projectTemplateCreateRequest},t);return new w(i)}))}createProjectTemplate(e,t){return O(this,void 0,void 0,(function*(){const n=yield this.createProjectTemplateRaw(e,t);return yield n.value()}))}deleteProjectTemplateRaw(e,t){return O(this,void 0,void 0,(function*(){if(null==e.projectTemplateId)throw new d("projectTemplateId",'Required parameter "projectTemplateId" was null or undefined when calling deleteProjectTemplate().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling deleteProjectTemplate().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteProjectTemplate().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/project-templates/{projectTemplateId}".replace("{projectTemplateId}",encodeURIComponent(String(e.projectTemplateId))),method:"DELETE",headers:n,query:{}},t);return new f(o)}))}deleteProjectTemplate(e,t){return O(this,void 0,void 0,(function*(){yield this.deleteProjectTemplateRaw(e,t)}))}getProjectTemplateRaw(e,t){return O(this,void 0,void 0,(function*(){if(null==e.projectTemplateId)throw new d("projectTemplateId",'Required parameter "projectTemplateId" was null or undefined when calling getProjectTemplate().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getProjectTemplate().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getProjectTemplate().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/project-templates/{projectTemplateId}".replace("{projectTemplateId}",encodeURIComponent(String(e.projectTemplateId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getProjectTemplate(e,t){return O(this,void 0,void 0,(function*(){const n=yield this.getProjectTemplateRaw(e,t);return yield n.value()}))}listProjectTemplatesRaw(e,t){return O(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listProjectTemplates().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listProjectTemplates().');const n={};null!=e.name&&(n.name=e.name),null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.sort&&(n.sort=e.sort),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/project-templates",method:"GET",headers:o,query:n},t);return new w(i)}))}listProjectTemplates(e,t){return O(this,void 0,void 0,(function*(){const n=yield this.listProjectTemplatesRaw(e,t);return yield n.value()}))}updateProjectTemplateRaw(e,t){return O(this,void 0,void 0,(function*(){if(null==e.projectTemplateId)throw new d("projectTemplateId",'Required parameter "projectTemplateId" was null or undefined when calling updateProjectTemplate().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling updateProjectTemplate().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateProjectTemplate().');if(null==e.projectTemplateUpdateRequest)throw new d("projectTemplateUpdateRequest",'Required parameter "projectTemplateUpdateRequest" was null or undefined when calling updateProjectTemplate().');const n={"Content-Type":"application/json"};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/project-templates/{projectTemplateId}".replace("{projectTemplateId}",encodeURIComponent(String(e.projectTemplateId))),method:"PUT",headers:n,query:{},body:e.projectTemplateUpdateRequest},t);return new f(o)}))}updateProjectTemplate(e,t){return O(this,void 0,void 0,(function*(){yield this.updateProjectTemplateRaw(e,t)}))}}var H=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class B extends a{getPublicKeyRaw(e,t){return H(this,void 0,void 0,(function*(){if(null==e.kid)throw new d("kid",'Required parameter "kid" was null or undefined when calling getPublicKey().');const n=yield this.request({path:"/.well-known/jwks.json/{kid}".replace("{kid}",encodeURIComponent(String(e.kid))),method:"GET",headers:{},query:{}},t);return new w(n)}))}getPublicKey(e,t){return H(this,void 0,void 0,(function*(){const n=yield this.getPublicKeyRaw(e,t);return yield n.value()}))}listPublicKeysRaw(e){return H(this,void 0,void 0,(function*(){const t=yield this.request({path:"/.well-known/jwks.json",method:"GET",headers:{},query:{}},e);return new w(t)}))}listPublicKeys(e){return H(this,void 0,void 0,(function*(){const t=yield this.listPublicKeysRaw(e);return yield t.value()}))}}var N=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class K extends a{downloadQuoteReportRaw(e,t){return N(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling downloadQuoteReport().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling downloadQuoteReport().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling downloadQuoteReport().');const n={};null!=e.format&&(n.format=e.format),null!=e.exportId&&(n.exportId=e.exportId);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/quote-report/download".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"GET",headers:o,query:n},t);return new m(i)}))}downloadQuoteReport(e,t){return N(this,void 0,void 0,(function*(){const n=yield this.downloadQuoteReportRaw(e,t);return yield n.value()}))}exportQuoteReportRaw(e,t){return N(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling exportQuoteReport().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling exportQuoteReport().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling exportQuoteReport().');const n={};null!=e.format&&(n.format=e.format),null!=e.languageId&&(n.languageId=e.languageId);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/quote-report/export".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"POST",headers:o,query:n},t);return new w(i)}))}exportQuoteReport(e,t){return N(this,void 0,void 0,(function*(){const n=yield this.exportQuoteReportRaw(e,t);return yield n.value()}))}pollQuoteReportExportRaw(e,t){return N(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling pollQuoteReportExport().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling pollQuoteReportExport().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling pollQuoteReportExport().');const n={};null!=e.format&&(n.format=e.format),null!=e.exportId&&(n.exportId=e.exportId);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/quote-report/export".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"GET",headers:o,query:n},t);return new w(i)}))}pollQuoteReportExport(e,t){return N(this,void 0,void 0,(function*(){const n=yield this.pollQuoteReportExportRaw(e,t);return yield n.value()}))}}var Q=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class W extends a{addSourceFileRaw(e,t){return Q(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling addSourceFile().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling addSourceFile().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling addSourceFile().');if(null==e.properties)throw new d("properties",'Required parameter "properties" was null or undefined when calling addSourceFile().');if(null==e.file)throw new d("file",'Required parameter "file" was null or undefined when calling addSourceFile().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));let o,i=!1;i=h([{contentType:"multipart/form-data"}]),o=i?new FormData:new URLSearchParams,null!=e.properties&&o.append("properties",new Blob([JSON.stringify(e.properties)],{type:"application/json"})),null!=e.file&&o.append("file",e.file);const r=yield this.request({path:"/projects/{projectId}/source-files".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"POST",headers:n,query:{},body:o},t);return new w(r)}))}addSourceFile(e,t){return Q(this,void 0,void 0,(function*(){const n=yield this.addSourceFileRaw(e,t);return yield n.value()}))}addSourceFileVersionRaw(e,t){return Q(this,void 0,void 0,(function*(){if(null==e.sourceFileId)throw new d("sourceFileId",'Required parameter "sourceFileId" was null or undefined when calling addSourceFileVersion().');if(null==e.taskId)throw new d("taskId",'Required parameter "taskId" was null or undefined when calling addSourceFileVersion().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling addSourceFileVersion().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling addSourceFileVersion().');if(null==e.properties)throw new d("properties",'Required parameter "properties" was null or undefined when calling addSourceFileVersion().');if(null==e.file)throw new d("file",'Required parameter "file" was null or undefined when calling addSourceFileVersion().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));let i,r=!1;r=h([{contentType:"multipart/form-data"}]),i=r?new FormData:new URLSearchParams,null!=e.properties&&i.append("properties",new Blob([JSON.stringify(e.properties)],{type:"application/json"})),null!=e.file&&i.append("file",e.file);const a=yield this.request({path:"/tasks/{taskId}/source-files/{sourceFileId}/versions".replace("{sourceFileId}",encodeURIComponent(String(e.sourceFileId))).replace("{taskId}",encodeURIComponent(String(e.taskId))),method:"POST",headers:o,query:n,body:i},t);return new w(a)}))}addSourceFileVersion(e,t){return Q(this,void 0,void 0,(function*(){const n=yield this.addSourceFileVersionRaw(e,t);return yield n.value()}))}addSourceFilesRaw(e,t){return Q(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling addSourceFiles().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling addSourceFiles().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling addSourceFiles().');if(null==e.sourceFileAttachmentRequest)throw new d("sourceFileAttachmentRequest",'Required parameter "sourceFileAttachmentRequest" was null or undefined when calling addSourceFiles().');const n={};null!=e.fields&&(n.fields=e.fields);const o={"Content-Type":"application/json"};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/source-files/attach-files".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"POST",headers:o,query:n,body:e.sourceFileAttachmentRequest},t);return new w(i)}))}addSourceFiles(e,t){return Q(this,void 0,void 0,(function*(){const n=yield this.addSourceFilesRaw(e,t);return yield n.value()}))}downloadSourceFileVersionRaw(e,t){return Q(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling downloadSourceFileVersion().');if(null==e.sourceFileId)throw new d("sourceFileId",'Required parameter "sourceFileId" was null or undefined when calling downloadSourceFileVersion().');if(null==e.fileVersionId)throw new d("fileVersionId",'Required parameter "fileVersionId" was null or undefined when calling downloadSourceFileVersion().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling downloadSourceFileVersion().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling downloadSourceFileVersion().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/projects/{projectId}/source-files/{sourceFileId}/versions/{fileVersionId}/download".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{sourceFileId}",encodeURIComponent(String(e.sourceFileId))).replace("{fileVersionId}",encodeURIComponent(String(e.fileVersionId))),method:"GET",headers:n,query:{}},t);return new m(o)}))}downloadSourceFileVersion(e,t){return Q(this,void 0,void 0,(function*(){const n=yield this.downloadSourceFileVersionRaw(e,t);return yield n.value()}))}getSourceFileRaw(e,t){return Q(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling getSourceFile().');if(null==e.sourceFileId)throw new d("sourceFileId",'Required parameter "sourceFileId" was null or undefined when calling getSourceFile().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getSourceFile().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getSourceFile().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/source-files/{sourceFileId}".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{sourceFileId}",encodeURIComponent(String(e.sourceFileId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getSourceFile(e,t){return Q(this,void 0,void 0,(function*(){const n=yield this.getSourceFileRaw(e,t);return yield n.value()}))}getSourceFilePropertiesRaw(e,t){return Q(this,void 0,void 0,(function*(){if(null==e.taskId)throw new d("taskId",'Required parameter "taskId" was null or undefined when calling getSourceFileProperties().');if(null==e.sourceFileId)throw new d("sourceFileId",'Required parameter "sourceFileId" was null or undefined when calling getSourceFileProperties().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getSourceFileProperties().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getSourceFileProperties().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/tasks/{taskId}/source-files/{sourceFileId}".replace("{taskId}",encodeURIComponent(String(e.taskId))).replace("{sourceFileId}",encodeURIComponent(String(e.sourceFileId))),method:"GET",headers:n,query:{}},t);return new w(o)}))}getSourceFileProperties(e,t){return Q(this,void 0,void 0,(function*(){const n=yield this.getSourceFilePropertiesRaw(e,t);return yield n.value()}))}listSourceFileVersionsRaw(e,t){return Q(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling listSourceFileVersions().');if(null==e.sourceFileId)throw new d("sourceFileId",'Required parameter "sourceFileId" was null or undefined when calling listSourceFileVersions().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listSourceFileVersions().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listSourceFileVersions().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/source-files/{sourceFileId}/versions".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{sourceFileId}",encodeURIComponent(String(e.sourceFileId))),method:"GET",headers:o,query:n},t);return new w(i)}))}listSourceFileVersions(e,t){return Q(this,void 0,void 0,(function*(){const n=yield this.listSourceFileVersionsRaw(e,t);return yield n.value()}))}listSourceFilesRaw(e,t){return Q(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling listSourceFiles().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listSourceFiles().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listSourceFiles().');const n={};null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.sort&&(n.sort=e.sort),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/source-files".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"GET",headers:o,query:n},t);return new w(i)}))}listSourceFiles(e,t){return Q(this,void 0,void 0,(function*(){const n=yield this.listSourceFilesRaw(e,t);return yield n.value()}))}updateSourceFileRaw(e,t){return Q(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling updateSourceFile().');if(null==e.sourceFileId)throw new d("sourceFileId",'Required parameter "sourceFileId" was null or undefined when calling updateSourceFile().');const n=yield this.request({path:"/projects/{projectId}/source-files/{sourceFileId}".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{sourceFileId}",encodeURIComponent(String(e.sourceFileId))),method:"PUT",headers:{"Content-Type":"application/json"},query:{},body:e.sourceFileRenameRequest},t);return new f(n)}))}updateSourceFile(e,t){return Q(this,void 0,void 0,(function*(){yield this.updateSourceFileRaw(e,t)}))}updateSourceFilesRaw(e,t){return Q(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling updateSourceFiles().');const n=yield this.request({path:"/projects/{projectId}/source-files".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"PUT",headers:{"Content-Type":"application/json"},query:{},body:e.sourceFilesUpdateRequest},t);return new f(n)}))}updateSourceFiles(e,t){return Q(this,void 0,void 0,(function*(){yield this.updateSourceFilesRaw(e,t)}))}updateSourcePropertiesRaw(e,t){return Q(this,void 0,void 0,(function*(){if(null==e.taskId)throw new d("taskId",'Required parameter "taskId" was null or undefined when calling updateSourceProperties().');if(null==e.sourceFileId)throw new d("sourceFileId",'Required parameter "sourceFileId" was null or undefined when calling updateSourceProperties().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling updateSourceProperties().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateSourceProperties().');const n={"Content-Type":"application/json"};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/tasks/{taskId}/source-files/{sourceFileId}".replace("{taskId}",encodeURIComponent(String(e.taskId))).replace("{sourceFileId}",encodeURIComponent(String(e.sourceFileId))),method:"PUT",headers:n,query:{},body:e.sourceFilePropertiesUpdateRequest},t);return new f(o)}))}updateSourceProperties(e,t){return Q(this,void 0,void 0,(function*(){yield this.updateSourcePropertiesRaw(e,t)}))}}var J=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class Z extends a{getTqaProfileRaw(e,t){return J(this,void 0,void 0,(function*(){if(null==e.profileId)throw new d("profileId",'Required parameter "profileId" was null or undefined when calling getTqaProfile().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getTqaProfile().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTqaProfile().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/tqa-profiles/{profileId}".replace("{profileId}",encodeURIComponent(String(e.profileId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getTqaProfile(e,t){return J(this,void 0,void 0,(function*(){const n=yield this.getTqaProfileRaw(e,t);return yield n.value()}))}listTqaProfilesRaw(e,t){return J(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listTqaProfiles().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTqaProfiles().');const n={};null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.sort&&(n.sort=e.sort),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/tqa-profiles",method:"GET",headers:o,query:n},t);return new w(i)}))}listTqaProfiles(e,t){return J(this,void 0,void 0,(function*(){const n=yield this.listTqaProfilesRaw(e,t);return yield n.value()}))}}var _=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class $ extends a{addTargetFileVersionRaw(e,t){return _(this,void 0,void 0,(function*(){if(null==e.taskId)throw new d("taskId",'Required parameter "taskId" was null or undefined when calling addTargetFileVersion().');if(null==e.targetFileId)throw new d("targetFileId",'Required parameter "targetFileId" was null or undefined when calling addTargetFileVersion().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling addTargetFileVersion().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling addTargetFileVersion().');if(null==e.properties)throw new d("properties",'Required parameter "properties" was null or undefined when calling addTargetFileVersion().');if(null==e.file)throw new d("file",'Required parameter "file" was null or undefined when calling addTargetFileVersion().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));let i,r=!1;r=h([{contentType:"multipart/form-data"}]),i=r?new FormData:new URLSearchParams,null!=e.properties&&i.append("properties",new Blob([JSON.stringify(e.properties)],{type:"application/json"})),null!=e.file&&i.append("file",e.file);const a=yield this.request({path:"/tasks/{taskId}/target-files/{targetFileId}/versions".replace("{taskId}",encodeURIComponent(String(e.taskId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))),method:"POST",headers:o,query:n,body:i},t);return new w(a)}))}addTargetFileVersion(e,t){return _(this,void 0,void 0,(function*(){const n=yield this.addTargetFileVersionRaw(e,t);return yield n.value()}))}downloadExportedTargetFileVersionRaw(e,t){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling downloadExportedTargetFileVersion().');if(null==e.targetFileId)throw new d("targetFileId",'Required parameter "targetFileId" was null or undefined when calling downloadExportedTargetFileVersion().');if(null==e.fileVersionId)throw new d("fileVersionId",'Required parameter "fileVersionId" was null or undefined when calling downloadExportedTargetFileVersion().');if(null==e.exportId)throw new d("exportId",'Required parameter "exportId" was null or undefined when calling downloadExportedTargetFileVersion().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling downloadExportedTargetFileVersion().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling downloadExportedTargetFileVersion().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}/versions/{fileVersionId}/exports/{exportId}/download".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))).replace("{fileVersionId}",encodeURIComponent(String(e.fileVersionId))).replace("{exportId}",encodeURIComponent(String(e.exportId))),method:"GET",headers:n,query:{}},t);return new m(o)}))}downloadExportedTargetFileVersion(e,t){return _(this,void 0,void 0,(function*(){const n=yield this.downloadExportedTargetFileVersionRaw(e,t);return yield n.value()}))}downloadFileVersionRaw(e,t){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling downloadFileVersion().');if(null==e.targetFileId)throw new d("targetFileId",'Required parameter "targetFileId" was null or undefined when calling downloadFileVersion().');if(null==e.fileVersionId)throw new d("fileVersionId",'Required parameter "fileVersionId" was null or undefined when calling downloadFileVersion().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling downloadFileVersion().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling downloadFileVersion().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}/versions/{fileVersionId}/download".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))).replace("{fileVersionId}",encodeURIComponent(String(e.fileVersionId))),method:"GET",headers:n,query:{}},t);return new m(o)}))}downloadFileVersion(e,t){return _(this,void 0,void 0,(function*(){const n=yield this.downloadFileVersionRaw(e,t);return yield n.value()}))}exportTargetFileVersionRaw(e,t){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling exportTargetFileVersion().');if(null==e.targetFileId)throw new d("targetFileId",'Required parameter "targetFileId" was null or undefined when calling exportTargetFileVersion().');if(null==e.fileVersionId)throw new d("fileVersionId",'Required parameter "fileVersionId" was null or undefined when calling exportTargetFileVersion().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling exportTargetFileVersion().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling exportTargetFileVersion().');const n={};null!=e.format&&(n.format=e.format);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}/versions/{fileVersionId}/exports".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))).replace("{fileVersionId}",encodeURIComponent(String(e.fileVersionId))),method:"POST",headers:o,query:n},t);return new w(i)}))}exportTargetFileVersion(e,t){return _(this,void 0,void 0,(function*(){const n=yield this.exportTargetFileVersionRaw(e,t);return yield n.value()}))}getTargetFileRaw(e,t){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling getTargetFile().');if(null==e.targetFileId)throw new d("targetFileId",'Required parameter "targetFileId" was null or undefined when calling getTargetFile().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getTargetFile().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTargetFile().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getTargetFile(e,t){return _(this,void 0,void 0,(function*(){const n=yield this.getTargetFileRaw(e,t);return yield n.value()}))}getTargetFileVersionRaw(e,t){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling getTargetFileVersion().');if(null==e.targetFileId)throw new d("targetFileId",'Required parameter "targetFileId" was null or undefined when calling getTargetFileVersion().');if(null==e.fileVersionId)throw new d("fileVersionId",'Required parameter "fileVersionId" was null or undefined when calling getTargetFileVersion().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getTargetFileVersion().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTargetFileVersion().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}/versions/{fileVersionId}".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))).replace("{fileVersionId}",encodeURIComponent(String(e.fileVersionId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getTargetFileVersion(e,t){return _(this,void 0,void 0,(function*(){const n=yield this.getTargetFileVersionRaw(e,t);return yield n.value()}))}importTargetFileVersionRaw(e,t){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling importTargetFileVersion().');if(null==e.targetFileId)throw new d("targetFileId",'Required parameter "targetFileId" was null or undefined when calling importTargetFileVersion().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling importTargetFileVersion().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling importTargetFileVersion().');if(null==e.file)throw new d("file",'Required parameter "file" was null or undefined when calling importTargetFileVersion().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));let o,i=!1;i=h([{contentType:"multipart/form-data"}]),o=i?new FormData:new URLSearchParams,null!=e.file&&o.append("file",e.file);const r=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}/versions/imports".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))),method:"POST",headers:n,query:{},body:o},t);return new w(r)}))}importTargetFileVersion(e,t){return _(this,void 0,void 0,(function*(){const n=yield this.importTargetFileVersionRaw(e,t);return yield n.value()}))}listTargetFileVersionsRaw(e,t){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling listTargetFileVersions().');if(null==e.targetFileId)throw new d("targetFileId",'Required parameter "targetFileId" was null or undefined when calling listTargetFileVersions().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listTargetFileVersions().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTargetFileVersions().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}/versions".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))),method:"GET",headers:o,query:n},t);return new w(i)}))}listTargetFileVersions(e,t){return _(this,void 0,void 0,(function*(){const n=yield this.listTargetFileVersionsRaw(e,t);return yield n.value()}))}listTargetFilesRaw(e,t){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling listTargetFiles().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listTargetFiles().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTargetFiles().');const n={};null!=e.targetFileIds&&(n.targetFileIds=e.targetFileIds.join(s)),null!=e.sourceFileIds&&(n.sourceFileIds=e.sourceFileIds.join(s)),null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/target-files".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"GET",headers:o,query:n},t);return new w(i)}))}listTargetFiles(e,t){return _(this,void 0,void 0,(function*(){const n=yield this.listTargetFilesRaw(e,t);return yield n.value()}))}pollTargetFileVersionExportRaw(e,t){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling pollTargetFileVersionExport().');if(null==e.targetFileId)throw new d("targetFileId",'Required parameter "targetFileId" was null or undefined when calling pollTargetFileVersionExport().');if(null==e.fileVersionId)throw new d("fileVersionId",'Required parameter "fileVersionId" was null or undefined when calling pollTargetFileVersionExport().');if(null==e.exportId)throw new d("exportId",'Required parameter "exportId" was null or undefined when calling pollTargetFileVersionExport().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling pollTargetFileVersionExport().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling pollTargetFileVersionExport().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}/versions/{fileVersionId}/exports/{exportId}".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))).replace("{fileVersionId}",encodeURIComponent(String(e.fileVersionId))).replace("{exportId}",encodeURIComponent(String(e.exportId))),method:"GET",headers:n,query:{}},t);return new w(o)}))}pollTargetFileVersionExport(e,t){return _(this,void 0,void 0,(function*(){const n=yield this.pollTargetFileVersionExportRaw(e,t);return yield n.value()}))}pollTargetFileVersionImportRaw(e,t){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling pollTargetFileVersionImport().');if(null==e.targetFileId)throw new d("targetFileId",'Required parameter "targetFileId" was null or undefined when calling pollTargetFileVersionImport().');if(null==e.importId)throw new d("importId",'Required parameter "importId" was null or undefined when calling pollTargetFileVersionImport().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling pollTargetFileVersionImport().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling pollTargetFileVersionImport().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}/versions/imports/{importId}".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))).replace("{importId}",encodeURIComponent(String(e.importId))),method:"GET",headers:n,query:{}},t);return new w(o)}))}pollTargetFileVersionImport(e,t){return _(this,void 0,void 0,(function*(){const n=yield this.pollTargetFileVersionImportRaw(e,t);return yield n.value()}))}updateTargetFileRaw(e,t){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling updateTargetFile().');if(null==e.targetFileId)throw new d("targetFileId",'Required parameter "targetFileId" was null or undefined when calling updateTargetFile().');const n=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))),method:"PUT",headers:{"Content-Type":"application/json"},query:{},body:e.targetFileRenameRequest},t);return new f(n)}))}updateTargetFile(e,t){return _(this,void 0,void 0,(function*(){yield this.updateTargetFileRaw(e,t)}))}updateTargetFilesRaw(e,t){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new d("projectId",'Required parameter "projectId" was null or undefined when calling updateTargetFiles().');const n=yield this.request({path:"/projects/{projectId}/target-files".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"PUT",headers:{"Content-Type":"application/json"},query:{},body:e.targetFilesUpdateRequest},t);return new f(n)}))}updateTargetFiles(e,t){return _(this,void 0,void 0,(function*(){yield this.updateTargetFilesRaw(e,t)}))}}var Y=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class ee extends a{acceptTaskRaw(e,t){return Y(this,void 0,void 0,(function*(){if(null==e.taskId)throw new d("taskId",'Required parameter "taskId" was null or undefined when calling acceptTask().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling acceptTask().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling acceptTask().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/tasks/{taskId}/accept".replace("{taskId}",encodeURIComponent(String(e.taskId))),method:"PUT",headers:n,query:{}},t);return new f(o)}))}acceptTask(e,t){return Y(this,void 0,void 0,(function*(){yield this.acceptTaskRaw(e,t)}))}assignTaskRaw(e,t){return Y(this,void 0,void 0,(function*(){if(null==e.taskId)throw new d("taskId",'Required parameter "taskId" was null or undefined when calling assignTask().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling assignTask().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling assignTask().');if(null==e.taskAssignRequest)throw new d("taskAssignRequest",'Required parameter "taskAssignRequest" was null or undefined when calling assignTask().');const n={"Content-Type":"application/json"};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/tasks/{taskId}/assign".replace("{taskId}",encodeURIComponent(String(e.taskId))),method:"PUT",headers:n,query:{},body:e.taskAssignRequest},t);return new f(o)}))}assignTask(e,t){return Y(this,void 0,void 0,(function*(){yield this.assignTaskRaw(e,t)}))}completeTaskRaw(e,t){return Y(this,void 0,void 0,(function*(){if(null==e.taskId)throw new d("taskId",'Required parameter "taskId" was null or undefined when calling completeTask().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling completeTask().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling completeTask().');if(null==e.taskCompleteRequest)throw new d("taskCompleteRequest",'Required parameter "taskCompleteRequest" was null or undefined when calling completeTask().');const n={"Content-Type":"application/json"};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/tasks/{taskId}/complete".replace("{taskId}",encodeURIComponent(String(e.taskId))),method:"PUT",headers:n,query:{},body:e.taskCompleteRequest},t);return new f(o)}))}completeTask(e,t){return Y(this,void 0,void 0,(function*(){yield this.completeTaskRaw(e,t)}))}getTaskRaw(e,t){return Y(this,void 0,void 0,(function*(){if(null==e.taskId)throw new d("taskId",'Required parameter "taskId" was null or undefined when calling getTask().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getTask().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTask().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/tasks/{taskId}".replace("{taskId}",encodeURIComponent(String(e.taskId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getTask(e,t){return Y(this,void 0,void 0,(function*(){const n=yield this.getTaskRaw(e,t);return yield n.value()}))}listTasksAssignedToMeRaw(e,t){return Y(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listTasksAssignedToMe().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTasksAssignedToMe().');const n={};null!=e.status&&(n.status=e.status),null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.sort&&(n.sort=e.sort),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/tasks/assigned",method:"GET",headers:o,query:n},t);return new w(i)}))}listTasksAssignedToMe(e,t){return Y(this,void 0,void 0,(function*(){const n=yield this.listTasksAssignedToMeRaw(e,t);return yield n.value()}))}reclaimTaskRaw(e,t){return Y(this,void 0,void 0,(function*(){if(null==e.taskId)throw new d("taskId",'Required parameter "taskId" was null or undefined when calling reclaimTask().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling reclaimTask().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling reclaimTask().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/tasks/{taskId}/reclaim".replace("{taskId}",encodeURIComponent(String(e.taskId))),method:"PUT",headers:n,query:{}},t);return new f(o)}))}reclaimTask(e,t){return Y(this,void 0,void 0,(function*(){yield this.reclaimTaskRaw(e,t)}))}rejectTaskRaw(e,t){return Y(this,void 0,void 0,(function*(){if(null==e.taskId)throw new d("taskId",'Required parameter "taskId" was null or undefined when calling rejectTask().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling rejectTask().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling rejectTask().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/tasks/{taskId}/reject".replace("{taskId}",encodeURIComponent(String(e.taskId))),method:"PUT",headers:n,query:{}},t);return new f(o)}))}rejectTask(e,t){return Y(this,void 0,void 0,(function*(){yield this.rejectTaskRaw(e,t)}))}releaseTaskRaw(e,t){return Y(this,void 0,void 0,(function*(){if(null==e.taskId)throw new d("taskId",'Required parameter "taskId" was null or undefined when calling releaseTask().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling releaseTask().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling releaseTask().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/tasks/{taskId}/release".replace("{taskId}",encodeURIComponent(String(e.taskId))),method:"PUT",headers:n,query:{}},t);return new f(o)}))}releaseTask(e,t){return Y(this,void 0,void 0,(function*(){yield this.releaseTaskRaw(e,t)}))}}var te=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class ne extends a{getTaskTypeRaw(e,t){return te(this,void 0,void 0,(function*(){if(null==e.taskTypeId)throw new d("taskTypeId",'Required parameter "taskTypeId" was null or undefined when calling getTaskType().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getTaskType().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTaskType().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/task-types/{taskTypeId}".replace("{taskTypeId}",encodeURIComponent(String(e.taskTypeId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getTaskType(e,t){return te(this,void 0,void 0,(function*(){const n=yield this.getTaskTypeRaw(e,t);return yield n.value()}))}listTaskTypesRaw(e,t){return te(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listTaskTypes().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTaskTypes().');const n={};null!=e.key&&(n.key=e.key.join(s)),null!=e.automatic&&(n.automatic=e.automatic),null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.sort&&(n.sort=e.sort),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/task-types",method:"GET",headers:o,query:n},t);return new w(i)}))}listTaskTypes(e,t){return te(this,void 0,void 0,(function*(){const n=yield this.listTaskTypesRaw(e,t);return yield n.value()}))}}var oe=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class ie extends a{createTermbaseRaw(e,t){return oe(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling createTermbase().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling createTermbase().');const n={};null!=e.fields&&(n.fields=e.fields);const o={"Content-Type":"application/json"};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbases",method:"POST",headers:o,query:n,body:e.termbaseCreateRequest},t);return new w(i)}))}createTermbase(e,t){return oe(this,void 0,void 0,(function*(){const n=yield this.createTermbaseRaw(e,t);return yield n.value()}))}createTermbaseEntryRaw(e,t){return oe(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new d("termbaseId",'Required parameter "termbaseId" was null or undefined when calling createTermbaseEntry().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling createTermbaseEntry().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling createTermbaseEntry().');const n={};null!=e.fields&&(n.fields=e.fields);const o={"Content-Type":"application/json"};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbases/{termbaseId}/entries".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"POST",headers:o,query:n,body:e.termbaseEntryCreateRequest},t);return new w(i)}))}createTermbaseEntry(e,t){return oe(this,void 0,void 0,(function*(){const n=yield this.createTermbaseEntryRaw(e,t);return yield n.value()}))}deleteTermbaseRaw(e,t){return oe(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new d("termbaseId",'Required parameter "termbaseId" was null or undefined when calling deleteTermbase().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling deleteTermbase().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteTermbase().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/termbases/{termbaseId}".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"DELETE",headers:n,query:{}},t);return new f(o)}))}deleteTermbase(e,t){return oe(this,void 0,void 0,(function*(){yield this.deleteTermbaseRaw(e,t)}))}deleteTermbaseEntriesRaw(e,t){return oe(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new d("termbaseId",'Required parameter "termbaseId" was null or undefined when calling deleteTermbaseEntries().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling deleteTermbaseEntries().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteTermbaseEntries().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/termbases/{termbaseId}/entries".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"DELETE",headers:n,query:{}},t);return new f(o)}))}deleteTermbaseEntries(e,t){return oe(this,void 0,void 0,(function*(){yield this.deleteTermbaseEntriesRaw(e,t)}))}deleteTermbaseEntryRaw(e,t){return oe(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new d("termbaseId",'Required parameter "termbaseId" was null or undefined when calling deleteTermbaseEntry().');if(null==e.entryId)throw new d("entryId",'Required parameter "entryId" was null or undefined when calling deleteTermbaseEntry().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling deleteTermbaseEntry().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteTermbaseEntry().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/termbases/{termbaseId}/entries/{entryId}".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))).replace("{entryId}",encodeURIComponent(String(e.entryId))),method:"DELETE",headers:n,query:{}},t);return new f(o)}))}deleteTermbaseEntry(e,t){return oe(this,void 0,void 0,(function*(){yield this.deleteTermbaseEntryRaw(e,t)}))}getTermbaseRaw(e,t){return oe(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new d("termbaseId",'Required parameter "termbaseId" was null or undefined when calling getTermbase().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getTermbase().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTermbase().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbases/{termbaseId}".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getTermbase(e,t){return oe(this,void 0,void 0,(function*(){const n=yield this.getTermbaseRaw(e,t);return yield n.value()}))}getTermbaseEntryRaw(e,t){return oe(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new d("termbaseId",'Required parameter "termbaseId" was null or undefined when calling getTermbaseEntry().');if(null==e.entryId)throw new d("entryId",'Required parameter "entryId" was null or undefined when calling getTermbaseEntry().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getTermbaseEntry().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTermbaseEntry().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbases/{termbaseId}/entries/{entryId}".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))).replace("{entryId}",encodeURIComponent(String(e.entryId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getTermbaseEntry(e,t){return oe(this,void 0,void 0,(function*(){const n=yield this.getTermbaseEntryRaw(e,t);return yield n.value()}))}listTermbaseRaw(e,t){return oe(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listTermbase().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTermbase().');const n={};null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.fields&&(n.fields=e.fields),null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbases",method:"GET",headers:o,query:n},t);return new w(i)}))}listTermbase(e,t){return oe(this,void 0,void 0,(function*(){const n=yield this.listTermbaseRaw(e,t);return yield n.value()}))}listTermbaseEntriesRaw(e,t){return oe(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new d("termbaseId",'Required parameter "termbaseId" was null or undefined when calling listTermbaseEntries().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listTermbaseEntries().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTermbaseEntries().');const n={};null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.fields&&(n.fields=e.fields),null!=e.humanReadableIds&&(n.humanReadableIds=e.humanReadableIds);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbases/{termbaseId}/entries".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"GET",headers:o,query:n},t);return new w(i)}))}listTermbaseEntries(e,t){return oe(this,void 0,void 0,(function*(){const n=yield this.listTermbaseEntriesRaw(e,t);return yield n.value()}))}listTermbaseTermsRaw(e,t){return oe(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new d("termbaseId",'Required parameter "termbaseId" was null or undefined when calling listTermbaseTerms().');if(null==e.sourceLanguageCode)throw new d("sourceLanguageCode",'Required parameter "sourceLanguageCode" was null or undefined when calling listTermbaseTerms().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listTermbaseTerms().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTermbaseTerms().');const n={};null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.search&&(n.search=e.search),null!=e.searchType&&(n.searchType=e.searchType),null!=e.targetLanguageCode&&(n.targetLanguageCode=e.targetLanguageCode);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbases/{termbaseId}/terms/{sourceLanguageCode}".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))).replace("{sourceLanguageCode}",encodeURIComponent(String(e.sourceLanguageCode))),method:"GET",headers:o,query:n},t);return new w(i)}))}listTermbaseTerms(e,t){return oe(this,void 0,void 0,(function*(){const n=yield this.listTermbaseTermsRaw(e,t);return yield n.value()}))}updateTermbaseRaw(e,t){return oe(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new d("termbaseId",'Required parameter "termbaseId" was null or undefined when calling updateTermbase().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling updateTermbase().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateTermbase().');const n={"Content-Type":"application/json"};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/termbases/{termbaseId}".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"PUT",headers:n,query:{},body:e.termbaseUpdateRequest},t);return new f(o)}))}updateTermbase(e,t){return oe(this,void 0,void 0,(function*(){yield this.updateTermbaseRaw(e,t)}))}updateTermbaseEntryRaw(e,t){return oe(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new d("termbaseId",'Required parameter "termbaseId" was null or undefined when calling updateTermbaseEntry().');if(null==e.entryId)throw new d("entryId",'Required parameter "entryId" was null or undefined when calling updateTermbaseEntry().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling updateTermbaseEntry().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateTermbaseEntry().');const n={"Content-Type":"application/json"};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/termbases/{termbaseId}/entries/{entryId}".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))).replace("{entryId}",encodeURIComponent(String(e.entryId))),method:"PUT",headers:n,query:{},body:e.termbaseEntryUpdateRequest},t);return new f(o)}))}updateTermbaseEntry(e,t){return oe(this,void 0,void 0,(function*(){yield this.updateTermbaseEntryRaw(e,t)}))}}var re=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class ae extends a{downloadExportedTermbaseRaw(e,t){return re(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new d("termbaseId",'Required parameter "termbaseId" was null or undefined when calling downloadExportedTermbase().');if(null==e.exportId)throw new d("exportId",'Required parameter "exportId" was null or undefined when calling downloadExportedTermbase().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling downloadExportedTermbase().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling downloadExportedTermbase().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/termbases/{termbaseId}/exports/{exportId}/download".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))).replace("{exportId}",encodeURIComponent(String(e.exportId))),method:"GET",headers:n,query:{}},t);return new m(o)}))}downloadExportedTermbase(e,t){return re(this,void 0,void 0,(function*(){const n=yield this.downloadExportedTermbaseRaw(e,t);return yield n.value()}))}downloadTermbaseDefinitionRaw(e,t){return re(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new d("termbaseId",'Required parameter "termbaseId" was null or undefined when calling downloadTermbaseDefinition().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling downloadTermbaseDefinition().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling downloadTermbaseDefinition().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/termbases/{termbaseId}/export-template".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"GET",headers:n,query:{}},t);return new m(o)}))}downloadTermbaseDefinition(e,t){return re(this,void 0,void 0,(function*(){const n=yield this.downloadTermbaseDefinitionRaw(e,t);return yield n.value()}))}exportTermbaseRaw(e,t){return re(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new d("termbaseId",'Required parameter "termbaseId" was null or undefined when calling exportTermbase().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling exportTermbase().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling exportTermbase().');const n={"Content-Type":"application/json"};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/termbases/{termbaseId}/exports".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"POST",headers:n,query:{},body:e.exportTermbaseRequest},t);return new w(o)}))}exportTermbase(e,t){return re(this,void 0,void 0,(function*(){const n=yield this.exportTermbaseRaw(e,t);return yield n.value()}))}pollExportTermbaseRaw(e,t){return re(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new d("termbaseId",'Required parameter "termbaseId" was null or undefined when calling pollExportTermbase().');if(null==e.exportId)throw new d("exportId",'Required parameter "exportId" was null or undefined when calling pollExportTermbase().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling pollExportTermbase().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling pollExportTermbase().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/termbases/{termbaseId}/exports/{exportId}".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))).replace("{exportId}",encodeURIComponent(String(e.exportId))),method:"GET",headers:n,query:{}},t);return new w(o)}))}pollExportTermbase(e,t){return re(this,void 0,void 0,(function*(){const n=yield this.pollExportTermbaseRaw(e,t);return yield n.value()}))}}var le=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class ue extends a{downloadTermbaseImportLogRaw(e,t){return le(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new d("termbaseId",'Required parameter "termbaseId" was null or undefined when calling downloadTermbaseImportLog().');if(null==e.importId)throw new d("importId",'Required parameter "importId" was null or undefined when calling downloadTermbaseImportLog().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling downloadTermbaseImportLog().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling downloadTermbaseImportLog().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/termbases/{termbaseId}/imports/{importId}/logs".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))).replace("{importId}",encodeURIComponent(String(e.importId))),method:"GET",headers:n,query:{}},t);return new m(o)}))}downloadTermbaseImportLog(e,t){return le(this,void 0,void 0,(function*(){const n=yield this.downloadTermbaseImportLogRaw(e,t);return yield n.value()}))}getImportHistoryRaw(e,t){return le(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new d("termbaseId",'Required parameter "termbaseId" was null or undefined when calling getImportHistory().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getImportHistory().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getImportHistory().');const n={};null!=e.fields&&(n.fields=e.fields),null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbases/{termbaseId}/imports".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getImportHistory(e,t){return le(this,void 0,void 0,(function*(){const n=yield this.getImportHistoryRaw(e,t);return yield n.value()}))}importTermbaseRaw(e,t){return le(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new d("termbaseId",'Required parameter "termbaseId" was null or undefined when calling importTermbase().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling importTermbase().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling importTermbase().');if(null==e.file)throw new d("file",'Required parameter "file" was null or undefined when calling importTermbase().');const n={};null!=e.strictImport&&(n.strictImport=e.strictImport),null!=e.duplicateEntriesStrategy&&(n.duplicateEntriesStrategy=e.duplicateEntriesStrategy);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));let i,r=!1;r=h([{contentType:"multipart/form-data"}]),i=r?new FormData:new URLSearchParams,null!=e.file&&i.append("file",e.file);const a=yield this.request({path:"/termbases/{termbaseId}/imports".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"POST",headers:o,query:n,body:i},t);return new w(a)}))}importTermbase(e,t){return le(this,void 0,void 0,(function*(){const n=yield this.importTermbaseRaw(e,t);return yield n.value()}))}pollTermbaseImportRaw(e,t){return le(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new d("termbaseId",'Required parameter "termbaseId" was null or undefined when calling pollTermbaseImport().');if(null==e.importId)throw new d("importId",'Required parameter "importId" was null or undefined when calling pollTermbaseImport().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling pollTermbaseImport().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling pollTermbaseImport().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/termbases/{termbaseId}/imports/{importId}".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))).replace("{importId}",encodeURIComponent(String(e.importId))),method:"GET",headers:n,query:{}},t);return new w(o)}))}pollTermbaseImport(e,t){return le(this,void 0,void 0,(function*(){const n=yield this.pollTermbaseImportRaw(e,t);return yield n.value()}))}}var de=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class se extends a{convertTermbaseTemplateRaw(e,t){return de(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling convertTermbaseTemplate().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling convertTermbaseTemplate().');if(null==e.file)throw new d("file",'Required parameter "file" was null or undefined when calling convertTermbaseTemplate().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));let i,r=!1;r=h([{contentType:"multipart/form-data"}]),i=r?new FormData:new URLSearchParams,null!=e.file&&i.append("file",e.file);const a=yield this.request({path:"/termbase-templates/convert-xdt",method:"POST",headers:o,query:n,body:i},t);return new w(a)}))}convertTermbaseTemplate(e,t){return de(this,void 0,void 0,(function*(){const n=yield this.convertTermbaseTemplateRaw(e,t);return yield n.value()}))}createTermbaseTemplateRaw(e,t){return de(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling createTermbaseTemplate().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling createTermbaseTemplate().');const n={};null!=e.fields&&(n.fields=e.fields);const o={"Content-Type":"application/json"};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbase-templates",method:"POST",headers:o,query:n,body:e.termbaseTemplateCreateRequest},t);return new w(i)}))}createTermbaseTemplate(e,t){return de(this,void 0,void 0,(function*(){const n=yield this.createTermbaseTemplateRaw(e,t);return yield n.value()}))}deleteTermbaseTemplateRaw(e,t){return de(this,void 0,void 0,(function*(){if(null==e.termbaseTemplateId)throw new d("termbaseTemplateId",'Required parameter "termbaseTemplateId" was null or undefined when calling deleteTermbaseTemplate().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling deleteTermbaseTemplate().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteTermbaseTemplate().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/termbase-templates/{termbaseTemplateId}".replace("{termbaseTemplateId}",encodeURIComponent(String(e.termbaseTemplateId))),method:"DELETE",headers:n,query:{}},t);return new f(o)}))}deleteTermbaseTemplate(e,t){return de(this,void 0,void 0,(function*(){yield this.deleteTermbaseTemplateRaw(e,t)}))}getTermbaseTemplateRaw(e,t){return de(this,void 0,void 0,(function*(){if(null==e.termbaseTemplateId)throw new d("termbaseTemplateId",'Required parameter "termbaseTemplateId" was null or undefined when calling getTermbaseTemplate().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getTermbaseTemplate().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTermbaseTemplate().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbase-templates/{termbaseTemplateId}".replace("{termbaseTemplateId}",encodeURIComponent(String(e.termbaseTemplateId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getTermbaseTemplate(e,t){return de(this,void 0,void 0,(function*(){const n=yield this.getTermbaseTemplateRaw(e,t);return yield n.value()}))}listTermbaseTemplatesRaw(e,t){return de(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listTermbaseTemplates().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTermbaseTemplates().');const n={};null!=e.location&&(n.location=e.location),null!=e.fields&&(n.fields=e.fields),null!=e.type&&(n.type=e.type),null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbase-templates",method:"GET",headers:o,query:n},t);return new w(i)}))}listTermbaseTemplates(e,t){return de(this,void 0,void 0,(function*(){const n=yield this.listTermbaseTemplatesRaw(e,t);return yield n.value()}))}updateTermbaseTemplateRaw(e,t){return de(this,void 0,void 0,(function*(){if(null==e.termbaseTemplateId)throw new d("termbaseTemplateId",'Required parameter "termbaseTemplateId" was null or undefined when calling updateTermbaseTemplate().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling updateTermbaseTemplate().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateTermbaseTemplate().');const n={"Content-Type":"application/json"};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/termbase-templates/{termbaseTemplateId}".replace("{termbaseTemplateId}",encodeURIComponent(String(e.termbaseTemplateId))),method:"PUT",headers:n,query:{},body:e.termbaseTemplateUpdateRequest},t);return new f(o)}))}updateTermbaseTemplate(e,t){return de(this,void 0,void 0,(function*(){yield this.updateTermbaseTemplateRaw(e,t)}))}}var ce=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class pe extends a{getTranslationEngineRaw(e,t){return ce(this,void 0,void 0,(function*(){if(null==e.translationEngineId)throw new d("translationEngineId",'Required parameter "translationEngineId" was null or undefined when calling getTranslationEngine().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getTranslationEngine().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTranslationEngine().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/translation-engines/{translationEngineId}".replace("{translationEngineId}",encodeURIComponent(String(e.translationEngineId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getTranslationEngine(e,t){return ce(this,void 0,void 0,(function*(){const n=yield this.getTranslationEngineRaw(e,t);return yield n.value()}))}listTranslationEnginesRaw(e,t){return ce(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listTranslationEngines().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTranslationEngines().');const n={};null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.sort&&(n.sort=e.sort),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/translation-engines",method:"GET",headers:o,query:n},t);return new w(i)}))}listTranslationEngines(e,t){return ce(this,void 0,void 0,(function*(){const n=yield this.listTranslationEnginesRaw(e,t);return yield n.value()}))}updateTranslationEngineRaw(e,t){return ce(this,void 0,void 0,(function*(){if(null==e.translationEngineId)throw new d("translationEngineId",'Required parameter "translationEngineId" was null or undefined when calling updateTranslationEngine().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling updateTranslationEngine().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateTranslationEngine().');const n={"Content-Type":"application/json"};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/translation-engines/{translationEngineId}".replace("{translationEngineId}",encodeURIComponent(String(e.translationEngineId))),method:"PUT",headers:n,query:{},body:e.translationEngineUpdateRequest},t);return new f(o)}))}updateTranslationEngine(e,t){return ce(this,void 0,void 0,(function*(){yield this.updateTranslationEngineRaw(e,t)}))}}var he=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class we extends a{copyTranslationMemoryRaw(e,t){return he(this,void 0,void 0,(function*(){if(null==e.translationMemoryId)throw new d("translationMemoryId",'Required parameter "translationMemoryId" was null or undefined when calling copyTranslationMemory().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling copyTranslationMemory().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling copyTranslationMemory().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant)),null!=e.authorization&&(o.Authorization=String(e.authorization));const i=yield this.request({path:"/translation-memory/{translationMemoryId}/copy".replace("{translationMemoryId}",encodeURIComponent(String(e.translationMemoryId))),method:"POST",headers:o,query:n},t);return new w(i)}))}copyTranslationMemory(e,t){return he(this,void 0,void 0,(function*(){const n=yield this.copyTranslationMemoryRaw(e,t);return yield n.value()}))}createTranslationMemoryRaw(e,t){return he(this,void 0,void 0,(function*(){if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling createTranslationMemory().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling createTranslationMemory().');const n={};null!=e.fields&&(n.fields=e.fields);const o={"Content-Type":"application/json"};null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant)),null!=e.authorization&&(o.Authorization=String(e.authorization));const i=yield this.request({path:"/translation-memory",method:"POST",headers:o,query:n,body:e.translationMemoryCreateRequest},t);return new w(i)}))}createTranslationMemory(e,t){return he(this,void 0,void 0,(function*(){const n=yield this.createTranslationMemoryRaw(e,t);return yield n.value()}))}deleteTranslationMemoryRaw(e,t){return he(this,void 0,void 0,(function*(){if(null==e.translationMemoryId)throw new d("translationMemoryId",'Required parameter "translationMemoryId" was null or undefined when calling deleteTranslationMemory().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteTranslationMemory().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling deleteTranslationMemory().');const n={};null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant)),null!=e.authorization&&(n.Authorization=String(e.authorization));const o=yield this.request({path:"/translation-memory/{translationMemoryId}".replace("{translationMemoryId}",encodeURIComponent(String(e.translationMemoryId))),method:"DELETE",headers:n,query:{}},t);return new f(o)}))}deleteTranslationMemory(e,t){return he(this,void 0,void 0,(function*(){yield this.deleteTranslationMemoryRaw(e,t)}))}getFieldTemplateRaw(e,t){return he(this,void 0,void 0,(function*(){if(null==e.fieldTemplateId)throw new d("fieldTemplateId",'Required parameter "fieldTemplateId" was null or undefined when calling getFieldTemplate().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getFieldTemplate().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getFieldTemplate().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/translation-memory/field-templates/{fieldTemplateId}".replace("{fieldTemplateId}",encodeURIComponent(String(e.fieldTemplateId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getFieldTemplate(e,t){return he(this,void 0,void 0,(function*(){const n=yield this.getFieldTemplateRaw(e,t);return yield n.value()}))}getTranslationMemoryRaw(e,t){return he(this,void 0,void 0,(function*(){if(null==e.translationMemoryId)throw new d("translationMemoryId",'Required parameter "translationMemoryId" was null or undefined when calling getTranslationMemory().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTranslationMemory().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getTranslationMemory().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant)),null!=e.authorization&&(o.Authorization=String(e.authorization));const i=yield this.request({path:"/translation-memory/{translationMemoryId}".replace("{translationMemoryId}",encodeURIComponent(String(e.translationMemoryId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getTranslationMemory(e,t){return he(this,void 0,void 0,(function*(){const n=yield this.getTranslationMemoryRaw(e,t);return yield n.value()}))}listFieldTemplatesRaw(e,t){return he(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listFieldTemplates().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listFieldTemplates().');const n={};null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.sort&&(n.sort=e.sort),null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/translation-memory/field-templates",method:"GET",headers:o,query:n},t);return new w(i)}))}listFieldTemplates(e,t){return he(this,void 0,void 0,(function*(){const n=yield this.listFieldTemplatesRaw(e,t);return yield n.value()}))}listTranslationMemoriesRaw(e,t){return he(this,void 0,void 0,(function*(){if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTranslationMemories().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listTranslationMemories().');const n={};null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.sort&&(n.sort=e.sort),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant)),null!=e.authorization&&(o.Authorization=String(e.authorization));const i=yield this.request({path:"/translation-memory",method:"GET",headers:o,query:n},t);return new w(i)}))}listTranslationMemories(e,t){return he(this,void 0,void 0,(function*(){const n=yield this.listTranslationMemoriesRaw(e,t);return yield n.value()}))}updateTranslationMemoryRaw(e,t){return he(this,void 0,void 0,(function*(){if(null==e.translationMemoryId)throw new d("translationMemoryId",'Required parameter "translationMemoryId" was null or undefined when calling updateTranslationMemory().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateTranslationMemory().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling updateTranslationMemory().');const n={"Content-Type":"application/json"};null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant)),null!=e.authorization&&(n.Authorization=String(e.authorization));const o=yield this.request({path:"/translation-memory/{translationMemoryId}".replace("{translationMemoryId}",encodeURIComponent(String(e.translationMemoryId))),method:"PUT",headers:n,query:{},body:e.translationMemoryUpdateRequest},t);return new f(o)}))}updateTranslationMemory(e,t){return he(this,void 0,void 0,(function*(){yield this.updateTranslationMemoryRaw(e,t)}))}}var fe=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))},me=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class ge extends a{getTMImportHistoryRaw(e,t){return me(this,void 0,void 0,(function*(){if(null==e.translationMemoryId)throw new d("translationMemoryId",'Required parameter "translationMemoryId" was null or undefined when calling getTMImportHistory().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getTMImportHistory().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTMImportHistory().');const n={};null!=e.fields&&(n.fields=e.fields),null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/translation-memory/{translationMemoryId}/imports".replace("{translationMemoryId}",encodeURIComponent(String(e.translationMemoryId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getTMImportHistory(e,t){return me(this,void 0,void 0,(function*(){const n=yield this.getTMImportHistoryRaw(e,t);return yield n.value()}))}importTranslationMemoryRaw(e,t){return me(this,void 0,void 0,(function*(){if(null==e.translationMemoryId)throw new d("translationMemoryId",'Required parameter "translationMemoryId" was null or undefined when calling importTranslationMemory().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling importTranslationMemory().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling importTranslationMemory().');if(null==e.properties)throw new d("properties",'Required parameter "properties" was null or undefined when calling importTranslationMemory().');if(null==e.file)throw new d("file",'Required parameter "file" was null or undefined when calling importTranslationMemory().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));let o,i=!1;i=h([{contentType:"multipart/form-data"}]),o=i?new FormData:new URLSearchParams,null!=e.properties&&o.append("properties",new Blob([JSON.stringify(e.properties)],{type:"application/json"})),null!=e.file&&o.append("file",e.file);const r=yield this.request({path:"/translation-memory/{translationMemoryId}/imports".replace("{translationMemoryId}",encodeURIComponent(String(e.translationMemoryId))),method:"POST",headers:n,query:{},body:o},t);return new w(r)}))}importTranslationMemory(e,t){return me(this,void 0,void 0,(function*(){const n=yield this.importTranslationMemoryRaw(e,t);return yield n.value()}))}pollTMImportRaw(e,t){return me(this,void 0,void 0,(function*(){if(null==e.importId)throw new d("importId",'Required parameter "importId" was null or undefined when calling pollTMImport().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling pollTMImport().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling pollTMImport().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/translation-memory/imports/{importId}".replace("{importId}",encodeURIComponent(String(e.importId))),method:"GET",headers:n,query:{}},t);return new w(o)}))}pollTMImport(e,t){return me(this,void 0,void 0,(function*(){const n=yield this.pollTMImportRaw(e,t);return yield n.value()}))}}var Te=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class ye extends a{getMyUserRaw(e,t){return Te(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getMyUser().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getMyUser().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/users/me",method:"GET",headers:o,query:n},t);return new w(i)}))}getMyUser(e,t){return Te(this,void 0,void 0,(function*(){const n=yield this.getMyUserRaw(e,t);return yield n.value()}))}getUserRaw(e,t){return Te(this,void 0,void 0,(function*(){if(null==e.userId)throw new d("userId",'Required parameter "userId" was null or undefined when calling getUser().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getUser().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getUser().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/users/{userId}".replace("{userId}",encodeURIComponent(String(e.userId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getUser(e,t){return Te(this,void 0,void 0,(function*(){const n=yield this.getUserRaw(e,t);return yield n.value()}))}listUsersRaw(e,t){return Te(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listUsers().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listUsers().');const n={};null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.sort&&(n.sort=e.sort),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/users",method:"GET",headers:o,query:n},t);return new w(i)}))}listUsers(e,t){return Te(this,void 0,void 0,(function*(){const n=yield this.listUsersRaw(e,t);return yield n.value()}))}}var Ce=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function l(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((o=o.apply(e,t||[])).next())}))};class ve extends a{getWorkflowRaw(e,t){return Ce(this,void 0,void 0,(function*(){if(null==e.workflowId)throw new d("workflowId",'Required parameter "workflowId" was null or undefined when calling getWorkflow().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling getWorkflow().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getWorkflow().');const n={};null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/workflows/{workflowId}".replace("{workflowId}",encodeURIComponent(String(e.workflowId))),method:"GET",headers:o,query:n},t);return new w(i)}))}getWorkflow(e,t){return Ce(this,void 0,void 0,(function*(){const n=yield this.getWorkflowRaw(e,t);return yield n.value()}))}listWorkflowsRaw(e,t){return Ce(this,void 0,void 0,(function*(){if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling listWorkflows().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listWorkflows().');const n={};null!=e.top&&(n.top=e.top),null!=e.skip&&(n.skip=e.skip),null!=e.location&&(n.location=e.location.join(s)),null!=e.locationStrategy&&(n.locationStrategy=e.locationStrategy),null!=e.sort&&(n.sort=e.sort),null!=e.fields&&(n.fields=e.fields);const o={};null!=e.authorization&&(o.Authorization=String(e.authorization)),null!=e.xLCTenant&&(o["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/workflows",method:"GET",headers:o,query:n},t);return new w(i)}))}listWorkflows(e,t){return Ce(this,void 0,void 0,(function*(){const n=yield this.listWorkflowsRaw(e,t);return yield n.value()}))}updateWorkflowRaw(e,t){return Ce(this,void 0,void 0,(function*(){if(null==e.workflowId)throw new d("workflowId",'Required parameter "workflowId" was null or undefined when calling updateWorkflow().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling updateWorkflow().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateWorkflow().');if(null==e.workflowUpdateRequest)throw new d("workflowUpdateRequest",'Required parameter "workflowUpdateRequest" was null or undefined when calling updateWorkflow().');const n={"Content-Type":"application/json"};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/workflows/{workflowId}".replace("{workflowId}",encodeURIComponent(String(e.workflowId))),method:"PUT",headers:n,query:{},body:e.workflowUpdateRequest},t);return new f(o)}))}updateWorkflow(e,t){return Ce(this,void 0,void 0,(function*(){yield this.updateWorkflowRaw(e,t)}))}}const Ie={ENVIRONMENT:(()=>{const e=document.location.host.split("-")[0];switch(e){case"ci":case"qa":case"pte":case"uat":return e.toUpperCase();case"staging":return"STG";default:return"PROD"}})()||"CI",ENVIRONMENTS:{LOCAL:{apiUrl:"https://ci-lc-api.sdl.com/public-api/v1"},CI:{apiUrl:"https://ci-lc-api.sdl.com/public-api/v1"},QA:{apiUrl:"https://qa-lc-api.sdl.com/public-api/v1"},PTE:{apiUrl:"https://pte-lc-api.sdl.com/public-api/v1"},UAT:{apiUrl:"https://uat-lc-api.sdl.com/public-api/v1"},STG:{apiUrl:"https://staging-lc-api.sdl.com/public-api/v1"},PROD:{apiUrl:"https://lc-api.sdl.com/public-api/v1"}}};var xe;const Re=new i({basePath:Ie.ENVIRONMENTS[xe=xe||Ie.ENVIRONMENT].apiUrl}),Le={accountApi:()=>new T(Re),customFieldApi:()=>new C(Re),customerApi:()=>new I(Re),fileApi:()=>new R(Re),fileProcessingConfigurationApi:()=>new q(Re),folderApi:()=>new j(Re),groupApi:()=>new S(Re),languageApi:()=>new F(Re),languageProcessingApi:()=>new P(Re),pricingModelApi:()=>new U(Re),projectApi:()=>new G(Re),projectGroupApi:()=>new X(Re),projectTemplateApi:()=>new D(Re),publicKeysApi:()=>new B(Re),quoteApi:()=>new K(Re),sourceFileApi:()=>new W(Re),tqaProfileApi:()=>new Z(Re),targetFileApi:()=>new $(Re),taskApi:()=>new ee(Re),taskTypeApi:()=>new ne(Re),termbaseApi:()=>new ie(Re),termbaseExportApi:()=>new ae(Re),termbaseImportApi:()=>new ue(Re),termbaseTemplateApi:()=>new se(Re),translationEngineApi:()=>new pe(Re),translationMemoryApi:()=>new we(Re),translationMemoryExportApi:new class extends a{downloadExportedTranslationMemoryRaw(e,t){return fe(this,void 0,void 0,(function*(){if(null==e.exportId)throw new d("exportId",'Required parameter "exportId" was null or undefined when calling downloadExportedTranslationMemory().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling downloadExportedTranslationMemory().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling downloadExportedTranslationMemory().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/translation-memory/exports/{exportId}/download".replace("{exportId}",encodeURIComponent(String(e.exportId))),method:"GET",headers:n,query:{}},t);return new m(o)}))}downloadExportedTranslationMemory(e,t){return fe(this,void 0,void 0,(function*(){const n=yield this.downloadExportedTranslationMemoryRaw(e,t);return yield n.value()}))}exportTranslationMemoryRaw(e,t){return fe(this,void 0,void 0,(function*(){if(null==e.translationMemoryId)throw new d("translationMemoryId",'Required parameter "translationMemoryId" was null or undefined when calling exportTranslationMemory().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling exportTranslationMemory().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling exportTranslationMemory().');const n={"Content-Type":"application/json"};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/translation-memory/{translationMemoryId}/exports".replace("{translationMemoryId}",encodeURIComponent(String(e.translationMemoryId))),method:"POST",headers:n,query:{},body:e.translationMemoryExportRequest},t);return new w(o)}))}exportTranslationMemory(e,t){return fe(this,void 0,void 0,(function*(){const n=yield this.exportTranslationMemoryRaw(e,t);return yield n.value()}))}pollTranslationMemoryExportRaw(e,t){return fe(this,void 0,void 0,(function*(){if(null==e.exportId)throw new d("exportId",'Required parameter "exportId" was null or undefined when calling pollTranslationMemoryExport().');if(null==e.authorization)throw new d("authorization",'Required parameter "authorization" was null or undefined when calling pollTranslationMemoryExport().');if(null==e.xLCTenant)throw new d("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling pollTranslationMemoryExport().');const n={};null!=e.authorization&&(n.Authorization=String(e.authorization)),null!=e.xLCTenant&&(n["X-LC-Tenant"]=String(e.xLCTenant));const o=yield this.request({path:"/translation-memory/exports/{exportId}".replace("{exportId}",encodeURIComponent(String(e.exportId))),method:"GET",headers:n,query:{}},t);return new w(o)}))}pollTranslationMemoryExport(e,t){return fe(this,void 0,void 0,(function*(){const n=yield this.pollTranslationMemoryExportRaw(e,t);return yield n.value()}))}}(Re),translationMemoryImportApi:()=>new ge(Re),userApi:()=>new ye(Re),workflowApi:()=>new ve(Re)},qe={success:"success",fail:"fail",warning:"warning",info:"info"},ze={load:"load",route:"route"};let je;function be(e,t){const n=new CustomEvent(e,{detail:t});window.dispatchEvent(n)}function Se(){return je}const ke={apiClient:Le,onReady:function(e,t){be("register",{elements:e,callback:e=>{je=e,t()}})},getLocalData:function(e,t){return new Promise(((n,o)=>{be("getLocalData",Object.assign(Object.assign({context:e,selector:t},Se()),{resolve:n,reject:o}))}))},callApi:function(e){return new Promise(((t,n)=>{be("callApi",Object.assign(Object.assign(Object.assign({},e),Se()),{resolve:t,reject:n}))}))},callAddonApi:function(e){return new Promise(((t,n)=>{be("callAddonApi",Object.assign(Object.assign(Object.assign({},e),Se()),{resolve:t,reject:n}))}))},updateElement:function(e,t){return new Promise(((n,o)=>{be("updateElement",Object.assign(Object.assign({elementId:e,update:t},Se()),{resolve:n,reject:o}))}))},navigate:function(e,t){return new Promise(((n,o)=>{be("navigate",Object.assign(Object.assign({type:t||ze.route,path:e},Se()),{resolve:n,reject:o}))}))},showNotification:function(e,t,n){return new Promise(((o,i)=>{be("showNotification",Object.assign(Object.assign({context:t,type:n||qe.info,text:e},Se()),{resolve:o,reject:i}))}))},getRegistrationResult:Se,contexts:{projects:"projects",taskInbox:"task-inbox"},dataSelectors:{selectedProjects:"selectedProjects",selectedTasks:"selectedTasks",projectDashboard:"projectDashboard",projectFiles:"projectFiles",projectStages:"projectStages",projectTaskHistory:"projectTaskHistory"},notificationTypes:qe,navigationTypes:ze};return t})(),e.exports=t()}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}(()=>{"use strict";var e=n(462),t=function(){return t=Object.assign||function(e){for(var t,n=1,o=arguments.length;n0&&i[i.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]".concat(t," content inserted on render.
This panel was added to column ").concat(!isNaN(t)&&t%2?"1":"2"," in Dashboard's main section."),n.appendChild(o)}},w=function(e){for(var t=document.getElementsByClassName("x-progress-text"),n=0;nTask description: ".concat(i||"no inputFiles"),o.appendChild(r)}else console.error("[UI Extensibility] [extension] No boxContentWrapper or taskPreview data")},x=0,R=function(e,t){d(e);var n=document.getElementById(e.domElementId);if(n){n.innerHTML="";var o=document.createElement("div");o.innerHTML="Custom panel ".concat(t," content inserted on render."),n.appendChild(o)}},L=[{elementId:"invoiceButton",icon:"x-fal fa-newspaper",text:"Create Invoice",location:"project-details-toolbar",type:"button",hidden:!0,actions:[{eventType:"onrender",eventHandler:l,payload:[]},{eventType:"onclick",eventHandler:function(t){d(t),e.trados.showNotification("Requesting LC UI Extensibility service to perform file download API call (LC Public API quote-report)",e.trados.contexts.projects,e.trados.notificationTypes.success),e.trados.callApi({url:"public-api/v1/projects/".concat(t.project.id,"/quote-report"),method:"GET",fileName:"invoice.pdf"}).then((function(t){e.trados.showNotification("Get project quote public API call completed successfully. Download will begin shortly.",e.trados.contexts.projects,e.trados.notificationTypes.success)})).catch((function(t){console.error("Get project quote call failed",t),e.trados.showNotification("Get project quote public API call failed.",e.trados.contexts.projects,e.trados.notificationTypes.fail)}))},payload:["project"]}]},{elementId:"invoiceButtonGeneratedApi",icon:"x-fal fa-newspaper",text:"Create Invoice (generated API)",location:"project-details-toolbar",type:"button",hidden:!0,actions:[{eventType:"onrender",eventHandler:l,payload:[]},{eventType:"onclick",eventHandler:function(n){return o(void 0,void 0,void 0,(function(){var r,a,l;return i(this,(function(u){switch(u.label){case 0:d(n),r=n.project.id,e.trados.showNotification("Requesting the export of the quote report (LC Public API ExportQuoteReport)",e.trados.contexts.projects),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,e.trados.apiClient.quoteApi().exportQuoteReport(t({projectId:r},e.trados.getRegistrationResult()))];case 2:case 3:return u.sent(),[3,4];case 4:return a=0,l=setInterval((function(){return o(void 0,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,e.trados.apiClient.quoteApi().pollQuoteReportExport(t({projectId:r},e.trados.getRegistrationResult())).then((function(n){a++,console.log("----pollResponse",n),"completed"===n.status?(clearInterval(l),l=null,e.trados.apiClient.quoteApi().downloadQuoteReport(t({projectId:r},e.trados.getRegistrationResult())).then((function(t){e.trados.showNotification("Download quote report completed successfully.
Preparing file. Download will begin shortly.",e.trados.contexts.projects,e.trados.notificationTypes.success),s("quoteReport.pdf",t)})).catch((function(t){console.log("Failed to download quote report.",t),e.trados.showNotification("Failed to download the quote report.",e.trados.contexts.projects,e.trados.notificationTypes.fail)}))):9===a&&(clearInterval(l),l=null,e.trados.showNotification("The export status was verified 10 times and it's not yet complete. We've given up checking.",e.trados.contexts.projects,e.trados.notificationTypes.fail))})).catch((function(t){console.log("Failed to poll quote report export status.",t),e.trados.showNotification("Failed to poll quote report export status.",e.trados.contexts.projects,e.trados.notificationTypes.fail)}))];case 1:return n.sent(),[2]}}))}))}),2e3),[2]}}))}))},payload:["project"]}]},{elementId:"openNewTabButtonLink",icon:"x-fal fa-external-link",text:"Open rws.com in New tab",location:"project-details-toolbar",type:"button",isLink:!0,href:"https://www.rws.com"},{elementId:"navigateButtonRoute",icon:"x-fal fa-clipboard",text:"View Project Template",location:"project-details-toolbar",type:"button",hidden:!0,actions:[{eventType:"onrender",eventHandler:function(t){d(t);var n=Boolean(t.project&&!t.project.id);e.trados.updateElement("navigateButtonRoute",{hidden:n})},payload:["project"]},{eventType:"onclick",eventHandler:function(t){var n;if(d(t),null===(n=t.project)||void 0===n?void 0:n.projectTemplate){var o=t.project.projectTemplate.id,i="resources/project-templates/".concat(o);e.trados.navigate(i,e.trados.navigationTypes.route)}},payload:["project"]}]},{elementId:"getLocalDataButton",icon:"x-fal fa-table",text:"Get Local Data",location:"project-details-toolbar",type:"button",actions:[{eventType:"onclick",eventHandler:function(t){d(t),t.project&&e.trados.getLocalData(e.trados.contexts.projects).then(c).catch((function(t){console.error("Failed to get local data",t),e.trados.showNotification("Failed to get local data.",e.trados.contexts.projects,e.trados.notificationTypes.fail)}))},payload:["selectedProjects","project","selectedFile","selectedFiles","selectedTaskHistoryTask","selectedStagesTasks","projectActiveTab"]}]},{elementId:"setProjectImportanceButton",icon:"x-fal fa-exclamation-circle",text:"Set Importance",location:"project-details-toolbar",type:"button",menu:[{text:"High",value:"high",icon:"x-fal fa-chevron-circle-up"},{text:"Medium",value:"medium",icon:"x-fal fa-dot-circle"},{text:"Low",value:"low",icon:"x-fal fa-chevron-circle-down"},{separator:!0},{text:"Unset importance",value:"none",icon:"x-fal fa-trash",disabled:!0}],actions:[{eventType:"onrender",eventHandler:function(t){d(t),r=t.project,t.project&&!a.find((function(e){return e.projectId===t.project.id}))&&(console.log("[UI Extensibility] [extension] Get project importance from add-on API"),e.trados.callAddonApi({url:"api/project-metadata/project-id/".concat(t.project.id),method:"GET"}).then((function(e){e&&e.responseData&&(e.responseData.errorCode?console.warn("Failed to get project metadata (importance).",e.responseData.errorCode,e.responseData.message):"string"!=typeof e.responseData&&u(e,!1))})).catch((function(t){console.error("Failed to get project metadata (importance)",t),e.trados.showNotification("Failed to get local data.",e.trados.contexts.projects,e.trados.notificationTypes.fail)})),a.push({projectId:t.project.id,pending:!0}))},payload:[]},{eventType:"onclick",eventHandler:function(t){if(d(t),t.project){var n=t.value;if(n){var o=a.find((function(e){return e.projectId===t.project.id&&!e.pending}));e.trados.updateElement("setProjectImportanceButton",{disabled:!0}),"none"===n&&o?e.trados.callAddonApi({url:"api/project-metadata/".concat(o.id),method:"DELETE"}).then((function(t){t.responseData&&r&&(p(t),e.trados.updateElement("setProjectImportanceButton",{icon:"x-fal fa-exclamation-circle",text:"Set Importance",disabled:!1,menuItems:[{index:4,disabled:!0}]}))})).catch((function(t){console.error("Failed to delete project metadata (importance)",t),e.trados.showNotification("Failed to delete project importance.",e.trados.contexts.projects,e.trados.notificationTypes.fail)})):e.trados.callAddonApi({url:"api/project-metadata".concat(o?"/"+o.id:""),method:o?"PUT":"POST",body:JSON.stringify({projectId:t.project.id,importance:n})}).then((function(e){u(e,!0)})).catch((function(t){console.error("Failed to set project metadata (importance)",t),e.trados.showNotification("Failed to set project importance.",e.trados.contexts.projects,e.trados.notificationTypes.fail)}))}}},payload:["project"]}]},{elementId:"extensionsHelper",text:"Extensions Helper",location:"project-details-tabpanel",type:"tab",actions:[{eventType:"onrender",eventHandler:function(t){d(t);var n=document.getElementById(t.domElementId);if(n){n.innerHTML="";var o=document.createElement("div");o.className="x-panel-header-title-light-framed",o.setAttribute("style","margin-bottom: 10px"),o.innerText="Available data",f=t.project,m=t.selectedProjects;var i={project:f,selectedProjects:m},r=document.createElement("a");r.setAttribute("style","margin-left: 10px; color: #434a65;"),r.innerHTML='',r.onclick=function(){SDL.common.utils.ClipboardCopy.copyToClipboard(JSON.stringify(i)),r.className.indexOf("fa-check")||(r.className="x-fa fa-check",setTimeout((function(){r.className="x-fa fa-copy"}),2e3))},o.appendChild(r),n.appendChild(o),n.style.position="relative";var a=document.createElement("style");a.innerHTML='\n.json-viewer {\n color: #000;\n margin: 0;\n padding-left: 20px;\n line-height: 20px;\n background-image: linear-gradient(\n 0deg,\n #fcfcfc 50%,\n #f3f3f3 50%,\n #f3f3f3 100%\n );\n background-size: 40px 40px;\n}\n.json-viewer ul {\n list-style-type: none;\n margin: 0;\n margin: 0 0 0 1px;\n border-left: 1px dotted #ccc;\n padding-left: 2em;\n}\n.json-viewer .hide {\n display: none;\n}\n.json-viewer .type-string {\n color: #0b7500;\n}\n.json-viewer .type-date {\n color: #cb7500;\n}\n.json-viewer .type-boolean {\n color: #1a01cc;\n font-weight: bold;\n}\n.json-viewer .type-number {\n color: #1a01cc;\n}\n.json-viewer .type-null,\n.json-viewer .type-undefined {\n color: #90a;\n}\n.json-viewer a.list-link {\n color: #000;\n text-decoration: none;\n position: relative;\n}\n.json-viewer a.list-link:before {\n color: #aaa;\n content: "▼";\n position: absolute;\n display: inline-block;\n width: 1em;\n left: -1em;\n}\n.json-viewer a.list-link.collapsed:before {\n content: "►";\n}\n.json-viewer a.list-link.empty:before {\n content: "";\n}\n.json-viewer .items-ph {\n color: #aaa;\n padding: 0 1em;\n}\n.json-viewer .items-ph:hover {\n text-decoration: underline;\n}\n.json-viewer .copy-links {\n display: none;\n}\n.json-viewer li:hover > a.list-link.collapsed ~ .copy-links.collapsed,\n.json-viewer li:hover > a.list-link:not(.collapsed) ~ .copy-links.expanded,\n.json-viewer li:hover > .copy-links.simple {\n display: inline;\n}',document.body.appendChild(a);var l=new(function(e){var t={}.toString,n=t.call(new Date);function o(){this._dom_container=e.createElement("pre"),this._dom_container.classList.add("json-viewer")}function i(t,n,o){var i=e.createElement("a");i.title=t,i.innerText="Copy path",i.setAttribute("style","margin-left: 10px"),i.onclick=function(){SDL.common.utils.ClipboardCopy.copyToClipboard(t)};var r=e.createElement("a"),a="object"==typeof n?JSON.stringify(n):n;r.title=a,r.innerText="Copy value",r.setAttribute("style","margin-left: 10px"),r.onclick=function(){SDL.common.utils.ClipboardCopy.copyToClipboard(a)};var l=e.createElement("span");return l.className="copy-links"+(o?" "+o:" simple"),l.appendChild(i),l.appendChild(r),l}function r(o,d,s,c,p,h){var w=t.call(d)===n,f=!w&&"object"==typeof d&&null!==d&&"toJSON"in d?d.toJSON():d;if("object"!=typeof f||null===f||w)o.appendChild(a(d,w));else{var m,g=s>=0&&p>=s,T=c>=0&&p>=c,y=Array.isArray(f),C=y?f:Object.keys(f);if(0===p){var v=l(C.length),I=u(y?"[":"{");C.length?(I.addEventListener("click",(function(){g||(I.classList.toggle("collapsed"),v.classList.toggle("hide"),o.querySelector("ul").classList.toggle("hide"))})),T&&(I.classList.add("collapsed"),v.classList.remove("hide"))):I.classList.add("empty"),I.appendChild(v),o.appendChild(I)}if(C.length&&!g){var x=C.length-1,R=e.createElement("ul");R.setAttribute("data-level",p.toString()),R.classList.add("type-"+(y?"array":"object")),C.forEach((function(o,w){var m=y?o:d[o],g=e.createElement("li");if("object"==typeof m){var T=-1,C=h+(h.length?".":"")+o;if(!m||m instanceof Date)g.appendChild(e.createTextNode(y?"":o+": ")),g.appendChild(a(m||null,!0));else{var v=Array.isArray(m),I=v?m.length:Object.keys(m).length;if(T=f.indexOf?f.indexOf(m):-1,C=h+(h.length?T>-1?"["+T+"]":"."+o:""+o),I){var L=("string"==typeof o?o+": ":"")+(v?"[":"{"),q=u(L),z=l(I);s>=0&&p+1>=s?g.appendChild(e.createTextNode(L)):(q.appendChild(z),g.appendChild(q)),r(g,m,s,c,p+1,C),g.appendChild(e.createTextNode(v?"]":"}"));var j=g.querySelector("ul"),b=function(){q.classList.toggle("collapsed"),z.classList.toggle("hide"),j.classList.toggle("hide")};q.addEventListener("click",b),c>=0&&p+1>=c&&b()}else g.appendChild(e.createTextNode(o+": "+(v?"[]":"{}")))}w1||0===e?"items":"item")}(t),n}function u(t){var n=e.createElement("a");return n.classList.add("list-link"),n.href="javascript:void(0)",n.innerHTML=t||"",n}return o.prototype.showJSON=function(e,t,n){var o="number"==typeof t?t:-1,i="number"==typeof n?n:-1;this._dom_container.innerHTML="",r(this._dom_container,e,o,i,0,"")},o.prototype.getContainer=function(){return this._dom_container},o}(document));n.appendChild(l.getContainer()),l.showJSON(i,null,1),console.log("[UI Extensibility] [extension] JSON data displayed");var u=document.createElement("div");u.className="x-panel-header-title-light-framed",u.setAttribute("style","margin: 40px 0 5px"),u.innerText="Dev Playground",n.appendChild(u);var s=document.createElement("form");s.autocomplete="off";var c=document.createElement("input");c.setAttribute("type","hidden"),c.setAttribute("autocomplete","false"),s.appendChild(c);var p=document.createElement("label");p.setAttribute("for","extension-notification-input"),p.setAttribute("autocomplete","false"),p.setAttribute("style","margin-bottom: 10px; font-weight: 700; display: inline-block; width: 120px;"),p.innerText="Notification text",s.appendChild(p);var h=document.createElement("input");h.setAttribute("id","extension-notification-input"),h.setAttribute("style","margin: 0 5px; border: 1px solid #9ba9b6; border-radius: 4px; padding: 5px 10px 4px; width: 475px;"),h.placeholder="Input notification text",s.appendChild(h),s.appendChild(document.createElement("br"));var w=document.createElement("label");w.setAttribute("for","extension-notification-select"),w.setAttribute("style","margin-bottom: 10px; font-weight: 700; display: inline-block; width: 120px;"),w.innerText="Notification type",s.appendChild(w);var g=document.createElement("select");g.setAttribute("id","extension-notification-select"),g.setAttribute("style","margin: 0 5px; border: 1px solid #9ba9b6; border-radius: 4px; padding: 5px 6px 4px; width: 475px;"),[["Information","info"],["Success","success"],["Warning","warning"],["Failure","fail"]].forEach((function(e){var t=document.createElement("option");t.textContent=e[0],t.value=e[1],g.appendChild(t)})),s.appendChild(g),s.appendChild(document.createElement("br"));var T=document.createElement("button");T.type="submit",T.innerText="Display notification",T.style="margin-top: 5px",T.className="x-btn x-btn-default-toolbar-medium",s.appendChild(T),s.addEventListener("submit",(function(t){var n=h.value,o=g.value;e.trados.showNotification(n,e.trados.contexts.projects,o),t.preventDefault()}));var y=document.createElement("div");y.style="white-space: pre; overflow: auto; margin-top: 10px; border: 1px solid #9ba9b6; border-radius: 4px; padding: 5px 10px 4px; width: 600px; height: 170px; ",s.appendChild(y);var C=function(){var e=h.value;y.innerText='trados.showNotification(\n "{text}",\n trados.contexts.projects,\n "{type}"\n});'.replace("{type}",g.value).replace("{text}",e)};h.addEventListener("input",(function(){C()})),g.addEventListener("change",(function(){C()})),C(),n.appendChild(s)}},payload:["project","selectedProjects"]}]},{elementId:"dashboardMain1Box",text:"Custom Panel 1",location:"project-details-dashboard-main",type:"panel",actions:[{eventType:"onrender",eventHandler:function(e){h(e,1)},payload:[]}]},{elementId:"dashboardMain2Box",text:"Custom Panel 2",location:"project-details-dashboard-main",type:"panel",actions:[{eventType:"onrender",eventHandler:function(e){h(e,2)},payload:[]}]},{elementId:"dashboardMain3Box",text:"Custom Panel 3",location:"project-details-dashboard-main",type:"panel",actions:[{eventType:"onrender",eventHandler:function(e){h(e,3)},payload:[]}]},{elementId:"dashboardSidebarBox",text:"Sidebar Box",location:"project-details-dashboard-sidebar",type:"sidebarBox",actions:[{eventType:"onrender",eventHandler:function(e){d(e);var t=document.getElementById(e.domElementId);if(t){t.innerHTML="";var n=document.createElement("div");n.innerHTML="Custom sidebar box content inserted on render.",t.appendChild(n)}},payload:[]}]},{elementId:"getLocalDashboardDataButton",icon:"x-fal fa-table",iconAlign:"right",text:"Get Local Data",location:"project-details-dashboard-toolbar",type:"button",actions:[{eventType:"onclick",eventHandler:function(t){d(t),e.trados.getLocalData(e.trados.contexts.projects,e.trados.dataSelectors.projectDashboard).then(c).catch((function(e){}))},payload:[]}]},{elementId:"increaseFontSizeButton",icon:"x-fal fa-font",iconAlign:"right",text:"Increase font size",location:"project-details-dashboard-toolbar",type:"button",actions:[{eventType:"onclick",eventHandler:function(e){d(e);for(var t=document.getElementsByTagName("table"),n=0;n")),n.appendChild(o)}},payload:["selectedTaskHistoryTask"]}]},{elementId:"highlightSelectedTaskButton",icon:"x-fal fa-folder-open",iconAlign:"right",text:"Highlight selected tasks",location:"project-details-task-history-toolbar",type:"button",actions:[{eventType:"onrender",eventHandler:function(t){d(t);var n=Boolean(t.selectedTaskHistoryTask);e.trados.updateElement("highlightSelectedTaskButton",{disabled:!n});for(var o=0,i=document.getElementsByClassName("x-grid-row");o times.");var o=e.task;console.log("[UI Extensibility] [extension] Task from event",o),t.appendChild(n),t.style.position="relative"}},payload:["task","taskActiveTab"]}]},{elementId:"taskSidebarBox",text:"Task Details Sidebar Box",location:"task-sidebar",type:"sidebarBox",actions:[{eventType:"onrender",eventHandler:function(e){d(e);var t=e.task;console.log("[UI Extensibility] [extension] Task data",t);var n=document.getElementById(e.domElementId);if(n){n.innerHTML="";var o=document.createElement("div");o.innerHTML="Custom sidebar box content inserted on render.
".concat(t?t.id:"No task id available."),n.appendChild(o)}},payload:[]}]},{elementId:"custom-btn-task-details-toolbar",icon:"x-fal fa-newspaper",text:"Custom task details toolbar button",location:"task-details-toolbar",type:"button",actions:[{eventType:"onrender",eventHandler:function(e){d(e);var t=document.getElementById(e.domElementId),n=e.task;t&&n&&console.log("RENDERED DETAILS TOOLBAR BUTTON")},payload:[]},{eventType:"onclick",eventHandler:function(e){d(e);var t=e.task;console.log("CLICKED DETAILS TOOLBAR BUTTON",t)},payload:["task","taskActiveTab"]}]},{elementId:"detailsMain1Box",text:"Custom Panel 1",location:"task-details-main",type:"panel",actions:[{eventType:"onrender",eventHandler:function(e){R(e,1)},payload:[]}]},{elementId:"detailsMain2Box",text:"Custom Panel 2",location:"task-details-main",type:"panel",actions:[{eventType:"onrender",eventHandler:function(e){R(e,2)},payload:[]}]},{elementId:"custom-btn-task-files-toolbar",icon:"x-fal fa-newspaper",text:"Custom button",location:"task-files-toolbar",type:"button",actions:[{eventType:"onrender",eventHandler:function(e){d(e);var t=document.getElementById(e.domElementId),n=e.task;t&&n&&console.log("RENDERED FILES TOOLBAR BUTTON")},payload:[]},{eventType:"onclick",eventHandler:function(e){d(e);var t=e.task,n=e.selectedFiles;console.log("CLICKED FILES TOOLBAR BUTTON",t,n)},payload:["task","taskActiveTab","selectedFiles"]}]}];e.trados.onReady(L,(function(){console.log("[UI Extensibility] [extension] Extension registered.")})),console.log("[UI Extensibility] [extension] Register request event published. External script loaded.")})()})(); \ No newline at end of file diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/dist/my-ui-extension-script.js b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/dist/my-ui-extension-script.js new file mode 100644 index 0000000..fa45f4e --- /dev/null +++ b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/dist/my-ui-extension-script.js @@ -0,0 +1 @@ +(()=>{var e={524:function(e){var n;n=()=>(()=>{"use strict";var e={d:(n,t)=>{for(var r in t)e.o(t,r)&&!e.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:t[r]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{AccountApi:()=>x,AddProjectsToGroupResponseStatusEnum:()=>Xn,AdditionalCostConditionalCostTypeEnum:()=>Bn,AdditionalCostCostOperatorEnum:()=>Qn,AdditionalCostCostVariableEnum:()=>Wn,AdditionalCostLanguageConditionalCostTypeEnum:()=>_n,AdditionalCostLanguageCostOperatorEnum:()=>Zn,AdditionalCostLanguageCostVariableEnum:()=>$n,AdditionalCostLanguageTypeEnum:()=>Hn,AdditionalCostLanguageVolumeUnitTypeEnum:()=>Kn,AdditionalCostTypeEnum:()=>Dn,AdditionalCostVolumeUnitTypeEnum:()=>Nn,AsynchronousResultStatusEnum:()=>Jn,ConfigurationResourceRequestStrategyEnum:()=>Yn,CustomFieldApi:()=>L,CustomFieldDefinitionResourceTypeEnum:()=>nt,CustomFieldDefinitionTypeEnum:()=>et,CustomerApi:()=>z,CustomerRagStatusEnum:()=>tt,CustomerUpdateRequestFolderVisibilityEnum:()=>it,CustomerUpdateRequestRagStatusEnum:()=>rt,DownloadQuoteReportFormatEnum:()=>de,ExportQuoteReportFormatEnum:()=>ce,ExportTargetFileVersionFormatEnum:()=>Ce,ExportTermbaseRequestFormatEnum:()=>ot,FileApi:()=>E,FileMetadataResponseUnzipStatusEnum:()=>at,FileProcessingConfigurationApi:()=>F,FileRole:()=>lt,FileUploadResponseUnzipStatusEnum:()=>ut,FileVersionExportStatusEnum:()=>st,FileVersionImportStatusEnum:()=>dt,FolderApi:()=>A,GroupApi:()=>G,ImportTermbaseDuplicateEntriesStrategyEnum:()=>Ue,LanguageApi:()=>X,LanguagePairResourceTypeEnum:()=>ct,LanguagePricePricingUnitEnum:()=>pt,LanguageProcessingApi:()=>B,ListCustomFieldsLocationStrategyEnum:()=>q,ListCustomersLocationStrategyEnum:()=>j,ListFieldTemplatesLocationStrategyEnum:()=>Be,ListFileProcessingConfigurationsLocationStrategyEnum:()=>k,ListGroupsLocationStrategyEnum:()=>V,ListLanguageProcessingRulesLocationStrategyEnum:()=>Q,ListLanguagesTypeEnum:()=>D,ListPricingModelsLocationStrategyEnum:()=>K,ListProjectGroupsLocationStrategyEnum:()=>te,ListProjectTasksLocationStrategyEnum:()=>$,ListProjectTemplatesLocationStrategyEnum:()=>oe,ListProjectsLocationStrategyEnum:()=>J,ListProjectsStatusEnum:()=>Y,ListScheduleTemplatesLocationStrategyEnum:()=>On,ListTaskTypesLocationStrategyEnum:()=>qe,ListTasksAssignedToMeLocationStrategyEnum:()=>xe,ListTermbaseLocationStrategyEnum:()=>je,ListTermbaseTemplatesTypeEnum:()=>Ge,ListTermbaseTermsSearchTypeEnum:()=>be,ListTqaProfilesLocationStrategyEnum:()=>fe,ListTranslationEnginesLocationStrategyEnum:()=>Xe,ListTranslationMemoriesLocationStrategyEnum:()=>Qe,ListUsersLocationStrategyEnum:()=>Je,ListWorkflowsLocationStrategyEnum:()=>nn,MachineTranslationApi:()=>Un,PollQuoteReportExport200ResponseStatusEnum:()=>ht,PollQuoteReportExportFormatEnum:()=>pe,PricingModelApi:()=>H,ProjectApi:()=>Z,ProjectGroupApi:()=>ne,ProjectGroupCreateResponseStatusEnum:()=>mt,ProjectGroupProjectStatusEnum:()=>ft,ProjectGroupStatusEnum:()=>gt,ProjectManagerRequestTypeEnum:()=>Tt,ProjectManagerResponseTypeEnum:()=>yt,ProjectPlanTaskAssigneeRequestTypeEnum:()=>Ct,ProjectStatusEnum:()=>wt,ProjectStatusHistoryFromEnum:()=>It,ProjectStatusHistoryToEnum:()=>Rt,ProjectTemplateApi:()=>ie,ProjectTemplateBatchTasksPreprocessingSettingsAfterApplyingTranslationsEnum:()=>vt,ProjectTemplateBatchTasksPreprocessingSettingsNoMatchFoundActionEnum:()=>Lt,ProjectTemplateBatchTasksPreprocessingSettingsTranslationOverwriteModeEnum:()=>xt,ProjectTemplateVerificationQaCheckerInconsistenciesCheckInconsistentTranslationsSeverityEnum:()=>qt,ProjectTemplateVerificationQaCheckerInconsistenciesCheckRepeatedWordsSeverityEnum:()=>St,ProjectTemplateVerificationQaCheckerInconsistenciesCheckUneditedSegmentsFuzzySeverityEnum:()=>zt,ProjectTemplateVerificationQaCheckerLengthVerificationCheckLengthLimitationSeverityEnum:()=>jt,ProjectTemplateVerificationQaCheckerLengthVerificationTargetSegmentsVerificationTypeEnum:()=>bt,ProjectTemplateVerificationQaCheckerNumbersCheckDatesSeverityEnum:()=>Ft,ProjectTemplateVerificationQaCheckerNumbersCheckMeasurementsSeverityEnum:()=>kt,ProjectTemplateVerificationQaCheckerNumbersCheckNumbersSeverityEnum:()=>Et,ProjectTemplateVerificationQaCheckerNumbersCheckTimesSeverityEnum:()=>Pt,ProjectTemplateVerificationQaCheckerPunctuationCheckBracketsSeverityEnum:()=>Nt,ProjectTemplateVerificationQaCheckerPunctuationCheckCapitalizationOfInitialsSeverityEnum:()=>Xt,ProjectTemplateVerificationQaCheckerPunctuationCheckConsistencyOfGlobalCapitalizationSeverityEnum:()=>Dt,ProjectTemplateVerificationQaCheckerPunctuationCheckExtraSpaceSeverityEnum:()=>Ot,ProjectTemplateVerificationQaCheckerPunctuationCheckIdenticalPunctuationSeverityEnum:()=>Ut,ProjectTemplateVerificationQaCheckerPunctuationCheckMultipleDotsSeverityEnum:()=>Vt,ProjectTemplateVerificationQaCheckerPunctuationCheckMultipleSpacesSeverityEnum:()=>Gt,ProjectTemplateVerificationQaCheckerPunctuationCheckSpanishPunctuationSeverityEnum:()=>At,ProjectTemplateVerificationQaCheckerPunctuationCheckUnintentionalSpacesBeforePunctuationSeverityEnum:()=>Mt,ProjectTemplateVerificationQaCheckerRegularExpressionsModelConditionEnum:()=>Qt,ProjectTemplateVerificationQaCheckerRegularExpressionsRegularExpressionSeverityEnum:()=>Bt,ProjectTemplateVerificationQaCheckerSegmentsToExcludeReportAllNonExcludedSeverityEnum:()=>Wt,ProjectTemplateVerificationQaCheckerSegmentsVerificationForbiddenCharsSeverityEnum:()=>Zt,ProjectTemplateVerificationQaCheckerSegmentsVerificationForgottenTranslationSeverityEnum:()=>Ht,ProjectTemplateVerificationQaCheckerSegmentsVerificationIgnoreSegmentsFewerThanBaseEnum:()=>_t,ProjectTemplateVerificationQaCheckerSegmentsVerificationSourceTargetIdenticalSeverityEnum:()=>Kt,ProjectTemplateVerificationQaCheckerTrademarkCheckTrademarkSeverityEnum:()=>$t,ProjectTemplateVerificationQaCheckerWordListCheckWordListSeverityEnum:()=>Jt,ProjectTemplateVerificationTagVerifierSettingsAddedTagsSeverityEnum:()=>Yt,ProjectTemplateVerificationTagVerifierSettingsDeletedTagsSeverityEnum:()=>er,ProjectTemplateVerificationTagVerifierSettingsSpaceAroundTagsSeverityEnum:()=>tr,ProjectTemplateVerificationTagVerifierSettingsTagOrderChangedSeverityEnum:()=>nr,PublicKeysApi:()=>le,QuoteAdditionalCostConditionalCostOperatorEnum:()=>ar,QuoteAdditionalCostConditionalCostTypeEnum:()=>or,QuoteAdditionalCostConditionalCostVariableEnum:()=>lr,QuoteAdditionalCostCostTypeEnum:()=>rr,QuoteAdditionalCostRequestConditionalCostOperatorEnum:()=>cr,QuoteAdditionalCostRequestConditionalCostTypeEnum:()=>dr,QuoteAdditionalCostRequestConditionalCostVariableEnum:()=>pr,QuoteAdditionalCostRequestCostTypeEnum:()=>ur,QuoteAdditionalCostRequestVolumeUnitTypeEnum:()=>sr,QuoteAdditionalCostVolumeUnitTypeEnum:()=>ir,QuoteApi:()=>se,QuoteLanguageCostConditionalCostOperatorEnum:()=>mr,QuoteLanguageCostConditionalCostTypeEnum:()=>gr,QuoteLanguageCostConditionalCostVariableEnum:()=>fr,QuoteLanguageCostCostTypeEnum:()=>hr,QuoteLanguageCostRequestConditionalCostOperatorEnum:()=>Ir,QuoteLanguageCostRequestConditionalCostTypeEnum:()=>Cr,QuoteLanguageCostRequestConditionalCostVariableEnum:()=>Rr,QuoteLanguageCostRequestCostTypeEnum:()=>Tr,QuoteLanguageCostRequestVolumeUnitTypeEnum:()=>yr,QuoteLanguageCostVolumeUnitTypeEnum:()=>wr,RateLimitsApi:()=>Mn,ScheduleTemplateApi:()=>Vn,ScheduleTemplateConfigurationSchedulesReminderEnum:()=>vr,ScheduleTemplateConfigurationSchedulesScopeEnum:()=>xr,ScheduleTemplateProjectConfigurationReminderEnum:()=>Lr,SourceFileApi:()=>we,SourceFileAttachmentRequestItemRoleEnum:()=>qr,SourceFileAttachmentRequestItemTypeEnum:()=>Sr,SourceFilePropertiesResponseFileRoleEnum:()=>zr,SourceFilePropertiesUpdateRequestFileRoleEnum:()=>jr,SourceFileRequestRoleEnum:()=>br,SourceFileRequestTypeEnum:()=>Er,SourceFileVersionPropertiesCreateRequestTypeEnum:()=>Fr,SourceFileVersionResponseTypeEnum:()=>kr,SourceFileVersionTypeEnum:()=>Pr,TQAProfileApi:()=>me,TargetFileApi:()=>ye,TargetFileLatestVersionTypeEnum:()=>Ar,TargetFileStatusEnum:()=>Ur,TargetFileVersionPropertiesCreateRequestTypeEnum:()=>Gr,TargetFileVersionResponseTypeEnum:()=>Vr,TargetFileVersionTypeEnum:()=>Mr,TaskApi:()=>Re,TaskAssigneeRequestTypeEnum:()=>Dr,TaskAssigneeTypeEnum:()=>Xr,TaskConfigurationScopeRequestTypeEnum:()=>Br,TaskConfigurationScopeTypeEnum:()=>Nr,TaskInputFileTypeEnum:()=>Wr,TaskInputTypeEnum:()=>Qr,TaskStatusEnum:()=>Or,TaskTypeApi:()=>Le,TaskTypeScopeEnum:()=>Hr,TermbaseApi:()=>ze,TermbaseExportApi:()=>Pe,TermbaseExportResponseStatusEnum:()=>_r,TermbaseFieldCreateRequestDataTypeEnum:()=>ei,TermbaseFieldCreateRequestLevelEnum:()=>Yr,TermbaseFieldDataTypeEnum:()=>Jr,TermbaseFieldLevelEnum:()=>$r,TermbaseFieldTypeEnum:()=>Zr,TermbaseFieldUpdateRequestDataTypeEnum:()=>ti,TermbaseFieldUpdateRequestLevelEnum:()=>ni,TermbaseFieldValueLinkCreateRequestTypeEnum:()=>ii,TermbaseFieldValueLinkTypeEnum:()=>ri,TermbaseFieldValueLinkUpdateRequestTypeEnum:()=>oi,TermbaseImportApi:()=>ke,TermbaseImportHistoryResponseStatusEnum:()=>ai,TermbaseImportResponseStatusEnum:()=>li,TermbasePollImportResponseStatusEnum:()=>ui,TermbaseStatusEnum:()=>Kr,TermbaseTemplateApi:()=>Me,TermbaseTemplateTypeEnum:()=>si,TranslationEngineApi:()=>Oe,TranslationMemoryApi:()=>Ne,TranslationMemoryExportApi:()=>He,TranslationMemoryExportResponseStatusEnum:()=>di,TranslationMemoryFieldTypeEnum:()=>ci,TranslationMemoryFieldUpdateType:()=>pi,TranslationMemoryImportApi:()=>_e,TranslationMemoryImportHistoryResponseStatusEnum:()=>hi,TranslationMemoryImportRequestOnlyImportSegmentsWithConfirmationLevelsEnum:()=>mi,TranslationMemoryImportRequestTargetSegmentsDifferOptionEnum:()=>wi,TranslationMemoryImportRequestUnknownFieldsOptionEnum:()=>gi,TranslationMemoryImportResponseStatusEnum:()=>fi,TranslationMemoryImportSettingsOnlyImportSegmentsWithConfirmationLevelsEnum:()=>Ti,TranslationMemoryImportSettingsTargetSegmentsDifferOptionEnum:()=>Ci,TranslationMemoryImportSettingsUnknownFieldsOptionEnum:()=>yi,UpdateTranslationMemorySettingsSegmentsConfirmationLevelsEnum:()=>Ii,UpdateTranslationMemorySettingsTargetSegmentsDifferOptionEnum:()=>Ri,UserApi:()=>$e,WorkflowApi:()=>en,WorkflowTaskAssigneeRequestTypeEnum:()=>vi,WorkflowTaskAssigneeTypeEnum:()=>xi,WorkflowTemplateTransitionConditionTypeEnum:()=>Li,WorkflowTemplateTransitionNodeTypeEnum:()=>qi,trados:()=>Si,tradosAccountApi:()=>rn,tradosCustomFieldApi:()=>on,tradosCustomerApi:()=>an,tradosFileApi:()=>ln,tradosFileProcessingConfigurationApi:()=>un,tradosFolderApi:()=>sn,tradosGroupApi:()=>dn,tradosLanguageApi:()=>cn,tradosLanguageProcessingApi:()=>pn,tradosPricingModelApi:()=>hn,tradosProjectApi:()=>wn,tradosProjectGroupApi:()=>gn,tradosProjectTemplateApi:()=>mn,tradosPublicKeysApi:()=>fn,tradosQuoteApi:()=>Tn,tradosSourceFileApi:()=>yn,tradosTargetFileApi:()=>In,tradosTaskApi:()=>Rn,tradosTaskTypeApi:()=>xn,tradosTermbaseApi:()=>vn,tradosTermbaseExportApi:()=>Ln,tradosTermbaseImportApi:()=>qn,tradosTermbaseTemplateApi:()=>Sn,tradosTqaProfileApi:()=>Cn,tradosTranslationEngineApi:()=>zn,tradosTranslationMemoryApi:()=>jn,tradosTranslationMemoryExportApi:()=>bn,tradosTranslationMemoryImportApi:()=>En,tradosUserApi:()=>Pn,tradosWorkflowApi:()=>Fn});const t={success:"success",fail:"fail",warning:"warning",info:"info"},r={load:"load",route:"route"};let i;function o(e,n){const t=new CustomEvent(e,{detail:n});window.dispatchEvent(t)}function a(){return i}var l=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};const u="https://lc-api.sdl.com/public-api/v1".replace(/\/+$/,"");class s{constructor(e={}){this.configuration=e}set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:u}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||m}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){const e=this.configuration.accessToken;if(e)return"function"==typeof e?e:()=>l(this,void 0,void 0,(function*(){return e}))}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const d=new s;class c{constructor(e=d){this.configuration=e,this.fetchApi=(e,n)=>l(this,void 0,void 0,(function*(){let t,r={url:e,init:n};for(const e of this.middleware)e.pre&&(r=(yield e.pre(Object.assign({fetch:this.fetchApi},r)))||r);try{t=yield(this.configuration.fetchApi||fetch)(r.url,r.init)}catch(e){for(const n of this.middleware)n.onError&&(t=(yield n.onError({fetch:this.fetchApi,url:r.url,init:r.init,error:e,response:t?t.clone():void 0}))||t);if(void 0===t)throw e instanceof Error?new h(e,"The request failed and the interceptors did not return an alternative response"):e}for(const e of this.middleware)e.post&&(t=(yield e.post({fetch:this.fetchApi,url:r.url,init:r.init,response:t.clone()}))||t);return t})),this.middleware=e.middleware}withMiddleware(...e){const n=this.clone();return n.middleware=n.middleware.concat(...e),n}withPreMiddleware(...e){const n=e.map((e=>({pre:e})));return this.withMiddleware(...n)}withPostMiddleware(...e){const n=e.map((e=>({post:e})));return this.withMiddleware(...n)}isJsonMime(e){return!!e&&c.jsonRegex.test(e)}request(e,n){return l(this,void 0,void 0,(function*(){const{url:t,init:r}=yield this.createFetchParams(e,n),i=yield this.fetchApi(t,r);if(i&&i.status>=200&&i.status<300)return i;throw new p(i,"Response returned an error code")}))}createFetchParams(e,n){return l(this,void 0,void 0,(function*(){let t=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(t+="?"+this.configuration.queryParamsStringify(e.query));const r=Object.assign({},this.configuration.headers,e.headers);Object.keys(r).forEach((e=>void 0===r[e]?delete r[e]:{}));const i="function"==typeof n?n:()=>l(this,void 0,void 0,(function*(){return n})),o={method:e.method,headers:r,body:e.body,credentials:this.configuration.credentials},a=Object.assign(Object.assign({},o),yield i({init:o,context:e}));let u;var s;return s=a.body,u="undefined"!=typeof FormData&&s instanceof FormData||a.body instanceof URLSearchParams||function(e){return"undefined"!=typeof Blob&&e instanceof Blob}(a.body)?a.body:this.isJsonMime(r["Content-Type"])?JSON.stringify(a.body):a.body,{url:t,init:Object.assign(Object.assign({},a),{body:u})}}))}clone(){const e=new(0,this.constructor)(this.configuration);return e.middleware=this.middleware.slice(),e}}c.jsonRegex=new RegExp("^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$","i");class p extends Error{constructor(e,n){super(n),this.response=e,this.name="ResponseError"}}class h extends Error{constructor(e,n){super(n),this.cause=e,this.name="FetchError"}}class w extends Error{constructor(e,n){super(n),this.field=e,this.name="RequiredError"}}const g=",";function m(e,n=""){return Object.keys(e).map((t=>f(t,e[t],n))).filter((e=>e.length>0)).join("&")}function f(e,n,t=""){const r=t+(t.length?`[${e}]`:e);if(n instanceof Array){const e=n.map((e=>encodeURIComponent(String(e)))).join(`&${encodeURIComponent(r)}=`);return`${encodeURIComponent(r)}=${e}`}return n instanceof Set?f(e,Array.from(n),t):n instanceof Date?`${encodeURIComponent(r)}=${encodeURIComponent(n.toISOString())}`:n instanceof Object?m(n,r):`${encodeURIComponent(r)}=${encodeURIComponent(String(n))}`}function T(e){for(const n of e)if("multipart/form-data"===n.contentType)return!0;return!1}class y{constructor(e,n=e=>e){this.raw=e,this.transformer=n}value(){return l(this,void 0,void 0,(function*(){return this.transformer(yield this.raw.json())}))}}class C{constructor(e){this.raw=e}value(){return l(this,void 0,void 0,(function*(){}))}}class I{constructor(e){this.raw=e}value(){return l(this,void 0,void 0,(function*(){return yield this.raw.blob()}))}}var R=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class x extends c{listMyAccountsRaw(e,n){return R(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listMyAccounts().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listMyAccounts().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/accounts",method:"GET",headers:t,query:{}},n);return new y(r)}))}listMyAccounts(e,n){return R(this,void 0,void 0,(function*(){const t=yield this.listMyAccountsRaw(e,n);return yield t.value()}))}}var v=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class L extends c{getCustomFieldRaw(e,n){return v(this,void 0,void 0,(function*(){if(null==e.customFieldDefinitionId)throw new w("customFieldDefinitionId",'Required parameter "customFieldDefinitionId" was null or undefined when calling getCustomField().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getCustomField().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getCustomField().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/custom-field-definitions/{customFieldDefinitionId}".replace("{customFieldDefinitionId}",encodeURIComponent(String(e.customFieldDefinitionId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getCustomField(e,n){return v(this,void 0,void 0,(function*(){const t=yield this.getCustomFieldRaw(e,n);return yield t.value()}))}listCustomFieldsRaw(e,n){return v(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listCustomFields().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listCustomFields().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.sort&&(t.sort=e.sort),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/custom-field-definitions",method:"GET",headers:r,query:t},n);return new y(i)}))}listCustomFields(e,n){return v(this,void 0,void 0,(function*(){const t=yield this.listCustomFieldsRaw(e,n);return yield t.value()}))}}const q={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"};var S=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class z extends c{createCustomerRaw(e,n){return S(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling createCustomer().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling createCustomer().');if(null==e.customerCreateRequest)throw new w("customerCreateRequest",'Required parameter "customerCreateRequest" was null or undefined when calling createCustomer().');const t={};null!=e.fields&&(t.fields=e.fields);const r={"Content-Type":"application/json"};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/customers",method:"POST",headers:r,query:t,body:e.customerCreateRequest},n);return new y(i)}))}createCustomer(e,n){return S(this,void 0,void 0,(function*(){const t=yield this.createCustomerRaw(e,n);return yield t.value()}))}deleteCustomerRaw(e,n){return S(this,void 0,void 0,(function*(){if(null==e.customerId)throw new w("customerId",'Required parameter "customerId" was null or undefined when calling deleteCustomer().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling deleteCustomer().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteCustomer().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/customers/{customerId}".replace("{customerId}",encodeURIComponent(String(e.customerId))),method:"DELETE",headers:t,query:{}},n);return new C(r)}))}deleteCustomer(e,n){return S(this,void 0,void 0,(function*(){yield this.deleteCustomerRaw(e,n)}))}getCustomerRaw(e,n){return S(this,void 0,void 0,(function*(){if(null==e.customerId)throw new w("customerId",'Required parameter "customerId" was null or undefined when calling getCustomer().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getCustomer().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getCustomer().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/customers/{customerId}".replace("{customerId}",encodeURIComponent(String(e.customerId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getCustomer(e,n){return S(this,void 0,void 0,(function*(){const t=yield this.getCustomerRaw(e,n);return yield t.value()}))}listCustomersRaw(e,n){return S(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listCustomers().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listCustomers().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.sort&&(t.sort=e.sort),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/customers",method:"GET",headers:r,query:t},n);return new y(i)}))}listCustomers(e,n){return S(this,void 0,void 0,(function*(){const t=yield this.listCustomersRaw(e,n);return yield t.value()}))}updateCustomerRaw(e,n){return S(this,void 0,void 0,(function*(){if(null==e.customerId)throw new w("customerId",'Required parameter "customerId" was null or undefined when calling updateCustomer().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling updateCustomer().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateCustomer().');if(null==e.customerUpdateRequest)throw new w("customerUpdateRequest",'Required parameter "customerUpdateRequest" was null or undefined when calling updateCustomer().');const t={"Content-Type":"application/json"};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/customers/{customerId}".replace("{customerId}",encodeURIComponent(String(e.customerId))),method:"PUT",headers:t,query:{},body:e.customerUpdateRequest},n);return new C(r)}))}updateCustomer(e,n){return S(this,void 0,void 0,(function*(){yield this.updateCustomerRaw(e,n)}))}}const j={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"};var b=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class E extends c{pollUploadZipFileRaw(e,n){return b(this,void 0,void 0,(function*(){if(null==e.fileId)throw new w("fileId",'Required parameter "fileId" was null or undefined when calling pollUploadZipFile().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling pollUploadZipFile().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling pollUploadZipFile().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/files/{fileId}".replace("{fileId}",encodeURIComponent(String(e.fileId))),method:"GET",headers:t,query:{}},n);return new y(r)}))}pollUploadZipFile(e,n){return b(this,void 0,void 0,(function*(){const t=yield this.pollUploadZipFileRaw(e,n);return yield t.value()}))}uploadZipFileRaw(e,n){return b(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling uploadZipFile().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling uploadZipFile().');if(null==e.file)throw new w("file",'Required parameter "file" was null or undefined when calling uploadZipFile().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));let r,i=!1;i=T([{contentType:"multipart/form-data"}]),r=i?new FormData:new URLSearchParams,null!=e.file&&r.append("file",e.file);const o=yield this.request({path:"/files",method:"POST",headers:t,query:{},body:r},n);return new y(o)}))}uploadZipFile(e,n){return b(this,void 0,void 0,(function*(){const t=yield this.uploadZipFileRaw(e,n);return yield t.value()}))}}var P=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class F extends c{getFileProcessingConfigurationRaw(e,n){return P(this,void 0,void 0,(function*(){if(null==e.fileProcessingConfigurationId)throw new w("fileProcessingConfigurationId",'Required parameter "fileProcessingConfigurationId" was null or undefined when calling getFileProcessingConfiguration().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getFileProcessingConfiguration().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getFileProcessingConfiguration().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/file-processing-configurations/{fileProcessingConfigurationId}".replace("{fileProcessingConfigurationId}",encodeURIComponent(String(e.fileProcessingConfigurationId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getFileProcessingConfiguration(e,n){return P(this,void 0,void 0,(function*(){const t=yield this.getFileProcessingConfigurationRaw(e,n);return yield t.value()}))}getFileTypeSettingRaw(e,n){return P(this,void 0,void 0,(function*(){if(null==e.fileProcessingConfigurationId)throw new w("fileProcessingConfigurationId",'Required parameter "fileProcessingConfigurationId" was null or undefined when calling getFileTypeSetting().');if(null==e.fileTypeSettingId)throw new w("fileTypeSettingId",'Required parameter "fileTypeSettingId" was null or undefined when calling getFileTypeSetting().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getFileTypeSetting().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getFileTypeSetting().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/file-processing-configurations/{fileProcessingConfigurationId}/file-type-settings/{fileTypeSettingId}".replace("{fileProcessingConfigurationId}",encodeURIComponent(String(e.fileProcessingConfigurationId))).replace("{fileTypeSettingId}",encodeURIComponent(String(e.fileTypeSettingId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getFileTypeSetting(e,n){return P(this,void 0,void 0,(function*(){const t=yield this.getFileTypeSettingRaw(e,n);return yield t.value()}))}listFileProcessingConfigurationsRaw(e,n){return P(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listFileProcessingConfigurations().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listFileProcessingConfigurations().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.sort&&(t.sort=e.sort),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/file-processing-configurations",method:"GET",headers:r,query:t},n);return new y(i)}))}listFileProcessingConfigurations(e,n){return P(this,void 0,void 0,(function*(){const t=yield this.listFileProcessingConfigurationsRaw(e,n);return yield t.value()}))}listFileTypeSettingsRaw(e,n){return P(this,void 0,void 0,(function*(){if(null==e.fileProcessingConfigurationId)throw new w("fileProcessingConfigurationId",'Required parameter "fileProcessingConfigurationId" was null or undefined when calling listFileTypeSettings().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listFileTypeSettings().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listFileTypeSettings().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/file-processing-configurations/{fileProcessingConfigurationId}/file-type-settings".replace("{fileProcessingConfigurationId}",encodeURIComponent(String(e.fileProcessingConfigurationId))),method:"GET",headers:r,query:t},n);return new y(i)}))}listFileTypeSettings(e,n){return P(this,void 0,void 0,(function*(){const t=yield this.listFileTypeSettingsRaw(e,n);return yield t.value()}))}}const k={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"};var U=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class A extends c{getFolderRaw(e,n){return U(this,void 0,void 0,(function*(){if(null==e.folderId)throw new w("folderId",'Required parameter "folderId" was null or undefined when calling getFolder().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getFolder().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getFolder().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/folders/{folderId}".replace("{folderId}",encodeURIComponent(String(e.folderId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getFolder(e,n){return U(this,void 0,void 0,(function*(){const t=yield this.getFolderRaw(e,n);return yield t.value()}))}getRootFolderRaw(e,n){return U(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getRootFolder().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getRootFolder().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/folders/root",method:"GET",headers:r,query:t},n);return new y(i)}))}getRootFolder(e,n){return U(this,void 0,void 0,(function*(){const t=yield this.getRootFolderRaw(e,n);return yield t.value()}))}listFoldersRaw(e,n){return U(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listFolders().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listFolders().');const t={};null!=e.name&&(t.name=e.name),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/folders",method:"GET",headers:r,query:t},n);return new y(i)}))}listFolders(e,n){return U(this,void 0,void 0,(function*(){const t=yield this.listFoldersRaw(e,n);return yield t.value()}))}}var M=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class G extends c{getGroupRaw(e,n){return M(this,void 0,void 0,(function*(){if(null==e.groupId)throw new w("groupId",'Required parameter "groupId" was null or undefined when calling getGroup().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getGroup().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getGroup().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/groups/{groupId}".replace("{groupId}",encodeURIComponent(String(e.groupId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getGroup(e,n){return M(this,void 0,void 0,(function*(){const t=yield this.getGroupRaw(e,n);return yield t.value()}))}listGroupsRaw(e,n){return M(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listGroups().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listGroups().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.sort&&(t.sort=e.sort),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/groups",method:"GET",headers:r,query:t},n);return new y(i)}))}listGroups(e,n){return M(this,void 0,void 0,(function*(){const t=yield this.listGroupsRaw(e,n);return yield t.value()}))}}const V={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"};var O=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class X extends c{listLanguagesRaw(e,n){return O(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listLanguages().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listLanguages().');const t={};null!=e.languageCodes&&(t.languageCodes=e.languageCodes.join(g)),null!=e.type&&(t.type=e.type),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/languages",method:"GET",headers:r,query:t},n);return new y(i)}))}listLanguages(e,n){return O(this,void 0,void 0,(function*(){const t=yield this.listLanguagesRaw(e,n);return yield t.value()}))}}const D={All:"all",Specific:"specific",Neutral:"neutral"};var N=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class B extends c{getLanguageProcessingRuleRaw(e,n){return N(this,void 0,void 0,(function*(){if(null==e.languageProcessingRuleId)throw new w("languageProcessingRuleId",'Required parameter "languageProcessingRuleId" was null or undefined when calling getLanguageProcessingRule().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getLanguageProcessingRule().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getLanguageProcessingRule().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/language-processing-rules/{languageProcessingRuleId}".replace("{languageProcessingRuleId}",encodeURIComponent(String(e.languageProcessingRuleId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getLanguageProcessingRule(e,n){return N(this,void 0,void 0,(function*(){const t=yield this.getLanguageProcessingRuleRaw(e,n);return yield t.value()}))}listLanguageProcessingRulesRaw(e,n){return N(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listLanguageProcessingRules().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listLanguageProcessingRules().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.sort&&(t.sort=e.sort),null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/language-processing-rules",method:"GET",headers:r,query:t},n);return new y(i)}))}listLanguageProcessingRules(e,n){return N(this,void 0,void 0,(function*(){const t=yield this.listLanguageProcessingRulesRaw(e,n);return yield t.value()}))}}const Q={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"};var W=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class H extends c{getPricingModelRaw(e,n){return W(this,void 0,void 0,(function*(){if(null==e.pricingModelId)throw new w("pricingModelId",'Required parameter "pricingModelId" was null or undefined when calling getPricingModel().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getPricingModel().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getPricingModel().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/pricing-models/{pricingModelId}".replace("{pricingModelId}",encodeURIComponent(String(e.pricingModelId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getPricingModel(e,n){return W(this,void 0,void 0,(function*(){const t=yield this.getPricingModelRaw(e,n);return yield t.value()}))}listPricingModelsRaw(e,n){return W(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listPricingModels().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listPricingModels().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.sort&&(t.sort=e.sort),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/pricing-models",method:"GET",headers:r,query:t},n);return new y(i)}))}listPricingModels(e,n){return W(this,void 0,void 0,(function*(){const t=yield this.listPricingModelsRaw(e,n);return yield t.value()}))}}const K={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"};var _=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class Z extends c{cancelProjectFileRaw(e,n){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling cancelProjectFile().');if(null==e.fileId)throw new w("fileId",'Required parameter "fileId" was null or undefined when calling cancelProjectFile().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling cancelProjectFile().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling cancelProjectFile().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/projects/{projectId}/files/{fileId}/cancel".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{fileId}",encodeURIComponent(String(e.fileId))),method:"PUT",headers:t,query:{}},n);return new C(r)}))}cancelProjectFile(e,n){return _(this,void 0,void 0,(function*(){yield this.cancelProjectFileRaw(e,n)}))}completeProjectRaw(e,n){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling completeProject().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling completeProject().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling completeProject().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/projects/{projectId}/complete".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"PUT",headers:t,query:{}},n);return new C(r)}))}completeProject(e,n){return _(this,void 0,void 0,(function*(){yield this.completeProjectRaw(e,n)}))}createProjectRaw(e,n){return _(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling createProject().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling createProject().');if(null==e.projectCreateRequest)throw new w("projectCreateRequest",'Required parameter "projectCreateRequest" was null or undefined when calling createProject().');const t={};null!=e.fields&&(t.fields=e.fields);const r={"Content-Type":"application/json"};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects",method:"POST",headers:r,query:t,body:e.projectCreateRequest},n);return new y(i)}))}createProject(e,n){return _(this,void 0,void 0,(function*(){const t=yield this.createProjectRaw(e,n);return yield t.value()}))}deleteProjectRaw(e,n){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling deleteProject().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling deleteProject().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteProject().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/projects/{projectId}".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"DELETE",headers:t,query:{}},n);return new C(r)}))}deleteProject(e,n){return _(this,void 0,void 0,(function*(){yield this.deleteProjectRaw(e,n)}))}getProjectRaw(e,n){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling getProject().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getProject().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getProject().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getProject(e,n){return _(this,void 0,void 0,(function*(){const t=yield this.getProjectRaw(e,n);return yield t.value()}))}getProjectConfigurationRaw(e,n){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling getProjectConfiguration().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getProjectConfiguration().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getProjectConfiguration().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/configuration".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getProjectConfiguration(e,n){return _(this,void 0,void 0,(function*(){const t=yield this.getProjectConfigurationRaw(e,n);return yield t.value()}))}listProjectTasksRaw(e,n){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling listProjectTasks().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listProjectTasks().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listProjectTasks().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.sort&&(t.sort=e.sort),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/tasks".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"GET",headers:r,query:t},n);return new y(i)}))}listProjectTasks(e,n){return _(this,void 0,void 0,(function*(){const t=yield this.listProjectTasksRaw(e,n);return yield t.value()}))}listProjectsRaw(e,n){return _(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listProjects().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listProjects().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.sort&&(t.sort=e.sort),null!=e.fields&&(t.fields=e.fields),null!=e.excludeOnline&&(t.excludeOnline=e.excludeOnline),null!=e.status&&(t.status=e.status),null!=e.createdFrom&&(t.createdFrom=e.createdFrom.toISOString()),null!=e.createdTo&&(t.createdTo=e.createdTo.toISOString()),null!=e.createdBy&&(t.createdBy=e.createdBy);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects",method:"GET",headers:r,query:t},n);return new y(i)}))}listProjects(e,n){return _(this,void 0,void 0,(function*(){const t=yield this.listProjectsRaw(e,n);return yield t.value()}))}startProjectRaw(e,n){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling startProject().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling startProject().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling startProject().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/projects/{projectId}/start".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"PUT",headers:t,query:{}},n);return new C(r)}))}startProject(e,n){return _(this,void 0,void 0,(function*(){yield this.startProjectRaw(e,n)}))}updateCustomFieldRaw(e,n){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling updateCustomField().');if(null==e.customFieldKey)throw new w("customFieldKey",'Required parameter "customFieldKey" was null or undefined when calling updateCustomField().');const t=yield this.request({path:"/projects/{projectId}/custom-fields/{customFieldKey}".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{customFieldKey}",encodeURIComponent(String(e.customFieldKey))),method:"PUT",headers:{"Content-Type":"application/json"},query:{},body:e.customFieldUpdateRequest},n);return new C(t)}))}updateCustomField(e,n){return _(this,void 0,void 0,(function*(){yield this.updateCustomFieldRaw(e,n)}))}updateProjectRaw(e,n){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling updateProject().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling updateProject().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateProject().');if(null==e.projectUpdateRequest)throw new w("projectUpdateRequest",'Required parameter "projectUpdateRequest" was null or undefined when calling updateProject().');const t={"Content-Type":"application/json"};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/projects/{projectId}".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"PUT",headers:t,query:{},body:e.projectUpdateRequest},n);return new C(r)}))}updateProject(e,n){return _(this,void 0,void 0,(function*(){yield this.updateProjectRaw(e,n)}))}updateProjectConfigurationRaw(e,n){return _(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling updateProjectConfiguration().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling updateProjectConfiguration().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateProjectConfiguration().');const t={"Content-Type":"application/json"};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/projects/{projectId}/configuration".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"PUT",headers:t,query:{},body:e.projectConfigurationRequest},n);return new C(r)}))}updateProjectConfiguration(e,n){return _(this,void 0,void 0,(function*(){yield this.updateProjectConfigurationRaw(e,n)}))}}const $={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"},J={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"},Y={Created:"created",InProgress:"inProgress",Completed:"completed",Archived:"archived"};var ee=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class ne extends c{addProjectsToGroupRaw(e,n){return ee(this,void 0,void 0,(function*(){if(null==e.projectGroupId)throw new w("projectGroupId",'Required parameter "projectGroupId" was null or undefined when calling addProjectsToGroup().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling addProjectsToGroup().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling addProjectsToGroup().');if(null==e.addProjectsToGroupRequest)throw new w("addProjectsToGroupRequest",'Required parameter "addProjectsToGroupRequest" was null or undefined when calling addProjectsToGroup().');const t={};null!=e.fields&&(t.fields=e.fields);const r={"Content-Type":"application/json"};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/project-groups/{projectGroupId}/projects".replace("{projectGroupId}",encodeURIComponent(String(e.projectGroupId))),method:"POST",headers:r,query:t,body:e.addProjectsToGroupRequest},n);return new y(i)}))}addProjectsToGroup(e,n){return ee(this,void 0,void 0,(function*(){const t=yield this.addProjectsToGroupRaw(e,n);return yield t.value()}))}createProjectGroupRaw(e,n){return ee(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling createProjectGroup().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling createProjectGroup().');if(null==e.projectGroupCreateRequest)throw new w("projectGroupCreateRequest",'Required parameter "projectGroupCreateRequest" was null or undefined when calling createProjectGroup().');const t={};null!=e.fields&&(t.fields=e.fields);const r={"Content-Type":"application/json"};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/project-groups",method:"POST",headers:r,query:t,body:e.projectGroupCreateRequest},n);return new y(i)}))}createProjectGroup(e,n){return ee(this,void 0,void 0,(function*(){const t=yield this.createProjectGroupRaw(e,n);return yield t.value()}))}deleteProjectGroupRaw(e,n){return ee(this,void 0,void 0,(function*(){if(null==e.projectGroupId)throw new w("projectGroupId",'Required parameter "projectGroupId" was null or undefined when calling deleteProjectGroup().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling deleteProjectGroup().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteProjectGroup().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/project-groups/{projectGroupId}".replace("{projectGroupId}",encodeURIComponent(String(e.projectGroupId))),method:"DELETE",headers:t,query:{}},n);return new C(r)}))}deleteProjectGroup(e,n){return ee(this,void 0,void 0,(function*(){yield this.deleteProjectGroupRaw(e,n)}))}getProjectGroupRaw(e,n){return ee(this,void 0,void 0,(function*(){if(null==e.projectGroupId)throw new w("projectGroupId",'Required parameter "projectGroupId" was null or undefined when calling getProjectGroup().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getProjectGroup().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getProjectGroup().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/project-groups/{projectGroupId}".replace("{projectGroupId}",encodeURIComponent(String(e.projectGroupId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getProjectGroup(e,n){return ee(this,void 0,void 0,(function*(){const t=yield this.getProjectGroupRaw(e,n);return yield t.value()}))}listProjectGroupsRaw(e,n){return ee(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listProjectGroups().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listProjectGroups().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/project-groups",method:"GET",headers:r,query:t},n);return new y(i)}))}listProjectGroups(e,n){return ee(this,void 0,void 0,(function*(){const t=yield this.listProjectGroupsRaw(e,n);return yield t.value()}))}removeProjectsFromGroupRaw(e,n){return ee(this,void 0,void 0,(function*(){if(null==e.projectGroupId)throw new w("projectGroupId",'Required parameter "projectGroupId" was null or undefined when calling removeProjectsFromGroup().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling removeProjectsFromGroup().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling removeProjectsFromGroup().');const t={"Content-Type":"application/json"};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/project-groups/{projectGroupId}/projects".replace("{projectGroupId}",encodeURIComponent(String(e.projectGroupId))),method:"DELETE",headers:t,query:{},body:e.removeProjectsFromGroupRequest},n);return new C(r)}))}removeProjectsFromGroup(e,n){return ee(this,void 0,void 0,(function*(){yield this.removeProjectsFromGroupRaw(e,n)}))}updateProjectGroupRaw(e,n){return ee(this,void 0,void 0,(function*(){if(null==e.projectGroupId)throw new w("projectGroupId",'Required parameter "projectGroupId" was null or undefined when calling updateProjectGroup().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling updateProjectGroup().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateProjectGroup().');if(null==e.projectGroupUpdateRequest)throw new w("projectGroupUpdateRequest",'Required parameter "projectGroupUpdateRequest" was null or undefined when calling updateProjectGroup().');const t={"Content-Type":"application/json"};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/project-groups/{projectGroupId}".replace("{projectGroupId}",encodeURIComponent(String(e.projectGroupId))),method:"PUT",headers:t,query:{},body:e.projectGroupUpdateRequest},n);return new C(r)}))}updateProjectGroup(e,n){return ee(this,void 0,void 0,(function*(){yield this.updateProjectGroupRaw(e,n)}))}}const te={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"};var re=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class ie extends c{createProjectTemplateRaw(e,n){return re(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling createProjectTemplate().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling createProjectTemplate().');if(null==e.projectTemplateCreateRequest)throw new w("projectTemplateCreateRequest",'Required parameter "projectTemplateCreateRequest" was null or undefined when calling createProjectTemplate().');const t={};null!=e.fields&&(t.fields=e.fields);const r={"Content-Type":"application/json"};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/project-templates",method:"POST",headers:r,query:t,body:e.projectTemplateCreateRequest},n);return new y(i)}))}createProjectTemplate(e,n){return re(this,void 0,void 0,(function*(){const t=yield this.createProjectTemplateRaw(e,n);return yield t.value()}))}deleteProjectTemplateRaw(e,n){return re(this,void 0,void 0,(function*(){if(null==e.projectTemplateId)throw new w("projectTemplateId",'Required parameter "projectTemplateId" was null or undefined when calling deleteProjectTemplate().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling deleteProjectTemplate().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteProjectTemplate().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/project-templates/{projectTemplateId}".replace("{projectTemplateId}",encodeURIComponent(String(e.projectTemplateId))),method:"DELETE",headers:t,query:{}},n);return new C(r)}))}deleteProjectTemplate(e,n){return re(this,void 0,void 0,(function*(){yield this.deleteProjectTemplateRaw(e,n)}))}getProjectTemplateRaw(e,n){return re(this,void 0,void 0,(function*(){if(null==e.projectTemplateId)throw new w("projectTemplateId",'Required parameter "projectTemplateId" was null or undefined when calling getProjectTemplate().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getProjectTemplate().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getProjectTemplate().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/project-templates/{projectTemplateId}".replace("{projectTemplateId}",encodeURIComponent(String(e.projectTemplateId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getProjectTemplate(e,n){return re(this,void 0,void 0,(function*(){const t=yield this.getProjectTemplateRaw(e,n);return yield t.value()}))}listProjectTemplatesRaw(e,n){return re(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listProjectTemplates().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listProjectTemplates().');const t={};null!=e.name&&(t.name=e.name),null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.sort&&(t.sort=e.sort),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/project-templates",method:"GET",headers:r,query:t},n);return new y(i)}))}listProjectTemplates(e,n){return re(this,void 0,void 0,(function*(){const t=yield this.listProjectTemplatesRaw(e,n);return yield t.value()}))}updateProjectTemplateRaw(e,n){return re(this,void 0,void 0,(function*(){if(null==e.projectTemplateId)throw new w("projectTemplateId",'Required parameter "projectTemplateId" was null or undefined when calling updateProjectTemplate().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling updateProjectTemplate().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateProjectTemplate().');if(null==e.projectTemplateUpdateRequest)throw new w("projectTemplateUpdateRequest",'Required parameter "projectTemplateUpdateRequest" was null or undefined when calling updateProjectTemplate().');const t={"Content-Type":"application/json"};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/project-templates/{projectTemplateId}".replace("{projectTemplateId}",encodeURIComponent(String(e.projectTemplateId))),method:"PUT",headers:t,query:{},body:e.projectTemplateUpdateRequest},n);return new C(r)}))}updateProjectTemplate(e,n){return re(this,void 0,void 0,(function*(){yield this.updateProjectTemplateRaw(e,n)}))}}const oe={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"};var ae=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class le extends c{getPublicKeyRaw(e,n){return ae(this,void 0,void 0,(function*(){if(null==e.kid)throw new w("kid",'Required parameter "kid" was null or undefined when calling getPublicKey().');const t=yield this.request({path:"/.well-known/jwks.json/{kid}".replace("{kid}",encodeURIComponent(String(e.kid))),method:"GET",headers:{},query:{}},n);return new y(t)}))}getPublicKey(e,n){return ae(this,void 0,void 0,(function*(){const t=yield this.getPublicKeyRaw(e,n);return yield t.value()}))}listPublicKeysRaw(e){return ae(this,void 0,void 0,(function*(){const n=yield this.request({path:"/.well-known/jwks.json",method:"GET",headers:{},query:{}},e);return new y(n)}))}listPublicKeys(e){return ae(this,void 0,void 0,(function*(){const n=yield this.listPublicKeysRaw(e);return yield n.value()}))}}var ue=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class se extends c{downloadQuoteReportRaw(e,n){return ue(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling downloadQuoteReport().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling downloadQuoteReport().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling downloadQuoteReport().');const t={};null!=e.format&&(t.format=e.format),null!=e.exportId&&(t.exportId=e.exportId);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/quote-report/download".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"GET",headers:r,query:t},n);return new I(i)}))}downloadQuoteReport(e,n){return ue(this,void 0,void 0,(function*(){const t=yield this.downloadQuoteReportRaw(e,n);return yield t.value()}))}exportQuoteReportRaw(e,n){return ue(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling exportQuoteReport().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling exportQuoteReport().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling exportQuoteReport().');const t={};null!=e.format&&(t.format=e.format),null!=e.languageId&&(t.languageId=e.languageId);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/quote-report/export".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"POST",headers:r,query:t},n);return new y(i)}))}exportQuoteReport(e,n){return ue(this,void 0,void 0,(function*(){const t=yield this.exportQuoteReportRaw(e,n);return yield t.value()}))}pollQuoteReportExportRaw(e,n){return ue(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling pollQuoteReportExport().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling pollQuoteReportExport().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling pollQuoteReportExport().');const t={};null!=e.format&&(t.format=e.format),null!=e.exportId&&(t.exportId=e.exportId);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/quote-report/export".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"GET",headers:r,query:t},n);return new y(i)}))}pollQuoteReportExport(e,n){return ue(this,void 0,void 0,(function*(){const t=yield this.pollQuoteReportExportRaw(e,n);return yield t.value()}))}}const de={Pdf:"pdf",Excel:"excel"},ce={Pdf:"pdf",Excel:"excel"},pe={Pdf:"pdf",Excel:"excel"};var he=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class we extends c{addSourceFileRaw(e,n){return he(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling addSourceFile().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling addSourceFile().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling addSourceFile().');if(null==e.properties)throw new w("properties",'Required parameter "properties" was null or undefined when calling addSourceFile().');if(null==e.file)throw new w("file",'Required parameter "file" was null or undefined when calling addSourceFile().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));let r,i=!1;i=T([{contentType:"multipart/form-data"}]),r=i?new FormData:new URLSearchParams,null!=e.properties&&r.append("properties",new Blob([JSON.stringify(e.properties)],{type:"application/json"})),null!=e.file&&r.append("file",e.file);const o=yield this.request({path:"/projects/{projectId}/source-files".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"POST",headers:t,query:{},body:r},n);return new y(o)}))}addSourceFile(e,n){return he(this,void 0,void 0,(function*(){const t=yield this.addSourceFileRaw(e,n);return yield t.value()}))}addSourceFileVersionRaw(e,n){return he(this,void 0,void 0,(function*(){if(null==e.sourceFileId)throw new w("sourceFileId",'Required parameter "sourceFileId" was null or undefined when calling addSourceFileVersion().');if(null==e.taskId)throw new w("taskId",'Required parameter "taskId" was null or undefined when calling addSourceFileVersion().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling addSourceFileVersion().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling addSourceFileVersion().');if(null==e.properties)throw new w("properties",'Required parameter "properties" was null or undefined when calling addSourceFileVersion().');if(null==e.file)throw new w("file",'Required parameter "file" was null or undefined when calling addSourceFileVersion().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));let i,o=!1;o=T([{contentType:"multipart/form-data"}]),i=o?new FormData:new URLSearchParams,null!=e.properties&&i.append("properties",new Blob([JSON.stringify(e.properties)],{type:"application/json"})),null!=e.file&&i.append("file",e.file);const a=yield this.request({path:"/tasks/{taskId}/source-files/{sourceFileId}/versions".replace("{sourceFileId}",encodeURIComponent(String(e.sourceFileId))).replace("{taskId}",encodeURIComponent(String(e.taskId))),method:"POST",headers:r,query:t,body:i},n);return new y(a)}))}addSourceFileVersion(e,n){return he(this,void 0,void 0,(function*(){const t=yield this.addSourceFileVersionRaw(e,n);return yield t.value()}))}addSourceFilesRaw(e,n){return he(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling addSourceFiles().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling addSourceFiles().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling addSourceFiles().');if(null==e.sourceFileAttachmentRequest)throw new w("sourceFileAttachmentRequest",'Required parameter "sourceFileAttachmentRequest" was null or undefined when calling addSourceFiles().');const t={};null!=e.fields&&(t.fields=e.fields);const r={"Content-Type":"application/json"};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/source-files/attach-files".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"POST",headers:r,query:t,body:e.sourceFileAttachmentRequest},n);return new y(i)}))}addSourceFiles(e,n){return he(this,void 0,void 0,(function*(){const t=yield this.addSourceFilesRaw(e,n);return yield t.value()}))}downloadSourceFileVersionRaw(e,n){return he(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling downloadSourceFileVersion().');if(null==e.sourceFileId)throw new w("sourceFileId",'Required parameter "sourceFileId" was null or undefined when calling downloadSourceFileVersion().');if(null==e.fileVersionId)throw new w("fileVersionId",'Required parameter "fileVersionId" was null or undefined when calling downloadSourceFileVersion().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling downloadSourceFileVersion().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling downloadSourceFileVersion().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/projects/{projectId}/source-files/{sourceFileId}/versions/{fileVersionId}/download".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{sourceFileId}",encodeURIComponent(String(e.sourceFileId))).replace("{fileVersionId}",encodeURIComponent(String(e.fileVersionId))),method:"GET",headers:t,query:{}},n);return new I(r)}))}downloadSourceFileVersion(e,n){return he(this,void 0,void 0,(function*(){const t=yield this.downloadSourceFileVersionRaw(e,n);return yield t.value()}))}getSourceFileRaw(e,n){return he(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling getSourceFile().');if(null==e.sourceFileId)throw new w("sourceFileId",'Required parameter "sourceFileId" was null or undefined when calling getSourceFile().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getSourceFile().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getSourceFile().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/source-files/{sourceFileId}".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{sourceFileId}",encodeURIComponent(String(e.sourceFileId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getSourceFile(e,n){return he(this,void 0,void 0,(function*(){const t=yield this.getSourceFileRaw(e,n);return yield t.value()}))}getSourceFilePropertiesRaw(e,n){return he(this,void 0,void 0,(function*(){if(null==e.taskId)throw new w("taskId",'Required parameter "taskId" was null or undefined when calling getSourceFileProperties().');if(null==e.sourceFileId)throw new w("sourceFileId",'Required parameter "sourceFileId" was null or undefined when calling getSourceFileProperties().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getSourceFileProperties().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getSourceFileProperties().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/tasks/{taskId}/source-files/{sourceFileId}".replace("{taskId}",encodeURIComponent(String(e.taskId))).replace("{sourceFileId}",encodeURIComponent(String(e.sourceFileId))),method:"GET",headers:t,query:{}},n);return new y(r)}))}getSourceFileProperties(e,n){return he(this,void 0,void 0,(function*(){const t=yield this.getSourceFilePropertiesRaw(e,n);return yield t.value()}))}listSourceFileVersionsRaw(e,n){return he(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling listSourceFileVersions().');if(null==e.sourceFileId)throw new w("sourceFileId",'Required parameter "sourceFileId" was null or undefined when calling listSourceFileVersions().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listSourceFileVersions().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listSourceFileVersions().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/source-files/{sourceFileId}/versions".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{sourceFileId}",encodeURIComponent(String(e.sourceFileId))),method:"GET",headers:r,query:t},n);return new y(i)}))}listSourceFileVersions(e,n){return he(this,void 0,void 0,(function*(){const t=yield this.listSourceFileVersionsRaw(e,n);return yield t.value()}))}listSourceFilesRaw(e,n){return he(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling listSourceFiles().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listSourceFiles().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listSourceFiles().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.sort&&(t.sort=e.sort),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/source-files".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"GET",headers:r,query:t},n);return new y(i)}))}listSourceFiles(e,n){return he(this,void 0,void 0,(function*(){const t=yield this.listSourceFilesRaw(e,n);return yield t.value()}))}updateSourceFileRaw(e,n){return he(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling updateSourceFile().');if(null==e.sourceFileId)throw new w("sourceFileId",'Required parameter "sourceFileId" was null or undefined when calling updateSourceFile().');const t=yield this.request({path:"/projects/{projectId}/source-files/{sourceFileId}".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{sourceFileId}",encodeURIComponent(String(e.sourceFileId))),method:"PUT",headers:{"Content-Type":"application/json"},query:{},body:e.sourceFileRenameRequest},n);return new C(t)}))}updateSourceFile(e,n){return he(this,void 0,void 0,(function*(){yield this.updateSourceFileRaw(e,n)}))}updateSourceFilesRaw(e,n){return he(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling updateSourceFiles().');const t=yield this.request({path:"/projects/{projectId}/source-files".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"PUT",headers:{"Content-Type":"application/json"},query:{},body:e.sourceFilesUpdateRequest},n);return new C(t)}))}updateSourceFiles(e,n){return he(this,void 0,void 0,(function*(){yield this.updateSourceFilesRaw(e,n)}))}updateSourcePropertiesRaw(e,n){return he(this,void 0,void 0,(function*(){if(null==e.taskId)throw new w("taskId",'Required parameter "taskId" was null or undefined when calling updateSourceProperties().');if(null==e.sourceFileId)throw new w("sourceFileId",'Required parameter "sourceFileId" was null or undefined when calling updateSourceProperties().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling updateSourceProperties().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateSourceProperties().');const t={"Content-Type":"application/json"};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/tasks/{taskId}/source-files/{sourceFileId}".replace("{taskId}",encodeURIComponent(String(e.taskId))).replace("{sourceFileId}",encodeURIComponent(String(e.sourceFileId))),method:"PUT",headers:t,query:{},body:e.sourceFilePropertiesUpdateRequest},n);return new C(r)}))}updateSourceProperties(e,n){return he(this,void 0,void 0,(function*(){yield this.updateSourcePropertiesRaw(e,n)}))}}var ge=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class me extends c{getTqaProfileRaw(e,n){return ge(this,void 0,void 0,(function*(){if(null==e.profileId)throw new w("profileId",'Required parameter "profileId" was null or undefined when calling getTqaProfile().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getTqaProfile().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTqaProfile().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/tqa-profiles/{profileId}".replace("{profileId}",encodeURIComponent(String(e.profileId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getTqaProfile(e,n){return ge(this,void 0,void 0,(function*(){const t=yield this.getTqaProfileRaw(e,n);return yield t.value()}))}listTqaProfilesRaw(e,n){return ge(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listTqaProfiles().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTqaProfiles().');const t={};null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.sort&&(t.sort=e.sort),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/tqa-profiles",method:"GET",headers:r,query:t},n);return new y(i)}))}listTqaProfiles(e,n){return ge(this,void 0,void 0,(function*(){const t=yield this.listTqaProfilesRaw(e,n);return yield t.value()}))}}const fe={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"};var Te=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class ye extends c{addTargetFileVersionRaw(e,n){return Te(this,void 0,void 0,(function*(){if(null==e.taskId)throw new w("taskId",'Required parameter "taskId" was null or undefined when calling addTargetFileVersion().');if(null==e.targetFileId)throw new w("targetFileId",'Required parameter "targetFileId" was null or undefined when calling addTargetFileVersion().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling addTargetFileVersion().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling addTargetFileVersion().');if(null==e.properties)throw new w("properties",'Required parameter "properties" was null or undefined when calling addTargetFileVersion().');if(null==e.file)throw new w("file",'Required parameter "file" was null or undefined when calling addTargetFileVersion().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));let i,o=!1;o=T([{contentType:"multipart/form-data"}]),i=o?new FormData:new URLSearchParams,null!=e.properties&&i.append("properties",new Blob([JSON.stringify(e.properties)],{type:"application/json"})),null!=e.file&&i.append("file",e.file);const a=yield this.request({path:"/tasks/{taskId}/target-files/{targetFileId}/versions".replace("{taskId}",encodeURIComponent(String(e.taskId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))),method:"POST",headers:r,query:t,body:i},n);return new y(a)}))}addTargetFileVersion(e,n){return Te(this,void 0,void 0,(function*(){const t=yield this.addTargetFileVersionRaw(e,n);return yield t.value()}))}downloadExportedTargetFileVersionRaw(e,n){return Te(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling downloadExportedTargetFileVersion().');if(null==e.targetFileId)throw new w("targetFileId",'Required parameter "targetFileId" was null or undefined when calling downloadExportedTargetFileVersion().');if(null==e.fileVersionId)throw new w("fileVersionId",'Required parameter "fileVersionId" was null or undefined when calling downloadExportedTargetFileVersion().');if(null==e.exportId)throw new w("exportId",'Required parameter "exportId" was null or undefined when calling downloadExportedTargetFileVersion().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling downloadExportedTargetFileVersion().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling downloadExportedTargetFileVersion().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}/versions/{fileVersionId}/exports/{exportId}/download".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))).replace("{fileVersionId}",encodeURIComponent(String(e.fileVersionId))).replace("{exportId}",encodeURIComponent(String(e.exportId))),method:"GET",headers:t,query:{}},n);return new I(r)}))}downloadExportedTargetFileVersion(e,n){return Te(this,void 0,void 0,(function*(){const t=yield this.downloadExportedTargetFileVersionRaw(e,n);return yield t.value()}))}downloadFileVersionRaw(e,n){return Te(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling downloadFileVersion().');if(null==e.targetFileId)throw new w("targetFileId",'Required parameter "targetFileId" was null or undefined when calling downloadFileVersion().');if(null==e.fileVersionId)throw new w("fileVersionId",'Required parameter "fileVersionId" was null or undefined when calling downloadFileVersion().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling downloadFileVersion().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling downloadFileVersion().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}/versions/{fileVersionId}/download".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))).replace("{fileVersionId}",encodeURIComponent(String(e.fileVersionId))),method:"GET",headers:t,query:{}},n);return new I(r)}))}downloadFileVersion(e,n){return Te(this,void 0,void 0,(function*(){const t=yield this.downloadFileVersionRaw(e,n);return yield t.value()}))}exportTargetFileVersionRaw(e,n){return Te(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling exportTargetFileVersion().');if(null==e.targetFileId)throw new w("targetFileId",'Required parameter "targetFileId" was null or undefined when calling exportTargetFileVersion().');if(null==e.fileVersionId)throw new w("fileVersionId",'Required parameter "fileVersionId" was null or undefined when calling exportTargetFileVersion().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling exportTargetFileVersion().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling exportTargetFileVersion().');const t={};null!=e.format&&(t.format=e.format);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}/versions/{fileVersionId}/exports".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))).replace("{fileVersionId}",encodeURIComponent(String(e.fileVersionId))),method:"POST",headers:r,query:t},n);return new y(i)}))}exportTargetFileVersion(e,n){return Te(this,void 0,void 0,(function*(){const t=yield this.exportTargetFileVersionRaw(e,n);return yield t.value()}))}getTargetFileRaw(e,n){return Te(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling getTargetFile().');if(null==e.targetFileId)throw new w("targetFileId",'Required parameter "targetFileId" was null or undefined when calling getTargetFile().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getTargetFile().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTargetFile().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getTargetFile(e,n){return Te(this,void 0,void 0,(function*(){const t=yield this.getTargetFileRaw(e,n);return yield t.value()}))}getTargetFileVersionRaw(e,n){return Te(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling getTargetFileVersion().');if(null==e.targetFileId)throw new w("targetFileId",'Required parameter "targetFileId" was null or undefined when calling getTargetFileVersion().');if(null==e.fileVersionId)throw new w("fileVersionId",'Required parameter "fileVersionId" was null or undefined when calling getTargetFileVersion().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getTargetFileVersion().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTargetFileVersion().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}/versions/{fileVersionId}".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))).replace("{fileVersionId}",encodeURIComponent(String(e.fileVersionId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getTargetFileVersion(e,n){return Te(this,void 0,void 0,(function*(){const t=yield this.getTargetFileVersionRaw(e,n);return yield t.value()}))}importTargetFileVersionRaw(e,n){return Te(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling importTargetFileVersion().');if(null==e.targetFileId)throw new w("targetFileId",'Required parameter "targetFileId" was null or undefined when calling importTargetFileVersion().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling importTargetFileVersion().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling importTargetFileVersion().');if(null==e.file)throw new w("file",'Required parameter "file" was null or undefined when calling importTargetFileVersion().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));let r,i=!1;i=T([{contentType:"multipart/form-data"}]),r=i?new FormData:new URLSearchParams,null!=e.file&&r.append("file",e.file);const o=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}/versions/imports".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))),method:"POST",headers:t,query:{},body:r},n);return new y(o)}))}importTargetFileVersion(e,n){return Te(this,void 0,void 0,(function*(){const t=yield this.importTargetFileVersionRaw(e,n);return yield t.value()}))}listTargetFileVersionsRaw(e,n){return Te(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling listTargetFileVersions().');if(null==e.targetFileId)throw new w("targetFileId",'Required parameter "targetFileId" was null or undefined when calling listTargetFileVersions().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listTargetFileVersions().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTargetFileVersions().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}/versions".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))),method:"GET",headers:r,query:t},n);return new y(i)}))}listTargetFileVersions(e,n){return Te(this,void 0,void 0,(function*(){const t=yield this.listTargetFileVersionsRaw(e,n);return yield t.value()}))}listTargetFilesRaw(e,n){return Te(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling listTargetFiles().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listTargetFiles().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTargetFiles().');const t={};null!=e.targetFileIds&&(t.targetFileIds=e.targetFileIds.join(g)),null!=e.sourceFileIds&&(t.sourceFileIds=e.sourceFileIds.join(g)),null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/projects/{projectId}/target-files".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"GET",headers:r,query:t},n);return new y(i)}))}listTargetFiles(e,n){return Te(this,void 0,void 0,(function*(){const t=yield this.listTargetFilesRaw(e,n);return yield t.value()}))}pollTargetFileVersionExportRaw(e,n){return Te(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling pollTargetFileVersionExport().');if(null==e.targetFileId)throw new w("targetFileId",'Required parameter "targetFileId" was null or undefined when calling pollTargetFileVersionExport().');if(null==e.fileVersionId)throw new w("fileVersionId",'Required parameter "fileVersionId" was null or undefined when calling pollTargetFileVersionExport().');if(null==e.exportId)throw new w("exportId",'Required parameter "exportId" was null or undefined when calling pollTargetFileVersionExport().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling pollTargetFileVersionExport().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling pollTargetFileVersionExport().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}/versions/{fileVersionId}/exports/{exportId}".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))).replace("{fileVersionId}",encodeURIComponent(String(e.fileVersionId))).replace("{exportId}",encodeURIComponent(String(e.exportId))),method:"GET",headers:t,query:{}},n);return new y(r)}))}pollTargetFileVersionExport(e,n){return Te(this,void 0,void 0,(function*(){const t=yield this.pollTargetFileVersionExportRaw(e,n);return yield t.value()}))}pollTargetFileVersionImportRaw(e,n){return Te(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling pollTargetFileVersionImport().');if(null==e.targetFileId)throw new w("targetFileId",'Required parameter "targetFileId" was null or undefined when calling pollTargetFileVersionImport().');if(null==e.importId)throw new w("importId",'Required parameter "importId" was null or undefined when calling pollTargetFileVersionImport().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling pollTargetFileVersionImport().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling pollTargetFileVersionImport().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}/versions/imports/{importId}".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))).replace("{importId}",encodeURIComponent(String(e.importId))),method:"GET",headers:t,query:{}},n);return new y(r)}))}pollTargetFileVersionImport(e,n){return Te(this,void 0,void 0,(function*(){const t=yield this.pollTargetFileVersionImportRaw(e,n);return yield t.value()}))}updateTargetFileRaw(e,n){return Te(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling updateTargetFile().');if(null==e.targetFileId)throw new w("targetFileId",'Required parameter "targetFileId" was null or undefined when calling updateTargetFile().');const t=yield this.request({path:"/projects/{projectId}/target-files/{targetFileId}".replace("{projectId}",encodeURIComponent(String(e.projectId))).replace("{targetFileId}",encodeURIComponent(String(e.targetFileId))),method:"PUT",headers:{"Content-Type":"application/json"},query:{},body:e.targetFileRenameRequest},n);return new C(t)}))}updateTargetFile(e,n){return Te(this,void 0,void 0,(function*(){yield this.updateTargetFileRaw(e,n)}))}updateTargetFilesRaw(e,n){return Te(this,void 0,void 0,(function*(){if(null==e.projectId)throw new w("projectId",'Required parameter "projectId" was null or undefined when calling updateTargetFiles().');const t=yield this.request({path:"/projects/{projectId}/target-files".replace("{projectId}",encodeURIComponent(String(e.projectId))),method:"PUT",headers:{"Content-Type":"application/json"},query:{},body:e.targetFilesUpdateRequest},n);return new C(t)}))}updateTargetFiles(e,n){return Te(this,void 0,void 0,(function*(){yield this.updateTargetFilesRaw(e,n)}))}}const Ce={Native:"native",Sdlxliff:"sdlxliff"};var Ie=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class Re extends c{acceptTaskRaw(e,n){return Ie(this,void 0,void 0,(function*(){if(null==e.taskId)throw new w("taskId",'Required parameter "taskId" was null or undefined when calling acceptTask().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling acceptTask().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling acceptTask().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/tasks/{taskId}/accept".replace("{taskId}",encodeURIComponent(String(e.taskId))),method:"PUT",headers:t,query:{}},n);return new C(r)}))}acceptTask(e,n){return Ie(this,void 0,void 0,(function*(){yield this.acceptTaskRaw(e,n)}))}assignTaskRaw(e,n){return Ie(this,void 0,void 0,(function*(){if(null==e.taskId)throw new w("taskId",'Required parameter "taskId" was null or undefined when calling assignTask().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling assignTask().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling assignTask().');if(null==e.taskAssignRequest)throw new w("taskAssignRequest",'Required parameter "taskAssignRequest" was null or undefined when calling assignTask().');const t={"Content-Type":"application/json"};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/tasks/{taskId}/assign".replace("{taskId}",encodeURIComponent(String(e.taskId))),method:"PUT",headers:t,query:{},body:e.taskAssignRequest},n);return new C(r)}))}assignTask(e,n){return Ie(this,void 0,void 0,(function*(){yield this.assignTaskRaw(e,n)}))}completeTaskRaw(e,n){return Ie(this,void 0,void 0,(function*(){if(null==e.taskId)throw new w("taskId",'Required parameter "taskId" was null or undefined when calling completeTask().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling completeTask().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling completeTask().');if(null==e.taskCompleteRequest)throw new w("taskCompleteRequest",'Required parameter "taskCompleteRequest" was null or undefined when calling completeTask().');const t={"Content-Type":"application/json"};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/tasks/{taskId}/complete".replace("{taskId}",encodeURIComponent(String(e.taskId))),method:"PUT",headers:t,query:{},body:e.taskCompleteRequest},n);return new C(r)}))}completeTask(e,n){return Ie(this,void 0,void 0,(function*(){yield this.completeTaskRaw(e,n)}))}getTaskRaw(e,n){return Ie(this,void 0,void 0,(function*(){if(null==e.taskId)throw new w("taskId",'Required parameter "taskId" was null or undefined when calling getTask().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getTask().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTask().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/tasks/{taskId}".replace("{taskId}",encodeURIComponent(String(e.taskId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getTask(e,n){return Ie(this,void 0,void 0,(function*(){const t=yield this.getTaskRaw(e,n);return yield t.value()}))}listTasksAssignedToMeRaw(e,n){return Ie(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listTasksAssignedToMe().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTasksAssignedToMe().');const t={};null!=e.status&&(t.status=e.status),null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.sort&&(t.sort=e.sort),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/tasks/assigned",method:"GET",headers:r,query:t},n);return new y(i)}))}listTasksAssignedToMe(e,n){return Ie(this,void 0,void 0,(function*(){const t=yield this.listTasksAssignedToMeRaw(e,n);return yield t.value()}))}reclaimTaskRaw(e,n){return Ie(this,void 0,void 0,(function*(){if(null==e.taskId)throw new w("taskId",'Required parameter "taskId" was null or undefined when calling reclaimTask().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling reclaimTask().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling reclaimTask().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/tasks/{taskId}/reclaim".replace("{taskId}",encodeURIComponent(String(e.taskId))),method:"PUT",headers:t,query:{}},n);return new C(r)}))}reclaimTask(e,n){return Ie(this,void 0,void 0,(function*(){yield this.reclaimTaskRaw(e,n)}))}rejectTaskRaw(e,n){return Ie(this,void 0,void 0,(function*(){if(null==e.taskId)throw new w("taskId",'Required parameter "taskId" was null or undefined when calling rejectTask().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling rejectTask().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling rejectTask().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/tasks/{taskId}/reject".replace("{taskId}",encodeURIComponent(String(e.taskId))),method:"PUT",headers:t,query:{}},n);return new C(r)}))}rejectTask(e,n){return Ie(this,void 0,void 0,(function*(){yield this.rejectTaskRaw(e,n)}))}releaseTaskRaw(e,n){return Ie(this,void 0,void 0,(function*(){if(null==e.taskId)throw new w("taskId",'Required parameter "taskId" was null or undefined when calling releaseTask().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling releaseTask().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling releaseTask().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/tasks/{taskId}/release".replace("{taskId}",encodeURIComponent(String(e.taskId))),method:"PUT",headers:t,query:{}},n);return new C(r)}))}releaseTask(e,n){return Ie(this,void 0,void 0,(function*(){yield this.releaseTaskRaw(e,n)}))}}const xe={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"};var ve=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class Le extends c{getTaskTypeRaw(e,n){return ve(this,void 0,void 0,(function*(){if(null==e.taskTypeId)throw new w("taskTypeId",'Required parameter "taskTypeId" was null or undefined when calling getTaskType().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getTaskType().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTaskType().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/task-types/{taskTypeId}".replace("{taskTypeId}",encodeURIComponent(String(e.taskTypeId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getTaskType(e,n){return ve(this,void 0,void 0,(function*(){const t=yield this.getTaskTypeRaw(e,n);return yield t.value()}))}listTaskTypesRaw(e,n){return ve(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listTaskTypes().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTaskTypes().');const t={};null!=e.key&&(t.key=e.key.join(g)),null!=e.automatic&&(t.automatic=e.automatic),null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.sort&&(t.sort=e.sort),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/task-types",method:"GET",headers:r,query:t},n);return new y(i)}))}listTaskTypes(e,n){return ve(this,void 0,void 0,(function*(){const t=yield this.listTaskTypesRaw(e,n);return yield t.value()}))}}const qe={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"};var Se=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class ze extends c{createTermbaseRaw(e,n){return Se(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling createTermbase().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling createTermbase().');const t={};null!=e.fields&&(t.fields=e.fields);const r={"Content-Type":"application/json"};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbases",method:"POST",headers:r,query:t,body:e.termbaseCreateRequest},n);return new y(i)}))}createTermbase(e,n){return Se(this,void 0,void 0,(function*(){const t=yield this.createTermbaseRaw(e,n);return yield t.value()}))}createTermbaseEntryRaw(e,n){return Se(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new w("termbaseId",'Required parameter "termbaseId" was null or undefined when calling createTermbaseEntry().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling createTermbaseEntry().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling createTermbaseEntry().');const t={};null!=e.fields&&(t.fields=e.fields);const r={"Content-Type":"application/json"};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbases/{termbaseId}/entries".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"POST",headers:r,query:t,body:e.termbaseEntryCreateRequest},n);return new y(i)}))}createTermbaseEntry(e,n){return Se(this,void 0,void 0,(function*(){const t=yield this.createTermbaseEntryRaw(e,n);return yield t.value()}))}deleteTermbaseRaw(e,n){return Se(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new w("termbaseId",'Required parameter "termbaseId" was null or undefined when calling deleteTermbase().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling deleteTermbase().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteTermbase().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/termbases/{termbaseId}".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"DELETE",headers:t,query:{}},n);return new C(r)}))}deleteTermbase(e,n){return Se(this,void 0,void 0,(function*(){yield this.deleteTermbaseRaw(e,n)}))}deleteTermbaseEntriesRaw(e,n){return Se(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new w("termbaseId",'Required parameter "termbaseId" was null or undefined when calling deleteTermbaseEntries().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling deleteTermbaseEntries().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteTermbaseEntries().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/termbases/{termbaseId}/entries".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"DELETE",headers:t,query:{}},n);return new C(r)}))}deleteTermbaseEntries(e,n){return Se(this,void 0,void 0,(function*(){yield this.deleteTermbaseEntriesRaw(e,n)}))}deleteTermbaseEntryRaw(e,n){return Se(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new w("termbaseId",'Required parameter "termbaseId" was null or undefined when calling deleteTermbaseEntry().');if(null==e.entryId)throw new w("entryId",'Required parameter "entryId" was null or undefined when calling deleteTermbaseEntry().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling deleteTermbaseEntry().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteTermbaseEntry().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/termbases/{termbaseId}/entries/{entryId}".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))).replace("{entryId}",encodeURIComponent(String(e.entryId))),method:"DELETE",headers:t,query:{}},n);return new C(r)}))}deleteTermbaseEntry(e,n){return Se(this,void 0,void 0,(function*(){yield this.deleteTermbaseEntryRaw(e,n)}))}getTermbaseRaw(e,n){return Se(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new w("termbaseId",'Required parameter "termbaseId" was null or undefined when calling getTermbase().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getTermbase().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTermbase().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbases/{termbaseId}".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getTermbase(e,n){return Se(this,void 0,void 0,(function*(){const t=yield this.getTermbaseRaw(e,n);return yield t.value()}))}getTermbaseEntryRaw(e,n){return Se(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new w("termbaseId",'Required parameter "termbaseId" was null or undefined when calling getTermbaseEntry().');if(null==e.entryId)throw new w("entryId",'Required parameter "entryId" was null or undefined when calling getTermbaseEntry().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getTermbaseEntry().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTermbaseEntry().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbases/{termbaseId}/entries/{entryId}".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))).replace("{entryId}",encodeURIComponent(String(e.entryId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getTermbaseEntry(e,n){return Se(this,void 0,void 0,(function*(){const t=yield this.getTermbaseEntryRaw(e,n);return yield t.value()}))}listTermbaseRaw(e,n){return Se(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listTermbase().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTermbase().');const t={};null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.fields&&(t.fields=e.fields),null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbases",method:"GET",headers:r,query:t},n);return new y(i)}))}listTermbase(e,n){return Se(this,void 0,void 0,(function*(){const t=yield this.listTermbaseRaw(e,n);return yield t.value()}))}listTermbaseEntriesRaw(e,n){return Se(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new w("termbaseId",'Required parameter "termbaseId" was null or undefined when calling listTermbaseEntries().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listTermbaseEntries().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTermbaseEntries().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.fields&&(t.fields=e.fields),null!=e.humanReadableIds&&(t.humanReadableIds=e.humanReadableIds);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbases/{termbaseId}/entries".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"GET",headers:r,query:t},n);return new y(i)}))}listTermbaseEntries(e,n){return Se(this,void 0,void 0,(function*(){const t=yield this.listTermbaseEntriesRaw(e,n);return yield t.value()}))}listTermbaseTermsRaw(e,n){return Se(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new w("termbaseId",'Required parameter "termbaseId" was null or undefined when calling listTermbaseTerms().');if(null==e.sourceLanguageCode)throw new w("sourceLanguageCode",'Required parameter "sourceLanguageCode" was null or undefined when calling listTermbaseTerms().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listTermbaseTerms().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTermbaseTerms().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.search&&(t.search=e.search),null!=e.searchType&&(t.searchType=e.searchType),null!=e.targetLanguageCode&&(t.targetLanguageCode=e.targetLanguageCode);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbases/{termbaseId}/terms/{sourceLanguageCode}".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))).replace("{sourceLanguageCode}",encodeURIComponent(String(e.sourceLanguageCode))),method:"GET",headers:r,query:t},n);return new y(i)}))}listTermbaseTerms(e,n){return Se(this,void 0,void 0,(function*(){const t=yield this.listTermbaseTermsRaw(e,n);return yield t.value()}))}updateTermbaseRaw(e,n){return Se(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new w("termbaseId",'Required parameter "termbaseId" was null or undefined when calling updateTermbase().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling updateTermbase().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateTermbase().');const t={"Content-Type":"application/json"};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/termbases/{termbaseId}".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"PUT",headers:t,query:{},body:e.termbaseUpdateRequest},n);return new C(r)}))}updateTermbase(e,n){return Se(this,void 0,void 0,(function*(){yield this.updateTermbaseRaw(e,n)}))}updateTermbaseEntryRaw(e,n){return Se(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new w("termbaseId",'Required parameter "termbaseId" was null or undefined when calling updateTermbaseEntry().');if(null==e.entryId)throw new w("entryId",'Required parameter "entryId" was null or undefined when calling updateTermbaseEntry().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling updateTermbaseEntry().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateTermbaseEntry().');const t={"Content-Type":"application/json"};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/termbases/{termbaseId}/entries/{entryId}".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))).replace("{entryId}",encodeURIComponent(String(e.entryId))),method:"PUT",headers:t,query:{},body:e.termbaseEntryUpdateRequest},n);return new C(r)}))}updateTermbaseEntry(e,n){return Se(this,void 0,void 0,(function*(){yield this.updateTermbaseEntryRaw(e,n)}))}}const je={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"},be={Normal:"normal",Linguistic:"linguistic",Fuzzy:"fuzzy"};var Ee=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class Pe extends c{downloadExportedTermbaseRaw(e,n){return Ee(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new w("termbaseId",'Required parameter "termbaseId" was null or undefined when calling downloadExportedTermbase().');if(null==e.exportId)throw new w("exportId",'Required parameter "exportId" was null or undefined when calling downloadExportedTermbase().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling downloadExportedTermbase().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling downloadExportedTermbase().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/termbases/{termbaseId}/exports/{exportId}/download".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))).replace("{exportId}",encodeURIComponent(String(e.exportId))),method:"GET",headers:t,query:{}},n);return new I(r)}))}downloadExportedTermbase(e,n){return Ee(this,void 0,void 0,(function*(){const t=yield this.downloadExportedTermbaseRaw(e,n);return yield t.value()}))}downloadTermbaseDefinitionRaw(e,n){return Ee(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new w("termbaseId",'Required parameter "termbaseId" was null or undefined when calling downloadTermbaseDefinition().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling downloadTermbaseDefinition().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling downloadTermbaseDefinition().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/termbases/{termbaseId}/export-template".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"GET",headers:t,query:{}},n);return new I(r)}))}downloadTermbaseDefinition(e,n){return Ee(this,void 0,void 0,(function*(){const t=yield this.downloadTermbaseDefinitionRaw(e,n);return yield t.value()}))}exportTermbaseRaw(e,n){return Ee(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new w("termbaseId",'Required parameter "termbaseId" was null or undefined when calling exportTermbase().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling exportTermbase().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling exportTermbase().');const t={"Content-Type":"application/json"};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/termbases/{termbaseId}/exports".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"POST",headers:t,query:{},body:e.exportTermbaseRequest},n);return new y(r)}))}exportTermbase(e,n){return Ee(this,void 0,void 0,(function*(){const t=yield this.exportTermbaseRaw(e,n);return yield t.value()}))}pollExportTermbaseRaw(e,n){return Ee(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new w("termbaseId",'Required parameter "termbaseId" was null or undefined when calling pollExportTermbase().');if(null==e.exportId)throw new w("exportId",'Required parameter "exportId" was null or undefined when calling pollExportTermbase().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling pollExportTermbase().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling pollExportTermbase().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/termbases/{termbaseId}/exports/{exportId}".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))).replace("{exportId}",encodeURIComponent(String(e.exportId))),method:"GET",headers:t,query:{}},n);return new y(r)}))}pollExportTermbase(e,n){return Ee(this,void 0,void 0,(function*(){const t=yield this.pollExportTermbaseRaw(e,n);return yield t.value()}))}}var Fe=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class ke extends c{downloadTermbaseImportLogRaw(e,n){return Fe(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new w("termbaseId",'Required parameter "termbaseId" was null or undefined when calling downloadTermbaseImportLog().');if(null==e.importId)throw new w("importId",'Required parameter "importId" was null or undefined when calling downloadTermbaseImportLog().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling downloadTermbaseImportLog().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling downloadTermbaseImportLog().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/termbases/{termbaseId}/imports/{importId}/logs".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))).replace("{importId}",encodeURIComponent(String(e.importId))),method:"GET",headers:t,query:{}},n);return new I(r)}))}downloadTermbaseImportLog(e,n){return Fe(this,void 0,void 0,(function*(){const t=yield this.downloadTermbaseImportLogRaw(e,n);return yield t.value()}))}getImportHistoryRaw(e,n){return Fe(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new w("termbaseId",'Required parameter "termbaseId" was null or undefined when calling getImportHistory().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getImportHistory().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getImportHistory().');const t={};null!=e.fields&&(t.fields=e.fields),null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbases/{termbaseId}/imports".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getImportHistory(e,n){return Fe(this,void 0,void 0,(function*(){const t=yield this.getImportHistoryRaw(e,n);return yield t.value()}))}importTermbaseRaw(e,n){return Fe(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new w("termbaseId",'Required parameter "termbaseId" was null or undefined when calling importTermbase().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling importTermbase().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling importTermbase().');if(null==e.file)throw new w("file",'Required parameter "file" was null or undefined when calling importTermbase().');const t={};null!=e.strictImport&&(t.strictImport=e.strictImport),null!=e.duplicateEntriesStrategy&&(t.duplicateEntriesStrategy=e.duplicateEntriesStrategy);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));let i,o=!1;o=T([{contentType:"multipart/form-data"}]),i=o?new FormData:new URLSearchParams,null!=e.file&&i.append("file",e.file);const a=yield this.request({path:"/termbases/{termbaseId}/imports".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))),method:"POST",headers:r,query:t,body:i},n);return new y(a)}))}importTermbase(e,n){return Fe(this,void 0,void 0,(function*(){const t=yield this.importTermbaseRaw(e,n);return yield t.value()}))}pollTermbaseImportRaw(e,n){return Fe(this,void 0,void 0,(function*(){if(null==e.termbaseId)throw new w("termbaseId",'Required parameter "termbaseId" was null or undefined when calling pollTermbaseImport().');if(null==e.importId)throw new w("importId",'Required parameter "importId" was null or undefined when calling pollTermbaseImport().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling pollTermbaseImport().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling pollTermbaseImport().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/termbases/{termbaseId}/imports/{importId}".replace("{termbaseId}",encodeURIComponent(String(e.termbaseId))).replace("{importId}",encodeURIComponent(String(e.importId))),method:"GET",headers:t,query:{}},n);return new y(r)}))}pollTermbaseImport(e,n){return Fe(this,void 0,void 0,(function*(){const t=yield this.pollTermbaseImportRaw(e,n);return yield t.value()}))}}const Ue={Ignore:"ignore",Merge:"merge",Overwrite:"overwrite"};var Ae=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class Me extends c{convertTermbaseTemplateRaw(e,n){return Ae(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling convertTermbaseTemplate().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling convertTermbaseTemplate().');if(null==e.file)throw new w("file",'Required parameter "file" was null or undefined when calling convertTermbaseTemplate().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));let i,o=!1;o=T([{contentType:"multipart/form-data"}]),i=o?new FormData:new URLSearchParams,null!=e.file&&i.append("file",e.file);const a=yield this.request({path:"/termbase-templates/convert-xdt",method:"POST",headers:r,query:t,body:i},n);return new y(a)}))}convertTermbaseTemplate(e,n){return Ae(this,void 0,void 0,(function*(){const t=yield this.convertTermbaseTemplateRaw(e,n);return yield t.value()}))}createTermbaseTemplateRaw(e,n){return Ae(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling createTermbaseTemplate().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling createTermbaseTemplate().');const t={};null!=e.fields&&(t.fields=e.fields);const r={"Content-Type":"application/json"};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbase-templates",method:"POST",headers:r,query:t,body:e.termbaseTemplateCreateRequest},n);return new y(i)}))}createTermbaseTemplate(e,n){return Ae(this,void 0,void 0,(function*(){const t=yield this.createTermbaseTemplateRaw(e,n);return yield t.value()}))}deleteTermbaseTemplateRaw(e,n){return Ae(this,void 0,void 0,(function*(){if(null==e.termbaseTemplateId)throw new w("termbaseTemplateId",'Required parameter "termbaseTemplateId" was null or undefined when calling deleteTermbaseTemplate().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling deleteTermbaseTemplate().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteTermbaseTemplate().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/termbase-templates/{termbaseTemplateId}".replace("{termbaseTemplateId}",encodeURIComponent(String(e.termbaseTemplateId))),method:"DELETE",headers:t,query:{}},n);return new C(r)}))}deleteTermbaseTemplate(e,n){return Ae(this,void 0,void 0,(function*(){yield this.deleteTermbaseTemplateRaw(e,n)}))}getTermbaseTemplateRaw(e,n){return Ae(this,void 0,void 0,(function*(){if(null==e.termbaseTemplateId)throw new w("termbaseTemplateId",'Required parameter "termbaseTemplateId" was null or undefined when calling getTermbaseTemplate().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getTermbaseTemplate().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTermbaseTemplate().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbase-templates/{termbaseTemplateId}".replace("{termbaseTemplateId}",encodeURIComponent(String(e.termbaseTemplateId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getTermbaseTemplate(e,n){return Ae(this,void 0,void 0,(function*(){const t=yield this.getTermbaseTemplateRaw(e,n);return yield t.value()}))}listTermbaseTemplatesRaw(e,n){return Ae(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listTermbaseTemplates().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTermbaseTemplates().');const t={};null!=e.location&&(t.location=e.location),null!=e.fields&&(t.fields=e.fields),null!=e.type&&(t.type=e.type),null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/termbase-templates",method:"GET",headers:r,query:t},n);return new y(i)}))}listTermbaseTemplates(e,n){return Ae(this,void 0,void 0,(function*(){const t=yield this.listTermbaseTemplatesRaw(e,n);return yield t.value()}))}updateTermbaseTemplateRaw(e,n){return Ae(this,void 0,void 0,(function*(){if(null==e.termbaseTemplateId)throw new w("termbaseTemplateId",'Required parameter "termbaseTemplateId" was null or undefined when calling updateTermbaseTemplate().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling updateTermbaseTemplate().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateTermbaseTemplate().');const t={"Content-Type":"application/json"};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/termbase-templates/{termbaseTemplateId}".replace("{termbaseTemplateId}",encodeURIComponent(String(e.termbaseTemplateId))),method:"PUT",headers:t,query:{},body:e.termbaseTemplateUpdateRequest},n);return new C(r)}))}updateTermbaseTemplate(e,n){return Ae(this,void 0,void 0,(function*(){yield this.updateTermbaseTemplateRaw(e,n)}))}}const Ge={System:"system",UserDefined:"userDefined"};var Ve=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class Oe extends c{getTranslationEngineRaw(e,n){return Ve(this,void 0,void 0,(function*(){if(null==e.translationEngineId)throw new w("translationEngineId",'Required parameter "translationEngineId" was null or undefined when calling getTranslationEngine().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getTranslationEngine().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTranslationEngine().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/translation-engines/{translationEngineId}".replace("{translationEngineId}",encodeURIComponent(String(e.translationEngineId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getTranslationEngine(e,n){return Ve(this,void 0,void 0,(function*(){const t=yield this.getTranslationEngineRaw(e,n);return yield t.value()}))}listTranslationEnginesRaw(e,n){return Ve(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listTranslationEngines().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTranslationEngines().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.sort&&(t.sort=e.sort),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/translation-engines",method:"GET",headers:r,query:t},n);return new y(i)}))}listTranslationEngines(e,n){return Ve(this,void 0,void 0,(function*(){const t=yield this.listTranslationEnginesRaw(e,n);return yield t.value()}))}updateTranslationEngineRaw(e,n){return Ve(this,void 0,void 0,(function*(){if(null==e.translationEngineId)throw new w("translationEngineId",'Required parameter "translationEngineId" was null or undefined when calling updateTranslationEngine().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling updateTranslationEngine().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateTranslationEngine().');const t={"Content-Type":"application/json"};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/translation-engines/{translationEngineId}".replace("{translationEngineId}",encodeURIComponent(String(e.translationEngineId))),method:"PUT",headers:t,query:{},body:e.translationEngineUpdateRequest},n);return new C(r)}))}updateTranslationEngine(e,n){return Ve(this,void 0,void 0,(function*(){yield this.updateTranslationEngineRaw(e,n)}))}}const Xe={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"};var De=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class Ne extends c{copyTranslationMemoryRaw(e,n){return De(this,void 0,void 0,(function*(){if(null==e.translationMemoryId)throw new w("translationMemoryId",'Required parameter "translationMemoryId" was null or undefined when calling copyTranslationMemory().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling copyTranslationMemory().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling copyTranslationMemory().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant)),null!=e.authorization&&(r.Authorization=String(e.authorization));const i=yield this.request({path:"/translation-memory/{translationMemoryId}/copy".replace("{translationMemoryId}",encodeURIComponent(String(e.translationMemoryId))),method:"POST",headers:r,query:t},n);return new y(i)}))}copyTranslationMemory(e,n){return De(this,void 0,void 0,(function*(){const t=yield this.copyTranslationMemoryRaw(e,n);return yield t.value()}))}createTranslationMemoryRaw(e,n){return De(this,void 0,void 0,(function*(){if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling createTranslationMemory().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling createTranslationMemory().');const t={};null!=e.fields&&(t.fields=e.fields);const r={"Content-Type":"application/json"};null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant)),null!=e.authorization&&(r.Authorization=String(e.authorization));const i=yield this.request({path:"/translation-memory",method:"POST",headers:r,query:t,body:e.translationMemoryCreateRequest},n);return new y(i)}))}createTranslationMemory(e,n){return De(this,void 0,void 0,(function*(){const t=yield this.createTranslationMemoryRaw(e,n);return yield t.value()}))}deleteTranslationMemoryRaw(e,n){return De(this,void 0,void 0,(function*(){if(null==e.translationMemoryId)throw new w("translationMemoryId",'Required parameter "translationMemoryId" was null or undefined when calling deleteTranslationMemory().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteTranslationMemory().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling deleteTranslationMemory().');const t={};null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant)),null!=e.authorization&&(t.Authorization=String(e.authorization));const r=yield this.request({path:"/translation-memory/{translationMemoryId}".replace("{translationMemoryId}",encodeURIComponent(String(e.translationMemoryId))),method:"DELETE",headers:t,query:{}},n);return new C(r)}))}deleteTranslationMemory(e,n){return De(this,void 0,void 0,(function*(){yield this.deleteTranslationMemoryRaw(e,n)}))}getFieldTemplateRaw(e,n){return De(this,void 0,void 0,(function*(){if(null==e.fieldTemplateId)throw new w("fieldTemplateId",'Required parameter "fieldTemplateId" was null or undefined when calling getFieldTemplate().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getFieldTemplate().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getFieldTemplate().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/translation-memory/field-templates/{fieldTemplateId}".replace("{fieldTemplateId}",encodeURIComponent(String(e.fieldTemplateId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getFieldTemplate(e,n){return De(this,void 0,void 0,(function*(){const t=yield this.getFieldTemplateRaw(e,n);return yield t.value()}))}getTranslationMemoryRaw(e,n){return De(this,void 0,void 0,(function*(){if(null==e.translationMemoryId)throw new w("translationMemoryId",'Required parameter "translationMemoryId" was null or undefined when calling getTranslationMemory().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTranslationMemory().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getTranslationMemory().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant)),null!=e.authorization&&(r.Authorization=String(e.authorization));const i=yield this.request({path:"/translation-memory/{translationMemoryId}".replace("{translationMemoryId}",encodeURIComponent(String(e.translationMemoryId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getTranslationMemory(e,n){return De(this,void 0,void 0,(function*(){const t=yield this.getTranslationMemoryRaw(e,n);return yield t.value()}))}listFieldTemplatesRaw(e,n){return De(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listFieldTemplates().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listFieldTemplates().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.sort&&(t.sort=e.sort),null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/translation-memory/field-templates",method:"GET",headers:r,query:t},n);return new y(i)}))}listFieldTemplates(e,n){return De(this,void 0,void 0,(function*(){const t=yield this.listFieldTemplatesRaw(e,n);return yield t.value()}))}listTranslationMemoriesRaw(e,n){return De(this,void 0,void 0,(function*(){if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listTranslationMemories().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listTranslationMemories().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.sort&&(t.sort=e.sort),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant)),null!=e.authorization&&(r.Authorization=String(e.authorization));const i=yield this.request({path:"/translation-memory",method:"GET",headers:r,query:t},n);return new y(i)}))}listTranslationMemories(e,n){return De(this,void 0,void 0,(function*(){const t=yield this.listTranslationMemoriesRaw(e,n);return yield t.value()}))}updateTranslationMemoryRaw(e,n){return De(this,void 0,void 0,(function*(){if(null==e.translationMemoryId)throw new w("translationMemoryId",'Required parameter "translationMemoryId" was null or undefined when calling updateTranslationMemory().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateTranslationMemory().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling updateTranslationMemory().');const t={"Content-Type":"application/json"};null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant)),null!=e.authorization&&(t.Authorization=String(e.authorization));const r=yield this.request({path:"/translation-memory/{translationMemoryId}".replace("{translationMemoryId}",encodeURIComponent(String(e.translationMemoryId))),method:"PUT",headers:t,query:{},body:e.translationMemoryUpdateRequest},n);return new C(r)}))}updateTranslationMemory(e,n){return De(this,void 0,void 0,(function*(){yield this.updateTranslationMemoryRaw(e,n)}))}}const Be={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"},Qe={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"};var We=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class He extends c{downloadExportedTranslationMemoryRaw(e,n){return We(this,void 0,void 0,(function*(){if(null==e.exportId)throw new w("exportId",'Required parameter "exportId" was null or undefined when calling downloadExportedTranslationMemory().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling downloadExportedTranslationMemory().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling downloadExportedTranslationMemory().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/translation-memory/exports/{exportId}/download".replace("{exportId}",encodeURIComponent(String(e.exportId))),method:"GET",headers:t,query:{}},n);return new I(r)}))}downloadExportedTranslationMemory(e,n){return We(this,void 0,void 0,(function*(){const t=yield this.downloadExportedTranslationMemoryRaw(e,n);return yield t.value()}))}exportTranslationMemoryRaw(e,n){return We(this,void 0,void 0,(function*(){if(null==e.translationMemoryId)throw new w("translationMemoryId",'Required parameter "translationMemoryId" was null or undefined when calling exportTranslationMemory().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling exportTranslationMemory().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling exportTranslationMemory().');const t={"Content-Type":"application/json"};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/translation-memory/{translationMemoryId}/exports".replace("{translationMemoryId}",encodeURIComponent(String(e.translationMemoryId))),method:"POST",headers:t,query:{},body:e.translationMemoryExportRequest},n);return new y(r)}))}exportTranslationMemory(e,n){return We(this,void 0,void 0,(function*(){const t=yield this.exportTranslationMemoryRaw(e,n);return yield t.value()}))}pollTranslationMemoryExportRaw(e,n){return We(this,void 0,void 0,(function*(){if(null==e.exportId)throw new w("exportId",'Required parameter "exportId" was null or undefined when calling pollTranslationMemoryExport().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling pollTranslationMemoryExport().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling pollTranslationMemoryExport().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/translation-memory/exports/{exportId}".replace("{exportId}",encodeURIComponent(String(e.exportId))),method:"GET",headers:t,query:{}},n);return new y(r)}))}pollTranslationMemoryExport(e,n){return We(this,void 0,void 0,(function*(){const t=yield this.pollTranslationMemoryExportRaw(e,n);return yield t.value()}))}}var Ke=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class _e extends c{getTMImportHistoryRaw(e,n){return Ke(this,void 0,void 0,(function*(){if(null==e.translationMemoryId)throw new w("translationMemoryId",'Required parameter "translationMemoryId" was null or undefined when calling getTMImportHistory().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getTMImportHistory().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getTMImportHistory().');const t={};null!=e.fields&&(t.fields=e.fields),null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/translation-memory/{translationMemoryId}/imports".replace("{translationMemoryId}",encodeURIComponent(String(e.translationMemoryId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getTMImportHistory(e,n){return Ke(this,void 0,void 0,(function*(){const t=yield this.getTMImportHistoryRaw(e,n);return yield t.value()}))}importTranslationMemoryRaw(e,n){return Ke(this,void 0,void 0,(function*(){if(null==e.translationMemoryId)throw new w("translationMemoryId",'Required parameter "translationMemoryId" was null or undefined when calling importTranslationMemory().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling importTranslationMemory().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling importTranslationMemory().');if(null==e.properties)throw new w("properties",'Required parameter "properties" was null or undefined when calling importTranslationMemory().');if(null==e.file)throw new w("file",'Required parameter "file" was null or undefined when calling importTranslationMemory().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));let r,i=!1;i=T([{contentType:"multipart/form-data"}]),r=i?new FormData:new URLSearchParams,null!=e.properties&&r.append("properties",new Blob([JSON.stringify(e.properties)],{type:"application/json"})),null!=e.file&&r.append("file",e.file);const o=yield this.request({path:"/translation-memory/{translationMemoryId}/imports".replace("{translationMemoryId}",encodeURIComponent(String(e.translationMemoryId))),method:"POST",headers:t,query:{},body:r},n);return new y(o)}))}importTranslationMemory(e,n){return Ke(this,void 0,void 0,(function*(){const t=yield this.importTranslationMemoryRaw(e,n);return yield t.value()}))}pollTMImportRaw(e,n){return Ke(this,void 0,void 0,(function*(){if(null==e.importId)throw new w("importId",'Required parameter "importId" was null or undefined when calling pollTMImport().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling pollTMImport().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling pollTMImport().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/translation-memory/imports/{importId}".replace("{importId}",encodeURIComponent(String(e.importId))),method:"GET",headers:t,query:{}},n);return new y(r)}))}pollTMImport(e,n){return Ke(this,void 0,void 0,(function*(){const t=yield this.pollTMImportRaw(e,n);return yield t.value()}))}}var Ze=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class $e extends c{getMyUserRaw(e,n){return Ze(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getMyUser().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getMyUser().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/users/me",method:"GET",headers:r,query:t},n);return new y(i)}))}getMyUser(e,n){return Ze(this,void 0,void 0,(function*(){const t=yield this.getMyUserRaw(e,n);return yield t.value()}))}getUserRaw(e,n){return Ze(this,void 0,void 0,(function*(){if(null==e.userId)throw new w("userId",'Required parameter "userId" was null or undefined when calling getUser().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getUser().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getUser().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/users/{userId}".replace("{userId}",encodeURIComponent(String(e.userId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getUser(e,n){return Ze(this,void 0,void 0,(function*(){const t=yield this.getUserRaw(e,n);return yield t.value()}))}listUsersRaw(e,n){return Ze(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listUsers().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listUsers().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.sort&&(t.sort=e.sort),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/users",method:"GET",headers:r,query:t},n);return new y(i)}))}listUsers(e,n){return Ze(this,void 0,void 0,(function*(){const t=yield this.listUsersRaw(e,n);return yield t.value()}))}}const Je={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"};var Ye=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class en extends c{getWorkflowRaw(e,n){return Ye(this,void 0,void 0,(function*(){if(null==e.workflowId)throw new w("workflowId",'Required parameter "workflowId" was null or undefined when calling getWorkflow().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getWorkflow().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getWorkflow().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/workflows/{workflowId}".replace("{workflowId}",encodeURIComponent(String(e.workflowId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getWorkflow(e,n){return Ye(this,void 0,void 0,(function*(){const t=yield this.getWorkflowRaw(e,n);return yield t.value()}))}listWorkflowsRaw(e,n){return Ye(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listWorkflows().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listWorkflows().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy),null!=e.sort&&(t.sort=e.sort),null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/workflows",method:"GET",headers:r,query:t},n);return new y(i)}))}listWorkflows(e,n){return Ye(this,void 0,void 0,(function*(){const t=yield this.listWorkflowsRaw(e,n);return yield t.value()}))}updateWorkflowRaw(e,n){return Ye(this,void 0,void 0,(function*(){if(null==e.workflowId)throw new w("workflowId",'Required parameter "workflowId" was null or undefined when calling updateWorkflow().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling updateWorkflow().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateWorkflow().');if(null==e.workflowUpdateRequest)throw new w("workflowUpdateRequest",'Required parameter "workflowUpdateRequest" was null or undefined when calling updateWorkflow().');const t={"Content-Type":"application/json"};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/workflows/{workflowId}".replace("{workflowId}",encodeURIComponent(String(e.workflowId))),method:"PUT",headers:t,query:{},body:e.workflowUpdateRequest},n);return new C(r)}))}updateWorkflow(e,n){return Ye(this,void 0,void 0,(function*(){yield this.updateWorkflowRaw(e,n)}))}}const nn={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"},tn=()=>{const e=a();if(!e||!e.publicApiUrl)throw new Error("Use trados.onReady function before calling the Public API");const n={basePath:e.publicApiUrl};return new s(n)},rn=()=>new x(tn()),on=()=>new L(tn()),an=()=>new z(tn()),ln=()=>new E(tn()),un=()=>new F(tn()),sn=()=>new A(tn()),dn=()=>new G(tn()),cn=()=>new X(tn()),pn=()=>new B(tn()),hn=()=>new H(tn()),wn=()=>new Z(tn()),gn=()=>new ne(tn()),mn=()=>new ie(tn()),fn=()=>new le(tn()),Tn=()=>new se(tn()),yn=()=>new we(tn()),Cn=()=>new me(tn()),In=()=>new ye(tn()),Rn=()=>new Re(tn()),xn=()=>new Le(tn()),vn=()=>new ze(tn()),Ln=()=>new Pe(tn()),qn=()=>new ke(tn()),Sn=()=>new Me(tn()),zn=()=>new Oe(tn()),jn=()=>new Ne(tn()),bn=()=>new He(tn()),En=()=>new _e(tn()),Pn=()=>new $e(tn()),Fn=()=>new en(tn());var kn=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class Un extends c{listMachineTranslationsRaw(e,n){return kn(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listMachineTranslations().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listMachineTranslations().');if(null==e.sourceLanguage)throw new w("sourceLanguage",'Required parameter "sourceLanguage" was null or undefined when calling listMachineTranslations().');if(null==e.targetLanguage)throw new w("targetLanguage",'Required parameter "targetLanguage" was null or undefined when calling listMachineTranslations().');const t={};null!=e.sourceLanguage&&(t.sourceLanguage=e.sourceLanguage),null!=e.targetLanguage&&(t.targetLanguage=e.targetLanguage);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/machine-translation",method:"GET",headers:r,query:t},n);return new y(i)}))}listMachineTranslations(e,n){return kn(this,void 0,void 0,(function*(){const t=yield this.listMachineTranslationsRaw(e,n);return yield t.value()}))}}var An=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class Mn extends c{listRateLimitsRaw(e,n){return An(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listRateLimits().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listRateLimits().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/rate-limits",method:"GET",headers:r,query:t},n);return new y(i)}))}listRateLimits(e,n){return An(this,void 0,void 0,(function*(){const t=yield this.listRateLimitsRaw(e,n);return yield t.value()}))}}var Gn=function(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}u((r=r.apply(e,n||[])).next())}))};class Vn extends c{createScheduleTemplateRaw(e,n){return Gn(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling createScheduleTemplate().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling createScheduleTemplate().');const t={};null!=e.fields&&(t.fields=e.fields);const r={"Content-Type":"application/json"};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/schedule-templates",method:"POST",headers:r,query:t,body:e.scheduleTemplateCreateRequest},n);return new y(i)}))}createScheduleTemplate(e,n){return Gn(this,void 0,void 0,(function*(){const t=yield this.createScheduleTemplateRaw(e,n);return yield t.value()}))}deleteScheduleTemplateRaw(e,n){return Gn(this,void 0,void 0,(function*(){if(null==e.scheduleTemplateId)throw new w("scheduleTemplateId",'Required parameter "scheduleTemplateId" was null or undefined when calling deleteScheduleTemplate().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling deleteScheduleTemplate().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling deleteScheduleTemplate().');const t={};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/schedule-templates/{scheduleTemplateId}".replace("{scheduleTemplateId}",encodeURIComponent(String(e.scheduleTemplateId))),method:"DELETE",headers:t,query:{}},n);return new C(r)}))}deleteScheduleTemplate(e,n){return Gn(this,void 0,void 0,(function*(){yield this.deleteScheduleTemplateRaw(e,n)}))}getScheduleTemplateRaw(e,n){return Gn(this,void 0,void 0,(function*(){if(null==e.scheduleTemplateId)throw new w("scheduleTemplateId",'Required parameter "scheduleTemplateId" was null or undefined when calling getScheduleTemplate().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling getScheduleTemplate().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling getScheduleTemplate().');const t={};null!=e.fields&&(t.fields=e.fields);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/schedule-templates/{scheduleTemplateId}".replace("{scheduleTemplateId}",encodeURIComponent(String(e.scheduleTemplateId))),method:"GET",headers:r,query:t},n);return new y(i)}))}getScheduleTemplate(e,n){return Gn(this,void 0,void 0,(function*(){const t=yield this.getScheduleTemplateRaw(e,n);return yield t.value()}))}listScheduleTemplatesRaw(e,n){return Gn(this,void 0,void 0,(function*(){if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling listScheduleTemplates().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling listScheduleTemplates().');const t={};null!=e.top&&(t.top=e.top),null!=e.skip&&(t.skip=e.skip),null!=e.fields&&(t.fields=e.fields),null!=e.name&&(t.name=e.name),null!=e.location&&(t.location=e.location.join(g)),null!=e.locationStrategy&&(t.locationStrategy=e.locationStrategy);const r={};null!=e.authorization&&(r.Authorization=String(e.authorization)),null!=e.xLCTenant&&(r["X-LC-Tenant"]=String(e.xLCTenant));const i=yield this.request({path:"/schedule-templates",method:"GET",headers:r,query:t},n);return new y(i)}))}listScheduleTemplates(e,n){return Gn(this,void 0,void 0,(function*(){const t=yield this.listScheduleTemplatesRaw(e,n);return yield t.value()}))}updateScheduleTemplateRaw(e,n){return Gn(this,void 0,void 0,(function*(){if(null==e.scheduleTemplateId)throw new w("scheduleTemplateId",'Required parameter "scheduleTemplateId" was null or undefined when calling updateScheduleTemplate().');if(null==e.authorization)throw new w("authorization",'Required parameter "authorization" was null or undefined when calling updateScheduleTemplate().');if(null==e.xLCTenant)throw new w("xLCTenant",'Required parameter "xLCTenant" was null or undefined when calling updateScheduleTemplate().');const t={"Content-Type":"application/json"};null!=e.authorization&&(t.Authorization=String(e.authorization)),null!=e.xLCTenant&&(t["X-LC-Tenant"]=String(e.xLCTenant));const r=yield this.request({path:"/schedule-templates/{scheduleTemplateId}".replace("{scheduleTemplateId}",encodeURIComponent(String(e.scheduleTemplateId))),method:"PUT",headers:t,query:{},body:e.scheduleTemplateUpdateRequest},n);return new C(r)}))}updateScheduleTemplate(e,n){return Gn(this,void 0,void 0,(function*(){yield this.updateScheduleTemplateRaw(e,n)}))}}const On={Location:"location",Lineage:"lineage",Bloodline:"bloodline",Genealogy:"genealogy"},Xn={New:"new",InProgress:"inProgress",Completed:"completed",Deleting:"deleting"},Dn={Volume:"volume",PerTargetLanguage:"perTargetLanguage",PerFile:"perFile",Hourly:"hourly",Percentage:"percentage",PerPage:"perPage",Conditional:"conditional"},Nn={Words:"words",Characters:"characters"},Bn={Absolute:"absolute",Relative:"relative",Percentage:"percentage"},Qn={Less:"less",LessOrEqual:"lessOrEqual",Greater:"greater",GreaterOrEqual:"greaterOrEqual"},Wn={WordCount:"wordCount",RunningTotal:"runningTotal"},Hn={Volume:"volume",Hourly:"hourly",Percentage:"percentage",PerPage:"perPage",Conditional:"conditional"},Kn={Words:"words",Characters:"characters"},_n={Absolute:"absolute",Relative:"relative",Percentage:"percentage"},Zn={Less:"less",LessOrEqual:"lessOrEqual",Greater:"greater",GreaterOrEqual:"greaterOrEqual"},$n={WordCount:"wordCount",RunningTotal:"runningTotal"},Jn={Created:"created",InProgress:"inProgress",Completed:"completed",Failed:"failed"},Yn={Copy:"copy",Use:"use"},et={Long:"long",Double:"double",Boolean:"boolean",Date:"date",String:"string",Checkbox:"checkbox",Longtext:"longtext",Picklist:"picklist",MultiSelectPicklist:"multiSelectPicklist"},nt={Project:"project",Customer:"customer"},tt={Green:"green",Amber:"amber",Red:"red"},rt={Green:"green",Amber:"amber",Red:"red"},it={Default:"default",Private:"private"},ot={Xml:"xml",Tbx:"tbx"},at={Queued:"queued",Extracting:"extracting",Extracted:"extracted",UnzipError:"unzipError"},lt={Translatable:"translatable",Reference:"reference",Localizable:"localizable",Unknown:"unknown"},ut={Queued:"queued",Extracting:"extracting",Extracted:"extracted",UnzipError:"unzipError"},st={Created:"created",InProgress:"inProgress",Completed:"completed",Failed:"failed"},dt={Created:"created",InProgress:"inProgress",Completed:"completed",Failed:"failed"},ct={Tm:"TM",Mt:"MT",Tb:"TB"},pt={Words:"words",Characters:"characters"},ht={InProgress:"inProgress",Completed:"completed"},wt={Created:"created",InProgress:"inProgress",Completed:"completed",Archived:"archived"},gt={New:"new",InProgress:"inProgress",Completed:"completed",Deleting:"deleting"},mt={New:"new",InProgress:"inProgress",Completed:"completed",Deleting:"deleting"},ft={Attaching:"attaching",Attached:"attached",Detaching:"detaching",Updating:"updating",Failed:"failed"},Tt={Group:"group",User:"user"},yt={Group:"group",User:"user"},Ct={User:"user",Group:"group",VendorOrderTemplate:"vendorOrderTemplate",ProjectCreator:"projectCreator"},It={None:"none",Created:"created",InProgress:"inProgress",Completed:"completed"},Rt={Created:"created",InProgress:"inProgress",Completed:"completed"},xt={KeepExisting:"keepExisting",OverwriteIfBetter:"overwriteIfBetter",OverwriteAlways:"overwriteAlways",OverwriteExceptPerfectMatch:"overwriteExceptPerfectMatch"},vt={ConfirmExactMatches:"confirmExactMatches",ConfirmContextMatches:"confirmContextMatches",LockExactMatches:"lockExactMatches",LockContextMatches:"lockContextMatches"},Lt={LeaveTargetSegmentsEmpty:"leaveTargetSegmentsEmpty",CopySourceToTarget:"copySourceToTarget"},qt={Error:"error",Warning:"warning",Note:"note"},St={Error:"error",Warning:"warning",Note:" Note"},zt={Error:"error",Warning:"warning",Note:"note"},jt={Error:"error",Warning:"warning",Note:"note"},bt={FileSpecificLimit:"fileSpecificLimit",AbsoluteCharacterCount:"absoluteCharacterCount"},Et={Error:"error",Warning:"warning",Note:"note"},Pt={Error:"error",Warning:"warning",Note:"note"},Ft={Error:"error",Warning:"warning",Note:"note"},kt={Error:"error",Warning:"warning",Note:"note"},Ut={Error:"error",Warning:"warning",Note:"note"},At={Error:"error",Warning:"warning",Note:"note"},Mt={Error:"error",Warning:"warning",Note:"note"},Gt={Error:"error",Warning:"warning",Note:"note"},Vt={Error:"error",Warning:"warning",Note:"note"},Ot={Error:"error",Warning:"warning",Note:"note"},Xt={Error:"error",Warning:"warning",Note:"note"},Dt={Error:"error",Warning:"warning",Note:"note"},Nt={Error:"error",Warning:"warning",Note:"note"},Bt={Error:"error",Warning:"warning",Note:"note"},Qt={TargetAndSource:"targetAndSource",TargetNotSource:"targetNotSource",SourceNotTarget:"sourceNotTarget",SourceOnly:"sourceOnly",TargetOnly:"targetOnly",DifferentCount:"differentCount",GroupedTargetAndSource:"groupedTargetAndSource"},Wt={Error:"error",Warning:"warning",Note:"note"},Ht={Error:"error",Warning:"warning",Note:"note"},Kt={Error:"error",Warning:"warning",Note:"note"},_t={Words:"words",Characters:"characters"},Zt={Error:"error",Warning:"warning",Note:"note"},$t={Error:"error",Warning:"warning",Note:"note"},Jt={Error:"error",Warning:"warning",Note:"note"},Yt={Error:"error",Warning:"warning",Note:"note"},er={Error:"error",Warning:"warning",Note:"note"},nr={Error:"error",Warning:"warning",Note:"note"},tr={Error:"error",Warning:"warning",Note:"note"},rr={Volume:"volume",PerTargetLanguage:"perTargetLanguage",PerFile:"perFile",Hourly:"hourly",Percentage:"percentage",PerPage:"perPage",Conditional:"conditional"},ir={Words:"words",Characters:"characters"},or={Absolute:"absolute",Relative:"relative",Percentage:"percentage"},ar={Less:"less",LessOrEqual:"lessOrEqual",Greater:"greater",GreaterOrEqual:"greaterOrEqual"},lr={WordCount:"wordCount",RunningTotal:"runningTotal"},ur={Volume:"volume",PerTargetLanguage:"perTargetLanguage",PerFile:"perFile",Hourly:"hourly",Percentage:"percentage",PerPage:"perPage",Conditional:"conditional"},sr={Words:"words",Characters:"characters"},dr={Absolute:"absolute",Relative:"relative",Percentage:"percentage"},cr={Less:"less",LessOrEqual:"lessOrEqual",Greater:"greater",GreaterOrEqual:"greaterOrEqual"},pr={WordCount:"wordCount",RunningTotal:"runningTotal"},hr={Volume:"volume",PerTargetLanguage:"perTargetLanguage",PerFile:"perFile",Hourly:"hourly",Percentage:"percentage",PerPage:"perPage",Conditional:"conditional"},wr={Words:"words",Characters:"characters"},gr={Absolute:"absolute",Relative:"relative",Percentage:"percentage"},mr={Less:"less",LessOrEqual:"lessOrEqual",Greater:"greater",GreaterOrEqual:"greaterOrEqual"},fr={WordCount:"wordCount",RunningTotal:"runningTotal"},Tr={Volume:"volume",PerTargetLanguage:"perTargetLanguage",PerFile:"perFile",Hourly:"hourly",Percentage:"percentage",PerPage:"perPage",Conditional:"conditional"},yr={Words:"words",Characters:"characters"},Cr={Absolute:"absolute",Relative:"relative",Percentage:"percentage"},Ir={Less:"less",LessOrEqual:"lessOrEqual",Greater:"greater",GreaterOrEqual:"greaterOrEqual"},Rr={WordCount:"wordCount",RunningTotal:"runningTotal"},xr={Global:"global",SourceLanguage:"sourceLanguage",LanguageDirection:"languageDirection"},vr={NUMBER_15:15,NUMBER_30:30,NUMBER_60:60,NUMBER_120:120,NUMBER_480:480,NUMBER_1440:1440,NUMBER_2880:2880},Lr={NUMBER_15:15,NUMBER_30:30,NUMBER_60:60,NUMBER_120:120,NUMBER_480:480,NUMBER_1440:1440,NUMBER_2880:2880},qr={Translatable:"translatable",Reference:"reference",Unknown:"unknown"},Sr={Native:"native",Bcm:"bcm",Sdlxliff:"sdlxliff"},zr={Translatable:"translatable",Reference:"reference"},jr={Translatable:"translatable",Reference:"reference"},br={Translatable:"translatable",Reference:"reference",Unknown:"unknown"},Er={Native:"native",Bcm:"bcm",Sdlxliff:"sdlxliff"},Pr={Native:"native",Bcm:"bcm"},Fr={Bcm:"bcm",Native:"native"},kr={Native:"native",Bcm:"bcm"},Ur={InProgress:"inProgress",Finished:"finished",Canceled:"canceled"},Ar={Native:"native",Bcm:"bcm"},Mr={Native:"native",Bcm:"bcm"},Gr={Bcm:"bcm",Native:"native"},Vr={Native:"native",Bcm:"bcm"},Or={Created:"created",InProgress:"inProgress",Completed:"completed",Failed:"failed",Skipped:"skipped",Canceled:"canceled"},Xr={User:"user",Group:"group",VendorOrderTemplate:"vendorOrderTemplate",ProjectCreator:"projectCreator"},Dr={User:"user",Group:"group",VendorOrderTemplate:"vendorOrderTemplate",ProjectManager:"projectManager",ProjectCreator:"projectCreator"},Nr={Global:"global",SourceLanguage:"sourceLanguage",TargetLanguage:"targetLanguage",LanguageDirection:"languageDirection"},Br={Global:"global",SourceLanguage:"sourceLanguage",TargetLanguage:"targetLanguage",LanguageDirection:"languageDirection"},Qr={Project:"project",SourceFile:"sourceFile",TargetFile:"targetFile",LanguageDirection:"languageDirection"},Wr={SourceFile:"sourceFile",TargetFile:"targetFile"},Hr={File:"file",TargetLanguage:"targetLanguage",Batch:"batch",VendorOrder:"vendorOrder",Task:"task"},Kr={Ready:"ready",ProcessingContent:"processingContent",ExportingContent:"exportingContent",DeletingContent:"deletingContent"},_r={Queued:"queued",Processing:"processing",Done:"done",Cancelled:"cancelled",Error:"error"},Zr={System:"system",UserDefined:"userDefined"},$r={Entry:"entry",Language:"language",Term:"term"},Jr={Text:"text",Double:"double",Date:"date",Picklist:"picklist",Boolean:"boolean"},Yr={Entry:"entry",Language:"language",Term:"term"},ei={Text:"text",Double:"double",Date:"date",Picklist:"picklist",Boolean:"boolean"},ni={Entry:"entry",Language:"language",Term:"term"},ti={Text:"text",Double:"double",Date:"date",Picklist:"picklist",Boolean:"boolean"},ri={Term:"term",Entry:"entry",External:"external"},ii={Term:"term",Entry:"entry",External:"external"},oi={Term:"term",Entry:"entry",External:"external"},ai={Pending:"pending",Queued:"queued",Processing:"processing",Done:"done",Cancelled:"cancelled",Failed:"failed",Error:"error"},li={Queued:"queued",Processing:"processing",Done:"done",Cancelled:"cancelled",Failed:"failed",Error:"error"},ui={Queued:"queued",Processing:"processing",Done:"done",Cancelled:"cancelled",Failed:"failed",Error:"error"},si={System:"system",UserDefined:"userDefined"},di={Queued:"queued",InProgress:"inProgress",Failed:"failed",Done:"done",Cancelled:"cancelled"},ci={Unknown:"unknown",SingleString:"singleString",MultipleString:"multipleString",DateTime:"dateTime",SinglePicklist:"singlePicklist",MultiplePicklist:"multiplePicklist",Integer:"integer"},pi={DateTime:"dateTime",SinglePicklist:"singlePicklist",MultiplePicklist:"multiplePicklist",Integer:"integer",SingleString:"singleString",MultipleString:"multipleString"},hi={Queued:"queued",InProgress:"inProgress",Failed:"failed",Done:"done",Cancelled:"cancelled"},wi={AddNew:"addNew",Overwrite:"overwrite",LeaveUnchanged:"leaveUnchanged",KeepMostRecent:"keepMostRecent"},gi={SkipTranslationUnit:"skipTranslationUnit",Ignore:"ignore",AddToTranslationMemory:"addToTranslationMemory",FailTranslationUnitImport:"failTranslationUnitImport"},mi={Translated:"translated",ApprovedTranslation:"approvedTranslation",ApprovedSignOff:"approvedSignOff",Draft:"draft",RejectedTranslation:"rejectedTranslation",RejectedSignOff:"rejectedSignOff"},fi={Queued:"queued",InProgress:"inProgress",Failed:"failed",Done:"done",Cancelled:"cancelled"},Ti={Translated:"translated",ApprovedTranslation:"approvedTranslation",ApprovedSignOff:"approvedSignOff",Draft:"draft",RejectedTranslation:"rejectedTranslation",RejectedSignOff:"rejectedSignOff"},yi={SkipTranslationUnit:"skipTranslationUnit",Ignore:"ignore",AddToTranslationMemory:"addToTranslationMemory",FailTranslationUnitImport:"failTranslationUnitImport"},Ci={AddNew:"addNew",Overwrite:"overwrite",LeaveUnchanged:"leaveUnchanged",KeepMostRecent:"keepMostRecent"},Ii={ApprovedTranslation:"approvedTranslation",ApprovedSignOff:"approvedSignOff",Draft:"draft",NotTranslated:"notTranslated",Translated:"translated",RejectedTranslation:"rejectedTranslation",RejectedSignOff:"rejectedSignOff"},Ri={AddNew:"addNew",Overwrite:"overwrite",KeepMostRecent:"keepMostRecent",LeaveUnchanged:"leaveUnchanged",Merge:"merge"},xi={User:"user",Group:"group",VendorOrderTemplate:"vendorOrderTemplate",ProjectCreator:"projectCreator",ProjectManager:"projectManager"},vi={User:"user",Group:"group",VendorOrderTemplate:"vendorOrderTemplate",ProjectCreator:"projectCreator",ProjectManager:"projectManager"},Li={Outcome:"outcome",Expression:"expression"},qi={TaskTemplate:"taskTemplate",Start:"start",End:"end"},Si={onReady:function(e,n){o("register",{elements:e,callback:e=>{i=e,n()}})},getLocalData:function(e,n){return new Promise(((t,r)=>{o("getLocalData",Object.assign(Object.assign({context:e,selector:n},a()),{resolve:t,reject:r}))}))},callAppApi:function(e){return new Promise(((n,t)=>{o("callAppApi",Object.assign(Object.assign(Object.assign({},e),a()),{resolve:n,reject:t}))}))},updateElement:function(e,n){return new Promise(((t,r)=>{o("updateElement",Object.assign(Object.assign({elementId:e,update:n},a()),{resolve:t,reject:r}))}))},navigate:function(e,n){return new Promise(((t,i)=>{o("navigate",Object.assign(Object.assign({type:n||r.route,path:e},a()),{resolve:t,reject:i}))}))},showNotification:function(e,n,r){return new Promise(((i,l)=>{o("showNotification",Object.assign(Object.assign({context:n,type:r||t.info,text:e},a()),{resolve:i,reject:l}))}))},getRegistrationResult:a,contexts:{projects:"projects",taskInbox:"task-inbox"},dataSelectors:{selectedProjects:"selectedProjects",selectedTasks:"selectedTasks",projectDashboard:"projectDashboard",projectFiles:"projectFiles",projectStages:"projectStages",projectTaskHistory:"projectTaskHistory"},notificationTypes:t,navigationTypes:r};return n})(),e.exports=n()}},n={};function t(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return e[r].call(o.exports,o,o.exports,t),o.exports}(()=>{"use strict";var e=t(524),n=function(e){console.log("[UI Extensibility] [my UI extension] Custom event detail",e)},r=function(){return r=Object.assign||function(e){for(var n,t=1,r=arguments.length;t".concat(null===(t=null==n?void 0:n.responseData)||void 0===t?void 0:t.greeting,""),e.trados.contexts.projects,e.trados.notificationTypes.success)})).catch((function(n){console.error("[UI Extensibility] [my UI extension] Failed to call my app's API",n),e.trados.showNotification("Failed to call my app's API.",e.trados.contexts.projects,e.trados.notificationTypes.fail)}))},payload:["project"]}]},{elementId:"myLinkButton",icon:"x-fal fa-book",iconAlign:"left",text:"Extensibility Docs",location:"projects-list-toolbar",type:"button",isLink:!0,href:"https://languagecloud.sdl.com/lc/extensibility-docs"},{elementId:"callPublicApiButton",icon:"x-fal fa-info",text:"Show Project Template Name",location:"project-details-toolbar",type:"button",hidden:!0,actions:[{eventType:"onrender",eventHandler:function(t){var r;n(t);var i=!(null===(r=t.project)||void 0===r?void 0:r.projectTemplate);e.trados.updateElement("callPublicApiButton",{hidden:i})},payload:[]},{eventType:"onclick",eventHandler:function(t){var i,o;n(t);var a=null===(o=null===(i=t.project)||void 0===i?void 0:i.projectTemplate)||void 0===o?void 0:o.id;a&&(0,e.tradosProjectTemplateApi)().getProjectTemplate(r({projectTemplateId:a},e.trados.getRegistrationResult())).then((function(n){console.log("[UI Extensibility] [my UI extension] Project template details from Language Cloud Public API",n),e.trados.showNotification("This project was created using the ".concat(n.name," project template"),e.trados.contexts.projects,e.trados.notificationTypes.success)})).catch((function(e){console.error("[UI Extensibility] [my UI extension] API call failed",e)}))},payload:["project"]}]},{elementId:"myNavigateButton",icon:"x-fal fa-location-arrow",text:"Navigate to Project Template",location:"project-details-toolbar",type:"button",hidden:!0,actions:[{eventType:"onrender",eventHandler:function(t){var r;n(t);var i=!(null===(r=t.project)||void 0===r?void 0:r.projectTemplate);e.trados.updateElement("myNavigateButton",{hidden:i})},payload:[]},{eventType:"onclick",eventHandler:function(t){var r;if(n(t),null===(r=t.project)||void 0===r?void 0:r.projectTemplate){var i=t.project.projectTemplate.id,o="resources/project-templates/".concat(i);e.trados.navigate(o,e.trados.navigationTypes.route)}},payload:["project"]}]},{elementId:"myGetUiDataButton",icon:"x-fal fa-hand-pointer",text:"Get UI Data",location:"project-details-toolbar",type:"button",actions:[{eventType:"onclick",eventHandler:function(t){n(t);var r=t.projectActiveTab;e.trados.getLocalData(e.trados.contexts.projects,e.trados.dataSelectors.selectedProjects).then((function(n){var t=n.selectedProjects,i=t.length,o=["My active tab is ".concat(r,"."),i?"My selected projects (".concat(i,"):
").concat(t.map((function(e){return" - "+e.name})).join("
")):"No selected projects"];e.trados.showNotification(o.join("

"),e.trados.contexts.projects)})).catch((function(n){console.error("[UI Extensibility] [my UI extension] Failed to get local data",n),e.trados.showNotification("Failed to get local data.",e.trados.contexts.projects,e.trados.notificationTypes.fail)}))},payload:["projectActiveTab"]}]},{elementId:"myDropdownButton",icon:"x-fal fa-chevron-right",text:"Update Target Button",location:"project-details-toolbar",type:"button",menu:[{icon:"x-fal fa-angle-right",text:"Hide",value:"hide"},{icon:"x-fal fa-angle-right",text:"Show",value:"show"},{separator:!0},{icon:"x-fal fa-angle-right",text:"Disable",value:"disable"},{icon:"x-fal fa-angle-right",text:"Enable",value:"enable"},{separator:!0},{icon:"x-fal fa-angle-right",text:"Set star icon",value:"staricon"},{icon:"x-fal fa-angle-right",text:"Set dot circle icon",value:"dotcircleicon"},{separator:!0},{icon:"x-fal fa-angle-right",text:"Disable & make uppercase & set star icon for dropdown menu options",value:"disablemenuoptions"},{icon:"x-fal fa-angle-right",text:"Enable & make default case & set angle icon for dropdown menu options",value:"enablemenuoptions"}],actions:[{eventType:"onclick",eventHandler:function(n){switch(n.value){case"hide":e.trados.updateElement("myTargetButton",{hidden:!0});break;case"show":e.trados.updateElement("myTargetButton",{hidden:!1});break;case"disable":e.trados.updateElement("myTargetButton",{disabled:!0});break;case"enable":e.trados.updateElement("myTargetButton",{disabled:!1});break;case"staricon":e.trados.updateElement("myTargetButton",{icon:"x-fal fa-star"});break;case"dotcircleicon":e.trados.updateElement("myTargetButton",{icon:"x-fal fa-dot-circle"});break;case"disablemenuoptions":e.trados.updateElement("myTargetButton",{menuItems:[{index:0,disabled:!0,text:"MENU OPTION 1",icon:"x-fal fa-star"},{index:1,disabled:!0,text:"MENU OPTION 2",icon:"x-fal fa-star"}]});break;case"enablemenuoptions":e.trados.updateElement("myTargetButton",{menuItems:[{index:0,disabled:!1,text:"Menu option 1",icon:"x-fal fa-angle-right"},{index:1,disabled:!1,text:"Menu option 2",icon:"x-fal fa-angle-right"}]})}},payload:[]}]},{elementId:"myTargetButton",icon:"x-fal fa-dot-circle",text:"Target Button",location:"project-details-toolbar",type:"button",menu:[{text:"Menu option 1",icon:"x-fal fa-angle-right"},{text:"Menu option 2",icon:"x-fal fa-angle-right"}]},{elementId:"myCustomTab",text:"My Custom Tab",location:"project-details-tabpanel",type:"tab",actions:[{eventType:"onrender",eventHandler:function(e){n(e);var t=document.getElementById(e.domElementId);if(t){t.innerHTML="";var r=document.createElement("div");r.innerHTML="Custom tab content inserted on render.",t.appendChild(r)}},payload:[]}]},{elementId:"myCustomPanel",text:"My Custom Panel",location:"project-details-dashboard-main",type:"panel",actions:[{eventType:"onrender",eventHandler:function(e){n(e);var t=document.getElementById(e.domElementId);if(t){t.innerHTML="";var r=document.createElement("div");r.innerHTML="Custom panel content inserted on render.",t.appendChild(r)}},payload:[]}]},{elementId:"dashboardSidebarBox",text:"My Custom Sidebar Box",location:"project-details-dashboard-sidebar",type:"sidebarBox",actions:[{eventType:"onrender",eventHandler:function(e){n(e);var t=document.getElementById(e.domElementId);if(t){t.innerHTML="";var r=document.createElement("div");r.innerHTML="Custom sidebar box content inserted on render.",t.appendChild(r)}},payload:[]}]}];e.trados.onReady(i,(function(){console.log("[UI Extensibility] [my UI extension] UI extension registered with Trados UI.")})),console.log("[UI Extensibility] [my UI extension] External script loaded.")})()})(); \ No newline at end of file diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/buttonsHandlers.ts b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/buttonsHandlers.ts new file mode 100644 index 0000000..e3eb8e4 --- /dev/null +++ b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/buttonsHandlers.ts @@ -0,0 +1,154 @@ +import { trados, ExtensibilityEventDetail, Project, tradosProjectTemplateApi } from "@trados/trados-ui-extensibility"; +import { logExtensionData } from "./helpers"; + +/** + * Handles the callAppApiButton's click event. + * Calls my own app's greeting API to receive the greeting message which is included in a notification. + * + * @param detail The event detail object. + */ +export const callAppApiButtonClicked = ( + detail: ExtensibilityEventDetail +) => { + logExtensionData(detail); + + trados + // The callAppApi function will automatically add headers: the account identifier and authorization token. + .callAppApi({ + url: `api/greeting/`, + method: "GET" + }) + .then(data => { + trados.showNotification( + `App backend says ${data?.responseData?.greeting}`, + trados.contexts.projects, + trados.notificationTypes.success + ); + }) + .catch(reason => { + console.error("[UI Extensibility] [my UI extension] Failed to call my app's API", reason); + trados.showNotification( + "Failed to call my app's API.", + trados.contexts.projects, + trados.notificationTypes.fail + ); + }); +} + +/** + * Handles the callPublicApiButton's render event. + * Checks whether the current project is based on a project template, then updates callPublicApiButton's hidden property depending on the outcome. + * + * @param detail The event detail object. + */ +export const callPublicApiButtonRendered = ( + detail: ExtensibilityEventDetail +) => { + logExtensionData(detail); + const hidden = !detail.project?.projectTemplate; + trados.updateElement("callPublicApiButton", { hidden: hidden }); +}; + +/** + * Handles the callPublicApiButton's click event. + * Calls the ProjectTemplateAPI from Language Cloud Public API to get the current project's project template and displays its name in a notification. + * + * @param detail The event detail object. + */ +export const callPublicApiButtonClicked = (detail: ExtensibilityEventDetail) => { + logExtensionData(detail); + + const projectTemplateId = detail.project?.projectTemplate?.id; + if (projectTemplateId) { + // Call the function that initializes the tradosProjectTemplateApi. + tradosProjectTemplateApi() + // Call the getProjectTemplate API endpoint. + .getProjectTemplate({ + // Provide the project template identifier. + projectTemplateId: projectTemplateId, + // Provide the account identifier and authorization token returned by the getRegistrationResult function. + ...trados.getRegistrationResult() + }) + .then(apiData => { + console.log("[UI Extensibility] [my UI extension] Project template details from Language Cloud Public API", apiData); + + trados.showNotification( + `This project was created using the ${apiData.name} project template`, + trados.contexts.projects, + trados.notificationTypes.success + ); + }) + .catch(e => { + console.error(`[UI Extensibility] [my UI extension] API call failed`, e ); + }); + } +} + +/** + * Handles the myNavigateButton's render event. + * Checks whether the current project is based on a project template, then updates myNavigateButton's hidden property depending on the outcome. + * + * @param detail The event detail object. + */ +export const myNavigateButtonRendered = ( + detail: ExtensibilityEventDetail +) => { + logExtensionData(detail); + const hidden = !detail.project?.projectTemplate; + trados.updateElement("myNavigateButton", { hidden: hidden }); +}; + +/** + * Handles the myNavigateButton's click event. + * Navigates to the current project's project template details view. + * + * @param detail The event detail object. + */ +export const myNavigateButtonClicked = ( + detail: ExtensibilityEventDetail +) => { + logExtensionData(detail); + if (detail.project?.projectTemplate) { + const projectTemplateId = detail.project.projectTemplate.id; + const projectTemplatePath = `resources/project-templates/${projectTemplateId}`; + trados.navigate(projectTemplatePath, trados.navigationTypes.route); + } +}; + +/** + * Handles the myGetUiDataButton's click event. + * Gets the currently active tab in the project details view from the event detail; the onclick action's payload is ["projectActiveTab"]. + * Gets the currently selected projects in the projects list view using the getLocalData function as an alternative to the action payload approach. + * Shows a notification containing both the active tab and the selected projects in the projects list. + * + * @param detail The event detail object. + */ +export const myGetUiDataButtonClicked = (detail: ExtensibilityEventDetail) => { + logExtensionData(detail); + + // The click event detail contains local data requested via onclick action's payload - see extension elements array in index.ts. + const myActiveTab = detail.projectActiveTab; + + // You can also request local UI data using the trados.getLocalData function. + trados + .getLocalData(trados.contexts.projects, trados.dataSelectors.selectedProjects) + .then((data: { selectedProjects: Project[] }) => { + const mySelectedProjects = data.selectedProjects; + const mySelectedProjectsCount = mySelectedProjects.length; + const notificationData = [ + `My active tab is ${myActiveTab}.`, + mySelectedProjectsCount + ? `My selected projects (${mySelectedProjectsCount}):
${mySelectedProjects.map(p => " - " + p.name).join("
")}` + : "No selected projects" + ]; + trados.showNotification(notificationData.join("

"), trados.contexts.projects) + }) + .catch(reason => { + console.error("[UI Extensibility] [my UI extension] Failed to get local data", reason); + trados.showNotification( + "Failed to get local data.", + trados.contexts.projects, + trados.notificationTypes.fail + ); + }); +}; diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/helpers.ts b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/helpers.ts index 2974156..4d16f19 100644 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/helpers.ts +++ b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/helpers.ts @@ -1,84 +1,10 @@ -import { ExtensibilityEventDetail } from "@sdl/extensibility-types/extensibility"; -import { - currentProject, - projectImportanceList -} from "./projectToolbarHandlers"; +import { ExtensibilityEventDetail } from "@trados/trados-ui-extensibility"; +/** + * Logs the event detail object to the console. + * + * @param detail The event detail object. + */ export const logExtensionData = (detail: ExtensibilityEventDetail) => { - console.log("[UI Extensibility] [extension] Custom event detail", detail); + console.log("[UI Extensibility] [my UI extension] Custom event detail", detail); }; - -// simple file download -// no longer used for initial "Create invoice" button; still used for "Get local data" button -export const download = (filename: string, data: string | Blob) => { - const element = document.createElement("a"); - if (typeof data === "string") { - element.href = "data:text/plain;charset=utf-8," + encodeURIComponent(data); - } else { - element.href = URL.createObjectURL(data); - } - element.setAttribute("download", filename); - element.style.display = "none"; - document.body.appendChild(element); - element.click(); - document.body.removeChild(element); -}; - -export const downloadData = (data: any) => { - const filename = "local-data.txt"; - console.log( - `[UI Extensibility] [extension] Download data as ${filename} file`, - data - ); - - setTimeout(() => { - download(filename, JSON.stringify(data)); - }, 1); -}; - -export const updateProjectImportanceList = (data?: any) => { - const currentProjectImportanceItem = projectImportanceList.find( - i => i.projectId === currentProject!.id - ); - if (currentProjectImportanceItem) { - if (data.responseData.importance) { - // update existing entry - currentProjectImportanceItem.importance = - data.responseData.importance.toLowerCase(); - if (currentProjectImportanceItem.pending) { - currentProjectImportanceItem.pending = false; - currentProjectImportanceItem.id = data.responseData.id; - } - } else { - // delete entry - projectImportanceList.splice( - projectImportanceList.indexOf(currentProjectImportanceItem), - 1 - ); - } - } else { - // add entry - projectImportanceList.push({ - id: data.responseData.id, - projectId: data.responseData.projectId, - importance: data.responseData.importance, - pending: false - }); - } -}; - -// a similar function exists in public-packages/extensibility/src/api/apiClient.ts but is intentionally not exported -// this helper function in the mock extension is used when calling add-on/app backend api directly, see api/project-metadata in projects-app/src/mocks/ui-extensibility/extensions/handlers/projectToolbarHandlers.ts -export const getEnvironmentUrlPartByHost = () => { - const hostEnv = document.location.host.split("-")[0]; - switch (hostEnv) { - case "ci": - case "qa": - case "pte": - case "uat": - case "staging": - return `${hostEnv}-`; - default: - return ""; // prod - } -}; \ No newline at end of file diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/panelsHandlers.ts b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/panelsHandlers.ts new file mode 100644 index 0000000..094020e --- /dev/null +++ b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/panelsHandlers.ts @@ -0,0 +1,71 @@ +import { ExtensibilityEventDetail } from "@trados/trados-ui-extensibility"; +import { logExtensionData } from "./helpers"; + +/** + * Handles myCustomSidebarBox's render event. + * Adds HTML content to the sidebarBox. + * + * @param detail The event detail object. + */ +export const myCustomSidebarBoxRendered = ( + detail: ExtensibilityEventDetail +) => { + logExtensionData(detail); + + const sidebarBoxContentWrapper = document.getElementById(detail.domElementId); + if (sidebarBoxContentWrapper) { + // Reset content for re-renders: as the state changes in the Trados UI depending on user actions, re-renders occur. + sidebarBoxContentWrapper.innerHTML = ""; + + // Create and append div. + const div = document.createElement("div"); + div.innerHTML = `Custom sidebar box content inserted on render.`; + sidebarBoxContentWrapper.appendChild(div); + } +}; + +/** + * Handles myCustomPanel's render event. + * Adds HTML content to the panel. + * + * @param detail The event detail object. + */ +export const myCustomPanelRendered = ( + detail: ExtensibilityEventDetail +) => { + logExtensionData(detail); + + const panelContentWrapper = document.getElementById(detail.domElementId); + if (panelContentWrapper) { + // Reset content for re-renders: as the state changes in the Trados UI depending on user actions, re-renders occur. + panelContentWrapper.innerHTML = ""; + + // Create and append div. + const div = document.createElement("div"); + div.innerHTML = `Custom panel content inserted on render.`; + panelContentWrapper.appendChild(div); + } +}; + +/** + * Handles myCustomTab's render event. + * Adds HTML content to the tab. + * + * @param detail The event detail object. + */ +export const myCustomTabRendered = ( + detail: ExtensibilityEventDetail +) => { + logExtensionData(detail); + + const tabContentWrapper = document.getElementById(detail.domElementId); + if (tabContentWrapper) { + // Reset content for re-renders: as the state changes in the Trados UI depending on user actions, re-renders occur. + tabContentWrapper.innerHTML = ""; + + // Create and append div. + const div = document.createElement("div"); + div.innerHTML = `Custom tab content inserted on render.`; + tabContentWrapper.appendChild(div); + } +}; diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectDashboardHandlers.ts b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectDashboardHandlers.ts deleted file mode 100644 index 0903fce..0000000 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectDashboardHandlers.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { trados } from "@sdl/extensibility"; // doesn't work until new extensibility public package published -//import { trados } from "../../../../../../../public-packages/extensibility/src/index"; // works -import { ExtensibilityEventDetail } from "@sdl/extensibility-types/extensibility"; -import { downloadData, logExtensionData } from "./helpers"; - -export const dashboardSidebarBoxRendered = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - // extensionHelper is the elementId of the tab (in activated-extension.json config) - const boxContentWrapper = document.getElementById(detail.domElementId); - if (boxContentWrapper) { - boxContentWrapper.innerHTML = ""; - // create div - const div = document.createElement("div"); - div.innerHTML = `Custom sidebar box content inserted on render.`; - boxContentWrapper.appendChild(div); - } -}; - -export const getLocalDashboardDataButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - trados - .getLocalData( - trados.contexts.projects, - trados.dataSelectors.projectDashboard - ) - .then(downloadData) - .catch(_reason => { - debugger; // todo - }); -}; - -export const increaseFontSizeButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - const panels = document.getElementsByTagName("table"); - for (let i = 0; i < panels.length; i++) { - panels[i].style.fontSize = "20px"; - } -}; - -export const backToDefaultFontSizeButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - const panels = document.getElementsByTagName("table"); - for (let i = 0; i < panels.length; i++) { - panels[i].style.fontSize = "initial"; - } -}; - -export const dashboardMainPanelRendered = ( - detail: ExtensibilityEventDetail, - panelIndex: number -) => { - logExtensionData(detail); - - // extensionHelper is the elementId of the tab (in activated-extension.json config) - const panelContentWrapper = document.getElementById(detail.domElementId); - if (panelContentWrapper) { - // reset content for rerenders - panelContentWrapper.innerHTML = ""; // todo: fix multiple renders - // create div - const div = document.createElement("div"); - div.innerHTML = `Custom panel ${panelIndex} content inserted on render.
This panel was added to column ${ - !isNaN(panelIndex) && panelIndex % 2 ? "1" : "2" - } in Dashboard's main section.`; - panelContentWrapper.appendChild(div); - } -}; diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectFilesHandlers.ts b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectFilesHandlers.ts deleted file mode 100644 index 836328a..0000000 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectFilesHandlers.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { trados } from "@sdl/extensibility"; // doesn't work until new extensibility public package published -//import { trados } from "../../../../../../../public-packages/extensibility/src/index"; // works -import { ExtensibilityEventDetail } from "@sdl/extensibility-types/extensibility"; -import { downloadData, logExtensionData } from "./helpers"; - -const setProgressRowDisplayStyle = (displayStyle: string) => { - const progressTexts = document.getElementsByClassName("x-progress-text"); - for (let i = 0; i < progressTexts.length; i++) { - if (progressTexts[i].textContent === "0%") { - const expiredRow = progressTexts[i].closest("tr"); - if (expiredRow) { - //@ts-ignore - expiredRow.style.display = displayStyle; - } - } - } -}; - -export const getLocalFilesDataButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - trados - .getLocalData(trados.contexts.projects, trados.dataSelectors.projectFiles) - .then(downloadData) - .catch(_reason => { - debugger; // todo - }); -}; - -export const hideNotTranslatedFilesButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - setProgressRowDisplayStyle("none"); -}; - -export const showAllFilesButtonClicked = (detail: ExtensibilityEventDetail) => { - logExtensionData(detail); - setProgressRowDisplayStyle("table-row"); -}; diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectStagesHadlers.ts b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectStagesHadlers.ts deleted file mode 100644 index 330a8f2..0000000 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectStagesHadlers.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { trados } from "@sdl/extensibility"; // doesn't work until new extensibility public package published -//import { trados } from "../../../../../../../public-packages/extensibility/src/index"; // works -import { ExtensibilityEventDetail } from "@sdl/extensibility-types/extensibility"; -import { downloadData, logExtensionData } from "./helpers"; - -export const getLocalStagesDataButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - trados - .getLocalData(trados.contexts.projects, trados.dataSelectors.projectStages) - .then(downloadData) - .catch(_reason => { - debugger; // todo - }); -}; - -export const highlightPopulatedStagesButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - const panels = document.getElementsByClassName("items-count"); - for (let i = 0; i < panels.length; i++) { - if (panels[i].textContent !== "0") { - //@ts-ignore - panels[i].style.background = "green"; - } - } -}; - -export const removeStagesHighlightsButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - const panels = document.getElementsByClassName("items-count"); - for (let i = 0; i < panels.length; i++) { - if (panels[i].textContent !== "0") { - //@ts-ignore - panels[i].style.background = "#9ba9b6"; - } - } -}; diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectTabbarHandlers.ts b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectTabbarHandlers.ts deleted file mode 100644 index ab05060..0000000 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectTabbarHandlers.ts +++ /dev/null @@ -1,618 +0,0 @@ -import { trados } from "@sdl/extensibility"; // doesn't work until new extensibility public package published -//import { trados } from "../../../../../../../public-packages/extensibility/src/index"; // works -import { ExtensibilityEventDetail } from "@sdl/extensibility-types/extensibility"; -import { Project } from "@sdl/extensibility/lib/lc-public-api/models"; -import { logExtensionData } from "./helpers"; - -let project: Project | undefined = undefined; -let selectedProjects: Project[] | undefined = undefined; - -export const extensionsHelperTabRendered = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - - // extensionHelper is the elementId of the tab (in activated-extension.json config) - const tabContentWrapper = document.getElementById(detail.domElementId); - if (tabContentWrapper) { - // reset content for rerenders - tabContentWrapper.innerHTML = ""; - - // create heading - const heading = document.createElement("div"); - heading.className = "x-panel-header-title-light-framed"; - heading.setAttribute("style", "margin-bottom: 10px"); - heading.innerText = "Available data"; - - //project and selectedProjects selectors set as event payload - project = detail.project; - selectedProjects = detail.selectedProjects; - // create all data object - const data = { - project: project, - selectedProjects: selectedProjects - }; - - // create copy to clipboard button - const copyBtn = document.createElement("a"); - - //copyBtn.className = "x-btn x-btn-default-toolbar-medium"; - copyBtn.setAttribute("style", "margin-left: 10px; color: #434a65;"); - copyBtn.innerHTML = ``; - copyBtn.onclick = () => { - // @ts-ignore - SDL.common.utils.ClipboardCopy.copyToClipboard(JSON.stringify(data)); - if (!copyBtn.className.indexOf("fa-check")) { - copyBtn.className = "x-fa fa-check"; - setTimeout(() => { - copyBtn.className = "x-fa fa-copy"; - }, 2000); - } - }; - - // add copy button to heading and heading to tab - heading.appendChild(copyBtn); - tabContentWrapper.appendChild(heading); - tabContentWrapper.style.position = "relative"; - - // json-viewer css - const jsonViewerStyle = document.createElement("style"); - //jsonViewerStyle.setAttribute("data-loaded-by-extension-id", key || ""); todo: may be helpful for debugging, but extension key is not exposed. should it be? - jsonViewerStyle.innerHTML = getJsonViewerCss(); - document.body.appendChild(jsonViewerStyle); - - // json-viewer js - // TODO: investigate importing JSONViewer to prevent including large code - // JSONViewer - by Roman Makudera 2016 (c) MIT licence. - var JSONViewer = (function (document) { - var Object_prototype_toString = {}.toString; - var DatePrototypeAsString = Object_prototype_toString.call(new Date()); - - /** @constructor */ - function JSONViewer() { - // @ts-ignore - this._dom_container = document.createElement("pre"); - // @ts-ignore - this._dom_container.classList.add("json-viewer"); - } - - /** - * Visualise JSON object. - * - * @param {Object|Array} json Input value - * @param {Number} [inputMaxLvl] Process only to max level, where 0..n, -1 unlimited - * @param {Number} [inputColAt] Collapse at level, where 0..n, -1 unlimited - */ - JSONViewer.prototype.showJSON = function ( - jsonValue: any, - inputMaxLvl: number, - inputColAt: number - ) { - // Process only to maxLvl, where 0..n, -1 unlimited - var maxLvl = typeof inputMaxLvl === "number" ? inputMaxLvl : -1; // max level - // Collapse at level colAt, where 0..n, -1 unlimited - var colAt = typeof inputColAt === "number" ? inputColAt : -1; // collapse at - this._dom_container.innerHTML = ""; - walkJSONTree(this._dom_container, jsonValue, maxLvl, colAt, 0, ""); - }; - /** - * Get container with pre object - this container is used for visualise JSON data. - * - * @return {Element} - */ - JSONViewer.prototype.getContainer = function () { - return this._dom_container; - }; - - function createCopyLinks( - path: string, - value: any, - extraContainerCssClass?: string - ) { - const copyPathBtn = document.createElement("a"); - copyPathBtn.title = path; - copyPathBtn.innerText = "Copy path"; - copyPathBtn.setAttribute("style", "margin-left: 10px"); - copyPathBtn.onclick = () => { - //debugger; - // @ts-ignore - SDL.common.utils.ClipboardCopy.copyToClipboard(path); - }; - const copyValueBtn = document.createElement("a"); - const stringValue = - typeof value === "object" ? JSON.stringify(value) : value; - copyValueBtn.title = stringValue; - copyValueBtn.innerText = "Copy value"; - copyValueBtn.setAttribute("style", "margin-left: 10px"); - copyValueBtn.onclick = () => { - //debugger; - // @ts-ignore - SDL.common.utils.ClipboardCopy.copyToClipboard(stringValue); - }; - const spanEl = document.createElement("span"); - spanEl.className = - "copy-links" + - (extraContainerCssClass ? " " + extraContainerCssClass : " simple"); - spanEl.appendChild(copyPathBtn); - spanEl.appendChild(copyValueBtn); - return spanEl; - } - - /** - * Recursive walk for input value. - * - * @param {Element} outputParent is the Element that will contain the new DOM - * @param {Object|Array} value Input value - * @param {Number} maxLvl Process only to max level, where 0..n, -1 unlimited - * @param {Number} colAt Collapse at level, where 0..n, -1 unlimited - * @param {Number} lvl Current level - * @param {String} path Current object path - */ - function walkJSONTree( - outputParent: any, - value: any, - maxLvl: number, - colAt: number, - lvl: number, - path: string - ) { - var isDate = - Object_prototype_toString.call(value) === DatePrototypeAsString; - var realValue = - !isDate && - typeof value === "object" && - value !== null && - "toJSON" in value - ? value.toJSON() - : value; - if (typeof realValue === "object" && realValue !== null && !isDate) { - var isMaxLvl = maxLvl >= 0 && lvl >= maxLvl; - var isCollapse = colAt >= 0 && lvl >= colAt; - var isArray = Array.isArray(realValue); - var items = isArray ? realValue : Object.keys(realValue); - if (lvl === 0) { - // root level - var rootCount = _createItemsCount(items.length); - // hide/show - var rootLink = _createLink(isArray ? "[" : "{"); - if (items.length) { - rootLink.addEventListener("click", function () { - if (isMaxLvl) return; - rootLink.classList.toggle("collapsed"); - rootCount.classList.toggle("hide"); - // main list - outputParent.querySelector("ul").classList.toggle("hide"); - }); - if (isCollapse) { - rootLink.classList.add("collapsed"); - rootCount.classList.remove("hide"); - } - } else { - rootLink.classList.add("empty"); - } - rootLink.appendChild(rootCount); - outputParent.appendChild(rootLink); // output the rootLink - } - if (items.length && !isMaxLvl) { - var len = items.length - 1; - var ulList = document.createElement("ul"); - ulList.setAttribute("data-level", lvl.toString()); - ulList.classList.add("type-" + (isArray ? "array" : "object")); - items.forEach(function (key: any, ind: number) { - var item = isArray ? key : value[key]; - var li = document.createElement("li"); - if (typeof item === "object") { - let index = -1; - let pathToCopy = path + (path.length ? "." : "") + key; - - // null && date - if (!item || item instanceof Date) { - li.appendChild( - document.createTextNode(isArray ? "" : key + ": ") - ); - li.appendChild(createSimpleViewOf(item ? item : null, true)); - } - // array & object - else { - var itemIsArray = Array.isArray(item); - var itemLen = itemIsArray - ? item.length - : Object.keys(item).length; - - index = realValue.indexOf ? realValue.indexOf(item) : -1; - pathToCopy = - path + - (path.length - ? index > -1 - ? "[" + index + "]" - : "." + key - : "" + key); - - // empty - if (!itemLen) { - li.appendChild( - document.createTextNode( - key + ": " + (itemIsArray ? "[]" : "{}") - ) - ); - } else { - // 1+ items - var itemTitle = - (typeof key === "string" ? key + ": " : "") + - (itemIsArray ? "[" : "{"); - var itemLink = _createLink(itemTitle); - var itemsCount = _createItemsCount(itemLen); - // maxLvl - only text, no link - if (maxLvl >= 0 && lvl + 1 >= maxLvl) { - li.appendChild(document.createTextNode(itemTitle)); - } else { - itemLink.appendChild(itemsCount); - li.appendChild(itemLink); - } - //debugger; - walkJSONTree(li, item, maxLvl, colAt, lvl + 1, pathToCopy); - li.appendChild( - document.createTextNode(itemIsArray ? "]" : "}") - ); - var list = li.querySelector("ul"); - var itemLinkCb = function () { - itemLink.classList.toggle("collapsed"); - itemsCount.classList.toggle("hide"); - list!.classList.toggle("hide"); - }; - // hide/show - itemLink.addEventListener("click", itemLinkCb); - // collapse lower level - if (colAt >= 0 && lvl + 1 >= colAt) { - itemLinkCb(); - } - } - } - // add comma to the end - if (ind < len) { - li.appendChild(document.createTextNode(",")); - } - - if (key === "lastModifiedAt") { - //debugger; - } - if ( - Object_prototype_toString.call(item) === DatePrototypeAsString - ) { - li.appendChild( - createCopyLinks(path + (path.length ? "." : "") + key, item) - ); - } else { - li.insertBefore( - createCopyLinks(pathToCopy, item, "expanded"), - li.children[1] - ); - li.appendChild( - createCopyLinks(pathToCopy, item, "collapsed") - ); - } - } - // simple values - else { - // object keys with key: - if (!isArray) { - li.appendChild(document.createTextNode(key + ": ")); - } - // recursive - walkJSONTree( - li, - item, - maxLvl, - colAt, - lvl + 1, - path + (path.length ? "." : "") + key - ); - // add comma to the end - if (ind < len) { - li.appendChild(document.createTextNode(",")); - } - li.appendChild( - createCopyLinks(path + (path.length ? "." : "") + key, item) - ); - } - - ulList.appendChild(li); - // @ts-ignore - }, this); - outputParent.appendChild(ulList); // output ulList - } else if (items.length && isMaxLvl) { - var itemsCount = _createItemsCount(items.length); - itemsCount.classList.remove("hide"); - outputParent.appendChild(itemsCount); // output itemsCount - } - if (lvl === 0) { - // empty root - if (!items.length) { - var itemsCount = _createItemsCount(0); - itemsCount.classList.remove("hide"); - outputParent.appendChild(itemsCount); // output itemsCount - } - // root cover - outputParent.appendChild( - document.createTextNode(isArray ? "]" : "}") - ); - // collapse - if (isCollapse) { - outputParent.querySelector("ul").classList.add("hide"); - } - } - } else { - // simple values - outputParent.appendChild(createSimpleViewOf(value, isDate)); - } - } - - /** - * Create simple value (no object|array). - * - * @param {Number|String|null|undefined|Date} value Input value - * @return {Element} - */ - function createSimpleViewOf(value: any, isDate: boolean) { - var spanEl = document.createElement("span"); - var type: any = typeof value; - var asText = "" + value; - if (type === "string") { - asText = '"' + value + '"'; - } else if (value === null) { - type = "null"; - //asText = "null"; - } else if (isDate) { - type = "date"; - asText = value.toLocaleString(); - } - spanEl.className = "type-" + type; - spanEl.textContent = asText; - return spanEl; - } - - /** - * Create items count element. - * - * @param {Number} count Items count - * @return {Element} - */ - function _createItemsCount(count: number) { - var itemsCount = document.createElement("span"); - itemsCount.className = "items-ph hide"; - itemsCount.innerHTML = _getItemsTitle(count); - return itemsCount; - } - - /** - * Create clickable link. - * - * @param {String} title Link title - * @return {Element} - */ - function _createLink(title: string) { - var linkEl = document.createElement("a"); - linkEl.classList.add("list-link"); - linkEl.href = "javascript:void(0)"; - linkEl.innerHTML = title || ""; - return linkEl; - } - - /** - * Get correct item|s title for count. - * - * @param {Number} count Items count - * @return {String} - */ - function _getItemsTitle(count: number) { - var itemsTxt = count > 1 || count === 0 ? "items" : "item"; - return count + " " + itemsTxt; - } - - return JSONViewer; - })(document); - - // @ts-ignore - var jsonViewer = new JSONViewer(); - tabContentWrapper.appendChild(jsonViewer.getContainer()); - jsonViewer.showJSON(data, null, 1); - console.log("[UI Extensibility] [extension] JSON data displayed"); - - // add playground - const playgroundHeading = document.createElement("div"); - playgroundHeading.className = "x-panel-header-title-light-framed"; - playgroundHeading.setAttribute("style", "margin: 40px 0 5px"); - playgroundHeading.innerText = "Dev Playground"; - tabContentWrapper.appendChild(playgroundHeading); - - const playgroundForm = document.createElement("form"); - playgroundForm.autocomplete = "off"; - const hidden = document.createElement("input"); - hidden.setAttribute("type", "hidden"); - hidden.setAttribute("autocomplete", "false"); - playgroundForm.appendChild(hidden); - - const label = document.createElement("label"); - label.setAttribute("for", "extension-notification-input"); - label.setAttribute("autocomplete", "false"); - label.setAttribute( - "style", - "margin-bottom: 10px; font-weight: 700; display: inline-block; width: 120px;" - ); - label.innerText = "Notification text"; - playgroundForm.appendChild(label); - - const input = document.createElement("input"); - input.setAttribute("id", "extension-notification-input"); - input.setAttribute( - "style", - "margin: 0 5px; border: 1px solid #9ba9b6; border-radius: 4px; padding: 5px 10px 4px; width: 475px;" - ); - input.placeholder = "Input notification text"; - playgroundForm.appendChild(input); - - playgroundForm.appendChild(document.createElement("br")); - - const typeLabel = document.createElement("label"); - typeLabel.setAttribute("for", "extension-notification-select"); - typeLabel.setAttribute( - "style", - "margin-bottom: 10px; font-weight: 700; display: inline-block; width: 120px;" - ); - typeLabel.innerText = "Notification type"; - playgroundForm.appendChild(typeLabel); - - const select = document.createElement("select"); - select.setAttribute("id", "extension-notification-select"); - select.setAttribute( - "style", - "margin: 0 5px; border: 1px solid #9ba9b6; border-radius: 4px; padding: 5px 6px 4px; width: 475px;" - ); - [ - ["Information", "info"], - ["Success", "success"], - ["Warning", "warning"], - ["Failure", "fail"] - ].forEach(type => { - const option = document.createElement("option"); - option.textContent = type[0]; - option.value = type[1]; - select.appendChild(option); - }); - playgroundForm.appendChild(select); - - playgroundForm.appendChild(document.createElement("br")); - - const button = document.createElement("button"); - button.type = "submit"; - button.innerText = "Display notification"; - // @ts-ignore - button.style = "margin-top: 5px"; - button.className = "x-btn x-btn-default-toolbar-medium"; - playgroundForm.appendChild(button); - - playgroundForm.addEventListener("submit", function (submitEvent) { - // sample input where eval was needed: "This is the " + projectDetails.name + " project." - //const text = input.value.indexOf('"') > -1 || input.value.indexOf("`") > -1 - // ? eval(input.value.replace(/projectDetails/g, "project")) - // : input.value; - const text = input.value; - const type = select.value as "info" | "success" | "warning" | "fail"; - trados.showNotification(text, trados.contexts.projects, type); - - submitEvent.preventDefault(); - }); - - const scriptText = `trados.showNotification( - "{text}", - trados.contexts.projects, - "{type}" -});`; - const code = document.createElement("div"); - // @ts-ignore - code.style = - "white-space: pre; overflow: auto; margin-top: 10px; border: 1px solid #9ba9b6; border-radius: 4px; padding: 5px 10px 4px; width: 600px; height: 170px; "; - playgroundForm.appendChild(code); - const updateCode = () => { - const text = input.value; - code.innerText = scriptText - .replace("{type}", select.value) - .replace("{text}", text); - /*.replace( - "{text}", - (text.indexOf('"') > -1 || text.indexOf("`") > -1 - ? text - : `"${text}"`) || '""' - ) - */ - }; - - input.addEventListener("input", () => { - updateCode(); - }); - select.addEventListener("change", () => { - updateCode(); - }); - updateCode(); - - tabContentWrapper.appendChild(playgroundForm); - } -}; - -const getJsonViewerCss = () => { - return ` -.json-viewer { - color: #000; - margin: 0; - padding-left: 20px; - line-height: 20px; - background-image: linear-gradient( - 0deg, - #fcfcfc 50%, - #f3f3f3 50%, - #f3f3f3 100% - ); - background-size: 40px 40px; -} -.json-viewer ul { - list-style-type: none; - margin: 0; - margin: 0 0 0 1px; - border-left: 1px dotted #ccc; - padding-left: 2em; -} -.json-viewer .hide { - display: none; -} -.json-viewer .type-string { - color: #0b7500; -} -.json-viewer .type-date { - color: #cb7500; -} -.json-viewer .type-boolean { - color: #1a01cc; - font-weight: bold; -} -.json-viewer .type-number { - color: #1a01cc; -} -.json-viewer .type-null, -.json-viewer .type-undefined { - color: #90a; -} -.json-viewer a.list-link { - color: #000; - text-decoration: none; - position: relative; -} -.json-viewer a.list-link:before { - color: #aaa; - content: "▼"; - position: absolute; - display: inline-block; - width: 1em; - left: -1em; -} -.json-viewer a.list-link.collapsed:before { - content: "►"; -} -.json-viewer a.list-link.empty:before { - content: ""; -} -.json-viewer .items-ph { - color: #aaa; - padding: 0 1em; -} -.json-viewer .items-ph:hover { - text-decoration: underline; -} -.json-viewer .copy-links { - display: none; -} -.json-viewer li:hover > a.list-link.collapsed ~ .copy-links.collapsed, -.json-viewer li:hover > a.list-link:not(.collapsed) ~ .copy-links.expanded, -.json-viewer li:hover > .copy-links.simple { - display: inline; -}`; -}; diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectTaskHistoryHandlers.ts b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectTaskHistoryHandlers.ts deleted file mode 100644 index a0d83ca..0000000 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectTaskHistoryHandlers.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { trados } from "@sdl/extensibility"; // doesn't work until new extensibility public package published -//import { trados } from "../../../../../../../public-packages/extensibility/src/index"; // works -import { ExtensibilityEventDetail } from "@sdl/extensibility-types/extensibility"; -import { downloadData, logExtensionData } from "./helpers"; - -const setExpiredRowDisplayStyle = (displayStyle: string) => { - const statusText = document.getElementsByClassName("status file-failed"); - for (let i = 0; i < statusText.length; i++) { - const expiredRow = statusText[i].closest("tr"); - if (expiredRow) { - //@ts-ignore - expiredRow.style.display = displayStyle; - } - } -}; - -export const getLocalTaskHistoryDataButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - trados - .getLocalData( - trados.contexts.projects, - trados.dataSelectors.projectTaskHistory - ) - .then(downloadData) - .catch(_reason => { - debugger; // todo - }); -}; - -export const hideFailedTasksButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - setExpiredRowDisplayStyle("none"); -}; - -export const showAllTasksButtonClicked = (detail: ExtensibilityEventDetail) => { - logExtensionData(detail); - setExpiredRowDisplayStyle("table-row"); -}; - -export const highlightSelectedTaskButtonRendered = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - //const isPreviewPanelOpen = detail.projectTaskHistory!.preview.show; - // todo: check if closing preview makes selectedTaskHistoryTask null - const isPreviewPanelOpen = Boolean(detail.selectedTaskHistoryTask); - - // update button availability - trados.updateElement("highlightSelectedTaskButton", { - disabled: !isPreviewPanelOpen - }); - const selectedTaskRows = document.getElementsByClassName("x-grid-row"); - //@ts-ignore - for (let selectedTaskRow of selectedTaskRows) { - //@ts-ignore - if (selectedTaskRow && selectedTaskRow.style) - //@ts-ignore - selectedTaskRow.style.backgroundColor = "initial"; - } -}; - -export const highlightSelectedTaskButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - const selectedTaskRows = document.getElementsByClassName( - " x-grid-row x-grid-row-active" - ); - if (selectedTaskRows) { - //@ts-ignore - selectedTaskRows[0].style.backgroundColor = "#1d9570"; - } -}; - -// task history sidebar box -export const taskHistorySidebarBoxRendered = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - // extensionHelper is the elementId of the tab (in activated-extension.json config) - const boxContentWrapper = document.getElementById(detail.domElementId); - if (boxContentWrapper) { - boxContentWrapper.innerHTML = ""; - // create div - const div = document.createElement("div"); - div.innerHTML = `Custom sidebar box content inserted on render.`; - if (detail.selectedTaskHistoryTask?.status) { - div.innerHTML += `
Status: ${detail.selectedTaskHistoryTask.status}`; - } - boxContentWrapper.appendChild(div); - } -}; diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectToolbarHandlers.ts b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectToolbarHandlers.ts deleted file mode 100644 index d7a7324..0000000 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectToolbarHandlers.ts +++ /dev/null @@ -1,833 +0,0 @@ -import { trados } from "@sdl/extensibility"; // doesn't work until new extensibility public package published -//import { trados } from "../../../../../../../public-packages/extensibility/src/index"; // works -import type { - Project, - TargetFile -} from "@sdl/extensibility/lib/lc-public-api/models"; -//import type { -// Project, -// TargetFile -//} from "../../../../../../../public-packages/extensibility/dist/lib/lc-public-api/models/index"; -import { ExtensibilityEventDetail } from "@sdl/extensibility-types/extensibility"; -import { ProjectImportance } from "../types"; -import { - download, - downloadData, - getEnvironmentUrlPartByHost, - logExtensionData, - updateProjectImportanceList -} from "./helpers"; - -export let currentProject: Project | undefined = undefined; -export let projectImportanceList: ProjectImportance[] = []; - -export const compareProjectApiToLocalDataButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - const clickedSelector = detail.value; // extensibilityComponents sets value in menu item handler, so selector string - - if (clickedSelector) { - switch (clickedSelector) { - case "selectedProjects": - const selectedProjects = detail.selectedProjects; - if (selectedProjects?.length) { - // notification - trados.showNotification( - `Getting data via Public API for ${selectedProjects.length} selected project(s)`, - trados.contexts.projects, - trados.notificationTypes.info - ); - - // project api call for every selected project - Promise.all( - selectedProjects.map(p => - trados.apiClient.projectApi().getProject({ - projectId: p.id, - ...trados.getRegistrationResult(), - fields: - "name,description,dueBy,createdAt,status,statusHistory,languageDirections,customer,createdBy,location,projectTemplate,translationEngine,fileProcessingConfiguration,pricingModel,workflow,projectPlan,analytics,analysisStatistics,quote,customFields,tqaProfile,forceOnline,quoteTemplate,projectGroup,projectManagers" - }) - ) - ) - .then(apiData => { - // notification - trados.showNotification( - "Downloading files for comparison", - trados.contexts.projects, - trados.notificationTypes.info - ); - - // download - download( - `compare-api-data-${clickedSelector}.json`, - JSON.stringify(apiData) - ); - download( - `compare-ui-data-${clickedSelector}.json`, - JSON.stringify(selectedProjects) - ); - }) - .catch(e => { - console.error( - `[UI Extensibility] [extension] At least one API call failed`, - e - ); - }); - } else { - // notification - trados.showNotification( - "No projects selected in projects list", - trados.contexts.projects, - trados.notificationTypes.warning - ); - } - break; - case "project": - const project = detail.project; - if (project) { - // notification - trados.showNotification( - "Getting data via Public API", - trados.contexts.projects, - trados.notificationTypes.info - ); - - // project details api call - trados.apiClient - .projectApi() - .getProject({ - projectId: project.id, - ...trados.getRegistrationResult(), - fields: - "name,description,dueBy,createdAt,status,statusHistory,languageDirections,customer,createdBy,location,projectTemplate,translationEngine,fileProcessingConfiguration,pricingModel,workflow,projectPlan,analytics,analysisStatistics,quote,customFields,tqaProfile,forceOnline,quoteTemplate,projectGroup,projectManagers" - }) - .then(apiData => { - // notification - trados.showNotification( - "Downloading files for comparison", - trados.contexts.projects, - trados.notificationTypes.info - ); - - // download - download( - `compare-api-data-${clickedSelector}.json`, - JSON.stringify(apiData) - ); - download( - `compare-ui-data-${clickedSelector}.json`, - JSON.stringify(project) - ); - }) - .catch(e => { - console.error( - `[UI Extensibility] [extension] API call failed`, - e - ); - }); - } - break; - case "selectedFile": - const fileProject = detail.project; - const file = detail.selectedFile; // if file has status property, call targetFileApi instead of sourceFileApi - if (fileProject && file) { - // notification - trados.showNotification( - "Getting data via Public API", - trados.contexts.projects, - trados.notificationTypes.info - ); - - // file api call - const fileIsTargetFile = Boolean((file as TargetFile).status); - - if (fileIsTargetFile) { - // target file - trados.apiClient - .targetFileApi() - .getTargetFile({ - projectId: fileProject.id, - targetFileId: file.id, - ...trados.getRegistrationResult(), - fields: - "id,name,languageDirection,sourceFile,latestVersion,analysisStatistics,status" - }) - .then(apiData => { - // notification - trados.showNotification( - "Downloading files for comparison", - trados.contexts.projects, - trados.notificationTypes.info - ); - - // download - download( - `compare-api-data-${clickedSelector}.json`, - JSON.stringify(apiData) - ); - download( - `compare-ui-data-${clickedSelector}.json`, - JSON.stringify(file) - ); - }) - .catch(e => { - console.error( - `[UI Extensibility] [extension] API call failed`, - e - ); - }); - } else { - // source file - trados.apiClient - .sourceFileApi() - .getSourceFile({ - projectId: fileProject.id, - sourceFileId: file.id, - ...trados.getRegistrationResult(), - fields: "id,name,role,language,versions,targetLanguages,path" - }) - .then(apiData => { - // notification - trados.showNotification( - "Downloading files for comparison", - trados.contexts.projects, - trados.notificationTypes.info - ); - - // download - download( - `compare-api-data-${clickedSelector}.json`, - JSON.stringify(apiData) - ); - download( - `compare-ui-data-${clickedSelector}.json`, - JSON.stringify(file) - ); - }) - .catch(e => { - console.error( - `[UI Extensibility] [extension] API call failed`, - e - ); - }); - } - } else { - // notification - trados.showNotification( - "No file selected in project files tab", - trados.contexts.projects, - trados.notificationTypes.warning - ); - } - break; - case "selectedFiles": - const files = detail.selectedFiles; // if file has status property, call targetFileApi instead of sourceFileApi - const filesProject = detail.project; - if (filesProject && files?.length) { - // notification - trados.showNotification( - "Getting data via Public API", - trados.contexts.projects, - trados.notificationTypes.info - ); - - // file api call for every selected file - Promise.all( - files.map(f => { - const fileIsTargetFile = Boolean((f as TargetFile).status); - if (fileIsTargetFile) { - // target file - return trados.apiClient.targetFileApi().getTargetFile({ - projectId: filesProject.id, - targetFileId: f.id, - ...trados.getRegistrationResult(), - fields: - "id,name,languageDirection,sourceFile,latestVersion,analysisStatistics,status" - }); - } else { - // source file - return trados.apiClient.sourceFileApi().getSourceFile({ - projectId: filesProject.id, - sourceFileId: f.id, - ...trados.getRegistrationResult(), - fields: "id,name,role,language,versions,targetLanguages,path" - }); - } - }) - ) - .then(apiData => { - // notification - trados.showNotification( - "Downloading files for comparison", - trados.contexts.projects, - trados.notificationTypes.info - ); - - // download - download( - `compare-api-data-${clickedSelector}.json`, - JSON.stringify(apiData) - ); - download( - `compare-ui-data-${clickedSelector}.json`, - JSON.stringify(files) - ); - }) - .catch(e => { - console.error( - `[UI Extensibility] [extension] At least one API call failed`, - e - ); - }); - } else { - // notification - trados.showNotification( - "No files selected in project files tab", - trados.contexts.projects, - trados.notificationTypes.warning - ); - } - break; - case "selectedTaskHistoryTask": - const taskHistoryTask = detail.selectedTaskHistoryTask; - if (taskHistoryTask) { - // notification - trados.showNotification( - "Getting data via Public API", - trados.contexts.projects, - trados.notificationTypes.info - ); - - // task api call - trados.apiClient - .taskApi() - .getTask({ - taskId: taskHistoryTask.id, - ...trados.getRegistrationResult(), - fields: - "id,status,taskType,input,inputFiles,owner,assignees,dueBy,createdAt,outcome,comment,project,failedTask,completedAt" - }) - .then(apiData => { - // notification - trados.showNotification( - "Downloading files for comparison", - trados.contexts.projects, - trados.notificationTypes.info - ); - - // download - download( - `compare-api-data-${clickedSelector}.json`, - JSON.stringify(apiData) - ); - download( - `compare-ui-data-${clickedSelector}.json`, - JSON.stringify(taskHistoryTask) - ); - }) - .catch(e => { - console.error( - `[UI Extensibility] [extension] API call failed`, - e - ); - }); - } else { - // notification - trados.showNotification( - "No task selected in project task history tab", - trados.contexts.projects, - trados.notificationTypes.warning - ); - } - break; - case "selectedStagesTasks": - const stagesTasks = detail.selectedStagesTasks; - if (stagesTasks?.length) { - // notification - trados.showNotification( - `Getting data via Public API for ${stagesTasks.length} selected stages task(s)`, - trados.contexts.projects, - trados.notificationTypes.info - ); - - // task api call for every selected task in stages tab - Promise.all( - stagesTasks.map(t => - trados.apiClient.taskApi().getTask({ - taskId: t.id, - ...trados.getRegistrationResult(), - fields: - "id,status,taskType,input,inputFiles,owner,assignees,dueBy,createdAt,outcome,comment,project,failedTask,completedAt" - }) - ) - ) - .then(apiData => { - // notification - trados.showNotification( - "Getting data via Public API", - trados.contexts.projects, - trados.notificationTypes.info - ); - - // download - download( - `compare-api-data-${clickedSelector}.json`, - JSON.stringify(apiData) - ); - download( - `compare-ui-data-${clickedSelector}.json`, - JSON.stringify(stagesTasks) - ); - }) - .catch(e => { - console.error( - `[UI Extensibility] [extension] At least one API call failed`, - e - ); - }); - } else { - // notification - trados.showNotification( - "No tasks selected in project stages tab", - trados.contexts.projects, - trados.notificationTypes.warning - ); - } - break; - case "projectActiveTab": - const activeTab = detail.projectActiveTab; - // notification only - trados.showNotification( - `The active tab in the project details view is ${activeTab}`, - trados.contexts.projects, - trados.notificationTypes.info - ); - break; - } - } -}; - -export const invoiceButtonRendered = (detail: ExtensibilityEventDetail) => { - logExtensionData(detail); - // update button visible state - const hidden = Boolean(detail.project && !detail.project.quote); - trados.updateElement("invoiceButton", { - hidden: hidden - }); - trados.updateElement("invoiceButtonGeneratedApi", { - hidden: hidden - }); -}; - -export const invoiceButtonClicked = (detail: ExtensibilityEventDetail) => { - logExtensionData(detail); - - // notifications - trados.showNotification( - "Requesting LC UI Extensibility service to perform file download API call (LC Public API quote-report)", - trados.contexts.projects, - trados.notificationTypes.success - ); - - // api calls - public api (pdf quote download) - trados - .callApi({ - url: `public-api/v1/projects/${detail.project!.id}/quote-report`, // LC Public API - method: "GET", - fileName: "invoice.pdf" // when fileName exists, FileDownloader will be used in extensibility service to make the LC Public API call - }) - .then(_data => { - trados.showNotification( - "Get project quote public API call completed successfully. Download will begin shortly.", - trados.contexts.projects, - trados.notificationTypes.success - ); - }) - .catch(reason => { - console.error("Get project quote call failed", reason); - trados.showNotification( - "Get project quote public API call failed.", - trados.contexts.projects, - trados.notificationTypes.fail - ); - }); - - // api calls - add-on backend api (testfile download) - // todo: uncomment and check when add-on management add-on back-end proxy endpoint will support file download. currently only json responses are supported. - /* - const testFileAddOnApiCallRequestEvent = new CustomEvent( - EventType.CallAddonApi, - { - detail: { - config: { - extensionId: extensionId, - context: "projects", - url: "api/files/test-file/testfile.txt", - method: "GET", - fileName: "testfile.txt", - callId: "getTestFileAddonApiCall" - } - } - } - ); - window.dispatchEvent(testFileAddOnApiCallRequestEvent); - - // response handler - // todo: uncomment and check when add-on management add-on back-end proxy endpoint will support file download. currently only json responses are supported. - /* - if (apiCallCompleteDetail.callId === "getTestFileAddonApiCall") { - publish("showNotification", { - context: "projects", - type: apiCallCompleteDetail.success - ? "success" - : "fail", - text: apiCallCompleteDetail.success - ? "Test file download from add-on API call completed successfully. Download will begin shortly." - : "Test file download from add-on API call failed." - }); - } - */ -}; - -// duplicated create invoice functionality to exemplify how it works with the -// generated TypeScript client alternative -export const invoiceButtonGeneratedApiClicked = async ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - const projectId = detail.project!.id; - - // notifications - trados.showNotification( - "Requesting the export of the quote report (LC Public API ExportQuoteReport)", - trados.contexts.projects - ); - - /* remove try catch when https://jira.sdl.com/browse/LTLC-92923 fixed - const exportQuoteReport = await trados.apiClient.quoteApi.exportQuoteReport({ - projectId, - ...trados.getRegistrationResult() - }); - */ - try { - await trados.apiClient.quoteApi().exportQuoteReport({ - projectId, - ...trados.getRegistrationResult() - }); - } catch (error) { - // empty response instead of empty JSON response - https://jira.sdl.com/browse/LTLC-92923 - } - - //if (exportQuoteReport.id) { - let exportStatusChecks = 0; - let pollIntervalId: any = setInterval(async () => { - await trados.apiClient - .quoteApi() - .pollQuoteReportExport({ - projectId, - ...trados.getRegistrationResult() - }) - .then(pollResponse => { - exportStatusChecks++; - console.log("----pollResponse", pollResponse); - if (pollResponse.status === "completed") { - clearInterval(pollIntervalId); - pollIntervalId = null; - trados.apiClient - .quoteApi() - .downloadQuoteReport({ - projectId, - ...trados.getRegistrationResult() - }) - .then(blob => { - trados.showNotification( - "Download quote report completed successfully.
Preparing file. Download will begin shortly.", - trados.contexts.projects, - trados.notificationTypes.success - ); - - // for generated Public API, handle file download ourselves - download("quoteReport.pdf", blob); - }) - .catch(reason => { - console.log("Failed to download quote report.", reason); - trados.showNotification( - "Failed to download the quote report.", - trados.contexts.projects, - trados.notificationTypes.fail - ); - }); - } else { - if (exportStatusChecks === 9) { - clearInterval(pollIntervalId); - pollIntervalId = null; - trados.showNotification( - "The export status was verified 10 times and it's not yet complete. We've given up checking.", - trados.contexts.projects, - trados.notificationTypes.fail - ); - } - } - }) - .catch(reason => { - console.log("Failed to poll quote report export status.", reason); - trados.showNotification( - "Failed to poll quote report export status.", - trados.contexts.projects, - trados.notificationTypes.fail - ); - }); - }, 2000); // todo: 20000ms recommended interval, but isn't that too long a wait? - //} -}; - -// open in new tab -export const openNewTabButtonClicked = (detail: ExtensibilityEventDetail) => { - logExtensionData(detail); - const url = "https://www.rws.com"; - const windowName = "newTabFromLcUiExtension"; - window.open(url, windowName); -}; - -// navigate to project's template - set location and load new page -export const navigateButtonLoadRendered = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - // update button visible state - const hidden = Boolean(detail.project && !detail.project.id); - trados.updateElement("navigateButtonLoad", { - hidden: hidden - }); -}; - -// navigate to project's template - set location and load new page -export const navigateButtonLoadClicked = (detail: ExtensibilityEventDetail) => { - logExtensionData(detail); - if (detail.project?.projectTemplate) { - // either use project set in the render handler - // or use custom event's detail: e.detail which is requested via the action's payload in activated-extensions json - const projectTemplateId = detail.project.projectTemplate.id; // can be null; button is hidden if no project template id - const destinationPath = `resources/project-templates/${projectTemplateId}`; - - // navigate to LC page event - trados.navigate(destinationPath, trados.navigationTypes.load); - } -}; - -// navigate to project's template - rely on router controller, no page load -export const navigateButtonRouteRendered = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - // update button visible state - const hidden = Boolean(detail.project && !detail.project.id); - trados.updateElement("navigateButtonRoute", { - hidden: hidden - }); -}; - -// navigate to project's template - rely on router controller, no page load -export const navigateButtonRouteClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - if (detail.project?.projectTemplate) { - // either use project set in the render handler - // or use custom event's detail: e.detail which is requested via the action's payload in activated-extensions json - const projectTemplateId = detail.project.projectTemplate.id; // can be null; button is hidden if no project template id - const newPage = `resources/project-templates/${projectTemplateId}`; - - // navigate inside LC event - trados.navigate(newPage, trados.navigationTypes.route); - } -}; - -// get local data -export const getLocalDataButtonClicked = (detail: ExtensibilityEventDetail) => { - logExtensionData(detail); - if (detail.project) { - trados - .getLocalData(trados.contexts.projects) - .then(downloadData) - .catch(reason => { - console.error("Failed to get local data", reason); - trados.showNotification( - "Failed to get local data.", - trados.contexts.projects, - trados.notificationTypes.fail - ); - }); - } -}; - -// button rendered - setProjectImportanceButton -export const setProjectImportanceButtonRendered = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - currentProject = detail.project; // used in index.ts apiCallComplete handler - - // should get project importance call be made now?!? - if ( - detail.project && - !projectImportanceList.find(i => i.projectId === detail.project!.id) - ) { - console.log( - "[UI Extensibility] [extension] Get project importance from add-on API" - ); - // call add-on API to get project importance - trados - .callAddonApi({ - url: `api/project-metadata/project-id/${detail.project.id}`, - method: "GET" - }) - .then(data => { - if (data && data.responseData) { - if (data.responseData.errorCode) { - console.warn( - "Failed to get project metadata (importance).", - data.responseData.errorCode, - data.responseData.message - ); - } else { - if (typeof data.responseData !== "string") { - setGetProjectImportanceApiResponseHandler(data, false); - } - } - } - }) - .catch(reason => { - console.error("Failed to get project metadata (importance)", reason); - trados.showNotification( - "Failed to get local data.", - trados.contexts.projects, - trados.notificationTypes.fail - ); - }); - - // add to projectImportanceList as pending - projectImportanceList.push({ - projectId: detail.project.id!, - pending: true - }); - } -}; - -// call add-on API - POST/PUT/DELETE -export const setProjectImportanceButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - if (detail.project) { - const importanceToSet = detail.value; // extensibilityComponents sets value in menu item handler, so high/medium/low - if (importanceToSet) { - const currentProjectImportance = projectImportanceList.find( - (i: ProjectImportance) => - i.projectId === detail.project!.id && !i.pending - ); - // update button disabled state - trados.updateElement("setProjectImportanceButton", { - disabled: true - }); - - const deleteProjectImportance = importanceToSet === "none"; - if (deleteProjectImportance && currentProjectImportance) { - trados - .callAddonApi({ - url: `api/project-metadata/${currentProjectImportance.id}`, - method: "DELETE" - }) - .then(data => { - if (data.responseData && currentProject) { - // remove from local projectImportanceList - updateProjectImportanceList(data); - - // update button text - trados.updateElement("setProjectImportanceButton", { - icon: "x-fal fa-exclamation-circle", - text: "Set Importance", - disabled: false, - menuItems: [ - { - index: 4, // unset importance - disabled: true - } - ] - }); - } - }) - .catch(reason => { - console.error( - "Failed to delete project metadata (importance)", - reason - ); - trados.showNotification( - "Failed to delete project importance.", - trados.contexts.projects, - trados.notificationTypes.fail - ); - }); - } else { - trados - .callAddonApi({ - url: `api/project-metadata${currentProjectImportance ? "/" + currentProjectImportance.id : "" - }`, - method: currentProjectImportance ? "PUT" : "POST", - body: JSON.stringify({ - projectId: detail.project.id, - importance: importanceToSet - }) - }) - .then(data => { - setGetProjectImportanceApiResponseHandler(data, true); - }) - .catch(reason => { - console.error( - "Failed to set project metadata (importance)", - reason - ); - trados.showNotification( - "Failed to set project importance.", - trados.contexts.projects, - trados.notificationTypes.fail - ); - }); - } - } else { - // main button was clicked, not High/Medium/Low menu items, so do nothing - } - } -}; - -export const setGetProjectImportanceApiResponseHandler = ( - data: any, - isSetResponsone: boolean -) => { - if (data.responseData && currentProject) { - // update/add to local projectImportanceList - updateProjectImportanceList(data); - const respImportance = data.responseData.importance; - - // update button text - trados.updateElement("setProjectImportanceButton", { - icon: - respImportance.toLowerCase() === "high" - ? "x-fal fa-chevron-circle-up" - : respImportance.toLowerCase() === "medium" - ? "x-fal fa-dot-circle" - : respImportance.toLowerCase() === "low" - ? "x-fal fa-chevron-circle-down" - : "x-fal fa-exclamation-circle", - text: respImportance, - disabled: isSetResponsone ? false : undefined, - menuItems: [ - { - index: 4, // unset importance - disabled: false - } - ] - }); - } -}; \ No newline at end of file diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectsListToolbarHandlers.ts b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectsListToolbarHandlers.ts deleted file mode 100644 index c09cd80..0000000 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/projectsListToolbarHandlers.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { trados } from "@sdl/extensibility"; // doesn't work until new extensibility public package published -//import { trados } from "../../../../../../../public-packages/extensibility/src/index"; // works -import { ExtensibilityEventDetail } from "@sdl/extensibility-types/extensibility"; -import { downloadData, logExtensionData } from "./helpers"; - -export const getLocalSelectedProjectsDataButtonRendered = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - const button = document.getElementById(detail.domElementId); - const selectedProjects = detail.selectedProjects; - if (button && selectedProjects) { - // update button disabled state - trados.updateElement("getLocalSelectedProjectsDataButton", { - disabled: selectedProjects.length === 0 - }); - } -}; - -export const getLocalSelectedProjectsDataButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - const selectedProjects = detail.selectedProjects; - if (selectedProjects && selectedProjects.length) { - trados - .getLocalData( - trados.contexts.projects, - trados.dataSelectors.selectedProjects - ) - .then(downloadData) - .catch(_reason => { - debugger; // todo - }); - } else { - trados.showNotification( - "No selected projects", - trados.contexts.projects, - trados.notificationTypes.warning - ); - } -}; diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/taskDetailsHandlers.ts b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/taskDetailsHandlers.ts deleted file mode 100644 index 24c1628..0000000 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/taskDetailsHandlers.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { ExtensibilityEventDetail } from "@sdl/extensibility-types/extensibility"; -import { logExtensionData } from "./helpers"; - -// sidebar box (all tabs, not just Details tab) -export const taskDetailsSidebarBoxRendered = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - - const task = detail.task; - console.log("[UI Extensibility] [extension] Task data", task); - - // extensionHelper is the elementId of the tab (in activated-extension.json config) - const boxContentWrapper = document.getElementById(detail.domElementId); - if (boxContentWrapper) { - // reset content for rerenders - boxContentWrapper.innerHTML = ""; - // create div - const div = document.createElement("div"); - div.innerHTML = `Custom sidebar box content inserted on render.
${ - task ? task.id : "No task id available." - }`; - boxContentWrapper.appendChild(div); - } -}; - -export const taskDetailsToolbarButtonRendered = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - const button = document.getElementById(detail.domElementId); - const task = detail.task; - if (button && task) { - console.log("RENDERED DETAILS TOOLBAR BUTTON"); - } -}; - -export const taskDetailsToolbarButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - const task = detail.task; - console.log("CLICKED DETAILS TOOLBAR BUTTON", task); -}; - -// panel rendered -export const detailsMainBoxRendered = ( - detail: ExtensibilityEventDetail, - panelIndex: number -) => { - logExtensionData(detail); - - // extensionHelper is the elementId of the tab (in activated-extension.json config) - const panelContentWrapper = document.getElementById(detail.domElementId); - if (panelContentWrapper) { - // reset content for rerenders - panelContentWrapper.innerHTML = ""; - - // create div - const div = document.createElement("div"); - div.innerHTML = `Custom panel ${panelIndex} content inserted on render.`; - panelContentWrapper.appendChild(div); - } -}; - -// files tab -export const taskFilesToolbarButtonRendered = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - const button = document.getElementById(detail.domElementId); - const task = detail.task; - if (button && task) { - console.log("RENDERED FILES TOOLBAR BUTTON"); - } -}; - -export const taskFilesToolbarButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - const task = detail.task; - const selectedFiles = detail.selectedFiles; - console.log("CLICKED FILES TOOLBAR BUTTON", task, selectedFiles); -}; diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/taskTabbarHandlers.ts b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/taskTabbarHandlers.ts deleted file mode 100644 index 77d21ef..0000000 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/taskTabbarHandlers.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { ExtensibilityEventDetail } from "@sdl/extensibility-types/extensibility"; -import { logExtensionData } from "./helpers"; - -let renderCount = 0; - -export const taskTabRendered = (detail: ExtensibilityEventDetail) => { - logExtensionData(detail); - renderCount++; - - // custom-tab is the elementId of the tab (in activated-extension.json config) - const tabContentWrapper = document.getElementById(detail.domElementId); - if (tabContentWrapper) { - // reset content for rerenders - tabContentWrapper.innerHTML = ""; - - // create heading - const heading = document.createElement("div"); - heading.className = "x-panel-header-title-light-framed"; - heading.setAttribute("style", "margin-bottom: 10px"); - heading.innerHTML = `Custom tab rendered ${renderCount} times.`; - - //task details selector set as event payload - const task = detail.task; - console.log("[UI Extensibility] [extension] Task from event", task); - // add heading to tab - tabContentWrapper.appendChild(heading); - tabContentWrapper.style.position = "relative"; - } -}; diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/taskToolbarHandlers.ts b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/taskToolbarHandlers.ts deleted file mode 100644 index acc5d4d..0000000 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/taskToolbarHandlers.ts +++ /dev/null @@ -1,483 +0,0 @@ -import { trados } from "@sdl/extensibility"; // doesn't work until new extensibility public package published -//import { trados } from "../../../../../../../public-packages/extensibility/src/index"; // works -import { ExtensibilityEventDetail } from "@sdl/extensibility-types/extensibility"; -import { download, logExtensionData } from "./helpers"; -import { TargetFile } from "@sdl/extensibility/lib/lc-public-api/models"; - -export const compareTaskApiToLocalDataButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - const clickedSelector = detail.value; // extensibilityComponents sets value in menu item handler, so selector string - - if (clickedSelector) { - switch (clickedSelector) { - case "selectedNewTasks": - const newTasks = detail.selectedNewTasks; - if (newTasks?.length) { - // notification - trados.showNotification( - `Getting data via Public API for ${newTasks.length} selected new task(s)`, - trados.contexts.taskInbox, - trados.notificationTypes.info - ); - - // task api call for every selected task - Promise.all( - newTasks.map(t => - trados.apiClient.taskApi().getTask({ - taskId: t.id, - ...trados.getRegistrationResult(), - fields: - "id,status,taskType,input,inputFiles,owner,assignees,dueBy,createdAt,outcome,comment,project,failedTask,completedAt" - }) - ) - ) - .then(apiData => { - // notification - trados.showNotification( - "Downloading files for comparison", - trados.contexts.taskInbox, - trados.notificationTypes.info - ); - - // download - download( - `compare-api-data-${clickedSelector}.json`, - JSON.stringify(apiData) - ); - download( - `compare-ui-data-${clickedSelector}.json`, - JSON.stringify(newTasks) - ); - }) - .catch(e => { - console.error( - `[UI Extensibility] [extension] At least one API call failed`, - e - ); - }); - } else { - // notification - trados.showNotification( - "No tasks selected in inbox new tasks tab", - trados.contexts.taskInbox, - trados.notificationTypes.warning - ); - } - break; - case "selectedActiveTasks": - const activeTasks = detail.selectedActiveTasks; - if (activeTasks?.length) { - // notification - trados.showNotification( - `Getting data via Public API for ${activeTasks.length} selected new task(s)`, - trados.contexts.taskInbox, - trados.notificationTypes.info - ); - - // task api call for every selected task - Promise.all( - activeTasks.map(t => - trados.apiClient.taskApi().getTask({ - taskId: t.id, - ...trados.getRegistrationResult(), - fields: - "id,status,taskType,input,inputFiles,owner,assignees,dueBy,createdAt,outcome,comment,project,failedTask,completedAt" - }) - ) - ) - .then(apiData => { - // notification - trados.showNotification( - "Downloading files for comparison", - trados.contexts.taskInbox, - trados.notificationTypes.info - ); - - // download - download( - `compare-api-data-${clickedSelector}.json`, - JSON.stringify(apiData) - ); - download( - `compare-ui-data-${clickedSelector}.json`, - JSON.stringify(activeTasks) - ); - }) - .catch(e => { - console.error( - `[UI Extensibility] [extension] At least one API call failed`, - e - ); - }); - } else { - // notification - trados.showNotification( - "No tasks selected in inbox active tasks tab", - trados.contexts.taskInbox, - trados.notificationTypes.warning - ); - } - break; - case "selectedCompletedTasks": - const completedTasks = detail.selectedCompletedTasks; - if (completedTasks?.length) { - // notification - trados.showNotification( - `Getting data via Public API for ${completedTasks.length} selected new task(s)`, - trados.contexts.taskInbox, - trados.notificationTypes.info - ); - - // task api call for every selected task - Promise.all( - completedTasks.map(t => - trados.apiClient.taskApi().getTask({ - taskId: t.id, - ...trados.getRegistrationResult(), - fields: - "id,status,taskType,input,inputFiles,owner,assignees,dueBy,createdAt,outcome,comment,project,failedTask,completedAt" - }) - ) - ) - .then(apiData => { - // notification - trados.showNotification( - "Downloading files for comparison", - trados.contexts.taskInbox, - trados.notificationTypes.info - ); - - // download - download( - `compare-api-data-${clickedSelector}.json`, - JSON.stringify(apiData) - ); - download( - `compare-ui-data-${clickedSelector}.json`, - JSON.stringify(completedTasks) - ); - }) - .catch(e => { - console.error( - `[UI Extensibility] [extension] At least one API call failed`, - e - ); - }); - } else { - // notification - trados.showNotification( - "No tasks selected in inbox completed tasks tab", - trados.contexts.taskInbox, - trados.notificationTypes.warning - ); - } - break; - case "newTaskPreview": - const newTaskPreview = detail.newTaskPreview; - if (newTaskPreview) { - // notification - trados.showNotification( - "Getting data via Public API", - trados.contexts.taskInbox, - trados.notificationTypes.info - ); - - // task api call - trados.apiClient - .taskApi() - .getTask({ - taskId: newTaskPreview.id, - ...trados.getRegistrationResult(), - fields: - "id,status,taskType,input,inputFiles,owner,assignees,dueBy,createdAt,outcome,comment,project,failedTask,completedAt" - }) - .then(apiData => { - // notification - trados.showNotification( - "Downloading files for comparison", - trados.contexts.taskInbox, - trados.notificationTypes.info - ); - - // download - download( - `compare-api-data-${clickedSelector}.json`, - JSON.stringify(apiData) - ); - download( - `compare-ui-data-${clickedSelector}.json`, - JSON.stringify(newTaskPreview) - ); - }) - .catch(e => { - console.error( - `[UI Extensibility] [extension] API call failed`, - e - ); - }); - } else { - // notification - trados.showNotification( - "No new task preview", - trados.contexts.taskInbox, - trados.notificationTypes.warning - ); - } - break; - case "activeTaskPreview": - const activeTaskPreview = detail.activeTaskPreview; - if (activeTaskPreview) { - // notification - trados.showNotification( - "Getting data via Public API", - trados.contexts.taskInbox, - trados.notificationTypes.info - ); - - // task api call - trados.apiClient - .taskApi() - .getTask({ - taskId: activeTaskPreview.id, - ...trados.getRegistrationResult(), - fields: - "id,status,taskType,input,inputFiles,owner,assignees,dueBy,createdAt,outcome,comment,project,failedTask,completedAt" - }) - .then(apiData => { - // notification - trados.showNotification( - "Downloading files for comparison", - trados.contexts.taskInbox, - trados.notificationTypes.info - ); - - // download - download( - `compare-api-data-${clickedSelector}.json`, - JSON.stringify(apiData) - ); - download( - `compare-ui-data-${clickedSelector}.json`, - JSON.stringify(activeTaskPreview) - ); - }) - .catch(e => { - console.error( - `[UI Extensibility] [extension] API call failed`, - e - ); - }); - } else { - // notification - trados.showNotification( - "No active task preview", - trados.contexts.taskInbox, - trados.notificationTypes.warning - ); - } - break; - case "completedTaskPreview": - const completedTaskPreview = detail.completedTaskPreview; - if (completedTaskPreview) { - // notification - trados.showNotification( - "Getting data via Public API", - trados.contexts.taskInbox, - trados.notificationTypes.info - ); - - // task api call - trados.apiClient - .taskApi() - .getTask({ - taskId: completedTaskPreview.id, - ...trados.getRegistrationResult(), - fields: - "id,status,taskType,input,inputFiles,owner,assignees,dueBy,createdAt,outcome,comment,project,failedTask,completedAt" - }) - .then(apiData => { - // notification - trados.showNotification( - "Downloading files for comparison", - trados.contexts.taskInbox, - trados.notificationTypes.info - ); - - // download - download( - `compare-api-data-${clickedSelector}.json`, - JSON.stringify(apiData) - ); - download( - `compare-ui-data-${clickedSelector}.json`, - JSON.stringify(completedTaskPreview) - ); - }) - .catch(e => { - console.error( - `[UI Extensibility] [extension] API call failed`, - e - ); - }); - } else { - // notification - trados.showNotification( - "No completed task preview", - trados.contexts.taskInbox, - trados.notificationTypes.warning - ); - } - break; - case "task": - const task = detail.task; - if (task) { - // notification - trados.showNotification( - "Getting data via Public API", - trados.contexts.taskInbox, - trados.notificationTypes.info - ); - - // task api call - trados.apiClient - .taskApi() - .getTask({ - taskId: task.id, - ...trados.getRegistrationResult(), - fields: - "id,status,taskType,input,inputFiles,owner,assignees,dueBy,createdAt,outcome,comment,project,failedTask,completedAt" - }) - .then(apiData => { - // notification - trados.showNotification( - "Downloading files for comparison", - trados.contexts.taskInbox, - trados.notificationTypes.info - ); - - // download - download( - `compare-api-data-${clickedSelector}.json`, - JSON.stringify(apiData) - ); - download( - `compare-ui-data-${clickedSelector}.json`, - JSON.stringify(task) - ); - }) - .catch(e => { - console.error( - `[UI Extensibility] [extension] API call failed`, - e - ); - }); - } - break; - case "selectedFiles": - const files = detail.selectedFiles; // if file has status property, call targetFileApi instead of sourceFileApi - const taskProject = detail.task?.project; - if (taskProject && files?.length) { - // notification - trados.showNotification( - "Getting data via Public API", - trados.contexts.taskInbox, - trados.notificationTypes.info - ); - - // file api call for every selected file - Promise.all( - files.map(f => { - const fileIsTargetFile = Boolean((f as TargetFile).status); // todo: detect source vs target from selector data (only id, name, status properties) - if (fileIsTargetFile) { - // target file - return trados.apiClient.targetFileApi().getTargetFile({ - projectId: taskProject.id, - targetFileId: f.id, - ...trados.getRegistrationResult(), - fields: - "id,name,languageDirection,sourceFile,latestVersion,analysisStatistics,status" - }); - } else { - // source file - return trados.apiClient.sourceFileApi().getSourceFile({ - projectId: taskProject.id, - sourceFileId: f.id, - ...trados.getRegistrationResult(), - fields: "id,name,role,language,versions,targetLanguages,path" - }); - } - }) - ) - .then(apiData => { - // notification - trados.showNotification( - "Downloading files for comparison", - trados.contexts.taskInbox, - trados.notificationTypes.info - ); - - // download - download( - `compare-api-data-${clickedSelector}.json`, - JSON.stringify(apiData) - ); - download( - `compare-ui-data-${clickedSelector}.json`, - JSON.stringify(files) - ); - }) - .catch(e => { - console.error( - `[UI Extensibility] [extension] At least one API call failed`, - e - ); - }); - } else { - // notification - trados.showNotification( - "No files selected in task files tab", - trados.contexts.taskInbox, - trados.notificationTypes.warning - ); - } - break; - case "inboxActiveTab": - const inboxActiveTab = detail.inboxActiveTab; - // notification only - trados.showNotification( - `The active tab in the inbox view is ${inboxActiveTab}`, - trados.contexts.taskInbox, - trados.notificationTypes.info - ); - break; - case "taskActiveTab": - const taskActiveTab = detail.taskActiveTab; - // notification only - trados.showNotification( - `The active tab in the task details view is ${taskActiveTab}`, - trados.contexts.taskInbox, - trados.notificationTypes.info - ); - break; - } - } -}; - -export const taskToolbarButtonRendered = (detail: ExtensibilityEventDetail) => { - logExtensionData(detail); - const button = document.getElementById(detail.domElementId); - const task = detail.task; - if (button) { - console.log("RENDERED TASK TOOLBAR BUTTON", task); - } -}; - -export const taskToolbarButtonClicked = (detail: ExtensibilityEventDetail) => { - logExtensionData(detail); - if (detail.task) { - const task = detail.task; - console.log("CLICKED TASK TOOLBAR BUTTON", task); - } -}; diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/tasksListPreviewHandlers.ts b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/tasksListPreviewHandlers.ts deleted file mode 100644 index 3813525..0000000 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/tasksListPreviewHandlers.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { ExtensibilityEventDetail } from "@sdl/extensibility-types/extensibility"; -import { Task } from "@sdl/extensibility/dist/lib/lc-public-api/models"; - -import { logExtensionData } from "./helpers"; - -let taskPreview: Task | undefined = undefined; - -export const taskSidebarBoxRendered = (detail: ExtensibilityEventDetail) => { - logExtensionData(detail); - const boxContentWrapper: HTMLElement | null = document.getElementById( - detail.domElementId - ); - taskPreview = - detail.newTaskPreview || - detail.activeTaskPreview || - detail.completedTaskPreview || - undefined; // reset previous taskPreview? - - console.log( - "[UI Extensibility] [extension] Update preview sidebar box", - boxContentWrapper, - taskPreview - ); - - if (boxContentWrapper && taskPreview) { - const filename = taskPreview.inputFiles?.length - ? taskPreview.inputFiles[0].sourceFile?.name - : ""; - - // version 1: create html element and add to DOM - boxContentWrapper.innerHTML = ""; - // create div - const div = document.createElement("div"); - div.innerHTML = `Custom sidebar box content inserted on render.
Task description: ${ - filename ? filename : "no inputFiles" - }`; - boxContentWrapper.appendChild(div); - /* - // version 2: don't create html element and add to DOM; just change innerHTML - boxContentWrapper.innerHTML = `Custom sidebar box content inserted on render.
Task description: ${ - filename ? filename : "no filename in metadata" - }`; - */ - } else { - console.error( - `[UI Extensibility] [extension] No boxContentWrapper or taskPreview data` - ); - } -}; diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/tasksListToolbarHandlers.ts b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/tasksListToolbarHandlers.ts deleted file mode 100644 index f376336..0000000 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/handlers/tasksListToolbarHandlers.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { ExtensibilityEventDetail } from "@sdl/extensibility-types/extensibility"; -import { logExtensionData } from "./helpers"; - -let selectedNewTasks: undefined | any[] = undefined; -let selectedActiveTasks: undefined | any[] = undefined; -let selectedCompletedTasks: undefined | any[] = undefined; - -export const newTasksListToolbarButtonRendered = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - const button = document.getElementById(detail.domElementId); - selectedNewTasks = detail.selectedNewTasks; - if (button && selectedNewTasks) { - console.log("RENDERED NEW"); - } -}; - -export const newTasksListToolbarButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - if (detail.selectedNewTasks) { - selectedNewTasks = detail.selectedNewTasks; - console.log("CLICKED NEW", selectedNewTasks); - } -}; - -export const activeTasksListToolbarButtonRendered = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - const button = document.getElementById(detail.domElementId); - selectedActiveTasks = detail.selectedActiveTasks; - if (button && selectedActiveTasks) { - console.log("RENDERED ACTIVE"); - } -}; - -export const activeTasksListToolbarButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - if (detail.selectedActiveTasks) { - selectedActiveTasks = detail.selectedActiveTasks; - console.log("CLICKED ACTIVE", selectedActiveTasks); - } -}; - -export const completedTasksListToolbarButtonRendered = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - const button = document.getElementById(detail.domElementId); - selectedCompletedTasks = detail.selectedCompletedTasks; - if (button && selectedCompletedTasks) { - console.log("RENDERED COMPLETED"); - } -}; - -export const completedTasksListToolbarButtonClicked = ( - detail: ExtensibilityEventDetail -) => { - logExtensionData(detail); - if (detail.selectedCompletedTasks) { - selectedCompletedTasks = detail.selectedCompletedTasks; - console.log("CLICKED COMPLETED", selectedCompletedTasks); - } -}; diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/index.ts b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/index.ts index 75b5527..09ac03f 100644 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/index.ts +++ b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/index.ts @@ -1,1322 +1,327 @@ -/************************************************* - * this file is based on C:\SDL-Products\nimbus-ui\packages\projects\src\extensibility\PoCExtension.ts - * but wrapped into a self-invoked function - * - * the config is mocked in activated-extensions.json - * the extension script is mocked in the current file: run "tsc" from C:\SDL-Products\nimbus-ui\packages\projects-app\src\mocks\ui-extensibility to update the PoCExtension.js file - * the extension script is a self invoked function in this file that should be served by a separate website to simulate a third party resource: see https://confluence.sdl.com/display/LPD/UI+PoC+Add-on+-+Local+Setup for details - *************************************************/ -import { trados } from "@sdl/extensibility"; -import { - ExtensionElement, - ExtensibilityEventDetail, - ElementType -} from "@sdl/extensibility-types/extensibility"; +// Import the trados object and the ExtensionElement and ExtensibilityEventDetail types from the trados-ui-extensibility. +import { trados, ExtensionElement, ExtensibilityEventDetail } from "@trados/trados-ui-extensibility"; -// projects handlers -import { - backToDefaultFontSizeButtonClicked, - dashboardMainPanelRendered, - dashboardSidebarBoxRendered, - getLocalDashboardDataButtonClicked, - increaseFontSizeButtonClicked -} from "./handlers/projectDashboardHandlers"; -import { - getLocalFilesDataButtonClicked, - hideNotTranslatedFilesButtonClicked, - showAllFilesButtonClicked -} from "./handlers/projectFilesHandlers"; -import { - getLocalSelectedProjectsDataButtonRendered, - getLocalSelectedProjectsDataButtonClicked -} from "./handlers/projectsListToolbarHandlers"; -import { - getLocalStagesDataButtonClicked, - highlightPopulatedStagesButtonClicked, - removeStagesHighlightsButtonClicked -} from "./handlers/projectStagesHadlers"; -import { extensionsHelperTabRendered } from "./handlers/projectTabbarHandlers"; -import { - getLocalTaskHistoryDataButtonClicked, - hideFailedTasksButtonClicked, - highlightSelectedTaskButtonClicked, - highlightSelectedTaskButtonRendered, - showAllTasksButtonClicked, - taskHistorySidebarBoxRendered -} from "./handlers/projectTaskHistoryHandlers"; -import { - compareProjectApiToLocalDataButtonClicked, - getLocalDataButtonClicked, - invoiceButtonClicked, - invoiceButtonGeneratedApiClicked, - invoiceButtonRendered, - navigateButtonLoadClicked, - navigateButtonLoadRendered, - navigateButtonRouteClicked, - navigateButtonRouteRendered, - openNewTabButtonClicked, - setProjectImportanceButtonClicked, - setProjectImportanceButtonRendered -} from "./handlers/projectToolbarHandlers"; +// Import my extension's event handlers. +import { myCustomPanelRendered, myCustomSidebarBoxRendered, myCustomTabRendered } from "./handlers/panelsHandlers" +import { myNavigateButtonRendered, myNavigateButtonClicked, myGetUiDataButtonClicked, callAppApiButtonClicked, callPublicApiButtonRendered, callPublicApiButtonClicked } from "./handlers/buttonsHandlers"; -// task-inbox handlers -import { - activeTasksListToolbarButtonClicked, - activeTasksListToolbarButtonRendered, - completedTasksListToolbarButtonClicked, - completedTasksListToolbarButtonRendered, - newTasksListToolbarButtonClicked, - newTasksListToolbarButtonRendered -} from "./handlers/tasksListToolbarHandlers"; -import { taskSidebarBoxRendered } from "./handlers/tasksListPreviewHandlers"; -import { - compareTaskApiToLocalDataButtonClicked, - taskToolbarButtonClicked, - taskToolbarButtonRendered -} from "./handlers/taskToolbarHandlers"; -import { taskTabRendered } from "./handlers/taskTabbarHandlers"; -import { - detailsMainBoxRendered, - taskDetailsToolbarButtonClicked, - taskDetailsToolbarButtonRendered, - taskFilesToolbarButtonClicked, - taskFilesToolbarButtonRendered, - taskDetailsSidebarBoxRendered -} from "./handlers/taskDetailsHandlers"; - - -// extension elements: the JSON describing custom elements that will be added in the UI +// First create the extension elements array which describes the custom elements that will be added in the UI. const elements: ExtensionElement[] = [ - // projects elements - /* - { - elementId: "compareApiToLocalDataButton", - icon: "x-fal fa-copy", - text: "API vs Local data", - location: "project-details-toolbar", - type: "button", - hidden: false, - menu: [ - { - text: "selectedProjects", - value: "selectedProjects", - icon: "x-fal fa-copy" - }, - { - text: "project", - value: "project", - icon: "x-fal fa-copy" - }, - { - text: "selectedFile", - value: "selectedFile", - icon: "x-fal fa-copy" - }, - { - text: "selectedFiles", - value: "selectedFiles", - icon: "x-fal fa-copy" - }, - { - text: "selectedTaskHistoryTask", - value: "selectedTaskHistoryTask", - icon: "x-fal fa-copy" - }, - { - text: "selectedStagesTasks", - value: "selectedStagesTasks", - icon: "x-fal fa-copy" - }, - { separator: true }, - { - text: "projectActiveTab (notification only)", - value: "projectActiveTab", - icon: "x-fal fa-exclamation-circle" - } - ], - actions: [ - { - eventType: "onclick", - eventHandler: compareProjectApiToLocalDataButtonClicked, - payload: [ - "selectedProjects", - "project", - "selectedFile", - "selectedFiles", - "selectedTaskHistoryTask", - "selectedStagesTasks", - "projectActiveTab" - ] - } - ] - },*/ + // Button that calls my own app's API. + // The API endpoint code is available in Controllers/GreetingController.cs. + // A notification is shown containing a greeting message. { - elementId: "invoiceButton", - icon: "x-fal fa-newspaper", - text: "Create Invoice", - location: "project-details-toolbar", - type: "button", - hidden: true, - actions: [ - { - eventType: "onrender", - eventHandler: invoiceButtonRendered, - payload: [] - }, - { - eventType: "onclick", - eventHandler: invoiceButtonClicked, - payload: ["project"] - } - ] - }, - { - elementId: "invoiceButtonGeneratedApi", - icon: "x-fal fa-newspaper", - text: "Create Invoice (generated API)", - location: "project-details-toolbar", + elementId: "callAppApiButton", + icon: "x-fal fa-smile", + text: "Hello, App!", + location: "projects-list-toolbar", type: "button", - hidden: true, actions: [ - { - eventType: "onrender", - eventHandler: invoiceButtonRendered, - payload: [] - }, { eventType: "onclick", - eventHandler: invoiceButtonGeneratedApiClicked, + eventHandler: callAppApiButtonClicked, payload: ["project"] } ] }, - /* - { - elementId: "openNewTabButton", - icon: "x-fal fa-external-link", - iconAlign: "right", - text: "Open rws.com in New tab", - location: "project-details-toolbar", - type: "button", - actions: [ - { - eventType: "onclick", - eventHandler: openNewTabButtonClicked, - payload: ["project"] - } - ] - },*/ - { - elementId: "openNewTabButtonLink", - icon: "x-fal fa-external-link", - text: "Open rws.com in New tab", - location: "project-details-toolbar", + + // Link button - button with isLink property set to true. + // Notice there is no "action" property specified. + // The "href" property acts similarly to the href attribute of an HTML anchor element and the "href" URL gets opened in a new tab. + { + elementId: "myLinkButton", + // Custom buttons with isLink: true are automatically displayed with an "external-link" icon aligned to the right of the button. + // You can override this default behaviour by explicitly setting the "icon"" or "iconAlign"" properties. + icon: "x-fal fa-book", + iconAlign: "left", + text: "Extensibility Docs", + location: "projects-list-toolbar", type: "button", isLink: true, - href: "https://www.rws.com" + href: "https://languagecloud.sdl.com/lc/extensibility-docs" }, - /* + + // Button that calls the Language Cloud Public API. + // Hidden initially; only shown for projects created based on a project template. + // Shows a notification containing the name of the project template associated with the current project. { - elementId: "navigateButtonLoad", - icon: "x-fal fa-clipboard", - text: "View Project Template (page load)", + elementId: "callPublicApiButton", + icon: "x-fal fa-info", + text: "Show Project Template Name", location: "project-details-toolbar", type: "button", hidden: true, actions: [ { eventType: "onrender", - eventHandler: navigateButtonLoadRendered, - payload: ["project"] + eventHandler: callPublicApiButtonRendered, + // Specific to onrender: the event handler is called with a default data-selector included in the event detail. + // The default data-selector depends on context; in this case, it's the current project details. + payload: [] }, { eventType: "onclick", - eventHandler: navigateButtonLoadClicked, + eventHandler: callPublicApiButtonClicked, payload: ["project"] } ] - },*/ + }, + + // Button that navigates to the project's template details view. + // Hidden initially; only shown for projects created based on a project template. + // In the onrender event handler, myNavigateButtonRendered, the button's hidden property is updated depending on whether the current project has a project template or not. { - elementId: "navigateButtonRoute", - icon: "x-fal fa-clipboard", - text: "View Project Template", // (route)", + elementId: "myNavigateButton", + icon: "x-fal fa-location-arrow", + text: "Navigate to Project Template", location: "project-details-toolbar", type: "button", hidden: true, actions: [ { eventType: "onrender", - eventHandler: navigateButtonRouteRendered, - payload: ["project"] + eventHandler: myNavigateButtonRendered, + // Specific to onrender: even if the payload for the onrender event is an empty array, + // the event handler gets called with a default data-selector included in the event detail. + // The default data-selector depends on context and location; in this case, it's the current project details. + payload: [] }, { eventType: "onclick", - eventHandler: navigateButtonRouteClicked, + eventHandler: myNavigateButtonClicked, payload: ["project"] } ] }, + + // Button that retrieves a portion of the data available in the UI and shows a notification in the top right of the view. + // The notification will display + // - the active tab in the project details view (retrieved via the onrender action's payload) and + // - the selected projects in the projects list view (retrieved using the trados.getLocalData function). { - elementId: "getLocalDataButton", - icon: "x-fal fa-table", - text: "Get Local Data", + elementId: "myGetUiDataButton", + icon: "x-fal fa-hand-pointer", + text: "Get UI Data", location: "project-details-toolbar", type: "button", actions: [ { eventType: "onclick", - eventHandler: getLocalDataButtonClicked, - //payload: ["project"] - payload: [ - "selectedProjects", - "project", - "selectedFile", - "selectedFiles", - "selectedTaskHistoryTask", - "selectedStagesTasks", - "projectActiveTab" - ] + eventHandler: myGetUiDataButtonClicked, + payload: ["projectActiveTab"] } ] }, + + // Dropdown button that updates the properties of the next button (myTargetButton). { - elementId: "setProjectImportanceButton", - icon: "x-fal fa-exclamation-circle", - text: "Set Importance", + elementId: "myDropdownButton", + icon: "x-fal fa-chevron-right", + text: "Update Target Button", location: "project-details-toolbar", type: "button", menu: [ + // Toggle myTargetButton's hidden property. { - text: "High", - value: "high", - icon: "x-fal fa-chevron-circle-up" + icon: "x-fal fa-angle-right", + text: "Hide", + value: "hide" }, { - text: "Medium", - value: "medium", - icon: "x-fal fa-dot-circle" + icon: "x-fal fa-angle-right", + text: "Show", + value: "show" }, { - text: "Low", - value: "low", - icon: "x-fal fa-chevron-circle-down" + separator: true }, - { separator: true }, - { - text: "Unset importance", - value: "none", - icon: "x-fal fa-trash", - disabled: true - } - ], - actions: [ - { - eventType: "onrender", - eventHandler: setProjectImportanceButtonRendered, - payload: [] - }, - { - eventType: "onclick", - eventHandler: setProjectImportanceButtonClicked, - payload: ["project"] - } - ] - }, - { - elementId: "extensionsHelper", - text: "Extensions Helper", - location: "project-details-tabpanel", - type: "tab", - actions: [ - { - eventType: "onrender", - eventHandler: extensionsHelperTabRendered, - payload: ["project", "selectedProjects"] - } - ] - }, - { - elementId: "dashboardMain1Box", - text: "Custom Panel 1", - location: "project-details-dashboard-main", - type: "panel", - actions: [ - { - eventType: "onrender", - eventHandler: (detail: ExtensibilityEventDetail) => { - dashboardMainPanelRendered(detail, 1); - }, - payload: [] - } - ] - }, - { - elementId: "dashboardMain2Box", - text: "Custom Panel 2", - location: "project-details-dashboard-main", - type: "panel", - actions: [ - { - eventType: "onrender", - eventHandler: (detail: ExtensibilityEventDetail) => { - dashboardMainPanelRendered(detail, 2); - }, - payload: [] - } - ] - }, - { - elementId: "dashboardMain3Box", - text: "Custom Panel 3", - location: "project-details-dashboard-main", - type: "panel", - actions: [ - { - eventType: "onrender", - eventHandler: (detail: ExtensibilityEventDetail) => { - dashboardMainPanelRendered(detail, 3); - }, - payload: [] - } - ] - }, - { - elementId: "dashboardSidebarBox", - text: "Sidebar Box", - location: "project-details-dashboard-sidebar", - type: "sidebarBox", - actions: [ - { - eventType: "onrender", - eventHandler: dashboardSidebarBoxRendered, - payload: [] - } - ] - }, - { - elementId: "getLocalDashboardDataButton", - icon: "x-fal fa-table", - iconAlign: "right", - text: "Get Local Data", - location: "project-details-dashboard-toolbar", - type: "button", - actions: [ - { - eventType: "onclick", - eventHandler: getLocalDashboardDataButtonClicked, - payload: [] - } - ] - }, - { - elementId: "increaseFontSizeButton", - icon: "x-fal fa-font", - iconAlign: "right", - text: "Increase font size", - location: "project-details-dashboard-toolbar", - type: "button", - actions: [ - { - eventType: "onclick", - eventHandler: increaseFontSizeButtonClicked, - payload: [] - } - ] - }, - { - elementId: "backToDefaultFontSizeButton", - icon: "x-fal fa-arrow-down", - iconAlign: "right", - text: "Back to default font size", - location: "project-details-dashboard-toolbar", - type: "button", - actions: [ - { - eventType: "onclick", - eventHandler: backToDefaultFontSizeButtonClicked, - payload: [] - } - ] - }, - { - elementId: "getLocalStagesDataButton", - icon: "x-fal fa-calendar", - iconAlign: "right", - text: "Get local data", - location: "project-details-stages-toolbar", - type: "button", - actions: [ - { - eventType: "onclick", - eventHandler: getLocalStagesDataButtonClicked, - payload: [] - } - ] - }, - { - elementId: "highlightPopulatedStagesButton", - icon: "x-fal fa-folder-open", - iconAlign: "right", - text: "Highlight populated stages", - location: "project-details-stages-toolbar", - type: "button", - actions: [ - { - eventType: "onclick", - eventHandler: highlightPopulatedStagesButtonClicked, - payload: [] - } - ] - }, - { - elementId: "removeStagesHighlightsButton", - icon: "x-fal fa-folder", - iconAlign: "right", - text: "Remove stages highlights", - location: "project-details-stages-toolbar", - type: "button", - actions: [ - { - eventType: "onclick", - eventHandler: removeStagesHighlightsButtonClicked, - payload: [] - } - ] - }, - { - elementId: "getLocalFilesDataButton", - icon: "x-fal fa-calendar", - iconAlign: "right", - text: "Get local data", - location: "project-details-files-toolbar", - type: "button", - actions: [ - { - eventType: "onclick", - eventHandler: getLocalFilesDataButtonClicked, - payload: [] - } - ] - }, - { - elementId: "hideNotTranslatedFilesButton", - icon: "x-fal fa-ban", - iconAlign: "right", - text: "Hide not translated files", - location: "project-details-files-toolbar", - type: "button", - actions: [ - { - eventType: "onclick", - eventHandler: hideNotTranslatedFilesButtonClicked, - payload: [] - } - ] - }, - { - elementId: "showAllFilesButton", - icon: "x-fal fa-bars", - iconAlign: "right", - text: "Show all files", - location: "project-details-files-toolbar", - type: "button", - actions: [ - { - eventType: "onclick", - eventHandler: showAllFilesButtonClicked, - payload: [] - } - ] - }, - { - elementId: "getLocalTaskHistoryDataButton", - icon: "x-fal fa-calendar", - iconAlign: "right", - text: "Get local data", - location: "project-details-task-history-toolbar", - type: "button", - actions: [ - { - eventType: "onclick", - eventHandler: getLocalTaskHistoryDataButtonClicked, - payload: [] - } - ] - }, - { - elementId: "hideFailedTasksButton", - icon: "x-fal fa-ban", - iconAlign: "right", - text: "Hide Failed tasks", - location: "project-details-task-history-toolbar", - type: "button", - actions: [ - { - eventType: "onclick", - eventHandler: hideFailedTasksButtonClicked, - payload: [] - } - ] - }, - { - elementId: "showAllButton", - icon: "x-fal fa-bars", - iconAlign: "right", - text: "Show all tasks", - location: "project-details-task-history-toolbar", - type: "button", - actions: [ - { - eventType: "onclick", - eventHandler: showAllTasksButtonClicked, - payload: [] - } - ] - }, - { - elementId: "taskHistorySidebarBox", - text: "Sidebar Box", - location: "project-details-task-history-sidebar", - type: "sidebarBox", - actions: [ - { - eventType: "onrender", - eventHandler: taskHistorySidebarBoxRendered, - payload: ["selectedTaskHistoryTask"] - } - ] - }, - { - elementId: "highlightSelectedTaskButton", - icon: "x-fal fa-folder-open", - iconAlign: "right", - text: "Highlight selected tasks", - location: "project-details-task-history-toolbar", - type: "button", - actions: [ - { - eventType: "onrender", - eventHandler: highlightSelectedTaskButtonRendered, - payload: ["selectedTaskHistoryTask"] - }, - { - eventType: "onclick", - eventHandler: highlightSelectedTaskButtonClicked, - payload: [] - } - ] - }, - { - elementId: "getLocalSelectedProjectsDataButton", - icon: "x-fal fa-table", - iconAlign: "right", - text: "Get selection data", - location: "projects-list-toolbar", - type: "button", - disabled: true, - actions: [ - { - eventType: "onrender", - eventHandler: getLocalSelectedProjectsDataButtonRendered, - payload: ["selectedProjects"] - }, - { - eventType: "onclick", - eventHandler: getLocalSelectedProjectsDataButtonClicked, - payload: ["selectedProjects"] - } - ] - }, - // task-inbox elements - /* - { - elementId: "compareApiToLocalDataButton", - icon: "x-fal fa-copy", - text: "API vs Local data", - location: "task-toolbar", - type: "button", - hidden: false, - menu: [ - { - text: "selectedNewTasks", - value: "selectedNewTasks", - icon: "x-fal fa-copy" - }, + // Toggle myTargetButton's disabled property. { - text: "selectedActiveTasks", - value: "selectedActiveTasks", - icon: "x-fal fa-copy" + icon: "x-fal fa-angle-right", + text: "Disable", + value: "disable" }, { - text: "selectedCompletedTasks", - value: "selectedCompletedTasks", - icon: "x-fal fa-copy" + icon: "x-fal fa-angle-right", + text: "Enable", + value: "enable" }, { - text: "newTaskPreview", - value: "newTaskPreview", - icon: "x-fal fa-copy" + separator: true }, + + // Toggle myTargetButton's icon. { - text: "activeTaskPreview", - value: "activeTaskPreview", - icon: "x-fal fa-copy" + icon: "x-fal fa-angle-right", + text: "Set star icon", + value: "staricon" }, { - text: "completedTaskPreview", - value: "completedTaskPreview", - icon: "x-fal fa-copy" + icon: "x-fal fa-angle-right", + text: "Set dot circle icon", + value: "dotcircleicon" }, { - text: "task", - value: "task", - icon: "x-fal fa-copy" + separator: true }, + + // Toggle multiple properties in myTargetButton's menu options. { - text: "selectedFiles", - value: "selectedFiles", - icon: "x-fal fa-copy" - }, - { separator: true }, - { - text: "inboxActiveTab (notification only)", - value: "inboxActiveTab", - icon: "x-fal fa-exclamation-circle" + icon: "x-fal fa-angle-right", + text: "Disable & make uppercase & set star icon for dropdown menu options", + value: "disablemenuoptions" }, { - text: "taskActiveTab (notification only)", - value: "taskActiveTab", - icon: "x-fal fa-exclamation-circle" + icon: "x-fal fa-angle-right", + text: "Enable & make default case & set angle icon for dropdown menu options", + value: "enablemenuoptions" } ], actions: [ { eventType: "onclick", - eventHandler: compareTaskApiToLocalDataButtonClicked, - payload: [ - "selectedNewTasks", - "selectedActiveTasks", - "selectedCompletedTasks", - "newTaskPreview", - "activeTaskPreview", - "completedTaskPreview", - "inboxActiveTab", - "task", - "selectedFiles", - "taskActiveTab" - ] - } - ] - },*/ - { - elementId: "custom-btn-new-tasks-list-toolbar", - icon: "x-fal fa-newspaper", - text: "New custom button", - location: "new-tasks-list-toolbar", - type: "button", - actions: [ - { - eventType: "onrender", - eventHandler: newTasksListToolbarButtonRendered, - payload: [] - }, - { - eventType: "onclick", - eventHandler: newTasksListToolbarButtonClicked, - payload: ["selectedNewTasks"] - } - ] - }, - { - elementId: "custom-btn-active-tasks-list-toolbar", - icon: "x-fal fa-newspaper", - text: "Active custom button", - location: "active-tasks-list-toolbar", - type: "button", - actions: [ - { - eventType: "onrender", - eventHandler: activeTasksListToolbarButtonRendered, - payload: [] - }, - { - eventType: "onclick", - eventHandler: activeTasksListToolbarButtonClicked, - payload: ["selectedActiveTasks"] - } - ] - }, - { - elementId: "custom-btn-completed-tasks-list-toolbar", - icon: "x-fal fa-newspaper", - text: "Completed custom button", - location: "completed-tasks-list-toolbar", - type: "button", - actions: [ - { - eventType: "onrender", - eventHandler: completedTasksListToolbarButtonRendered, - payload: [] - }, - { - eventType: "onclick", - eventHandler: completedTasksListToolbarButtonClicked, - payload: ["selectedCompletedTasks"] - } - ] - }, - { - elementId: "newTaskSidebarBox", - text: "New Sidebar Box", - location: "new-tasks-list-sidebar", - type: "sidebarBox", - actions: [ - { - eventType: "onrender", - eventHandler: taskSidebarBoxRendered, - payload: [] - } - ] - }, - { - elementId: "activeTaskSidebarBox", - text: "Active Sidebar Box", - location: "active-tasks-list-sidebar", - type: "sidebarBox", - actions: [ - { - eventType: "onrender", - eventHandler: taskSidebarBoxRendered, - payload: [] - } - ] - }, - { - elementId: "completedTaskSidebarBox", - text: "Completed Sidebar Box", - location: "completed-tasks-list-sidebar", - type: "sidebarBox", - actions: [ - { - eventType: "onrender", - eventHandler: taskSidebarBoxRendered, + eventHandler: (detail: ExtensibilityEventDetail) => { + // The detail.value is the value of the clicked button dropdown menu option. + switch (detail.value) { + case "hide": + trados.updateElement("myTargetButton", { hidden: true }); + break; + case "show": + trados.updateElement("myTargetButton", { hidden: false }); + break; + case "disable": + trados.updateElement("myTargetButton", { disabled: true }); + break; + case "enable": + trados.updateElement("myTargetButton", { disabled: false }); + break; + case "staricon": + trados.updateElement("myTargetButton", { icon: "x-fal fa-star" }); + break; + case "dotcircleicon": + trados.updateElement("myTargetButton", { icon: "x-fal fa-dot-circle" }); + break; + case "disablemenuoptions": + trados.updateElement("myTargetButton", { + menuItems: [ + { + index: 0, + disabled: true, + text: "MENU OPTION 1", + icon: "x-fal fa-star" + }, + { + index: 1, + disabled: true, + text: "MENU OPTION 2", + icon: "x-fal fa-star" + } + ] + }); + break; + case "enablemenuoptions": + trados.updateElement("myTargetButton", { + menuItems: [ + { + index: 0, + disabled: false, + text: "Menu option 1", + icon: "x-fal fa-angle-right" + }, + { + index: 1, + disabled: false, + text: "Menu option 2", + icon: "x-fal fa-angle-right" + } + ] + }); + break; + } + }, payload: [] } ] }, + + // The target button has no actions. + // Its properties get updated when the previous button's (myDropdownButton) dropdown menu options are clicked. { - elementId: "custom-btn-task-toolbar", - icon: "x-fal fa-newspaper", - text: "Custom button", - location: "task-toolbar", + elementId: "myTargetButton", + icon: "x-fal fa-dot-circle", + text: "Target Button", + location: "project-details-toolbar", type: "button", - actions: [ + menu: [ { - eventType: "onrender", - eventHandler: taskToolbarButtonRendered, - payload: [] + text: "Menu option 1", + icon: "x-fal fa-angle-right" }, { - eventType: "onclick", - eventHandler: taskToolbarButtonClicked, - payload: ["task", "taskActiveTab"] + text: "Menu option 2", + icon: "x-fal fa-angle-right" } ] + }, + + // Custom tab. { - elementId: "custom-tab", - text: "Custom Tab", - location: "task-tabpanel", + elementId: "myCustomTab", + text: "My Custom Tab", + location: "project-details-tabpanel", type: "tab", actions: [ { eventType: "onrender", - eventHandler: taskTabRendered, - payload: ["task", "taskActiveTab"] - } - ] - }, - { - elementId: "taskSidebarBox", - text: "Task Details Sidebar Box", - location: "task-sidebar", - type: "sidebarBox", - actions: [ - { - eventType: "onrender", - eventHandler: taskDetailsSidebarBoxRendered, - payload: [] - } - ] - }, - { - elementId: "custom-btn-task-details-toolbar", - icon: "x-fal fa-newspaper", - text: "Custom task details toolbar button", - location: "task-details-toolbar", - type: "button", - actions: [ - { - eventType: "onrender", - eventHandler: taskDetailsToolbarButtonRendered, - payload: [] - }, - { - eventType: "onclick", - eventHandler: taskDetailsToolbarButtonClicked, - payload: ["task", "taskActiveTab"] - } - ] - }, - { - elementId: "detailsMain1Box", - text: "Custom Panel 1", - location: "task-details-main", - type: "panel", - actions: [ - { - eventType: "onrender", - eventHandler: (detail: ExtensibilityEventDetail) => { - detailsMainBoxRendered(detail, 1); - }, + eventHandler: myCustomTabRendered, payload: [] } ] }, + + // Custom panel. { - elementId: "detailsMain2Box", - text: "Custom Panel 2", - location: "task-details-main", + elementId: "myCustomPanel", + text: "My Custom Panel", + location: "project-details-dashboard-main", type: "panel", actions: [ { eventType: "onrender", - eventHandler: (detail: ExtensibilityEventDetail) => { - detailsMainBoxRendered(detail, 2); - }, + eventHandler: myCustomPanelRendered, payload: [] } ] }, + + // Custom sidebarBox. { - elementId: "custom-btn-task-files-toolbar", - icon: "x-fal fa-newspaper", - text: "Custom button", - location: "task-files-toolbar", - type: "button", + elementId: "dashboardSidebarBox", + text: "My Custom Sidebar Box", + location: "project-details-dashboard-sidebar", + type: "sidebarBox", actions: [ { eventType: "onrender", - eventHandler: taskFilesToolbarButtonRendered, + eventHandler: myCustomSidebarBoxRendered, payload: [] - }, - { - eventType: "onclick", - eventHandler: taskFilesToolbarButtonClicked, - payload: ["task", "taskActiveTab", "selectedFiles"] } ] } ]; -/* -// extra buttons for LTLC-85181 -const allToolbarLocations = [ - // projects - "projects-list-toolbar", - "project-details-toolbar", - "project-details-dashboard-toolbar", - "project-details-stages-toolbar", - "project-details-files-toolbar", - "project-details-task-history-toolbar", - // task-inbox - "new-tasks-list-toolbar", - "active-tasks-list-toolbar", - "completed-tasks-list-toolbar", - "task-toolbar", - "task-details-toolbar", - "task-files-toolbar" -]; - -allToolbarLocations.forEach(l => - elements.push( - { - elementId: `${l}-cstm-btn-actions`, - icon: "x-fal fa-info-circle", - text: "Change Target button", - // @ts-ignore - location: l, - type: "button", - menu: [ - // toggle hidden - { - icon: "x-fal fa-angle-right", - text: "Hide", - value: "hide" - }, - { - icon: "x-fal fa-angle-right", - text: "Show", - value: "show" - }, - { - separator: true - }, - // toggle disabled - { - icon: "x-fal fa-angle-right", - text: "Disable", - value: "disable" - }, - { - icon: "x-fal fa-angle-right", - text: "Enable", - value: "enable" - }, - { - separator: true - }, - // toggle text - { - icon: "x-fal fa-angle-right", - text: "Make text uppercase", - value: "uppercase" - }, - { - icon: "x-fal fa-angle-right", - text: "Make text casing default", - value: "defaultcase" - }, - { - separator: true - }, - // toggle icon - { - icon: "x-fal fa-angle-right", - text: "Set star icon", - value: "staricon" - }, - { - icon: "x-fal fa-angle-right", - text: "Set info icon", - value: "infoicon" - }, - { - separator: true - }, - // toggle menu - { - icon: "x-fal fa-angle-right", - text: "Disable & make uppercase & set star icon for dropdown menu options", - value: "disablemenuoptions" - }, - { - icon: "x-fal fa-angle-right", - text: "Enable & make default case & set info icon for dropdown menu options", - value: "enablemenuoptions" - } - ], - actions: [ - { - eventType: "onclick", - eventHandler: (detail: ExtensibilityEventDetail) => { - switch (detail.value) { - case "hide": - trados.updateElement(`${l}-cstm-btn-target`, { hidden: true }); - break; - case "show": - trados.updateElement(`${l}-cstm-btn-target`, { hidden: false }); - break; - case "disable": - trados.updateElement(`${l}-cstm-btn-target`, { - disabled: true - }); - break; - case "enable": - trados.updateElement(`${l}-cstm-btn-target`, { - disabled: false - }); - break; - case "uppercase": - trados.updateElement(`${l}-cstm-btn-target`, { - text: "TARGET" - }); - break; - case "defaultcase": - trados.updateElement(`${l}-cstm-btn-target`, { - text: "Target" - }); - break; - case "staricon": - trados.updateElement(`${l}-cstm-btn-target`, { - icon: "x-fal fa-star" - }); - break; - case "infoicon": - trados.updateElement(`${l}-cstm-btn-target`, { - icon: "x-fal fa-info" - }); - break; - case "disablemenuoptions": - trados.updateElement(`${l}-cstm-btn-target`, { - menuItems: [ - { - index: 0, - disabled: true, - text: "MENU OPTION 1", - icon: "x-fal fa-star" - }, - { - index: 1, - disabled: true, - text: "MENU OPTION 2", - icon: "x-fal fa-star" - } - ] - }); - break; - case "enablemenuoptions": - trados.updateElement(`${l}-cstm-btn-target`, { - menuItems: [ - { - index: 0, - disabled: false, - text: "Menu option 1", - icon: "x-fal fa-angle-right" - }, - { - index: 1, - disabled: false, - text: "Menu option 2", - icon: "x-fal fa-angle-right" - } - ] - }); - break; - } - }, - payload: [] - } - ] - }, - { - elementId: `${l}-cstm-btn-target`, - icon: "x-fal fa-dot-circle", - text: "Target", - location: l, - type: "button", - menu: [ - { - text: "Menu option 1", - icon: "x-fal fa-angle-right" - }, - { - text: "Menu option 2", - icon: "x-fal fa-angle-right" - } - ] - }, - { - elementId: `${l}-cstm-btn1`, - icon: "x-fal fa-info-circle", - text: "`\"'~!@#$%^&*()_+-=:?/><;,.\\|ăîâșț", - location: l, - type: "button" - }, - { - elementId: `${l}-cstm-btn2`, - icon: "x-fal fa-info-circle", - text: "Long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long text", - location: l, - type: "button", - menu: [ - { - text: "Long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long text" - }, - { - text: "Some text" - }, - { - separator: true - }, - { - text: "`\"'~!@#$%^&*()_+-=:?/><;,.\\|ăîâșț" - } - ] - }, - { - elementId: `${l}-cstm-btn3`, - icon: "x-fal fa-info-circle", - text: "Long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long text", - location: l, - type: "button" - }, - { - elementId: `${l}-cstm-btn4`, - icon: "x-fal fa-info-circle", - text: "Long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long link", - location: l, - type: "button", - isLink: true, - href: "mailto:api.extensibility.team@rws.com" - } - ) -); - -// extra containers for LTLC-85185 -const renderCounter: any = {}; -const renderContent = ( - type: ElementType, - detail: ExtensibilityEventDetail, - elementId: string -) => { - renderCounter[elementId]++; - const container = document.getElementById(detail.domElementId); - if (container) { - // remove content for rerenders - container.innerHTML = ""; - const elem = document.createElement("div"); - const imgSize = type === "sidebarBox" ? "500x500" : "2000x2000"; - const imgWidthHight = type === "sidebarBox" ? "500" : "2000"; - elem.innerHTML = `

Custom element rendered ${renderCounter[elementId]} times.

`; - elem.innerHTML += "`\"'~!@#$%^&*()_+-=:?/><;,.\\|ăîâșț"; - elem.innerHTML += `

LongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaksLongTextWithNoBreaks

`; - elem.innerHTML += ``; - - if (type === "tab") { - elem.className = "x-panel-header-title-light-framed"; - elem.setAttribute("style", "margin-bottom: 10px"); - container.style.position = "relative"; - } - - // add new content - container.appendChild(elem); - } -}; - -const allPanelLocations = [ - // projects - "project-details-dashboard-main", - // task-inbox - "task-details-main" -]; - -allPanelLocations.forEach(l => { - renderCounter[`${l}-cstm-pnl`] = 0; - elements.push({ - elementId: `${l}-cstm-pnl`, - text: "Custom Panel", - // @ts-ignore - location: l, - type: "panel", - actions: [ - { - eventType: "onrender", - eventHandler: (detail: ExtensibilityEventDetail) => { - renderContent("panel", detail, `${l}-cstm-pnl`); - - trados.updateElement( - `${l}-cstm-pnl`, - // todo: when publishing new public package version, use "title" for containers instead of "text" - { - text: "(updated `\"'~!@#$%^&*()_+-=:?/><;,.\\|ăîâșț) Custom Panel with extra long long long long long long long long long long long long long long long long long long long long long long long long long long long long text" - } - //update: { hidden: true } - ); - }, - payload: [] - } - ] - }); -}); - -const allTabLocations = [ - // projects - "project-details-tabpanel", - // task-inbox - "task-tabpanel" -]; - -allTabLocations.forEach(l => { - renderCounter[`${l}-cstm-tab`] = 0; - elements.push({ - elementId: `${l}-cstm-tab`, - text: "Custom Tab", - // @ts-ignore - location: l, - type: "tab", - actions: [ - { - eventType: "onrender", - eventHandler: (detail: ExtensibilityEventDetail) => { - renderContent("tab", detail, `${l}-cstm-tab`); - - trados.updateElement( - `${l}-cstm-tab`, - // todo: when publishing new public package version, use "title" for containers instead of "text" - { - text: "(updated `\"'~!@#$%^&*()_+-=:?/><;,.\\|ăîâșț) Custom Tab with extra long long long long long long long long long long long long long long long long long long long long long long long long long long long long text" - } - //update: { hidden: true } - ); - }, - payload: [] - } - ] +// Then call trados.onReady function to register the UI extension with Trados UI. +trados.onReady( + // The first argument is the extension elements array so Trados UI known what custom elements to add and where. + elements, + // The second argument is a callback function. + () => { + // My UI extension is now registered with Trados UI. + // The extensionKey is available for identification during events communication between Trados UI and UI extension. + // The account identifier & authorization token are available for API calls. + console.log("[UI Extensibility] [my UI extension] UI extension registered with Trados UI."); }); -}); - -const allSidebarBoxLocations = [ - // projects - "project-details-dashboard-sidebar", - "project-details-task-history-sidebar", - // task-inbox - "new-tasks-list-sidebar", - "active-tasks-list-sidebar", - "completed-tasks-list-sidebar", - "task-sidebar" -]; - -allSidebarBoxLocations.forEach(l => { - renderCounter[`${l}-cstm-sb`] = 0; - elements.push({ - elementId: `${l}-cstm-sb`, - text: "Custom Sidebar Box", - // @ts-ignore - location: l, - type: "sidebarBox", - actions: [ - { - eventType: "onrender", - eventHandler: (detail: ExtensibilityEventDetail) => { - renderContent("sidebarBox", detail, `${l}-cstm-sb`); - - trados.updateElement( - `${l}-cstm-sb`, - // todo: when publishing new public package version, use "title" for containers instead of "text" - { - text: "(updated `\"'~!@#$%^&*()_+-=:?/><;,.\\|ăîâșț) Custom Sidebar Box with extra long long long long long long long long long long long long long text" - } - //update: { hidden: true } - ); - }, - payload: [] - } - ] - }); -}); -*/ - -// onReady function calls publish("register", configWithElementsAndEventHandlers) -// then, once registered, performs callback function passing extensionKey, tenant and token as registrationResult arg -trados.onReady(elements, () => { - // extension registered - // extensionKey retrieved for identification if events communication - // tenant & token available for API calls - console.log("[UI Extensibility] [extension] Extension registered."); -}); -console.log( - "[UI Extensibility] [extension] Register request event published. External script loaded." -); +console.log("[UI Extensibility] [my UI extension] External script loaded."); diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/package.json b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/package.json index 959c064..7f2ec14 100644 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/package.json +++ b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/package.json @@ -1,23 +1,21 @@ { - "name": "@sdl/frontend-extension", + "name": "trados-ui-extension-sample", "version": "1.0.0", - "description": "A frontend extension.", + "description": "Trados UI extension sample", "main": "index.js", "sideEffects": false, "scripts": { - "npm-auth": "npm config set @sdl:registry https://nexus.sdl.com/repository/npm-internal/", "build-dev": "webpack --progress --mode=development", "build": "webpack --progress --mode=production" }, - "author": "SDL", + "author": "RWS", "license": "MIT", "dependencies": { - "@sdl/extensibility": "^1.0.0", - "@sdl/extensibility-types": "^1.0.0" + "@trados/trados-ui-extensibility": "^0.1.4" }, "devDependencies": { "ts-loader": "9.5.1", - "webpack": "5.91.0", + "webpack": "5.94.0", "webpack-cli": "5.1.4" } } diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/tsconfig.json b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/tsconfig.json index 251ff03..4088f7d 100644 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/tsconfig.json +++ b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/tsconfig.json @@ -5,6 +5,7 @@ "lib": [ "dom", "ES2015" ], "strict": true, "esModuleInterop": true, + "moduleResolution": "node", "skipLibCheck": true, "types": [] } diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/types.ts b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/types.ts deleted file mode 100644 index b0660c7..0000000 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/types.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type ProjectImportance = { - projectId: string; - pending: boolean; - importance?: "high" | "medium" | "low"; - id?: string; -}; diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/webpack.config.js b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/webpack.config.js index b89d716..64c96b9 100644 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/webpack.config.js +++ b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Resources/frontend/webpack.config.js @@ -22,7 +22,7 @@ module.exports = { extensions: [".tsx", ".ts", ".js"], }, output: { - filename: "bundle.js", + filename: "my-ui-extension-script.js", path: path.resolve(__dirname, "dist"), } }; diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Rws.LC.UISampleApp.csproj b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Rws.LC.UISampleApp.csproj index e184302..1e6ce14 100644 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Rws.LC.UISampleApp.csproj +++ b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/Rws.LC.UISampleApp.csproj @@ -6,7 +6,7 @@ - + Always diff --git a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/descriptor.json b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/descriptor.json index 50aa297..d3ca019 100644 --- a/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/descriptor.json +++ b/samples/dotnet/UISampleApp/Rws.LC.UISampleApp/descriptor.json @@ -7,10 +7,10 @@ "id": "SAMPLE_UI_EXTENSION_ID", "extensionPointId": "lc.ui", "name": "UI Extensibility App", - "description": "UI Extensibility in Inbox and Projects", + "description": "UI Extensibility examples in Projects view", "extensionPointVersion": "1", "configuration": { - "scriptPath": "/api/files/frontend/dist/bundle.js", + "scriptPath": "/api/files/frontend/dist/my-ui-extension-script.js", "endpoints": {} } }