Compare commits
6 Commits
v3.0.0-dev
...
v3.0.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
| ad355fe15e | |||
| 4dd8bd1108 | |||
| e2f4433042 | |||
| 7775abbbca | |||
| f340c57ffd | |||
| 6c6a603cd8 |
@@ -4,7 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-publish:
|
build-and-publish:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
@@ -30,6 +30,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Publish to Gitea Repo
|
- name: Publish to Gitea Repo
|
||||||
run: |
|
run: |
|
||||||
|
VERSION=${GITHUB_REF_NAME#v}
|
||||||
|
npm version $VERSION --no-git-tag-version
|
||||||
npm config set //git.fjla.uk/api/packages/owlboard/npm/:_authToken ${{ secrets.REPO_TOKEN }}
|
npm config set //git.fjla.uk/api/packages/owlboard/npm/:_authToken ${{ secrets.REPO_TOKEN }}
|
||||||
npm config set //git.fjla.uk/api/packages/OwlBoard/npm/:_authToken ${{ secrets.REPO_TOKEN }}
|
npm config set //git.fjla.uk/api/packages/OwlBoard/npm/:_authToken ${{ secrets.REPO_TOKEN }}
|
||||||
npm publish --registry=https://git.fjla.uk
|
npm publish --registry=https://git.fjla.uk
|
||||||
15
package-lock.json
generated
15
package-lock.json
generated
@@ -1,15 +1,17 @@
|
|||||||
{
|
{
|
||||||
"name": "owlboard-ts",
|
"name": "@owlboard/owlboard-ts",
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "owlboard-ts",
|
"name": "@owlboard/owlboard-ts",
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
|
"dependencies": {
|
||||||
|
"@owlboard/api-schema-types": "^3.0.2-alpha2"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@owlboard/api-schema-types": "^3.0.1-alpha3",
|
|
||||||
"@types/node": "^25.3.0",
|
"@types/node": "^25.3.0",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"tsx": "^4.21.0",
|
"tsx": "^4.21.0",
|
||||||
@@ -500,10 +502,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@owlboard/api-schema-types": {
|
"node_modules/@owlboard/api-schema-types": {
|
||||||
"version": "3.0.1-alpha3",
|
"version": "3.0.2-alpha2",
|
||||||
"resolved": "https://git.fjla.uk/api/packages/OwlBoard/npm/%40owlboard%2Fapi-schema-types/-/3.0.1-alpha3/api-schema-types-3.0.1-alpha3.tgz",
|
"resolved": "https://git.fjla.uk/api/packages/OwlBoard/npm/%40owlboard%2Fapi-schema-types/-/3.0.2-alpha2/api-schema-types-3.0.2-alpha2.tgz",
|
||||||
"integrity": "sha512-5CVm1k/C++/VrtAw4NkvclDunH+RmYLnDZZMSWTM1mm+WlEVnmD+MVnTgC/FhcsAmsNHV8swm66RCqkCuhbOnA==",
|
"integrity": "sha512-KyX4QcOCzVqYpiXY+WfhM1soXduMt2ldG6JSBK2WBxXWokS+keZshOHWHGTZvPLoZEWsuPznMAdzytI03/D3Ag==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@tsconfig/node10": {
|
"node_modules/@tsconfig/node10": {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
"author": "Frederick Boniface",
|
"author": "Frederick Boniface",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@owlboard/api-schema-types": "^3.0.1-alpha3"
|
"@owlboard/api-schema-types": "^3.0.2-alpha2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^25.3.0",
|
"@types/node": "^25.3.0",
|
||||||
|
|||||||
12
src/index.ts
12
src/index.ts
@@ -1,5 +1,9 @@
|
|||||||
export * from './lib/base.js';
|
export { OwlBoardClient } from './lib/client.js';
|
||||||
export * from './lib/client.js';
|
export { ValidationError, ApiError } from './lib/errors.js';
|
||||||
export * from './lib/errors.js';
|
|
||||||
|
|
||||||
export * from './modules/pis.js';
|
// Re-export API Schema types
|
||||||
|
export type * from '@owlboard/api-schema-types'
|
||||||
|
|
||||||
|
// Useful exports for Type Hinting
|
||||||
|
export { PisModule } from './modules/pis.js';
|
||||||
|
export { LocationFilterModule } from './modules/locationFilter.js';
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
import { BaseClient } from "./base.js";
|
import { BaseClient } from "./base.js";
|
||||||
import { PisModule } from "../modules/pis.js";
|
import { PisModule } from "../modules/pis.js";
|
||||||
|
import { LocationFilterModule } from "../modules/locationFilter.js";
|
||||||
|
|
||||||
export class OwlBoardClient extends BaseClient {
|
export class OwlBoardClient extends BaseClient {
|
||||||
public readonly pis: PisModule;
|
public readonly pis: PisModule;
|
||||||
|
public readonly locationFilter: LocationFilterModule;
|
||||||
|
|
||||||
constructor(baseUrl: string, apiKey?: string) {
|
constructor(baseUrl: string, apiKey?: string) {
|
||||||
super(baseUrl, apiKey);
|
super(baseUrl, apiKey);
|
||||||
|
|
||||||
this.pis = new PisModule(this);
|
this.pis = new PisModule(this);
|
||||||
|
this.locationFilter = new LocationFilterModule(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
15
src/modules/locationFilter.ts
Normal file
15
src/modules/locationFilter.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import { ApiLocationFilter } from "@owlboard/api-schema-types";
|
||||||
|
import type { BaseClient, ApiResult } from '../lib/base.js';
|
||||||
|
|
||||||
|
export class LocationFilterModule {
|
||||||
|
constructor(private client: BaseClient) {}
|
||||||
|
|
||||||
|
async getLocationFilterData(): Promise<ApiResult<ApiLocationFilter.LocationFilterObject[]>> {
|
||||||
|
const path = '/locationFilter/data';
|
||||||
|
|
||||||
|
return this.client.request<ApiLocationFilter.LocationFilterObject[]>(
|
||||||
|
path,
|
||||||
|
{method: "GET"}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { ApiPisObject } from '@owlboard/api-schema-types';
|
import { ApiPisObject } from '@owlboard/api-schema-types';
|
||||||
import type { BaseClient, ApiResult } from '../lib/base.js';
|
import type { BaseClient, ApiResult } from '../lib/base.js';
|
||||||
import { IsValidCrs, IsValidTiploc, IsValidPis } from 'src/lib/validation.js';
|
import { IsValidCrs, IsValidTiploc, IsValidPis } from '../lib/validation.js';
|
||||||
import { ValidationError } from 'src/lib/errors.js';
|
import { ValidationError } from '../lib/errors.js';
|
||||||
|
|
||||||
export class PisModule {
|
export class PisModule {
|
||||||
constructor(private client: BaseClient) {}
|
constructor(private client: BaseClient) {}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"declarationMap": true,
|
"declarationMap": true,
|
||||||
|
"composite": true,
|
||||||
|
|
||||||
// Stricter Typechecking Options
|
// Stricter Typechecking Options
|
||||||
"noUncheckedIndexedAccess": true,
|
"noUncheckedIndexedAccess": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user