-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
4,275 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env" | ||
], | ||
"plugins": [ | ||
"@babel/plugin-syntax-dynamic-import", | ||
"@babel/plugin-syntax-import-meta", | ||
"@babel/plugin-proposal-class-properties", | ||
"@babel/plugin-proposal-json-strings", | ||
[ | ||
"@babel/plugin-proposal-decorators", | ||
{ | ||
"legacy": true | ||
} | ||
], | ||
"@babel/plugin-proposal-function-sent", | ||
"@babel/plugin-proposal-export-namespace-from", | ||
"@babel/plugin-proposal-numeric-separator", | ||
"@babel/plugin-proposal-throw-expressions", | ||
"@babel/plugin-proposal-export-default-from", | ||
"@babel/plugin-proposal-logical-assignment-operators", | ||
"@babel/plugin-proposal-optional-chaining", | ||
[ | ||
"@babel/plugin-proposal-pipeline-operator", | ||
{ | ||
"proposal": "minimal" | ||
} | ||
], | ||
"@babel/plugin-proposal-nullish-coalescing-operator", | ||
"@babel/plugin-proposal-do-expressions", | ||
"@babel/plugin-proposal-function-bind" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# OpenAPI Generator Ignore | ||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
||
# Use this file to prevent files from being overwritten by the generator. | ||
# The patterns follow closely to .gitignore or .dockerignore. | ||
|
||
# As an example, the C# client generator defines ApiClient.cs. | ||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
#ApiClient.cs | ||
|
||
# You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
#foo/*/qux | ||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
#foo/**/qux | ||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
||
# You can also negate patterns with an exclamation (!). | ||
# For example, you can ignore all files in a docs folder with the file extension .md: | ||
#docs/*.md | ||
# Then explicitly reverse the ignore rule for a single file: | ||
#!docs/README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
.babelrc | ||
.gitignore | ||
.openapi-generator-ignore | ||
.travis.yml | ||
README.md | ||
docs/AddStub200Response.md | ||
docs/AddStubRequest.md | ||
docs/HealthcheckApi.md | ||
docs/MessageOK.md | ||
docs/SearchRequest.md | ||
docs/SearchResponse.md | ||
docs/Stub.md | ||
docs/StubHeaders.md | ||
docs/StubInput.md | ||
docs/StubOutput.md | ||
docs/StubsApi.md | ||
git_push.sh | ||
mocha.opts | ||
package.json | ||
src/ApiClient.js | ||
src/api/HealthcheckApi.js | ||
src/api/StubsApi.js | ||
src/index.js | ||
src/model/AddStub200Response.js | ||
src/model/AddStubRequest.js | ||
src/model/MessageOK.js | ||
src/model/SearchRequest.js | ||
src/model/SearchResponse.js | ||
src/model/Stub.js | ||
src/model/StubHeaders.js | ||
src/model/StubInput.js | ||
src/model/StubOutput.js | ||
test/api/HealthcheckApi.spec.js | ||
test/api/StubsApi.spec.js | ||
test/model/AddStub200Response.spec.js | ||
test/model/AddStubRequest.spec.js | ||
test/model/MessageOK.spec.js | ||
test/model/SearchRequest.spec.js | ||
test/model/SearchResponse.spec.js | ||
test/model/Stub.spec.js | ||
test/model/StubHeaders.spec.js | ||
test/model/StubInput.spec.js | ||
test/model/StubOutput.spec.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
7.4.0-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
language: node_js | ||
cache: npm | ||
node_js: | ||
- "6" | ||
- "6.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
# gripmock-sdk-js | ||
|
||
GripmockSdkJs - JavaScript client for gripmock-sdk-js | ||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: | ||
|
||
- API version: 2.4.0 | ||
- Package version: 2.4.0 | ||
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen | ||
|
||
## Installation | ||
|
||
### For [Node.js](https://nodejs.org/) | ||
|
||
#### npm | ||
|
||
To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages). | ||
|
||
Then install it via: | ||
|
||
```shell | ||
npm install gripmock-sdk-js --save | ||
``` | ||
|
||
Finally, you need to build the module: | ||
|
||
```shell | ||
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: | ||
|
||
```shell | ||
npm install | ||
``` | ||
|
||
Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`: | ||
|
||
```shell | ||
npm link | ||
``` | ||
|
||
To use the link you just defined in your project, switch to the directory you want to use your gripmock-sdk-js from, and run: | ||
|
||
```shell | ||
npm link /path/to/<JAVASCRIPT_CLIENT_DIR> | ||
``` | ||
|
||
Finally, you need to build the module: | ||
|
||
```shell | ||
npm run build | ||
``` | ||
|
||
#### git | ||
|
||
If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID | ||
then install it via: | ||
|
||
```shell | ||
npm install GIT_USER_ID/GIT_REPO_ID --save | ||
``` | ||
|
||
### For browser | ||
|
||
The library also works in the browser environment via npm and [browserify](http://browserify.org/). 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): | ||
|
||
```shell | ||
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: | ||
|
||
```javascript | ||
module: { | ||
rules: [ | ||
{ | ||
parser: { | ||
amd: false | ||
} | ||
} | ||
] | ||
} | ||
``` | ||
|
||
## Getting Started | ||
|
||
Please follow the [installation](#installation) instruction and execute the following JS code: | ||
|
||
```javascript | ||
var GripmockSdkJs = require('gripmock-sdk-js'); | ||
|
||
|
||
var api = new GripmockSdkJs.HealthcheckApi() | ||
var callback = function(error, data, response) { | ||
if (error) { | ||
console.error(error); | ||
} else { | ||
console.log('API called successfully. Returned data: ' + data); | ||
} | ||
}; | ||
api.liveness(callback); | ||
|
||
``` | ||
|
||
## Documentation for API Endpoints | ||
|
||
All URIs are relative to *https://raw.githubusercontent.com/api* | ||
|
||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
*GripmockSdkJs.HealthcheckApi* | [**liveness**](docs/HealthcheckApi.md#liveness) | **GET** /health/liveness | Liveness check | ||
*GripmockSdkJs.HealthcheckApi* | [**readiness**](docs/HealthcheckApi.md#readiness) | **GET** /health/readiness | Readiness check | ||
*GripmockSdkJs.StubsApi* | [**addStub**](docs/StubsApi.md#addStub) | **POST** /stubs | Add a new stub to the store | ||
*GripmockSdkJs.StubsApi* | [**batchStubsDelete**](docs/StubsApi.md#batchStubsDelete) | **POST** /stubs/batchDelete | Deletes a pack by IDs | ||
*GripmockSdkJs.StubsApi* | [**deleteStubByID**](docs/StubsApi.md#deleteStubByID) | **DELETE** /stubs/{uuid} | Deletes stub by ID | ||
*GripmockSdkJs.StubsApi* | [**listStubs**](docs/StubsApi.md#listStubs) | **GET** /stubs | Getting a list of stubs | ||
*GripmockSdkJs.StubsApi* | [**listUnusedStubs**](docs/StubsApi.md#listUnusedStubs) | **GET** /stubs/unused | Getting a list of unused stubs | ||
*GripmockSdkJs.StubsApi* | [**listUsedStubs**](docs/StubsApi.md#listUsedStubs) | **GET** /stubs/used | Getting a list of used stubs | ||
*GripmockSdkJs.StubsApi* | [**purgeStubs**](docs/StubsApi.md#purgeStubs) | **DELETE** /stubs | Remove all stubs | ||
*GripmockSdkJs.StubsApi* | [**searchStubs**](docs/StubsApi.md#searchStubs) | **POST** /stubs/search | Stub storage search | ||
|
||
|
||
## Documentation for Models | ||
|
||
- [GripmockSdkJs.AddStub200Response](docs/AddStub200Response.md) | ||
- [GripmockSdkJs.AddStubRequest](docs/AddStubRequest.md) | ||
- [GripmockSdkJs.MessageOK](docs/MessageOK.md) | ||
- [GripmockSdkJs.SearchRequest](docs/SearchRequest.md) | ||
- [GripmockSdkJs.SearchResponse](docs/SearchResponse.md) | ||
- [GripmockSdkJs.Stub](docs/Stub.md) | ||
- [GripmockSdkJs.StubHeaders](docs/StubHeaders.md) | ||
- [GripmockSdkJs.StubInput](docs/StubInput.md) | ||
- [GripmockSdkJs.StubOutput](docs/StubOutput.md) | ||
|
||
|
||
## Documentation for Authorization | ||
|
||
Endpoints do not require authorization. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# GripmockSdkJs.AddStub200Response | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# GripmockSdkJs.AddStubRequest | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**id** | **String** | | [optional] | ||
**service** | **String** | | | ||
**method** | **String** | | | ||
**headers** | [**StubHeaders**](StubHeaders.md) | | [optional] | ||
**input** | [**StubInput**](StubInput.md) | | | ||
**output** | [**StubOutput**](StubOutput.md) | | | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# GripmockSdkJs.HealthcheckApi | ||
|
||
All URIs are relative to *https://raw.githubusercontent.com/api* | ||
|
||
Method | HTTP request | Description | ||
------------- | ------------- | ------------- | ||
[**liveness**](HealthcheckApi.md#liveness) | **GET** /health/liveness | Liveness check | ||
[**readiness**](HealthcheckApi.md#readiness) | **GET** /health/readiness | Readiness check | ||
|
||
|
||
|
||
## liveness | ||
|
||
> MessageOK liveness() | ||
Liveness check | ||
|
||
The test says that the service is alive and yet | ||
|
||
### Example | ||
|
||
```javascript | ||
import GripmockSdkJs from 'gripmock-sdk-js'; | ||
|
||
let apiInstance = new GripmockSdkJs.HealthcheckApi(); | ||
apiInstance.liveness((error, data, response) => { | ||
if (error) { | ||
console.error(error); | ||
} else { | ||
console.log('API called successfully. Returned data: ' + data); | ||
} | ||
}); | ||
``` | ||
|
||
### Parameters | ||
|
||
This endpoint does not need any parameter. | ||
|
||
### Return type | ||
|
||
[**MessageOK**](MessageOK.md) | ||
|
||
### Authorization | ||
|
||
No authorization required | ||
|
||
### HTTP request headers | ||
|
||
- **Content-Type**: Not defined | ||
- **Accept**: application/json | ||
|
||
|
||
## readiness | ||
|
||
> MessageOK readiness() | ||
Readiness check | ||
|
||
The test indicates readiness to receive traffic | ||
|
||
### Example | ||
|
||
```javascript | ||
import GripmockSdkJs from 'gripmock-sdk-js'; | ||
|
||
let apiInstance = new GripmockSdkJs.HealthcheckApi(); | ||
apiInstance.readiness((error, data, response) => { | ||
if (error) { | ||
console.error(error); | ||
} else { | ||
console.log('API called successfully. Returned data: ' + data); | ||
} | ||
}); | ||
``` | ||
|
||
### Parameters | ||
|
||
This endpoint does not need any parameter. | ||
|
||
### Return type | ||
|
||
[**MessageOK**](MessageOK.md) | ||
|
||
### Authorization | ||
|
||
No authorization required | ||
|
||
### HTTP request headers | ||
|
||
- **Content-Type**: Not defined | ||
- **Accept**: application/json | ||
|
Oops, something went wrong.