onesky-utils
Advanced tools
Comparing version 0.0.3 to 1.0.0
@@ -10,3 +10,4 @@ | ||
getFile: rootRequire('lib/getFile.js'), | ||
getMultilingualFile: rootRequire('lib/getMultilingualFile.js'), | ||
postFile: rootRequire('lib/postFile.js') | ||
}; |
{ | ||
"name": "onesky-utils", | ||
"version": "0.0.3", | ||
"description": "", | ||
"version": "1.0.0", | ||
"description": "Node.js utils for working with OneSky translation service.", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -8,3 +8,3 @@ # nodejs-onesky-utils [![Build Status](https://travis-ci.org/brainly/nodejs-onesky-utils.svg?branch=master)](https://travis-ci.org/brainly/nodejs-onesky-utils) [![Code Climate](https://codeclimate.com/github/brainly/nodejs-onesky-utils/badges/gpa.svg)](https://codeclimate.com/github/brainly/nodejs-onesky-utils) [![npm version](https://badge.fury.io/js/onesky-utils.svg)](http://badge.fury.io/js/onesky-utils) | ||
``` | ||
```js | ||
var onesky = require('onesky-utils'); | ||
@@ -26,6 +26,27 @@ | ||
``` | ||
### getMultiLingualFile | ||
```js | ||
var onesky = require('onesky-utils'); | ||
var options = { | ||
language: 'en_EN', | ||
secret: '1234567', | ||
apiKey: 'abcdefg', | ||
projectId: '123', | ||
fileName: 'translations.po', | ||
format: 'I18NEXT_MULTILINGUAL_JSON' | ||
}; | ||
onesky.getMultiLingualFile(options).then(function(content) { | ||
console.log(content); | ||
}).catch(function(error) { | ||
console.log(error); | ||
}); | ||
``` | ||
### postFile | ||
``` | ||
```js | ||
var onesky = require('onesky-utils'); | ||
@@ -66,8 +87,22 @@ | ||
- **options.projectId** - numerical ID of the project | ||
- **options.fileName** - name of the translation file | ||
- **options.language** - language version | ||
- **options.secret** - secret and apiKey are used for authentication | ||
- **options.projectId** - Numerical ID of the project | ||
- **options.fileName** - Name of the translation file | ||
- **options.language** - Language version | ||
- **options.secret** - `secret` and `apiKey` are used for authentication | ||
- **options.apiKey** | ||
### getMultiLingualFile(options) | ||
Downloads multi-language translations from OneSky. | ||
Returns file content via promise. | ||
The `options` object is required. Options include: | ||
- **options.projectId** - Numerical ID of the project | ||
- **options.fileName** - Name of the translation file | ||
- **options.format** - Response file format (Optional. Defaults to `I18NEXT_MULTILINGUAL_JSON`) | ||
- **options.language** - Language version | ||
- **options.secret** - `secret` and `apiKey` are used for authentication | ||
- **options.apiKey** | ||
### postFile(options) | ||
@@ -78,9 +113,9 @@ Uploads translation file to OneSky. | ||
- **options.projectId** - numerical ID of the project | ||
- **options.fileName** - name of the translation file | ||
- **options.language** - language version | ||
- **options.format** - file format ([list here](https://github.com/onesky/api-documentation-platform/blob/master/reference/format.md)) | ||
- **options.content** string with the content of the file | ||
- **options.keepStrings** boolean saying if already uploaded strings not present on this file should be deprecated or keept | ||
- **options.secret** - secret and apiKey are used for authentication | ||
- **options.projectId** - Numerical ID of the project | ||
- **options.fileName** - Name of the translation file | ||
- **options.language** - Language version | ||
- **options.format** - File format ([list here](https://github.com/onesky/api-documentation-platform/blob/master/reference/format.md)) | ||
- **options.content** String with the content of the file | ||
- **options.keepStrings** Boolean saying if already uploaded strings not present on this file should be deprecated or keept | ||
- **options.secret** - `secret` and `apiKey` are used for authentication | ||
- **options.apiKey** | ||
@@ -87,0 +122,0 @@ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
19055
17
410
1
152
4