Skip to content

Commit a49f49a

Browse files
authored
Merge pull request #91 from bcomnes/node-client
Add node client info
2 parents ef35c7d + 94fbb28 commit a49f49a

File tree

141 files changed

+19429
-4
lines changed

Some content is hidden

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

141 files changed

+19429
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.iml
22
vendor
3+
*node_modules

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
CHECK_FILES?=$$(go list ./... | grep -v /vendor/)
33

44

5+
6+
57
help: ## Show this help.
68
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
79

@@ -22,3 +24,6 @@ test: ## Test the go code.
2224

2325
validate: ## Check that the swagger spec is valid.
2426
swagger validate swagger.yml
27+
28+
node: ## Generate the node module.
29+
swagger-codegen generate -i ./swagger.yml -l javascript -o ./node/

README.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
# Introduction
1+
# Netlify open-api
22

33
This repository contains Netlify's API definition in the [Open API format](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md), formerly known as Swagger.
44

55
It's still a work in progress and we welcome feedback and contributions.
66

7-
## Installation
7+
## Go Client
88

99
We use [go-swagger](https://github.com/go-swagger/go-swagger) to validate our spec against the 2.0 spec of Open API.
1010

1111
We currently depend on version 0.12.0 of the swagger toolchain. You can download the binary for your platform from this release page:
1212

1313
https://github.com/go-swagger/go-swagger/releases/tag/0.12.0
1414

15-
## Spec validation
15+
### Spec validation
1616

1717
You can run this command to validate the spec:
1818

1919
make validate
2020

21-
## Code generation
21+
### Code generation
2222

2323
Currently, we're generating client code for Go, but we're planning on releasing libraries in any language that can generate code from the spec.
2424

@@ -28,6 +28,33 @@ You can use this command to generate the Go client:
2828

2929
You may first want to edit swagger.yml to add your field or endpoint definitions.
3030

31+
## Node Client
32+
33+
In order to generate the Node client, you must install Java 8 and the swagger-codegen tool.
34+
35+
1. You will need java8 (or 7) to run the code-gen
36+
37+
```bash
38+
# install java 8 via homebrew
39+
brew cask install homebrew/cask-versions/java8
40+
```
41+
42+
43+
2. Then install swagger codegen
44+
45+
```bash
46+
# install code-gen via homebrew
47+
brew install swagger-codegen
48+
```
49+
50+
3. Generate the library
51+
52+
```console
53+
$ make node
54+
```
55+
56+
The `swagger-codegen` generates an entire module in the `node` folder. You can publish new versions of the client from that folder with `npm publish`.
57+
3158
## Explore API
3259

3360
Go to https://open-api.netlify.com to explore the spec definitions using Open-Api's UI.

node/.swagger-codegen-ignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Swagger Codegen Ignore
2+
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md

node/.swagger-codegen/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.3.1

node/.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
language: node_js
2+
node_js:
3+
- "6"
4+
- "6.1"
5+
- "5"
6+
- "5.11"
7+

node/README.md

Lines changed: 262 additions & 0 deletions
Large diffs are not rendered by default.

node/docs/AccessToken.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# NetlifysApiDefinition.AccessToken
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**id** | **String** | | [optional]
7+
**accessToken** | **String** | | [optional]
8+
**userId** | **String** | | [optional]
9+
**userEmail** | **String** | | [optional]
10+
**createdAt** | **String** | | [optional]
11+
12+

node/docs/AccountMembership.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# NetlifysApiDefinition.AccountMembership
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**id** | **String** | | [optional]
7+
**name** | **String** | | [optional]
8+
**slug** | **String** | | [optional]
9+
**type** | **String** | | [optional]
10+
**capabilities** | [**AccountMembershipCapabilities**](AccountMembershipCapabilities.md) | | [optional]
11+
**billingName** | **String** | | [optional]
12+
**billingEmail** | **String** | | [optional]
13+
**billingDetails** | **String** | | [optional]
14+
**billingPeriod** | **String** | | [optional]
15+
**paymentMethodId** | **String** | | [optional]
16+
**typeName** | **String** | | [optional]
17+
**typeId** | **String** | | [optional]
18+
**ownerIds** | **[String]** | | [optional]
19+
**rolesAllowed** | **[String]** | | [optional]
20+
**createdAt** | **String** | | [optional]
21+
**updatedAt** | **String** | | [optional]
22+
23+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# NetlifysApiDefinition.AccountMembershipCapabilities
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**sites** | [**AccountUsageCapability**](AccountUsageCapability.md) | | [optional]
7+
**collaborators** | [**AccountUsageCapability**](AccountUsageCapability.md) | | [optional]
8+
9+

0 commit comments

Comments
 (0)