Skip to content

Class.SourceFileApi

Octavian Condre edited this page Dec 10, 2025 · 4 revisions

Trados User Interface Extensibility / SourceFileApi

Class: SourceFileApi

Defined in: lc-public-api/apis/SourceFileApi.ts:121

Extends

  • BaseAPI

Constructors

Constructor

new SourceFileApi(configuration): SourceFileApi

Defined in: lc-public-api/runtime.ts:97

Parameters

configuration

Configuration = DefaultConfig

Returns

SourceFileApi

Inherited from

runtime.BaseAPI.constructor

Methods

addSourceFile()

addSourceFile(requestParameters, initOverrides?): Promise<SourceFile>

Defined in: lc-public-api/apis/SourceFileApi.ts:215

Adds a source file to the project. Files can be uploaded before starting a project or after the project has started. When adding a translatable file after the project started, a new start project request should be performed. Consider the file and project size limit when uploading files. > Note: The maximum character size of the sum between the name and the path fields must not exceed 255. Otherwise the request cannot be validated. > Note: Zip files will be added as reference files. If you want to upload zip files, please use the Upload Zip File endpoint. Add Source File

Parameters

requestParameters

AddSourceFileRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<SourceFile>


addSourceFileRaw()

addSourceFileRaw(requestParameters, initOverrides?): Promise<ApiResponse<SourceFile>>

Defined in: lc-public-api/apis/SourceFileApi.ts:127

Adds a source file to the project. Files can be uploaded before starting a project or after the project has started. When adding a translatable file after the project started, a new start project request should be performed. Consider the file and project size limit when uploading files. > Note: The maximum character size of the sum between the name and the path fields must not exceed 255. Otherwise the request cannot be validated. > Note: Zip files will be added as reference files. If you want to upload zip files, please use the Upload Zip File endpoint. Add Source File

Parameters

requestParameters

AddSourceFileRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<ApiResponse<SourceFile>>


addSourceFiles()

addSourceFiles(requestParameters, initOverrides?): Promise<SourceFileAttachmentResponse>

Defined in: lc-public-api/apis/SourceFileApi.ts:394

This endpoint can only be used after files have been uploaded via the Upload Zip File endpoint. It allows you to add multiple source files to a project. Each file must be individually attached by setting the fileUrl to the associatedFiles.id returned by the Poll Upload Zip File endpoint, once the unzipStatus is extracted. If a file is attached after the project has already been started, a new start project request must be made. > Note: The maximum character size of the sum between the name and the path fields must not exceed 255. Otherwise the request cannot be validated. Attach Source Files

Parameters

requestParameters

AddSourceFilesRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<SourceFileAttachmentResponse>


addSourceFilesRaw()

addSourceFilesRaw(requestParameters, initOverrides?): Promise<ApiResponse<SourceFileAttachmentResponse>>

Defined in: lc-public-api/apis/SourceFileApi.ts:332

This endpoint can only be used after files have been uploaded via the Upload Zip File endpoint. It allows you to add multiple source files to a project. Each file must be individually attached by setting the fileUrl to the associatedFiles.id returned by the Poll Upload Zip File endpoint, once the unzipStatus is extracted. If a file is attached after the project has already been started, a new start project request must be made. > Note: The maximum character size of the sum between the name and the path fields must not exceed 255. Otherwise the request cannot be validated. Attach Source Files

Parameters

requestParameters

AddSourceFilesRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<ApiResponse<SourceFileAttachmentResponse>>


addSourceFileVersion()

addSourceFileVersion(requestParameters, initOverrides?): Promise<SourceFileVersionResponse>

Defined in: lc-public-api/apis/SourceFileApi.ts:323

Adds a new version of the source file in BCM or native format. More information about file formats can be found on the File formats page. The version is added on the task represented by taskId. To successfully execute the add operation the task should already be assigned and accepted by a user. If the task is automatic, it's possible to add a source file version only when the status of task is inProgress. The file versions added need to respect the output file type declared by the task type of the enclosing task. On the Rules for sequencing tasks correctly page from the official RWS Documentation Center, you can find out what output file type is supported by each task. For adding a source file version using an extension task, the configuration of the task must declare the scope's value as "file". If the file type of the new added file is different than the supported source file type, the new fileTypeSettingsId must be specified in the body or an update of file type should be performed after the add operation, using the Update Source File Properties. The value of fileTypeSettingsId is one of the identifiers listed by the List File Type Settings endpoint. The List File Type Settings endpoint must be called with the File Processing Configuration identifier of your project. The File Processing Configuration of your project can be retrieved from Get Project endpoint. The multipart parameters in the body should respect and strictly follow the order specified in our documentation. Consider the file and project size limit when adding files. Add Source File Version

