7 Commits

Author SHA1 Message Date
a2308198e9 Add nearest stations schema
All checks were successful
Generate and Release Protos / release (push) Successful in 32s
2026-03-30 20:50:03 +01:00
8c2ed1ad8f Ensure TIPLOC is an optional entry. 'stations' will not include a TIPLOC as there is no 1-to-1 mapping.
All checks were successful
Generate and Release Protos / release (push) Successful in 25s
2026-03-25 09:36:47 +00:00
0848fe3b27 Create location filter schema
All checks were successful
Generate and Release Protos / release (push) Successful in 29s
2026-03-24 00:38:08 +00:00
8ac0215247 Feat: Add 'skip' object to the PISObject schema to allow for partial matches to be described.
All checks were successful
Generate and Release Protos / release (push) Successful in 28s
2026-02-20 22:31:01 +00:00
07f224ff18 Relax type requirements on 'd' (data payload) field to improve type generation
All checks were successful
Generate and Release Protos / release (push) Successful in 29s
2026-02-19 21:05:33 +00:00
91e9432a07 Update to handle /v3 version
All checks were successful
Generate and Release Protos / release (push) Successful in 29s
2026-02-19 17:13:47 +00:00
50e2907f47 Update package.json values for output 2026-02-17 20:50:28 +00:00
5 changed files with 87 additions and 7 deletions

View File

@@ -59,9 +59,29 @@ jobs:
}' >> index.ts
VERSION="${{ steps.get_version.outputs.VERSION }}"
REPO_URL="${{ github.server_url }}/${{ github.repository }}.git"
jq --arg ver "$VERSION" \
--arg name "@owlboard/api-schema-types" \
'.name = $name | .version = $ver | .type = "module" | .main = "./dist/index.js" | .types = "./dist/index.d.ts"' \
--arg repo "$REPO_URL" \
'.name = $name |
.description = "TypeScript type definitions for OwlBoard API schemas" |
.author = "Frederick Boniface" |
.version = $ver |
.type = "module" |
.main = "./dist/index.js" |
.license = "MIT" |
.repository = { "type": "git", "url": $repo } |
.files = ["dist"] |
.sideEffects = false |
.dependencies = {} |
.devDependencies = {} |
.exports = {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
} |
.types = "./dist/index.d.ts"' \
package.json > package.json.new && mv package.json.new package.json
# Compile
@@ -74,7 +94,7 @@ jobs:
- name: Publish Go
run: |
VERSION="v${{ steps.get_version.outputs.VERSION }}"
MOD_NAME="git.fjla.uk/owlboard/api-schema-types"
MOD_NAME="git.fjla.uk/owlboard/api-schema-types/v3"
ZIP_ROOT="/tmp/go_upload"
FULL_PATH="$ZIP_ROOT/$MOD_NAME@$VERSION"

View File

@@ -11,11 +11,7 @@
"description": "Unix timestamp showing when the data was generated, or the time the error was encountered"
},
"d": {
"description": "Payload data. Type depends on request endpoint",
"anyOf": [
{"type": "object"},
{"type": "array"}
]
"description": "Payload data. Type depends on request endpoint"
},
"e": {
"type": "object",

View File

@@ -0,0 +1,31 @@
{
"$id": "https://schema.owlboard.info/api/location-filter.schema.json",
"$schema": "https://json-schema.org/draft-07/schema#",
"title": "LocationFilterObject",
"description": "Location filter API Response. Provides a location's data for filtering on the frontend",
"type": "object",
"required": ["n", "s"],
"additionalProperties": false,
"properties": {
"n": {
"type": "string",
"name": "Name",
"description": "Name of the location"
},
"t": {
"type": "string",
"name": "TIPLOC",
"description": "TIPLOC of the location"
},
"c": {
"type": "string",
"name": "CRS",
"description": "CRS of the location"
},
"s": {
"type": "string",
"name": "searchString",
"description": "Generated string for efficient filtering"
}
}
}

View File

@@ -35,6 +35,20 @@
"pattern": "^[a-zA-Z0-9]+$"
},
"description": "List of TIPLOC Codes"
},
"skip": {
"type": "object",
"properties": {
"skip": {
"type": "integer",
"description": "Number of stops to skip"
},
"position": {
"type": "string",
"enum": ["head", "tail"],
"description": "Position of stops to be skipped, either 'head' or 'tail'"
}
}
}
},
"required": ["code"],

View File

@@ -0,0 +1,19 @@
{
"$id": "https://schema.owlboard.info/api/stations/nearestStations.schema.json",
"$schema": "https://json-schema.org/draft-07/schema#",
"title": "StationsNearestStations",
"description": "Nearest Stations API Resonse. Returned as an Array of the object. Response array will be sorted - nearest first",
"type": "object",
"properties": {
"c": {
"type": "string",
"name": "CRS"
},
"n": {
"type": "string",
"name": "Station Name"
}
},
"required": ["c", "n"],
"additionalProperties": false
}