0.6.3 • Published 12 months ago

lilt-node v0.6.3

Weekly downloads
-
License
Unlicense
Repository
-
Last release
12 months ago

lilt-node

LiltNode - JavaScript client for lilt-node 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.

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: v2.0
  • Package version: 0.5.0
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen For more information, please visit https://lilt.com/docs/api

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.CommentsApi()
var documentId = 56; // {Number} A unique document identifier.
var segmentId = 56; // {Number} A unique segment identifier.
var body = new LiltNode.CommentBody(); // {CommentBody} The comment being created
api.createComment(documentId, segmentId, body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
LiltNode.CommentsApicreateCommentPOST /commentsCreate a new comment
LiltNode.CommentsApideleteCommentDELETE /commentsDelete a Comment
LiltNode.CommentsApigetDocumentCommentsGET /commentsRetrieve a document's comments by segment
LiltNode.CommentsApiupdateCommentPUT /commentsUpdate an existing comment
LiltNode.ConnectorsApicreateConnectorPOST /connectorsUpload a Connector
LiltNode.ConnectorsApideleteConnectorDELETE /connectorsDelete a Connector
LiltNode.ConnectorsApiexportConnectorJobPOST /connectors/jobs/deliverDeliver a Connector Job
LiltNode.ConnectorsApigetConnectorJobsGET /connectors/jobsRetrieve a Connector Job
LiltNode.ConnectorsApigetConnectorsGET /connectorsRetrieve a Connector
LiltNode.ConnectorsApisyncConnectorPOST /connectors/syncSync a Connector
LiltNode.ConnectorsApiupdateConnectorPUT /connectorsUpload a Connector
LiltNode.ConverterConfigApiaddConverterConfigPUT /configs/converterAdd Converter Config
LiltNode.ConverterConfigApideleteConverterConfigDELETE /configs/converter/{configId}Delete Converter Config
LiltNode.ConverterConfigApideleteFilterMappingDELETE /configs/converter/{configId}/{fileExtension}Delete Filter Mapping
LiltNode.ConverterConfigApieditFilterMappingPUT /configs/converter/{configId}/{fileExtension}Add Filter Mapping
LiltNode.ConverterConfigApigetConverterConfigByIdGET /configs/converter/{configId}Fetch Converter Config by Id
LiltNode.ConverterConfigApigetConverterConfigsGET /configs/converterList Converter Configs
LiltNode.DocumentsApiassignDocumentPUT /documents/shareAssign a Document
LiltNode.DocumentsApicreateDocumentPOST /documentsCreate a Document
LiltNode.DocumentsApideleteDocumentDELETE /documentsDelete a Document
LiltNode.DocumentsApidownloadDocumentGET /documents/filesDownload a Document
LiltNode.DocumentsApigetDocumentGET /documentsRetrieve a Document
LiltNode.DocumentsApimarkReviewDonePOST /documents/done/reviewMark review done
LiltNode.DocumentsApimarkTranslationDonePOST /documents/done/translationMark translation done
LiltNode.DocumentsApipretranslateDocumentsPOST /documents/pretranslatePretranslate a Document
LiltNode.DocumentsApiunlockDocumentsPOST /documents/done/unlockUnlock documents
LiltNode.DocumentsApiuploadDocumentPOST /documents/filesUpload a File
LiltNode.FilesApiaddLabelPOST /files/labelsAdd Label to File
LiltNode.FilesApideleteFileDELETE /filesDelete a File
LiltNode.FilesApidownloadGET /files/downloadDownload file
LiltNode.FilesApigetFilesGET /filesRetrieve a File
LiltNode.FilesApiremoveLabelDELETE /files/labelsRemove Label from File
LiltNode.FilesApiuploadFilePOST /filesUpload a File
LiltNode.JobsApiarchiveJobPOST /jobs/{jobId}/archiveArchive a Job
LiltNode.JobsApicreateJobPOST /jobsCreate a Job
LiltNode.JobsApideleteJobDELETE /jobs/{jobId}Delete a Job
LiltNode.JobsApideliverJobPOST /jobs/{jobId}/deliverDeliver a Job
LiltNode.JobsApidownloadJobGET /jobs/{jobId}/downlodDownload a Job
LiltNode.JobsApiexportJobGET /jobs/{jobId}/exportExport a Job
LiltNode.JobsApigetJobGET /jobs/{jobId}Retrieve a Job
LiltNode.JobsApigetJobLeverageStatsPOST /jobs/{jobId}/statsRetrieve Job Leverage Stats
LiltNode.JobsApireactivateJobPOST /jobs/{jobId}/reactivateReactivate a Job
LiltNode.JobsApiretrieveAllJobsGET /jobsRetrieve all Jobs
LiltNode.JobsApiunarchiveJobPOST /jobs/{jobId}/unarchiveUnarchive a Job
LiltNode.JobsApiupdateJobPUT /jobs/{jobId}Update a Job
LiltNode.LanguagesApigetLanguagesGET /languagesRetrieve supported languages
LiltNode.LexiconApiqueryLexiconGET /lexiconQuery a Lexicon
LiltNode.LexiconApiupdateLexiconPOST /lexiconUpdate a Lexicon
LiltNode.MemoriesApicreateMemoryPOST /memoriesCreate a Memory
LiltNode.MemoriesApideleteMemoryDELETE /memoriesDelete a Memory
LiltNode.MemoriesApigetMemoryGET /memoriesRetrieve a Memory
LiltNode.MemoriesApiimportMemoryFilePOST /memories/importFile import for a Memory
LiltNode.MemoriesApiqueryMemoryGET /memories/queryQuery a Memory
LiltNode.MemoriesApisyncDeleteMemoryDELETE /memories/syncDelete-sync for a Memory
LiltNode.MemoriesApisyncDownMemoryGET /memories/syncGet-sync for a Memory
LiltNode.MemoriesApisyncInsertMemoryPOST /memories/syncInsert-sync for a Memory
LiltNode.MemoriesApisyncUpdateMemoryPUT /memories/syncUpdate-sync for a Memory
LiltNode.MemoriesApiupdateMemoryPUT /memoriesUpdate the name of a Memory
LiltNode.ProjectsApicreateProjectPOST /projectsCreate a Project
LiltNode.ProjectsApideleteProjectDELETE /projectsDelete a Project
LiltNode.ProjectsApideliverProjectsBulkPOST /projects/bulk-deliverDeliver multiple projects apart from their jobs.
LiltNode.ProjectsApigetProjectReportGET /projects/quoteRetrieve Project report
LiltNode.ProjectsApigetProjectRevisionReportGET /projects/{id}/revisionRetrieve Project revision report
LiltNode.ProjectsApigetProjectStatusGET /projects/statusRetrieve Project status
LiltNode.ProjectsApigetProjectsGET /projectsRetrieve a Project
LiltNode.ProjectsApitriggerAutoAssignmentPOST /autoAssignmentAuto Assignment
LiltNode.ProjectsApiupdateProjectsBulkPUT /projects/bulk-updateUpdate multiple Projects with a single payload
LiltNode.QAApiqaCheckGET /qaPerform QA check
LiltNode.RootApirootGET /Retrieve the REST API root
LiltNode.SegmentsApicreateSegmentPOST /segmentsCreate a Segment
LiltNode.SegmentsApideleteSegmentDELETE /segmentsDelete a Segment
LiltNode.SegmentsApigetSegmentGET /segmentsRetrieve a Segment
LiltNode.SegmentsApitagSegmentGET /segments/tagTag a Segment
LiltNode.SegmentsApiunlockSegmentsPOST /segments/review/unlockUnaccept and unlock segments
LiltNode.SegmentsApiupdateSegmentPUT /segmentsUpdate a Segment
LiltNode.SettingsApigetOrganizationSettingsGET /settings/organizationGet organization-level settings
LiltNode.SettingsApigetProjectSettingsGET /settings/project/{projectId}Get settings for a project
LiltNode.SettingsApigetUserSettingsGET /settings/userGet settings for the authenticated user
LiltNode.SettingsApiupsertSettingPOST /settingsUpdate or create a setting
LiltNode.TranslateApibatchTranslateFilePOST /translate/fileTranslate a File
LiltNode.TranslateApidownloadFileGET /translate/filesDownload translated file
LiltNode.TranslateApimonitorFileTranslationGET /translate/fileMonitor file translation
LiltNode.TranslateApiregisterSegmentGET /translate/registerRegister a segment
LiltNode.TranslateApitranslateSegmentGET /translateTranslate a segment
LiltNode.TranslateApitranslateSegmentPostPOST /translateTranslate a segment
LiltNode.WorkflowsApiadvanceWorkflowStagePOST /document/{documentId}/task/{taskId}/advanceAdvance workflow to the next stage
LiltNode.WorkflowsApigetDocumentWorkflowGET /workflows/document/{documentId}Retrieve document Workflow metadata
LiltNode.WorkflowsApigetWorkflowTemplatesGET /workflows/templatesRetrieve workflow templates
LiltNode.WorkflowsApirejectWorkflowStagePOST /document/{documentId}/task/{taskId}/rejectMove workflow to the previous stage
LiltNode.WorkflowsApisetDocumentStagePUT /workflows/{documentId}/stageSet Workflow stage for a document

Documentation for Models

Documentation for Authorization

ApiKeyAuth

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

BasicAuth

  • Type: HTTP basic authentication
0.6.3

12 months ago

0.6.2

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.0

4 years ago