Parameters

requestParameters

AddSourceFileVersionRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<SourceFileVersionResponse>


addSourceFileVersionRaw()

addSourceFileVersionRaw(requestParameters, initOverrides?): Promise<ApiResponse<SourceFileVersionResponse>>

Defined in: lc-public-api/apis/SourceFileApi.ts:224

Adds a new version of the source file in BCM or native format. More information about file formats can be found on the File formats page. The version is added on the task represented by taskId. To successfully execute the add operation the task should already be assigned and accepted by a user. If the task is automatic, it's possible to add a source file version only when the status of task is inProgress. The file versions added need to respect the output file type declared by the task type of the enclosing task. On the Rules for sequencing tasks correctly page from the official RWS Documentation Center, you can find out what output file type is supported by each task. For adding a source file version using an extension task, the configuration of the task must declare the scope's value as "file". If the file type of the new added file is different than the supported source file type, the new fileTypeSettingsId must be specified in the body or an update of file type should be performed after the add operation, using the Update Source File Properties. The value of fileTypeSettingsId is one of the identifiers listed by the List File Type Settings endpoint. The List File Type Settings endpoint must be called with the File Processing Configuration identifier of your project. The File Processing Configuration of your project can be retrieved from Get Project endpoint. The multipart parameters in the body should respect and strictly follow the order specified in our documentation. Consider the file and project size limit when adding files. Add Source File Version

Parameters

requestParameters

AddSourceFileVersionRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<ApiResponse<SourceFileVersionResponse>>


downloadSourceFileVersion()

downloadSourceFileVersion(requestParameters, initOverrides?): Promise<Blob>

Defined in: lc-public-api/apis/SourceFileApi.ts:465

Downloads a source file version. Download Source File Version

Parameters

requestParameters

DownloadSourceFileVersionRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<Blob>


downloadSourceFileVersionRaw()

downloadSourceFileVersionRaw(requestParameters, initOverrides?): Promise<ApiResponse<Blob>>

Defined in: lc-public-api/apis/SourceFileApi.ts:403

Downloads a source file version. Download Source File Version

Parameters

requestParameters

DownloadSourceFileVersionRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<ApiResponse<Blob>>


getSourceFile()

getSourceFile(requestParameters, initOverrides?): Promise<SourceFile>

Defined in: lc-public-api/apis/SourceFileApi.ts:533

Retrieves a source file from the project. Get Source File

Parameters

requestParameters

GetSourceFileRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<SourceFile>


getSourceFileProperties()

getSourceFileProperties(requestParameters, initOverrides?): Promise<SourceFilePropertiesResponse>

Defined in: lc-public-api/apis/SourceFileApi.ts:597

Retrieves the properties for a source file. Get Source File Properties

Parameters

requestParameters

GetSourceFilePropertiesRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<SourceFilePropertiesResponse>


getSourceFilePropertiesRaw()

getSourceFilePropertiesRaw(requestParameters, initOverrides?): Promise<ApiResponse<SourceFilePropertiesResponse>>

Defined in: lc-public-api/apis/SourceFileApi.ts:542

Retrieves the properties for a source file. Get Source File Properties

Parameters

requestParameters

GetSourceFilePropertiesRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<ApiResponse<SourceFilePropertiesResponse>>


getSourceFileRaw()

getSourceFileRaw(requestParameters, initOverrides?): Promise<ApiResponse<SourceFile>>

Defined in: lc-public-api/apis/SourceFileApi.ts:474

Retrieves a source file from the project. Get Source File

Parameters

requestParameters

GetSourceFileRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<ApiResponse<SourceFile>>


listSourceFiles()

listSourceFiles(requestParameters, initOverrides?): Promise<ListSourceFilesResponse>

Defined in: lc-public-api/apis/SourceFileApi.ts:738

Retrieves the source files in a project. List Source Files

Parameters

requestParameters

ListSourceFilesRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<ListSourceFilesResponse>


listSourceFilesRaw()

listSourceFilesRaw(requestParameters, initOverrides?): Promise<ApiResponse<ListSourceFilesResponse>>

Defined in: lc-public-api/apis/SourceFileApi.ts:674

Retrieves the source files in a project. List Source Files

Parameters

