Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Feb 8, 2023
1 parent 53a4575 commit 60bf4fc
Show file tree
Hide file tree
Showing 16 changed files with 286 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .openapi-generator-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

docs/
#docs/
test/
.travis.yml
git_push.sh
Expand Down
10 changes: 9 additions & 1 deletion .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
.babelrc
.gitignore
git_push.sh
docs/Block.md
docs/BlockSlotsInner.md
docs/Config200Response.md
docs/Config200ResponseNav.md
docs/Config200ResponseNitro.md
docs/ConfigApi.md
docs/Page.md
docs/PagesApi.md
docs/PagesInner.md
src/ApiClient.js
src/api/ConfigApi.js
src/api/PagesApi.js
Expand Down
13 changes: 13 additions & 0 deletions docs/Block.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Nitrocms.Block

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**items** | **[Object]** | Mapping Items | [optional]
**content** | **Object** | Text Contents | [optional]
**config** | **Object** | Config Content | [optional]
**identifier** | **String** | The unique identifier for the current block | [optional]
**slots** | [**[BlockSlotsInner]**](BlockSlotsInner.md) | | [optional]


10 changes: 10 additions & 0 deletions docs/BlockSlotsInner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Nitrocms.BlockSlotsInner

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**identifier** | **String** | The unique identifier of the slot | [optional]
**content** | [**[Block]**](Block.md) | | [optional]


12 changes: 12 additions & 0 deletions docs/Config200Response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Nitrocms.Config200Response

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**nitro** | [**Config200ResponseNitro**](Config200ResponseNitro.md) | | [optional]
**pages** | **Object** | | [optional]
**redirects** | **Object** | | [optional]
**nav** | [**Config200ResponseNav**](Config200ResponseNav.md) | | [optional]


9 changes: 9 additions & 0 deletions docs/Config200ResponseNav.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Nitrocms.Config200ResponseNav

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**items** | [**[PagesInner]**](PagesInner.md) | | [optional]


16 changes: 16 additions & 0 deletions docs/Config200ResponseNitro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Nitrocms.Config200ResponseNitro

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Number** | | [optional]
**domain** | **String** | | [optional]
**slug** | **String** | | [optional]
**version** | **Number** | Whenever flyo generates new data, this version will be increased. This can be used for cache informnations. | [optional]
**isOnline** | **Number** | | [optional]
**updatedAt** | **Number** | | [optional]
**language** | **String** | | [optional]
**integrationId** | **Number** | | [optional]


55 changes: 55 additions & 0 deletions docs/ConfigApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Nitrocms.ConfigApi

All URIs are relative to *https://edgeapi.flyo.cloud/nitro*

