6 Commits

Author SHA1 Message Date
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 31s
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
e3bab25418 Rename envelope to improve output-type naming
All checks were successful
Generate and Release Protos / release (push) Successful in 28s
2026-02-17 20:31:19 +00:00
6298763f2f Rename directories to fit with API schema
All checks were successful
Generate and Release Protos / release (push) Successful in 37s
2026-02-17 20:15:20 +00:00
3 changed files with 40 additions and 8 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

@@ -1,7 +1,8 @@
{
"$id": "https://schema.owlboard.info/api/api-envelope.schema.json",
"$schema": "https://json-schema.org/draft-07/schema#",
"title": "ApiEnvelope",
"title": "Envelope",
"description": "OwlBoard API Envelope",
"type": "object",
"properties": {
"t": {
@@ -10,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

@@ -2,6 +2,7 @@
"$id": "https://schema.owlboard.info/api/pis-object.schema.json",
"$schema": "https://json-schema.org/draft-07/schema#",
"title": "PisObjects",
"description": "PIS API Resonse, contains the code and optionally, TOC and/or a list of CRS, TIPLOC",
"type": "object",
"properties": {
"code": {
@@ -34,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"],