@emilgroup/translation-sdk 1.0.1-beta.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +0 -3
- package/README.md +26 -9
- package/api/translation-api.ts +117 -141
- package/api.ts +4 -2
- package/base.ts +97 -140
- package/common.ts +3 -2
- package/configuration.ts +8 -9
- package/dist/api/translation-api.d.ts +106 -124
- package/dist/api/translation-api.js +93 -100
- package/dist/api.d.ts +0 -1
- package/dist/api.js +0 -1
- package/dist/base.d.ts +13 -22
- package/dist/base.js +153 -125
- package/dist/common.d.ts +1 -0
- package/dist/common.js +4 -3
- package/dist/configuration.d.ts +7 -6
- package/dist/configuration.js +0 -8
- package/dist/models/create-product-language-request-dto.d.ts +1 -1
- package/dist/models/index.d.ts +0 -2
- package/dist/models/index.js +0 -2
- package/dist/models/product-language-class.d.ts +4 -4
- package/models/create-product-language-request-dto.ts +1 -1
- package/models/index.ts +0 -2
- package/models/product-language-class.ts +4 -4
- package/package.json +5 -2
- package/tsconfig.json +0 -1
- package/api/default-api.ts +0 -124
- package/dist/api/default-api.d.ts +0 -70
- package/dist/api/default-api.js +0 -200
- package/dist/models/inline-response200.d.ts +0 -54
- package/dist/models/inline-response200.js +0 -15
- package/dist/models/inline-response503.d.ts +0 -54
- package/dist/models/inline-response503.js +0 -15
- package/models/inline-response200.ts +0 -48
- package/models/inline-response503.ts +0 -48
package/.openapi-generator/FILES
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
.openapi-generator-ignore
|
|
4
4
|
README.md
|
|
5
5
|
api.ts
|
|
6
|
-
api/default-api.ts
|
|
7
6
|
api/translation-api.ts
|
|
8
7
|
base.ts
|
|
9
8
|
common.ts
|
|
@@ -14,8 +13,6 @@ models/create-product-language-request-dto.ts
|
|
|
14
13
|
models/create-product-language-response-class.ts
|
|
15
14
|
models/get-product-language-response-class.ts
|
|
16
15
|
models/index.ts
|
|
17
|
-
models/inline-response200.ts
|
|
18
|
-
models/inline-response503.ts
|
|
19
16
|
models/list-product-languages-response-class.ts
|
|
20
17
|
models/list-translations-response-class.ts
|
|
21
18
|
models/product-language-class.ts
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Emil Translation SDK
|
|
2
2
|
|
|
3
|
-
This TypeScript/JavaScript client utilizes [axios](https://github.com/axios/axios). The generated module can be used with
|
|
3
|
+
This TypeScript/JavaScript client utilizes [axios](https://github.com/axios/axios). The generated Node module can be used with Nodejs based applications.
|
|
4
4
|
|
|
5
5
|
Language level
|
|
6
6
|
* ES5 - you must have a Promises/A+ library installed
|
|
@@ -17,11 +17,11 @@ Although this package can be used in both TypeScript and JavaScript, it is inten
|
|
|
17
17
|
Navigate to the folder of your consuming project and run one of the following commands:
|
|
18
18
|
|
|
19
19
|
```
|
|
20
|
-
npm install @emilgroup/translation-sdk@1.
|
|
20
|
+
npm install @emilgroup/translation-sdk@1.1.0 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/translation-sdk@1.
|
|
24
|
+
yarn add @emilgroup/translation-sdk@1.1.0
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import `TranslationApi`.
|
|
@@ -29,19 +29,36 @@ And then you can import `TranslationApi`.
|
|
|
29
29
|
```ts
|
|
30
30
|
import { TranslationApi } from '@emilgroup/translation-sdk'
|
|
31
31
|
|
|
32
|
-
const
|
|
32
|
+
const tranlationApi = new TranslationApi();
|
|
33
33
|
```
|
|
34
|
+
## Credentials
|
|
34
35
|
|
|
35
|
-
To use authentication protected endpoints, you have to first authorize. To do so,
|
|
36
|
+
To use authentication protected endpoints, you have to first authorize. To do so, the easiest way is to provide a configuration file under `~/.emil/credentials` with the following content:
|
|
37
|
+
|
|
38
|
+
```shell
|
|
39
|
+
emil_username=XXXXX@XXXX.XXX
|
|
40
|
+
emil_password=XXXXXXXXXXXXXX
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
It is also possible to provide environment variables instead:
|
|
44
|
+
|
|
45
|
+
```shell
|
|
46
|
+
export EMIL_USERNAME=XXXXX@XXXX.XXX
|
|
47
|
+
export EMIL_PASSWORD=XXXXXXXXXXXXXX
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Example
|
|
51
|
+
|
|
52
|
+
Here is a basic functionning example:
|
|
36
53
|
|
|
37
54
|
```ts
|
|
38
|
-
async function
|
|
55
|
+
async function listProductLanguages(): Promise<Void> {
|
|
39
56
|
try {
|
|
40
|
-
const
|
|
57
|
+
const tranlationApi = new TranslationApi();
|
|
41
58
|
|
|
42
|
-
await
|
|
59
|
+
await tranlationApi.initialize(); // should be called only once per Api.
|
|
43
60
|
|
|
44
|
-
const { data: { items } } = await
|
|
61
|
+
const { data: { items } } = await tranlationApi.listProductLanguages();
|
|
45
62
|
|
|
46
63
|
console.log(items);
|
|
47
64
|
} catch(error) {
|