Method | HTTP request | Description
------------- | ------------- | -------------
[**config**](ConfigApi.md#config) | **GET** /config | Get Config



## config

> Config200Response config()
Get Config

Returns all relevant config data to run a site.

### Example

```javascript
import Nitrocms from 'nitrocms';
let defaultClient = Nitrocms.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new Nitrocms.ConfigApi();
apiInstance.config().then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});

```

### Parameters

This endpoint does not need any parameter.

### Return type

[**Config200Response**](Config200Response.md)

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

22 changes: 22 additions & 0 deletions docs/Page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Nitrocms.Page

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Number** | | [optional]
**nitroId** | **Number** | | [optional]
**title** | **String** | | [optional]
**slug** | **String** | | [optional]
**pagePageId** | **Number** | | [optional]
**depth** | **Number** | | [optional]
**sortIndex** | **Number** | | [optional]
**isOnline** | **Number** | | [optional]
**isHome** | **Number** | | [optional]
**createdAt** | **Number** | | [optional]
**updatedAt** | **Number** | | [optional]
**isVisible** | **Number** | | [optional]
**metaJson** | **Number** | | [optional]
**json** | [**[Block]**](Block.md) | | [optional]


104 changes: 104 additions & 0 deletions docs/PagesApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Nitrocms.PagesApi

All URIs are relative to *https://edgeapi.flyo.cloud/nitro*

Method | HTTP request | Description
------------- | ------------- | -------------
[**home**](PagesApi.md#home) | **GET** /pages/home | Get Home
[**page**](PagesApi.md#page) | **GET** /pages | Get Page



## home

> Page home()
Get Home

### Example

```javascript
import Nitrocms from 'nitrocms';
let defaultClient = Nitrocms.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new Nitrocms.PagesApi();
apiInstance.home().then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});

```

### Parameters

This endpoint does not need any parameter.

### Return type

[**Page**](Page.md)

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json


## page

> Page page(opts)
Get Page

### Example

```javascript
import Nitrocms from 'nitrocms';
let defaultClient = Nitrocms.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new Nitrocms.PagesApi();
let opts = {
'slug': foo/bar // String | The pages slug, if none give the homepage is returned. Also paths with subpages are allowed
};
apiInstance.page(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});

```

### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**slug** | **String**| The pages slug, if none give the homepage is returned. Also paths with subpages are allowed | [optional]

### Return type

[**Page**](Page.md)

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

12 changes: 12 additions & 0 deletions docs/PagesInner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Nitrocms.PagesInner

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**label** | **String** | | [optional]
**href** | **String** | | [optional]
**path** | **String** | A path always starts with a trailing slash | [optional]
**children** | [**[PagesInner]**](PagesInner.md) | | [optional]


2 changes: 1 addition & 1 deletion generate.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
openapi-generator-cli generate -i https://api.flyo.cloud/nitro/openapi \
openapi-generator-cli generate -i https://edgeapi.flyo.cloud/nitro/openapi \
-g javascript \
-o . \
--additional-properties=usePromises=true,projectName=nitrocms
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flyodev/nitrocms",
"version": "1.0.0-beta.125",
"version": "1.0.0-beta.125-patch1",
"description": "JS API client generated by OpenAPI Generator",
"license": "Unlicense",
"main": "dist/index.js",
Expand Down
6 changes: 3 additions & 3 deletions src/ApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ class ApiClient {
* Overrides the default value set in spec file if present
* @param {String} basePath
*/
constructor(basePath = 'https://api.flyo.cloud/nitro') {
constructor(basePath = 'https://edgeapi.flyo.cloud/nitro') {
/**
* The base URL against which to resolve every API call's (relative) path.
* @type {String}
* @default https://api.flyo.cloud/nitro
* @default https://edgeapi.flyo.cloud/nitro
*/
this.basePath = basePath.replace(/\/+$/, '');

Expand Down Expand Up @@ -594,7 +594,7 @@ class ApiClient {
hostSettings() {
return [
{
'url': "https://api.flyo.cloud/nitro",
'url': "https://edgeapi.flyo.cloud/nitro",
'description': "Production Server",
}
];
Expand Down
10 changes: 5 additions & 5 deletions src/api/PagesApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ export default class PagesApi {


/**
* Get Pages
* Get Page
* @param {Object} opts Optional parameters
* @param {String} opts.slug The pages slug, if none give the homepage is returned. Also paths with subpages are allowed
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Page} and HTTP response
*/
pagesWithHttpInfo(opts) {
pageWithHttpInfo(opts) {
opts = opts || {};
let postBody = null;

Expand All @@ -106,13 +106,13 @@ export default class PagesApi {
}

/**
* Get Pages
* Get Page
* @param {Object} opts Optional parameters
* @param {String} opts.slug The pages slug, if none give the homepage is returned. Also paths with subpages are allowed
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Page}
*/
pages(opts) {
return this.pagesWithHttpInfo(opts)
page(opts) {
return this.pageWithHttpInfo(opts)
.then(function(response_and_data) {
return response_and_data.data;
});
Expand Down
13 changes: 13 additions & 0 deletions src/model/PagesInner.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class PagesInner {
if (data.hasOwnProperty('href')) {
obj['href'] = ApiClient.convertToType(data['href'], 'String');
}
if (data.hasOwnProperty('path')) {
obj['path'] = ApiClient.convertToType(data['path'], 'String');
}
if (data.hasOwnProperty('children')) {
obj['children'] = ApiClient.convertToType(data['children'], [PagesInner]);
}
Expand All @@ -74,6 +77,10 @@ class PagesInner {
if (data['href'] && !(typeof data['href'] === 'string' || data['href'] instanceof String)) {
throw new Error("Expected the field `href` to be a primitive type in the JSON string but got " + data['href']);
}
// ensure the json data is a string
if (data['path'] && !(typeof data['path'] === 'string' || data['path'] instanceof String)) {
throw new Error("Expected the field `path` to be a primitive type in the JSON string but got " + data['path']);
}
if (data['children']) { // data not null
// ensure the json data is an array
if (!Array.isArray(data['children'])) {
Expand Down Expand Up @@ -103,6 +110,12 @@ PagesInner.prototype['label'] = undefined;
*/
PagesInner.prototype['href'] = undefined;

/**
* A path always starts with a trailing slash
* @member {String} path
*/
PagesInner.prototype['path'] = undefined;

/**
* @member {Array.<module:model/PagesInner>} children
*/
Expand Down

0 comments on commit 60bf4fc

Please sign in to comment.