diff --git a/articles/Extensibility/api/Extensibility-API.v1.json b/articles/Extensibility/api/Extensibility-API.v1.json index 46b6a2d..a58acf0 100644 --- a/articles/Extensibility/api/Extensibility-API.v1.json +++ b/articles/Extensibility/api/Extensibility-API.v1.json @@ -140,12 +140,10 @@ "operationId": "GetConfiguration", "parameters": [ { - "name": "TR_ID", - "in": "header", - "description": "A trace id, to help track problems. If it's not received, an auto-generated value will be used for logging. TR_ID header should also be set on the response.", - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/TR_ID" + }, + { + "$ref": "#/components/parameters/x-lc-signature" } ], "responses": { @@ -180,12 +178,7 @@ } } } - }, - "security": [ - { - "LanguageCloudJWSToken": [] - } - ] + } }, "post": { "tags": [ @@ -196,12 +189,10 @@ "operationId": "SetConfiguration", "parameters": [ { - "name": "TR_ID", - "in": "header", - "description": "A trace id, to help track problems. If it's not received, an auto-generated value will be used for logging. TR_ID header should also be set on the response.", - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/TR_ID" + }, + { + "$ref": "#/components/parameters/x-lc-signature" } ], "requestBody": { @@ -249,12 +240,7 @@ } } }, - "x-codegen-request-body-name": "body", - "security": [ - { - "LanguageCloudJWSToken": [] - } - ] + "x-codegen-request-body-name": "body" } }, "/app-lifecycle": { @@ -267,12 +253,10 @@ "operationId": "Lifecycle", "parameters": [ { - "name": "TR_ID", - "in": "header", - "description": "A trace id, to help track problems. If it's not received, an auto-generated value will be used for logging. TR_ID header should also be set on the response.", - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/TR_ID" + }, + { + "$ref": "#/components/parameters/x-lc-signature" } ], "requestBody": { @@ -311,11 +295,6 @@ } }, "x-codegen-request-body-name": "body", - "security": [ - { - "LanguageCloudJWSToken": [] - } - ], "x-stoplight": { "id": "twu3jqmmyjbcb" } @@ -331,12 +310,10 @@ "operationId": "MachineTranslationProviderTranslateBCM", "parameters": [ { - "name": "TR_ID", - "in": "header", - "description": "A trace id, to help track problems. If it's not received, an auto-generated value will be used for logging. TR_ID header should also be set on the response.", - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/TR_ID" + }, + { + "$ref": "#/components/parameters/x-lc-signature" }, { "$ref": "#/components/parameters/X-LC-AppVersion" @@ -400,12 +377,7 @@ } } }, - "x-codegen-request-body-name": "body", - "security": [ - { - "LanguageCloudJWSToken": [] - } - ] + "x-codegen-request-body-name": "body" } }, "/lc.mtprovider.engines": { @@ -418,12 +390,10 @@ "operationId": "GetMachineTranslationProviderEngines", "parameters": [ { - "name": "TR_ID", - "in": "header", - "description": "A trace id, to help track problems. If it's not received, an auto-generated value will be used for logging. TR_ID header should also be set on the response.", - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/TR_ID" + }, + { + "$ref": "#/components/parameters/x-lc-signature" }, { "name": "model", @@ -522,12 +492,7 @@ } } } - }, - "security": [ - { - "LanguageCloudJWSToken": [] - } - ] + } } }, "/lc.mtprovider.engines/{id}": { @@ -548,12 +513,10 @@ } }, { - "name": "TR_ID", - "in": "header", - "description": "A trace id, to help track problems. If it's not received, an auto-generated value will be used for logging. TR_ID header should also be set on the response.", - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/TR_ID" + }, + { + "$ref": "#/components/parameters/x-lc-signature" } ], "responses": { @@ -577,12 +540,7 @@ } } } - }, - "security": [ - { - "LanguageCloudJWSToken": [] - } - ] + } } }, "/lc.automatictask.submit": { @@ -591,16 +549,14 @@ "Automatic Task Type Provider" ], "summary": "Submit Task", - "description": "Submits an automatic task for execution. This call should return 'Accepted' and the task itself should be executed on a different thread. Note that there is a read timeout of 5 seconds for this call.", + "description": "Submits an automatic task for execution. This call should return 'Accepted' and the task itself should be executed on a different thread. Note that there is a read timeout of 5 seconds for this call.

Note: The processing time cannot exceed 4h from the moment the task is submitted, otherwise the task will be marked as unresponsive.

", "operationId": "automatictasktypeexecutetask", "parameters": [ { - "name": "TR_ID", - "in": "header", - "description": "A trace id, to help track problems. If it's not received, an auto-generated value will be used for logging. TR_ID header should also be set on the response.", - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/TR_ID" + }, + { + "$ref": "#/components/parameters/x-lc-signature" }, { "$ref": "#/components/parameters/X-LC-ExtensionPointVersion" @@ -644,7 +600,7 @@ }, "callbackUrl": { "type": "string", - "description": "The url to call when the task execution is finished. \nThe method should be a POST and the body should be AutomaticTaskCallbackRequest model. The app should provide the X-LC-Tenant header." + "description": "The URL to call when the task execution is finished. \nThe method should be a POST and the body should be AutomaticTaskCallbackRequest model. The app should provide the X-LC-Tenant header." } } } @@ -687,12 +643,7 @@ } } }, - "x-codegen-request-body-name": "body", - "security": [ - { - "LanguageCloudJWSToken": [] - } - ] + "x-codegen-request-body-name": "body" } }, "/external-job/v1/callback": { @@ -701,16 +652,11 @@ "Callback" ], "summary": "Submit Task Outcome", - "description": "This is the endpoint where the automatic task apps should return the outcome when the task execution is finished.", + "description": "This is the endpoint where the automatic task apps should return the outcome when the task execution is finished.

Note: If the callback is not returned within 4h of the task submission, the task will be marked as unresponsive!

", "operationId": "automatiktasktypecallback", "parameters": [ { - "name": "TR_ID", - "in": "header", - "description": "A trace id, to help track problems. If it's not received, an auto-generated value will be used for logging. TR_ID header should also be set on the response.", - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/TR_ID" }, { "name": "token", @@ -803,12 +749,10 @@ "operationId": "ValidateConfigurationSettings", "parameters": [ { - "name": "TR_ID", - "in": "header", - "description": "A trace id, to help track problems. If it's not received, an auto-generated value will be used for logging. TR_ID header should also be set on the response.", - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/TR_ID" + }, + { + "$ref": "#/components/parameters/x-lc-signature" } ], "responses": { @@ -825,12 +769,7 @@ } } } - }, - "security": [ - { - "LanguageCloudJWSToken": [] - } - ] + } } }, "/lc.preview.startpreview": { @@ -875,11 +814,6 @@ "tags": [ "Preview Provider" ], - "security": [ - { - "LanguageCloudJWSToken": [] - } - ], "parameters": [ { "$ref": "#/components/parameters/X-LC-ExtensionPointVersion" @@ -889,6 +823,12 @@ }, { "$ref": "#/components/parameters/X-LC-AppVersion" + }, + { + "$ref": "#/components/parameters/TR_ID" + }, + { + "$ref": "#/components/parameters/x-lc-signature" } ] } @@ -935,11 +875,6 @@ "tags": [ "Preview Provider" ], - "security": [ - { - "LanguageCloudJWSToken": [] - } - ], "parameters": [ { "$ref": "#/components/parameters/X-LC-ExtensionPointVersion" @@ -949,6 +884,12 @@ }, { "$ref": "#/components/parameters/X-LC-AppVersion" + }, + { + "$ref": "#/components/parameters/TR_ID" + }, + { + "$ref": "#/components/parameters/x-lc-signature" } ] } @@ -1002,11 +943,6 @@ "tags": [ "Preview Provider" ], - "security": [ - { - "LanguageCloudJWSToken": [] - } - ], "parameters": [ { "$ref": "#/components/parameters/X-LC-ExtensionPointVersion" @@ -1016,6 +952,12 @@ }, { "$ref": "#/components/parameters/X-LC-AppVersion" + }, + { + "$ref": "#/components/parameters/TR_ID" + }, + { + "$ref": "#/components/parameters/x-lc-signature" } ] } @@ -1053,11 +995,6 @@ "tags": [ "Preview Provider" ], - "security": [ - { - "LanguageCloudJWSToken": [] - } - ], "parameters": [ { "$ref": "#/components/parameters/X-LC-ExtensionPointVersion" @@ -1067,6 +1004,12 @@ }, { "$ref": "#/components/parameters/X-LC-AppVersion" + }, + { + "$ref": "#/components/parameters/TR_ID" + }, + { + "$ref": "#/components/parameters/x-lc-signature" } ] } @@ -1110,15 +1053,17 @@ } }, "description": "This endpoint initiates the background job for verification. The background job will push messages back to the Verification Service via a publish message URL and then send an asynchronous response once the job has completed.\nThe response for the callback is given here:\n[CallbackResponse](#/schemas/VerificationProvider.MainResponse)", - "security": [ - { - "Trados Cloud Platform JWS Token": [] - } - ], "tags": [ "Verification Provider" ], - "parameters": [] + "parameters": [ + { + "$ref": "#/components/parameters/TR_ID" + }, + { + "$ref": "#/components/parameters/x-lc-signature" + } + ] }, "parameters": [ { @@ -1168,11 +1113,6 @@ } }, "description": "This endpoint verifies the content of a single segment", - "security": [ - { - "Trados Cloud Platform JWS Token": [] - } - ], "requestBody": { "content": { "application/json": { @@ -1187,7 +1127,14 @@ "Verification Provider" ] }, - "parameters": [] + "parameters": [ + { + "$ref": "#/components/parameters/TR_ID" + }, + { + "$ref": "#/components/parameters/x-lc-signature" + } + ] }, "/lc.verification.getmessagesbyculture/{culture}": { "get": { @@ -1236,7 +1183,14 @@ }, "operationId": "VerificationProviderGetMessagesByCulture", "description": "Gets localized resources for message types defined by the app extension", - "parameters": [] + "parameters": [ + { + "$ref": "#/components/parameters/TR_ID" + }, + { + "$ref": "#/components/parameters/x-lc-signature" + } + ] }, "parameters": [ { @@ -1330,7 +1284,15 @@ "description": "Returns a JSON schema for the settings associated with this app\nThe JSON schema can must only use specific pre-defined types relating to \"string\", \"number\", \"integer\", \"boolean\", \"datetime\" and \"file\" - for complex types, objects are used with internal properties.", "requestBody": { "content": {} - } + }, + "parameters": [ + { + "$ref": "#/components/parameters/TR_ID" + }, + { + "$ref": "#/components/parameters/x-lc-signature" + } + ] } } }, @@ -3258,14 +3220,17 @@ "schema": { "type": "string" } + }, + "x-lc-signature": { + "name": "x-lc-signature", + "in": "header", + "required": false, + "schema": { + "type": "string" + }, + "description": "JWS token containing the signature and additional claims." } }, - "securitySchemes": { - "LanguageCloudJWSToken": { - "type": "http", - "scheme": "bearer", - "description": "" - } - } + "securitySchemes": {} } } \ No newline at end of file diff --git a/articles/Extensibility/docs/Whats-New.md b/articles/Extensibility/docs/Whats-New.md index 48a70bf..36982d7 100644 --- a/articles/Extensibility/docs/Whats-New.md +++ b/articles/Extensibility/docs/Whats-New.md @@ -1,5 +1,11 @@ # What's New +## January 2026 + +- We've documented automatic tasks expiration time. See [Submit](../api/Extensibility-API.v1-fv.html#/operations/automatictasktypeexecutetask) and [Callback](../api/Extensibility-API.v1-fv.html#/operations/automatiktasktypecallback) endpoints. +- We've added a new documentation [page](../docs/development/Integrate-With-Trados-Cloud-Platform-API.md) on how to use the Public API SDK in your apps. +- We've expanded support for [UI custom elements](../docs/development/UI-App-custom-elements-locations.md) to additional locations: Customers and Vendors. + ## July 2025 - We've expanded support for custom tabs to additional [locations](../docs/development/UI-App-custom-elements-locations.md). You can now use them in the following views: diff --git a/articles/Extensibility/docs/development/Integrate-With-Trados-Cloud-Platform-API.md b/articles/Extensibility/docs/development/Integrate-With-Trados-Cloud-Platform-API.md new file mode 100644 index 0000000..1bde7bf --- /dev/null +++ b/articles/Extensibility/docs/development/Integrate-With-Trados-Cloud-Platform-API.md @@ -0,0 +1,77 @@ +# Integration with Trados Cloud Platform API + +Trados Cloud Extensibility supports extensive customizations. Using the Trados Cloud Platform API (the Public API) makes those customizations even more powerful. + +This page explains how to use the API. + +You can find the API documentation and contract here: [Trados Cloud Platform API](https://eu.cloud.trados.com/lc/api-docs/introduction) + +The .NET blueprint currently includes examples. Java examples will be added in a future update. + +## Prerequisites + +To access the API, an app must declare a `scopes` value in its descriptor: `TENANT` or `TENANT_READ`. + +- `TENANT` — requests read and write permissions. +- `TENANT_READ` — requests read-only permissions. + +## .NET blueprint + +The .NET blueprint uses the Rws.LanguageCloud.Sdk NuGet package. Update it to the latest available version. + +Some infrastructure code has been introduced to simplify using the SDK, particularly because apps are expected to run in a multi-tenant environment and support multi-region deployments (or at least tenants in different regions). + +No additional setup is required to start using the SDK. + +There are two main scenarios to consider when using the SDK: + +- In the context of an HTTP request — when handling an incoming request and the code has the current tenant context available. +- In background jobs — when processing queued work where no tenant context is present and you must create one explicitly. + +The next sections cover each case. + +### HTTP context + +Inject `LanguageCloudClientFactory` into the class where you need it. + +For example, you can get project details: + +```csharp + var tenantId = HttpContext.User?.GetTenantId(); + + // Just as an example we'll try to make a Public API call + var accountInfo = await _repository.GetAccountInfoByTenantId(tenantId).ConfigureAwait(false); + string region = accountInfo.Region; + + // getting project details as an example of using the LC SDK, with implicit tenant from the current Http Context + var projectDetails = await _languageCloudClientFactory.Region(region).ProjectClient.GetProjectAsync(automaticTaskRequest.ProjectId); + +``` + +The `HttpContext` is available inside controllers. To access it from other classes, use `IHttpContextAccessor` or pass `tenantId` and `region` through method calls. + +To use the factory, first identify the tenant's region. This value is stored in the account information when the app is installed. + +Note: Region may be missing for accounts where the app was registered with `descriptorVersion` < 1.4. In that case, default the region to `eu`. + +The factory exposes different clients for the various APIs. + +### Background jobs + +See the previous section for related details. + +Background jobs will usually have the `tenantId` stored, and often the `region` as well. If the region isn't stored, retrieve it from `AccountInfo` in the repository. + +Assuming you have these details, you can make a scoped call with the SDK: + +```csharp + using (Context.BeginScope(tenantId)) + { + // getting project details as an example of using the LC SDK + var projectDetailsForExplicitTenant = await _languageCloudClientFactory.Region(region).ProjectClient.GetProjectAsync(automaticTaskRequest.ProjectId); + } +``` + +### Extending the factory with more clients + +The blueprint includes two implemented clients as examples: `AccountClient` and `ProjectClient`. To use additional clients, add them to `RegionClientContainerFactory`. diff --git a/articles/Extensibility/docs/development/UI-App-custom-elements-locations.md b/articles/Extensibility/docs/development/UI-App-custom-elements-locations.md index b0a5e82..722bdfe 100644 --- a/articles/Extensibility/docs/development/UI-App-custom-elements-locations.md +++ b/articles/Extensibility/docs/development/UI-App-custom-elements-locations.md @@ -6,7 +6,7 @@ tags: [Development] # Custom Elements and Locations The platform supports the addition of various UI elements, including **buttons** (generic, link, and dropdown) and **panels** (generic, sidebar, and tab). -These elements can be incorporated into specific sections of the user interface in the **Inbox, Orders, Projects and Reports** areas. +These elements can be incorporated into specific sections of the user interface in the **Customers, Inbox, Orders, Projects, Reports, and Vendors** areas. @@ -20,6 +20,17 @@ These elements can be incorporated into specific sections of the user interface + + + + + + + + @@ -277,6 +288,17 @@ These elements can be incorporated into specific sections of the user interface + + + + + + + +
CustomersCustomers list + customers-list-tabpanel + customers-list-tabpanel location + tab
Inbox Tasks list
VendorsVendors list + vendors-list-tabpanel + vendors-list-tabpanel location + tab
diff --git a/articles/Extensibility/docs/development/UI-App-development-guide.md b/articles/Extensibility/docs/development/UI-App-development-guide.md index 1b3ba36..b70cc2b 100644 --- a/articles/Extensibility/docs/development/UI-App-development-guide.md +++ b/articles/Extensibility/docs/development/UI-App-development-guide.md @@ -49,7 +49,7 @@ If you don't already have Node.js installed, you can download the most recent LT ### Dependencies -- [@trados/trados-ui-extensibility](https://www.npmjs.com/package/@trados/trados-ui-extensibility) v0.1.5 +- [@trados/trados-ui-extensibility](https://www.npmjs.com/package/@trados/trados-ui-extensibility) v0.1.6 - [GitHub repository](https://github.com/RWS/trados-ui-extensibility) - [GitHub wiki](https://github.com/RWS/trados-ui-extensibility/wiki) diff --git a/articles/Extensibility/toc.yml b/articles/Extensibility/toc.yml index 90afa12..7dde552 100644 --- a/articles/Extensibility/toc.yml +++ b/articles/Extensibility/toc.yml @@ -67,6 +67,8 @@ href: docs/development/samples/Java-Samples.md - name: .NET href: docs/development/samples/Dot-Net-Samples.md + - name: Integrate With Trados Cloud Platform API + href: docs/development/Integrate-With-Trados-Cloud-Platform-API.md - name: App Management items: