Skip to content

Commit

Permalink
feat: Add route logs for events and routes APIs (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
paigen11 authored Aug 8, 2023
2 parents dbf119c + b3582ae commit 18891b3
Show file tree
Hide file tree
Showing 93 changed files with 880 additions and 85 deletions.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"licenseName": "MIT",
"moduleName": "NotehubJs",
"npmRepository": "https://registry.npmjs.org",
"projectVersion": "1.0.14",
"projectVersion": "1.0.15",
"sourceFolder": "src",
"usePromises": true
}
82 changes: 82 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,31 @@ paths:
default:
$ref: '#/components/responses/ErrorResponse'

/v1/projects/{projectUID}/routes/{routeUID}/route-logs:
get:
tags: ["route_logs"]
operationId: getRouteLogsByRoute
description: Get Route Logs by Route UID
security:
- api_key: []
parameters:
- $ref: '#/components/parameters/projectUIDParam'
- $ref: '#/components/parameters/routeUIDParam'
- $ref: '#/components/parameters/pageSizeParam'
- $ref: '#/components/parameters/pageNumParam'
- $ref: '#/components/parameters/deviceUIDParamQuery'
- $ref: '#/components/parameters/sortByParam'
- $ref: '#/components/parameters/sortOrderParam'
- $ref: '#/components/parameters/startDateParam'
- $ref: '#/components/parameters/endDateParam'
- $ref: '#/components/parameters/systemFilesOnlyParam'
- $ref: '#/components/parameters/filesParam'
responses:
"200":
$ref: '#/components/responses/RouteLogsResponse'
default:
$ref: '#/components/responses/ErrorResponse'

/v1/products/{productUID}/project:
get:
tags: ["project", "product"]
Expand Down Expand Up @@ -1089,6 +1114,22 @@ paths:
default:
$ref: '#/components/responses/ErrorResponse'

/v1/projects/{projectUID}/events/{eventUID}/route-logs:
get:
tags: ["route_logs"]
operationId: getRouteLogsByEvent
description: Get Route Logs by Event UID
security:
- api_key: []
parameters:
- $ref: '#/components/parameters/projectUIDParam'
- $ref: '#/components/parameters/eventUIDParam'
responses:
"200":
$ref: '#/components/responses/RouteLogsResponse'
default:
$ref: '#/components/responses/ErrorResponse'

/v1/projects/{projectUID}/fleets/{fleetUID}/events:
get:
tags: ["fleet", "event"]
Expand Down Expand Up @@ -1773,6 +1814,14 @@ components:
# NOTE: Airnote's Project UID
example: app:2606f411-dea6-44a0-9743-1130f57d77d8

eventUIDParam:
name: eventUID
in: path
required: true
schema:
type: string
example: 4506f411-dea6-44a0-9743-1130f57d7747

fleetUIDParam:
name: fleetUID
in: path
Expand Down Expand Up @@ -2256,6 +2305,37 @@ components:
tower_timezone: America/Detroit
tower_id: 310,410,20483,184692496

RouteLogsResponse:
description: The response body for a Route Logs request.
content:
application/json:
schema:
type: array
items:
type: object
properties:
date:
type: string
description: The date of the logs.
routeUID:
type: string
description: The route UID.
eventUID:
type: string
description: The event UID.
attn:
type: boolean
description: Whether the event was routed in error
status:
type: string
description: The status of the event.
text:
type: string
description: The response body of the route.
url:
type: string
description: The URL of the route.