requestParameters

ListSourceFilesRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<ApiResponse<ListSourceFilesResponse>>


listSourceFileVersions()

listSourceFileVersions(requestParameters, initOverrides?): Promise<ListSourceFileVersionsResponse>

Defined in: lc-public-api/apis/SourceFileApi.ts:665

Retrieves all the versions of a source file. List Source File Versions

Parameters

requestParameters

ListSourceFileVersionsRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<ListSourceFileVersionsResponse>


listSourceFileVersionsRaw()

listSourceFileVersionsRaw(requestParameters, initOverrides?): Promise<ApiResponse<ListSourceFileVersionsResponse>>

Defined in: lc-public-api/apis/SourceFileApi.ts:606

Retrieves all the versions of a source file. List Source File Versions

Parameters

requestParameters

ListSourceFileVersionsRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<ApiResponse<ListSourceFileVersionsResponse>>


updateSourceFile()

updateSourceFile(requestParameters, initOverrides?): Promise<void>

Defined in: lc-public-api/apis/SourceFileApi.ts:783

Updates a source file. Update Source File

Parameters

requestParameters

UpdateSourceFileRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<void>


updateSourceFileRaw()

updateSourceFileRaw(requestParameters, initOverrides?): Promise<ApiResponse<void>>

Defined in: lc-public-api/apis/SourceFileApi.ts:747

Updates a source file. Update Source File

Parameters

requestParameters

UpdateSourceFileRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<ApiResponse<void>>


updateSourceFiles()

updateSourceFiles(requestParameters, initOverrides?): Promise<void>

Defined in: lc-public-api/apis/SourceFileApi.ts:820

Updates multiple source files. If any of the files fails to be updated, an error will be returned for each file. Update Source Files

Parameters

requestParameters

UpdateSourceFilesRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<void>


updateSourceFilesRaw()

updateSourceFilesRaw(requestParameters, initOverrides?): Promise<ApiResponse<void>>

Defined in: lc-public-api/apis/SourceFileApi.ts:791

Updates multiple source files. If any of the files fails to be updated, an error will be returned for each file. Update Source Files

Parameters

requestParameters

UpdateSourceFilesRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<ApiResponse<void>>


updateSourceProperties()

updateSourceProperties(requestParameters, initOverrides?): Promise<void>

Defined in: lc-public-api/apis/SourceFileApi.ts:886

Updates the properties of the source file. The value of fileTypeSettingsId should be one of the identifiers listed by the List File Type Settings endpoint called with an identifier of a File Processing Configuration that exists on the project. The list of File Processing Configurations from a project can be retrieved by using the List File Processing Configurations endpoint. Update Source File Properties

Parameters

requestParameters

UpdateSourcePropertiesRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<void>


updateSourcePropertiesRaw()

updateSourcePropertiesRaw(requestParameters, initOverrides?): Promise<ApiResponse<void>>

Defined in: lc-public-api/apis/SourceFileApi.ts:828

Updates the properties of the source file. The value of fileTypeSettingsId should be one of the identifiers listed by the List File Type Settings endpoint called with an identifier of a File Processing Configuration that exists on the project. The list of File Processing Configurations from a project can be retrieved by using the List File Processing Configurations endpoint. Update Source File Properties

Parameters

requestParameters

UpdateSourcePropertiesRequest

initOverrides?

RequestInit | InitOverrideFunction

Returns

Promise<ApiResponse<void>>


withMiddleware()

withMiddleware<T>(this, ...middlewares): T

Defined in: lc-public-api/runtime.ts:101

Type Parameters

T

T extends BaseAPI

Parameters

this

T

middlewares

...Middleware[]

Returns

T

Inherited from

runtime.BaseAPI.withMiddleware


withPostMiddleware()

withPostMiddleware<T>(this, ...postMiddlewares): T

Defined in: lc-public-api/runtime.ts:112

Type Parameters

T

T extends BaseAPI

Parameters

this

T

postMiddlewares

...((context) => Promise<void | Response> | undefined)[]

Returns

T

Inherited from

runtime.BaseAPI.withPostMiddleware


withPreMiddleware()

withPreMiddleware<T>(this, ...preMiddlewares): T

Defined in: lc-public-api/runtime.ts:107

Type Parameters

T

T extends BaseAPI

Parameters

this

T

preMiddlewares

...((context) => Promise<void | FetchParams> | undefined)[]

Returns

T

Inherited from

runtime.BaseAPI.withPreMiddleware

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally