3.0.0 • Published 6 months ago

lilt-node v3.0.0

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
6 months ago

lilt-node

LiltNode - JavaScript client for lilt-node Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals
The Lilt REST API enables programmatic access to the full-range of Lilt backend services including:

  • Training of and translating with interactive, adaptive machine translation
  • Large-scale translation memory
  • The Lexicon (a large-scale termbase)
  • Programmatic control of the Lilt CAT environment
  • Translation memory synchronization

Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is https://api.lilt.com/.

Authentication

Requests are authenticated via REST API key, which requires the Business plan.

Requests are authenticated using HTTP Basic Auth. Add your REST API key as both the username and password.

For development, you may also pass the REST API key via the key query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use.

Quotas

Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 3.0.0
  • Package version: 3.0.0
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install lilt-node --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your lilt-node from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

git

If the library is hosted at a git repository, e.g.https://github.com/lilt/lilt-node then install it via:

    npm install lilt/lilt-node --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var LiltNode = require('lilt-node');

var defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix['key'] = "Token"
// Configure HTTP basic authorization: BasicAuth
var BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME'
BasicAuth.password = 'YOUR PASSWORD'

var api = new LiltNode.CreateApi()
var contentId = 56; // {Number} The content ID.
api.deleteLiltCreateContent(contentId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Checking Credentials

If you would like to test your credentials using our functionality tests you can do the following.

Navigate to the folder where the package is installed and create a .env file inside the package using .env_example as a template. Fill out the API_HOST and API_KEY lines using the credentials you were given.

Then while inside the package folder, run:

npm test

You should be able to see the tests run.

Documentation for API Endpoints

All URIs are relative to https://api.lilt.com

ClassMethodHTTP requestDescription
LiltNode.CreateApideleteLiltCreateContentDELETE /v2/create/{contentId}Delete Lilt Create content
LiltNode.CreateApigenerateLiltCreateContentPOST /v2/createGenerate new Lilt Create content
LiltNode.CreateApigetLiltCreateByIdGET /v2/create/{contentId}Get Lilt Create content by ID.
LiltNode.CreateApigetLiltCreateContentGET /v2/createGet Lilt Create content
LiltNode.CreateApigetLiltCreatePreferencesGET /v2/create/preferencesGet Lilt Create preferences
LiltNode.CreateApiregenerateLiltCreateContentGET /v2/create/{contentId}/createRegenerate Lilt Create content
LiltNode.CreateApisignLiltCreateTermsPOST /v2/create/terms-and-conditionsSign the Lilt Create terms and conditions
LiltNode.CreateApiupdateLiltCreateContentPUT /v2/create/{contentId}Update Lilt Create content
LiltNode.CreateApiupdateLiltCreatePreferencesPUT /v2/create/preferencesUpdate Lilt Create preferences
LiltNode.DocumentsApidownloadDocumentGET /v2/documents/filesDownload a Document
LiltNode.DocumentsApiuploadDocumentPOST /v2/documents/filesUpload a File
LiltNode.FilesApiaddLabelPOST /v2/files/labelsAdd Label to File
LiltNode.FilesApideleteFileDELETE /v2/filesDelete a File
LiltNode.FilesApidownloadGET /v2/files/downloadDownload file
LiltNode.FilesApigetFilesGET /v2/filesRetrieve a File
LiltNode.FilesApiremoveLabelDELETE /v2/files/labelsRemove Label from File
LiltNode.FilesApiuploadFilePOST /v2/filesUpload a File
LiltNode.JobsApiarchiveJobPOST /v2/jobs/{jobId}/archiveArchive a Job
LiltNode.JobsApicreateJobPOST /v2/jobsCreate a Job
LiltNode.JobsApideleteJobDELETE /v2/jobs/{jobId}Delete a Job
LiltNode.JobsApideliverJobPOST /v2/jobs/{jobId}/deliverDeliver a Job
LiltNode.JobsApidownloadJobGET /v2/jobs/{jobId}/downloadDownload a Job
LiltNode.JobsApiexportJobGET /v2/jobs/{jobId}/exportExport a Job
LiltNode.JobsApigetJobGET /v2/jobs/{jobId}Retrieve a Job
LiltNode.JobsApigetJobLeverageStatsPOST /v2/jobs/{jobId}/statsRetrieve Job Leverage Stats
LiltNode.JobsApireactivateJobPOST /v2/jobs/{jobId}/reactivateReactivate a Job
LiltNode.JobsApiretrieveAllJobsGET /v2/jobsRetrieve all Jobs
LiltNode.JobsApiunarchiveJobPOST /v2/jobs/{jobId}/unarchiveUnarchive a Job
LiltNode.JobsApiupdateJobPUT /v2/jobs/{jobId}Update a Job
LiltNode.LanguagesApigetLanguagesGET /v2/languagesRetrieve supported languages
LiltNode.MemoriesApicreateMemoryPOST /v2/memoriesCreate a Memory
LiltNode.MemoriesApideleteMemoryDELETE /v2/memoriesDelete a Memory
LiltNode.MemoriesApideleteSegmentFromMemoryDELETE /v2/memories/segmentDelete a segment from a memory.
LiltNode.MemoriesApidownloadTermbaseGET /v2/memories/termbase/downloadTermbase download for a Memory
LiltNode.MemoriesApiexportTermbasePOST /v2/memories/termbase/exportTermbase export for a Memory
LiltNode.MemoriesApigetMemoryGET /v2/memoriesRetrieve a Memory
LiltNode.MemoriesApiimportMemoryFilePOST /v2/memories/importFile import for a Memory
LiltNode.MemoriesApiqueryMemoryGET /v2/memories/queryQuery a Memory
LiltNode.MemoriesApiupdateMemoryPUT /v2/memoriesUpdate the name of a Memory
LiltNode.ProjectsApicreateProjectPOST /v2/projectsCreate a Project
LiltNode.ProjectsApideleteProjectDELETE /v2/projectsDelete a Project
LiltNode.ProjectsApigetProjectsGET /v2/projectsRetrieve a Project
LiltNode.TranslateApibatchTranslateFilePOST /v2/translate/fileTranslate a File
LiltNode.TranslateApidownloadFileGET /v2/translate/filesDownload translated file
LiltNode.TranslateApimonitorFileTranslationGET /v2/translate/fileMonitor file translation
LiltNode.TranslateApitranslateSegmentPostPOST /v2/translateTranslate a segment
LiltNode.WorkflowsApigetWorkflowTemplatesGET /v2/workflows/templatesRetrieve workflow templates

Documentation for Models

Documentation for Authorization

ApiKeyAuth

  • Type: API key
  • API key parameter name: key
  • Location: URL query string

BasicAuth

  • Type: HTTP basic authentication
3.0.0

6 months ago

0.6.5

9 months ago

0.6.3

2 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

5 years ago