Skip to content

Commit

Permalink
feat: new project API DFU endpoints (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
paigen11 authored Oct 31, 2024
2 parents 9c9fdfe + 24379da commit e19ca23
Show file tree
Hide file tree
Showing 247 changed files with 8,201 additions and 3,069 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,14 @@ dist

# Stores VSCode versions used for testing VSCode extensions
.vscode-test
.vscode/

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.pnp.*

# MacOS files
.DS_Store
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.23-beta.3",
"projectVersion": "1.0.24",
"sourceFolder": "src",
"usePromises": true
}
67 changes: 40 additions & 27 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ openapi: "3.0.3"

info:
title: Notehub API
version: 1.1.0
version: 1.2.0
description: |
The OpenAPI definition for the Notehub.io API. Test the API
The OpenAPI definition for the Notehub.io API.
contact:
name: Blues Engineering
email: [email protected]
Expand Down Expand Up @@ -155,7 +155,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/Route"
$ref: "#/components/schemas/NotehubRoute"
example: >
{
"label": "Route Label",
Expand All @@ -172,7 +172,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/Route"
$ref: "#/components/schemas/NotehubRoute"
example:
{
"uid": "route:8d65a087d5d290ce5bdf03aeff2becc0",
Expand Down Expand Up @@ -211,7 +211,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/Route"
$ref: "#/components/schemas/NotehubRoute"
example:
{
"uid": "route:8d65a087d5d290ce5bdf03aeff2becc0",
Expand Down Expand Up @@ -248,7 +248,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/Route"
$ref: "#/components/schemas/NotehubRoute"
example: >
{
"http" {
Expand All @@ -268,7 +268,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/Route"
$ref: "#/components/schemas/NotehubRoute"
example: >
{
"uid": "route:8d65a087d5d290ce5bdf03aeff2becc0",
Expand Down Expand Up @@ -1182,6 +1182,7 @@ paths:
- $ref: "#/components/parameters/sortOrderParam"
- $ref: "#/components/parameters/startDateParam"
- $ref: "#/components/parameters/endDateParam"
- $ref: "#/components/parameters/dateTypeParam"
- $ref: "#/components/parameters/systemFilesOnlyParam"
- $ref: "#/components/parameters/filesQueryParam"
- $ref: "#/components/parameters/formatParam"
Expand All @@ -1201,7 +1202,7 @@ paths:
items:
type: string
- name: since
description: Deprecated.
description: Deprecated.
in: query
required: false
deprecated: true
Expand Down Expand Up @@ -1275,11 +1276,11 @@ paths:
- $ref: "#/components/parameters/sortOrderParam"
- $ref: "#/components/parameters/startDateParam"
- $ref: "#/components/parameters/endDateParam"
- $ref: "#/components/parameters/dateTypeParam"
- $ref: "#/components/parameters/systemFilesOnlyParam"
- $ref: "#/components/parameters/filesQueryParam"
- $ref: "#/components/parameters/formatParam"
- $ref: "#/components/parameters/serialNumberFilterParam"
- $ref: "#/components/parameters/fleetUIDFilterQueryParam"
- $ref: "#/components/parameters/sessionUIDFilterParam"
- $ref: "#/components/parameters/eventUIDFilterQueryParam"
- $ref: "#/components/parameters/selectFieldsParam"
Expand All @@ -1293,7 +1294,7 @@ paths:
items:
type: string
- name: since
description: Deprecated.
description: Deprecated.
in: query
required: false
deprecated: true
Expand Down Expand Up @@ -2194,7 +2195,7 @@ paths:
/v1/projects/{projectUID}/dfu/{firmwareType}/{action}:
post:
tags: ["project"]
operationId: dfuAction
operationId: dfuAction
description: Update/cancel host or notecard firmware updates
security:
- api_key: []
Expand All @@ -2212,7 +2213,7 @@ paths:
- $ref: "#/components/parameters/productUIDQueryParam"
- $ref: "#/components/parameters/skuParam"
requestBody:
description: Which firmware in the case of an update action
description: Which firmware in the case of an update action
required: false
content:
application/json:
Expand Down Expand Up @@ -2299,7 +2300,7 @@ components:
schema:
type: string
example: dev:000000000000000

firmwareTypeParam:
name: firmwareType
in: path
Expand All @@ -2309,9 +2310,9 @@ components:
enum:
- host
- notecard

dfuActionParam:
name: action
name: action
in: path
required: true
schema:
Expand Down Expand Up @@ -2399,13 +2400,15 @@ components:
schema:
type: string
enum:
- best_id
- device_serial
- device_uid
- captured
- modified
- device_location
- tower_location
- triangulated_location
- best_location
default: captured

sortOrderParam:
Expand Down Expand Up @@ -2441,6 +2444,19 @@ components:
# July 15th, 2022
example: 1657894210

dateTypeParam:
name: dateType
in: query
required: false
description: Which date to filter on, either 'captured' or 'uploaded'. This will apply to the startDate and endDate parameters
schema:
type: string
default: captured
enum:
- captured
- uploaded
example: uploaded

cursorParam:
name: cursor
in: query
Expand Down Expand Up @@ -2693,8 +2709,6 @@ components:
items:
type: string



responses:
ErrorResponse:
description: The response body in case of an API error.
Expand Down Expand Up @@ -3758,7 +3772,7 @@ components:
note_sent:
type: number

Route:
NotehubRoute:
type: object
properties:
uid:
Expand Down Expand Up @@ -4706,25 +4720,24 @@ components:
type: object
properties:
current_firmware:
$ref: '#/components/schemas/CurrentFirmware'
$ref: "#/components/schemas/CurrentFirmware"
firmware_update:
$ref: '#/components/schemas/UserDfuStateMachine'
$ref: "#/components/schemas/UserDfuStateMachine"
nullable: true

UserDfuStateMachine:
type: object
properties:
status:
$ref: '#/components/schemas/UserDfuStateMachineStatus'
$ref: "#/components/schemas/UserDfuStateMachineStatus"
created:
type: string
format: date-time
nullable: true
from_version:
type: string
metadata:
$ref: '#/components/schemas/UploadMetadata'

$ref: "#/components/schemas/UploadMetadata"

UserDfuStateMachineStatus:
type: object
Expand All @@ -4746,7 +4759,7 @@ components:
version:
type: string
metadata:
$ref: '#/components/schemas/Firmware'
$ref: "#/components/schemas/Firmware"

UploadMetadata:
type: object
Expand Down Expand Up @@ -4776,7 +4789,7 @@ components:
notes:
type: string
firmware:
$ref: '#/components/schemas/Firmware'
$ref: "#/components/schemas/Firmware"

Firmware:
type: object
Expand Down Expand Up @@ -4961,7 +4974,7 @@ components:
type: array
items:
$ref: "#/components/schemas/DeviceDfuStateMachineNode"

DeviceDfuStateMachineNode:
type: object
description: Represents a single request to update the host or Notecard firmware
Expand All @@ -4977,4 +4990,4 @@ components:
description: RFC3339 compatible datetime of when this status update happened
description:
type: string
description: Additional information
description: Additional information
Loading

0 comments on commit e19ca23

Please sign in to comment.