@crowdin/crowdin-api-client
Advanced tools
Comparing version 1.10.4 to 1.10.5
@@ -8,3 +8,3 @@ import { CrowdinApi, DownloadLink, PatchRequest, ResponseList, ResponseObject, Status } from '../core'; | ||
*/ | ||
listGlossaries(groupId: number, limit?: number, offset?: number): Promise<ResponseList<GlossariesModel.Glossary>>; | ||
listGlossaries(groupId?: number, limit?: number, offset?: number): Promise<ResponseList<GlossariesModel.Glossary>>; | ||
/** | ||
@@ -11,0 +11,0 @@ * @param request request body |
@@ -8,3 +8,3 @@ import { CrowdinApi, PatchRequest, ResponseList, ResponseObject } from '../core'; | ||
*/ | ||
listMts(groupId: number, limit?: number, offset?: number): Promise<ResponseList<MachineTranslationModel.MachineTranslation>>; | ||
listMts(groupId?: number, limit?: number, offset?: number): Promise<ResponseList<MachineTranslationModel.MachineTranslation>>; | ||
/** | ||
@@ -11,0 +11,0 @@ * @param request request body |
@@ -8,3 +8,3 @@ import { CrowdinApi, DownloadLink, PatchRequest, ResponseList, ResponseObject, Status } from '../core'; | ||
*/ | ||
listTm(groupId: number, limit?: number, offset?: number): Promise<ResponseList<TranslationMemoryModel.TranslationMemory>>; | ||
listTm(groupId?: number, limit?: number, offset?: number): Promise<ResponseList<TranslationMemoryModel.TranslationMemory>>; | ||
/** | ||
@@ -11,0 +11,0 @@ * @param request request body |
{ | ||
"name": "@crowdin/crowdin-api-client", | ||
"version": "1.10.4", | ||
"version": "1.10.5", | ||
"description": "JavaScript library for Crowdin API v2.", | ||
@@ -5,0 +5,0 @@ "main": "out/index.js", |
@@ -35,2 +35,3 @@ [<p align='center'><img src='https://support.crowdin.com/assets/logos/crowdin-dark-symbol.png' data-canonical-src='https://support.crowdin.com/assets/logos/crowdin-dark-symbol.png' width='200' height='200' align='center'/></p>](https://crowdin.com) | ||
* [Quick Start](#quick-start) | ||
* [Over-The-Air Content Delivery](#over-the-air-content-delivery) | ||
* [Seeking Assistance](#seeking-assistance) | ||
@@ -104,3 +105,3 @@ * [Contributing](#contributing) | ||
<details> | ||
<summary>Javascript</summary> | ||
<summary>Javascript ES6 modules</summary> | ||
@@ -151,2 +152,49 @@ ```javascript | ||
<details> | ||
<summary>Javascript CommonJS</summary> | ||
```javascript | ||
const crowdin = require('@crowdin/crowdin-api-client').default; | ||
// initialization of crowdin client | ||
const { projectsGroupsApi } = new crowdin({ | ||
token: 'personalAccessToken', | ||
organization: 'organizationName' // optional | ||
}); | ||
// get project list | ||
projectsGroupsApi.listProjects() | ||
.then(projects => console.log(projects)) | ||
.catch(error => console.error(error)); | ||
// You can also use async/wait. Add `async` keyword to your outer function/method | ||
async function getProjects() { | ||
try { | ||
const projects = await projectsGroupsApi.listProjects(); | ||
console.log(projects); | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
} | ||
``` | ||
Or specific API instances: | ||
```javascript | ||
const ProjectsGroups = require('@crowdin/crowdin-api-client').ProjectsGroups; | ||
// initialization of ProjectsGroups | ||
const projectsGroupsApi = new ProjectsGroups({ | ||
token: 'personalAccessToken', | ||
organization: 'organizationName' // optional | ||
}); | ||
// get project list | ||
projectsGroupsApi.listProjects() | ||
.then(projects => console.log(projects)) | ||
.catch(error => console.error(error)); | ||
``` | ||
</details> | ||
You can generate Personal Access Token in your Crowdin Account Settings. | ||
@@ -158,3 +206,3 @@ | ||
This client uses [axios](https://github.com/axios/axios) which internally uses `http` and `https` Node modules. | ||
So there is an option to use http client based on [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). | ||
So there is an option to use http client based on [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) (keep in mind that `fetch` should be available in global scope). | ||
@@ -221,2 +269,8 @@ ```typescript | ||
## Over-The-Air Content Delivery | ||
:dizzy: Recommended for translations delivery to your website or mobile application. | ||
You can also use the [Crowdin OTA Client JS](https://github.com/crowdin/ota-client-js) library to send the translated content to your web apps via content delivery. Crowdin Content Delivery uses a CDN vault that mirrors your project’s translated content. The updated translations will become available to users much faster. | ||
## Seeking Assistance | ||
@@ -223,0 +277,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
261664
291
4