Skip to content

Commit 27844de

Browse files
committed
Initial commit
1 parent e63edb1 commit 27844de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+23276
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,7 @@ dist
102102

103103
# TernJS port file
104104
.tern-port
105+
106+
/lib
107+
108+
/dist

LICENSE

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
License:
2+
========
3+
The MIT License (MIT)
4+
http://opensource.org/licenses/MIT
5+
6+
Copyright (c) 2014 - 2020 APIMATIC Limited
7+
8+
Permission is hereby granted, free of charge, to any person obtaining a copy
9+
of this software and associated documentation files (the "Software"), to deal
10+
in the Software without restriction, including without limitation the rights
11+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
copies of the Software, and to permit persons to whom the Software is
13+
furnished to do so, subject to the following conditions:
14+
15+
The above copyright notice and this permission notice shall be included in
16+
all copies or substantial portions of the Software.
17+
18+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
THE SOFTWARE.
25+
26+
Trade Mark:
27+
==========
28+
APIMATIC is a trade mark for APIMATIC Limited

README.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
2+
# Getting Started with FirstLanguage API
3+
4+
## Introduction
5+
6+
Collection of NLP APIs to help developers. We have grouped the APIs under Basic and Advanced. Basic APIs cover all basic text operations like POSTag, Stemmer etc and Advanced cover all the APIs like QA, translation etc.
7+
8+
### OpenAPI Specification
9+
10+
This API is documented in **OpenAPI v3.0 format**.
11+
In addition to standard
12+
OpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).
13+
14+
## Building
15+
16+
### Requirements
17+
18+
The SDK relies on **Node.js** and **npm** (to resolve dependencies). You can download and install Node.js and [npm](https://www.npmjs.com/) from [the official Node.js website](https://nodejs.org/en/download/).
19+
20+
> **NOTE:** npm is installed by default when Node.js is installed.
21+
22+
### Verify Successful Installation
23+
24+
Run the following commands in the command prompt or shell of your choice to check if Node.js and npm are successfully installed:
25+
26+
* Node.js: `node --version`
27+
28+
* npm: `npm --version`
29+
30+
![Version Check](https://apidocs.io/illustration/typescript?workspaceFolder=FirstLanguageAPI&step=versionCheck)
31+
32+
### Install Dependencies
33+
34+
- To resolve all dependencies, go to the **SDK root directory** and run the following command with npm:
35+
36+
```bash
37+
npm install
38+
```
39+
40+
- This will install all dependencies in the **node_modules** folder.
41+
42+
![Resolve Dependencies](https://apidocs.io/illustration/typescript?workspaceFolder=FirstLanguageAPI&workspaceName=firstlanguage-apilib&step=resolveDependency)
43+
44+
## Installation
45+
46+
The following section explains how to use the generated library in a new project.
47+
48+
### 1. Initialize the Node Project
49+
50+
- Open an IDE/text editor for JavaScript like Visual Studio Code. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.
51+
52+
- Click on **File** and select **Open Folder**. Select an empty folder of your project, the folder will become visible in the sidebar on the left.
53+
54+
![Open Folder](https://apidocs.io/illustration/typescript?step=openProject)
55+
56+
- To initialize the Node project, click on **Terminal** and select **New Terminal**. Execute the following command in the terminal:
57+
58+
```bash
59+
npm init --y
60+
```
61+
62+
![Initialize the Node Project](https://apidocs.io/illustration/typescript?step=initializeProject)
63+
64+
### 2. Add Dependencies to the Client Library
65+
66+
- The created project manages its dependencies using its `package.json` file. In order to add a dependency on the *FirstLanguage APILib* client library, double click on the `package.json` file in the bar on the left and add the dependency to the package in it.
67+
68+
![Add FirstlanguageApilib Dependency](https://apidocs.io/illustration/typescript?workspaceFolder=FirstLanguageAPI&workspaceName=firstlanguage-apilib&step=importDependency)
69+
70+
- To install the package in the project, run the following command in the terminal:
71+
72+
```bash
73+
npm install
74+
```
75+
76+
![Install FirstlanguageApilib Dependency](https://apidocs.io/illustration/typescript?step=installDependency)
77+
78+
## Initialize the API Client
79+
80+
**_Note:_** Documentation for the client can be found [here.](/doc/client.md)
81+
82+
The following parameters are configurable for the API Client:
83+
84+
| Parameter | Type | Description |
85+
| --- | --- | --- |
86+
| `timeout` | `number` | Timeout for API calls.<br>*Default*: `0` |
87+
| `apikey` | `string` | API Key can be copied from your dashboard |
88+
89+
The API client can be initialized as follows:
90+
91+
```ts
92+
const client = new Client({
93+
timeout: 0,
94+
apikey: 'apikey',
95+
})
96+
```
97+
98+
## Authorization
99+
100+
This API uses `Custom Header Signature`.
101+
102+
## List of APIs
103+
104+
* [Basic APIs](/doc/controllers/basic-ap-is.md)
105+
* [Advanced APIs](/doc/controllers/advanced-ap-is.md)
106+
107+
## Classes Documentation
108+
109+
* [ApiResponse](/doc/api-response.md)
110+
* [ApiError](/doc/api-error.md)
111+

doc/api-error.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
# ApiError
3+
4+
Thrown when the HTTP status code is not okay.
5+
6+
The ApiError extends the ApiResponse interface, so all ApiResponse properties are available.
7+
8+
## Properties
9+
10+
| Name | Type | Description |
11+
| --- | --- | --- |
12+
| request | HttpRequest | Original request that resulted in this response. |
13+
| statusCode | number | Response status codee. |
14+
| headers | Record<string, string> | Response headers. |
15+
| result | T | Response data. |
16+
| body | string \| Blob \| NodeJS.ReadableStream | Original body from the response. |
17+

doc/api-response.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
# ApiResponse
3+
4+
An interface for the result of an API call.
5+
6+
## Properties
7+
8+
| Name | Type | Description |
9+
| --- | --- | --- |
10+
| request | HttpRequest | Original request that resulted in this response. |
11+
| statusCode | number | Response status codee. |
12+
| headers | Record<string, string> | Response headers. |
13+
| result | T | Response data. |
14+
| body | string \| Blob \| NodeJS.ReadableStream | Original body from the response. |
15+

doc/client.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
# Client Class Documentation
3+
4+
The following parameters are configurable for the API Client:
5+
6+
| Parameter | Type | Description |
7+
| --- | --- | --- |
8+
| `timeout` | `number` | Timeout for API calls.<br>*Default*: `0` |
9+
| `apikey` | `string` | API Key can be copied from your dashboard |
10+
11+
The API client can be initialized as follows:
12+
13+
```ts
14+
const client = new Client({
15+
timeout: 0,
16+
apikey: 'apikey',
17+
})
18+
```
19+
20+
## FirstLanguage API Client
21+
22+
The gateway for the SDK. This class acts as a factory for the Controllers and also holds the configuration of the SDK.
23+
24+
## Controllers
25+
26+
| Name | Description |
27+
| --- | --- |
28+
| basicAPIs | Gets BasicAPIsController |
29+
| advancedAPIs | Gets AdvancedAPIsController |
30+

0 commit comments

Comments
 (0)