schemas:
Error:
type: object
Expand Down Expand Up @@ -2511,6 +2591,8 @@ components:
$ref: '#/components/schemas/DFUEnv'
sku:
type: string
disabled:
type: boolean
required:
- uid
- serial_number
Expand Down
4 changes: 4 additions & 0 deletions src/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ docs/GetProjectFleets200Response.md
docs/GetProjectMembers200Response.md
docs/GetProjectProducts200Response.md
docs/GetProjects200Response.md
docs/GetRouteLogsByRoute200ResponseInner.md
docs/Google.md
docs/HandleNoteChanges200Response.md
docs/HandleNoteGet200Response.md
Expand Down Expand Up @@ -75,6 +76,7 @@ docs/Radresponder.md
docs/Role.md
docs/Route.md
docs/RouteApi.md
docs/RouteLogsApi.md
docs/RouteSchema.md
docs/Snowflake.md
docs/SnowflakeTransform.md
Expand All @@ -99,6 +101,7 @@ src/api/NotesApi.js
src/api/ProductApi.js
src/api/ProjectApi.js
src/api/RouteApi.js
src/api/RouteLogsApi.js
src/index.js
src/model/Aws.js
src/model/Azure.js
Expand Down Expand Up @@ -138,6 +141,7 @@ src/model/GetProjectFleets200Response.js
src/model/GetProjectMembers200Response.js
src/model/GetProjectProducts200Response.js
src/model/GetProjects200Response.js
src/model/GetRouteLogsByRoute200ResponseInner.js
src/model/Google.js
src/model/HandleNoteChanges200Response.js
src/model/HandleNoteGet200Response.js
Expand Down
5 changes: 4 additions & 1 deletion src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The OpenAPI definition for the Notehub.io API.
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.0.0
- Package version: 1.0.14
- Package version: 1.0.15
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
For more information, please visit [https://dev.blues.io/support/](https://dev.blues.io/support/)

Expand Down Expand Up @@ -209,6 +209,8 @@ All URIs are relative to *https://api.notefile.net*
| _NotehubJs.RouteApi_ | [**getRoute**](docs/RouteApi.md#getRoute) | **GET** /v1/projects/{projectUID}/routes/{routeUID} |
| _NotehubJs.RouteApi_ | [**getRoutes**](docs/RouteApi.md#getRoutes) | **GET** /v1/projects/{projectUID}/routes |
| _NotehubJs.RouteApi_ | [**updateRoute**](docs/RouteApi.md#updateRoute) | **PUT** /v1/projects/{projectUID}/routes/{routeUID} |
| _NotehubJs.RouteLogsApi_ | [**getRouteLogsByEvent**](docs/RouteLogsApi.md#getRouteLogsByEvent) | **GET** /v1/projects/{projectUID}/events/{eventUID}/route-logs |
| _NotehubJs.RouteLogsApi_ | [**getRouteLogsByRoute**](docs/RouteLogsApi.md#getRouteLogsByRoute) | **GET** /v1/projects/{projectUID}/routes/{routeUID}/route-logs |

## Documentation for Models

Expand Down Expand Up @@ -250,6 +252,7 @@ All URIs are relative to *https://api.notefile.net*
- [NotehubJs.GetProjectMembers200Response](docs/GetProjectMembers200Response.md)
- [NotehubJs.GetProjectProducts200Response](docs/GetProjectProducts200Response.md)
- [NotehubJs.GetProjects200Response](docs/GetProjects200Response.md)
- [NotehubJs.GetRouteLogsByRoute200ResponseInner](docs/GetRouteLogsByRoute200ResponseInner.md)
- [NotehubJs.Google](docs/Google.md)
- [NotehubJs.HandleNoteChanges200Response](docs/HandleNoteChanges200Response.md)
- [NotehubJs.HandleNoteGet200Response](docs/HandleNoteGet200Response.md)
Expand Down
1 change: 1 addition & 0 deletions src/docs/Device.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
| **temperature** | **Number** | |
| **dfu** | [**DFUEnv**](DFUEnv.md) | | [optional] |
| **sku** | **String** | | [optional] |
| **disabled** | **Boolean** | | [optional] |
13 changes: 13 additions & 0 deletions src/docs/GetRouteLogsByRoute200ResponseInner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# NotehubJs.GetRouteLogsByRoute200ResponseInner

## Properties

| Name | Type | Description | Notes |
| ------------ | ----------- | ------------------------------------- | ---------- |
| **date** | **String** | The date of the logs. | [optional] |
| **routeUID** | **String** | The route UID. | [optional] |
| **eventUID** | **String** | The event UID. | [optional] |
| **attn** | **Boolean** | Whether the event was routed in error | [optional] |
| **status** | **String** | The status of the event. | [optional] |
| **text** | **String** | The response body of the route. | [optional] |
| **url** | **String** | The URL of the route. | [optional] |
120 changes: 120 additions & 0 deletions src/docs/RouteLogsApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# NotehubJs.RouteLogsApi

All URIs are relative to *https://api.notefile.net*

| Method | HTTP request | Description |
| -------------------------------------------------------------- | -------------------------------------------------------------- | ----------- |
| [**getRouteLogsByEvent**](RouteLogsApi.md#getRouteLogsByEvent) | **GET** /v1/projects/{projectUID}/events/{eventUID}/route-logs |
| [**getRouteLogsByRoute**](RouteLogsApi.md#getRouteLogsByRoute) | **GET** /v1/projects/{projectUID}/routes/{routeUID}/route-logs |

## getRouteLogsByEvent

> [GetRouteLogsByRoute200ResponseInner] getRouteLogsByEvent(projectUID, eventUID)
Get Route Logs by Event UID

### Example

```javascript
import * as NotehubJs from '@blues-inc/notehub-js';
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';

let apiInstance = new NotehubJs.RouteLogsApi();
let projectUID = app:2606f411-dea6-44a0-9743-1130f57d77d8; // String |
let eventUID = 4506f411-dea6-44a0-9743-1130f57d7747; // String |
apiInstance.getRouteLogsByEvent(projectUID, eventUID).then((data) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}, (error) => {
console.error(error);
});

```

### Parameters

| Name | Type | Description | Notes |
| -------------- | ---------- | ----------- | ----- |
| **projectUID** | **String** | |
| **eventUID** | **String** | |

### Return type

[**[GetRouteLogsByRoute200ResponseInner]**](GetRouteLogsByRoute200ResponseInner.md)

### Authorization

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

### HTTP request headers

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

## getRouteLogsByRoute

> [GetRouteLogsByRoute200ResponseInner] getRouteLogsByRoute(projectUID, routeUID, opts)
Get Route Logs by Route UID

### Example

```javascript
import * as NotehubJs from '@blues-inc/notehub-js';
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';

let apiInstance = new NotehubJs.RouteLogsApi();
let projectUID = app:2606f411-dea6-44a0-9743-1130f57d77d8; // String |
let routeUID = route:cbd20093cba58392c9f9bbdd0cdeb1a0; // String |
let opts = {
'pageSize': 50, // Number |
'pageNum': 1, // Number |
'deviceUID': "deviceUID_example", // String | A Device UID.
'sortBy': "'captured'", // String |
'sortOrder': "'asc'", // String |
'startDate': 1628631763, // Number | Unix timestamp
'endDate': 1657894210, // Number | Unix timestamp
'systemFilesOnly': true, // Boolean |
'files': _health.qo, data.qo // String |
};
apiInstance.getRouteLogsByRoute(projectUID, routeUID, opts).then((data) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}, (error) => {
console.error(error);
});

```

### Parameters

| Name | Type | Description | Notes |
| ------------------- | ----------- | -------------- | ------------------------------------------ |
| **projectUID** | **String** | |
| **routeUID** | **String** | |
| **pageSize** | **Number** | | [optional] [default to 50] |
| **pageNum** | **Number** | | [optional] [default to 1] |
| **deviceUID** | **String** | A Device UID. | [optional] |
| **sortBy** | **String** | | [optional] [default to 'captured'] |
| **sortOrder** | **String** | | [optional] [default to 'asc'] |
| **startDate** | **Number** | Unix timestamp | [optional] |
| **endDate** | **Number** | Unix timestamp | [optional] |
| **systemFilesOnly** | **Boolean** | | [optional] |
| **files** | **String** | | [optional] |

### Return type

[**[GetRouteLogsByRoute200ResponseInner]**](GetRouteLogsByRoute200ResponseInner.md)

### Authorization

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

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blues-inc/notehub-js",
"version": "1.0.14",
"version": "1.0.15",
"description": "The OpenAPI definition for the Notehub.io API. ",
"license": "MIT",
"main": "dist/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/src/ApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import querystring from "querystring";

/**
* @module ApiClient
* @version 1.0.14
* @version 1.0.15
*/

/**
Expand Down Expand Up @@ -55,7 +55,7 @@ class ApiClient {
* @default {}
*/
this.defaultHeaders = {
"User-Agent": "OpenAPI-Generator/1.0.14/Javascript",
"User-Agent": "OpenAPI-Generator/1.0.15/Javascript",
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/src/api/AuthorizationApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import LoginRequest from "../model/LoginRequest";
/**
* Authorization service.
* @module api/AuthorizationApi
* @version 1.0.14
* @version 1.0.15
*/
export default class AuthorizationApi {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/src/api/BillingAccountApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import GetBillingAccounts200Response from "../model/GetBillingAccounts200Respons
/**
* BillingAccount service.
* @module api/BillingAccountApi
* @version 1.0.14
* @version 1.0.15
*/
export default class BillingAccountApi {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/src/api/DeviceApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import PutDeviceFleetsRequest from "../model/PutDeviceFleetsRequest";
/**
* Device service.
* @module api/DeviceApi
* @version 1.0.14
* @version 1.0.15
*/
export default class DeviceApi {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/src/api/DevicesApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import GetProjectDevices200Response from "../model/GetProjectDevices200Response"
/**
* Devices service.
* @module api/DevicesApi
* @version 1.0.14
* @version 1.0.15
*/
export default class DevicesApi {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/src/api/EnvironmentVariablesApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import GetDeviceEnvironmentVariables200Response from "../model/GetDeviceEnvironm
/**
* EnvironmentVariables service.
* @module api/EnvironmentVariablesApi
* @version 1.0.14
* @version 1.0.15
*/
export default class EnvironmentVariablesApi {
/**
Expand Down
Loading

0 comments on commit 18891b3

Please sign in to comment.