@kayahr/edsm 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +22 -0
- package/README.md +168 -0
- package/lib/body.schema.json +587 -0
- package/lib/codex.schema.json +55 -0
- package/lib/commander-credits-response.schema.json +52 -0
- package/lib/commander-inventory-response.schema.json +91 -0
- package/lib/commander-position-response.schema.json +101 -0
- package/lib/commander-ranks-response.schema.json +138 -0
- package/lib/elite-server-status-response.schema.json +38 -0
- package/lib/flight-logs-response.schema.json +68 -0
- package/lib/main/api/commander.d.ts +96 -0
- package/lib/main/api/commander.js +38 -0
- package/lib/main/api/commander.js.map +1 -0
- package/lib/main/api/common.d.ts +28 -0
- package/lib/main/api/common.js +54 -0
- package/lib/main/api/common.js.map +1 -0
- package/lib/main/api/journal.d.ts +51 -0
- package/lib/main/api/journal.js +35 -0
- package/lib/main/api/journal.js.map +1 -0
- package/lib/main/api/logs.d.ts +130 -0
- package/lib/main/api/logs.js +60 -0
- package/lib/main/api/logs.js.map +1 -0
- package/lib/main/api/status.d.ts +13 -0
- package/lib/main/api/status.js +14 -0
- package/lib/main/api/status.js.map +1 -0
- package/lib/main/api/system.d.ts +279 -0
- package/lib/main/api/system.js +125 -0
- package/lib/main/api/system.js.map +1 -0
- package/lib/main/api/systems.d.ts +148 -0
- package/lib/main/api/systems.js +51 -0
- package/lib/main/api/systems.js.map +1 -0
- package/lib/main/bodies.d.ts +116 -0
- package/lib/main/bodies.js +33 -0
- package/lib/main/bodies.js.map +1 -0
- package/lib/main/codex.d.ts +20 -0
- package/lib/main/codex.js +15 -0
- package/lib/main/codex.js.map +1 -0
- package/lib/main/common.d.ts +14 -0
- package/lib/main/common.js +20 -0
- package/lib/main/common.js.map +1 -0
- package/lib/main/index.d.ts +14 -0
- package/lib/main/index.js +19 -0
- package/lib/main/index.js.map +1 -0
- package/lib/main/powerplay.d.ts +23 -0
- package/lib/main/powerplay.js +15 -0
- package/lib/main/powerplay.js.map +1 -0
- package/lib/main/stations.d.ts +69 -0
- package/lib/main/stations.js +15 -0
- package/lib/main/stations.js.map +1 -0
- package/lib/main/systems.d.ts +61 -0
- package/lib/main/systems.js +15 -0
- package/lib/main/systems.js.map +1 -0
- package/lib/main/util.d.ts +38 -0
- package/lib/main/util.js +104 -0
- package/lib/main/util.js.map +1 -0
- package/lib/powerplay.schema.json +90 -0
- package/lib/station-market-response.schema.json +95 -0
- package/lib/station-outfitting-response.schema.json +75 -0
- package/lib/station-shipyard-response.schema.json +72 -0
- package/lib/station.schema.json +315 -0
- package/lib/system-bodies-response.schema.json +609 -0
- package/lib/system-deaths-response.schema.json +58 -0
- package/lib/system-estimated-value-response.schema.json +76 -0
- package/lib/system-factions-response.schema.json +313 -0
- package/lib/system-response.schema.json +137 -0
- package/lib/system-stations-response.schema.json +222 -0
- package/lib/system-traffic-response.schema.json +85 -0
- package/lib/system.schema.json +1016 -0
- package/package.json +82 -0
- package/src/main/api/commander.ts +116 -0
- package/src/main/api/common.ts +77 -0
- package/src/main/api/journal.ts +76 -0
- package/src/main/api/logs.ts +166 -0
- package/src/main/api/status.ts +24 -0
- package/src/main/api/system.ts +361 -0
- package/src/main/api/systems.ts +199 -0
- package/src/main/bodies.ts +153 -0
- package/src/main/codex.ts +31 -0
- package/src/main/common.ts +29 -0
- package/src/main/index.ts +42 -0
- package/src/main/powerplay.ts +34 -0
- package/src/main/stations.ts +87 -0
- package/src/main/systems.ts +77 -0
- package/src/main/util.ts +103 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Id64 } from "./common.ts";
|
|
2
|
+
export interface StationControllingFaction {
|
|
3
|
+
id: number | null;
|
|
4
|
+
name: string | null;
|
|
5
|
+
}
|
|
6
|
+
export interface StationBody {
|
|
7
|
+
id: number;
|
|
8
|
+
name: string;
|
|
9
|
+
latitude?: number;
|
|
10
|
+
longitude?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface StationUpdateTime {
|
|
13
|
+
information: string;
|
|
14
|
+
market: string | null;
|
|
15
|
+
shipyard: string | null;
|
|
16
|
+
outfitting: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface Outfitting {
|
|
19
|
+
id: string | null;
|
|
20
|
+
name: string;
|
|
21
|
+
}
|
|
22
|
+
export interface Commodity {
|
|
23
|
+
id: string | null;
|
|
24
|
+
name: string;
|
|
25
|
+
buyPrice: number;
|
|
26
|
+
stock: number;
|
|
27
|
+
sellPrice: number;
|
|
28
|
+
demand: number;
|
|
29
|
+
stockBracket: number;
|
|
30
|
+
}
|
|
31
|
+
export interface Ship {
|
|
32
|
+
id: number;
|
|
33
|
+
name: string;
|
|
34
|
+
}
|
|
35
|
+
export interface Station {
|
|
36
|
+
id: number;
|
|
37
|
+
marketId: number | null;
|
|
38
|
+
type: string | null;
|
|
39
|
+
name: string;
|
|
40
|
+
body?: StationBody;
|
|
41
|
+
distanceToArrival: number | null;
|
|
42
|
+
allegiance: string | null;
|
|
43
|
+
government: string | null;
|
|
44
|
+
economy: string | null;
|
|
45
|
+
secondEconomy: string | null;
|
|
46
|
+
haveMarket: boolean;
|
|
47
|
+
haveShipyard: boolean;
|
|
48
|
+
haveOutfitting: boolean;
|
|
49
|
+
otherServices: string[];
|
|
50
|
+
controllingFaction?: StationControllingFaction;
|
|
51
|
+
updateTime: StationUpdateTime;
|
|
52
|
+
systemId?: number;
|
|
53
|
+
systemId64?: Id64 | null;
|
|
54
|
+
systemName?: string;
|
|
55
|
+
commodities: Commodity[] | null;
|
|
56
|
+
ships: Ship[] | null;
|
|
57
|
+
outfitting: Outfitting[] | null;
|
|
58
|
+
}
|
|
59
|
+
/** Station data in system objects with less details. */
|
|
60
|
+
export type SystemStation = Omit<Station, "systemId" | "systemId64" | "systemName" | "outfitting" | "ships" | "commodities">;
|
|
61
|
+
/** List of EDSM stations. */
|
|
62
|
+
export type Stations = Station[];
|
|
63
|
+
/**
|
|
64
|
+
* Parses stations from the given JSON stream.
|
|
65
|
+
*
|
|
66
|
+
* @param stream - The JSON input stream.
|
|
67
|
+
* @returns Stream of stations.
|
|
68
|
+
*/
|
|
69
|
+
export declare function parseStationsJSON(stream: AsyncIterable<Uint8Array>): AsyncIterable<Station>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2020 Klaus Reimer <k@ailis.de>
|
|
3
|
+
* See LICENSE.md for licensing information.
|
|
4
|
+
*/
|
|
5
|
+
import { parseJSONArray } from "./util.js";
|
|
6
|
+
/**
|
|
7
|
+
* Parses stations from the given JSON stream.
|
|
8
|
+
*
|
|
9
|
+
* @param stream - The JSON input stream.
|
|
10
|
+
* @returns Stream of stations.
|
|
11
|
+
*/
|
|
12
|
+
export function parseStationsJSON(stream) {
|
|
13
|
+
return parseJSONArray(stream);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=stations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stations.js","sourceRoot":"","sources":["../../src/main/stations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAwE3C;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAiC;IAC/D,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { SystemBody } from "./bodies.ts";
|
|
2
|
+
import type { Coordinates, Id64 } from "./common.ts";
|
|
3
|
+
import type { SystemStation } from "./stations.ts";
|
|
4
|
+
export interface EstimatedCoordinates extends Coordinates {
|
|
5
|
+
precision: number;
|
|
6
|
+
}
|
|
7
|
+
export interface ControllingFaction {
|
|
8
|
+
id: number;
|
|
9
|
+
name: string | null;
|
|
10
|
+
allegiance?: string;
|
|
11
|
+
government?: string;
|
|
12
|
+
isPlayer: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface State {
|
|
15
|
+
state: string;
|
|
16
|
+
}
|
|
17
|
+
export interface TrendState extends State {
|
|
18
|
+
trend: number;
|
|
19
|
+
}
|
|
20
|
+
export interface Faction {
|
|
21
|
+
id: number;
|
|
22
|
+
name: string;
|
|
23
|
+
allegiance?: string | null;
|
|
24
|
+
government?: string | null;
|
|
25
|
+
influence: number;
|
|
26
|
+
state: string | null;
|
|
27
|
+
activeStates: State[];
|
|
28
|
+
recoveringStates: TrendState[];
|
|
29
|
+
pendingStates: TrendState[];
|
|
30
|
+
happiness: string;
|
|
31
|
+
isPlayer: boolean;
|
|
32
|
+
lastUpdate: number;
|
|
33
|
+
}
|
|
34
|
+
/** A single EDSM system. */
|
|
35
|
+
export interface System {
|
|
36
|
+
name: string;
|
|
37
|
+
id: number;
|
|
38
|
+
id64: Id64 | null;
|
|
39
|
+
date: string;
|
|
40
|
+
coords?: Coordinates;
|
|
41
|
+
estimatedCoordinates?: EstimatedCoordinates;
|
|
42
|
+
allegiance?: string | null;
|
|
43
|
+
government?: string | null;
|
|
44
|
+
state?: string | null;
|
|
45
|
+
economy?: string | null;
|
|
46
|
+
security?: string;
|
|
47
|
+
population?: number | null;
|
|
48
|
+
controllingFaction?: ControllingFaction;
|
|
49
|
+
factions?: Faction[];
|
|
50
|
+
stations?: SystemStation[];
|
|
51
|
+
bodies?: SystemBody[];
|
|
52
|
+
}
|
|
53
|
+
/** List of EDSM systems. */
|
|
54
|
+
export type Systems = System[];
|
|
55
|
+
/**
|
|
56
|
+
* Parses systems from the given JSON stream.
|
|
57
|
+
*
|
|
58
|
+
* @param stream - The JSON input stream.
|
|
59
|
+
* @returns Stream of systems.
|
|
60
|
+
*/
|
|
61
|
+
export declare function parseSystemsJSON(stream: AsyncIterable<Uint8Array>): AsyncIterable<System>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2020 Klaus Reimer <k@ailis.de>
|
|
3
|
+
* See LICENSE.md for licensing information.
|
|
4
|
+
*/
|
|
5
|
+
import { parseJSONArray } from "./util.js";
|
|
6
|
+
/**
|
|
7
|
+
* Parses systems from the given JSON stream.
|
|
8
|
+
*
|
|
9
|
+
* @param stream - The JSON input stream.
|
|
10
|
+
* @returns Stream of systems.
|
|
11
|
+
*/
|
|
12
|
+
export function parseSystemsJSON(stream) {
|
|
13
|
+
return parseJSONArray(stream);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=systems.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"systems.js","sourceRoot":"","sources":["../../src/main/systems.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AA4D3C;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAiC;IAC9D,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for all exceptions. Automatically corrects its prototype and name.
|
|
3
|
+
*/
|
|
4
|
+
export declare abstract class EDSMException extends Error {
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new exception.
|
|
7
|
+
*
|
|
8
|
+
* @param message - The exception message.
|
|
9
|
+
* @param options - Optional error options.
|
|
10
|
+
*/
|
|
11
|
+
constructor(message: string, options?: ErrorOptions);
|
|
12
|
+
}
|
|
13
|
+
/** Thrown when state is illegal. */
|
|
14
|
+
export declare class IllegalStateException extends EDSMException {
|
|
15
|
+
}
|
|
16
|
+
/** Thrown when some resource was not found. */
|
|
17
|
+
export declare class NotFoundException extends EDSMException {
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Helper function to iterate over the array entries of the given stream. The stream must be a JSON file with an array
|
|
21
|
+
* bracket in the first and last line and all other lines must contain a single dataset each. So it's actually a JSONL
|
|
22
|
+
* file but wrapped in an array and with comma character suffixes.
|
|
23
|
+
*
|
|
24
|
+
* @param stream - The JSON input as an async iterable.
|
|
25
|
+
* @yields The created iterable for iterating over the array entries of the JSON stream.
|
|
26
|
+
*/
|
|
27
|
+
export declare function parseJSONArray<T>(stream: AsyncIterable<Uint8Array>): AsyncIterable<T>;
|
|
28
|
+
/**
|
|
29
|
+
* JSON reviver function which converts numbers of ID properties (property names ending with 'ID' or 'Address') to bigint if needed.
|
|
30
|
+
*
|
|
31
|
+
* @param key - The JSON property key.
|
|
32
|
+
* @param value - The parsed JSON property value.
|
|
33
|
+
* @param context - The reviver context containing the raw JSON source string.
|
|
34
|
+
* @returns The already parsed JSON property value if suitable or the raw source converted into a bigint.
|
|
35
|
+
*/
|
|
36
|
+
export declare function jsonReviver(key: string, value: unknown, context?: {
|
|
37
|
+
source: string;
|
|
38
|
+
}): unknown;
|
package/lib/main/util.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2020 Klaus Reimer <k@ailis.de>
|
|
3
|
+
* See LICENSE.md for licensing information.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Base class for all exceptions. Automatically corrects its prototype and name.
|
|
7
|
+
*/
|
|
8
|
+
export class EDSMException extends Error {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new exception.
|
|
11
|
+
*
|
|
12
|
+
* @param message - The exception message.
|
|
13
|
+
* @param options - Optional error options.
|
|
14
|
+
*/
|
|
15
|
+
constructor(message, options) {
|
|
16
|
+
super(message, options);
|
|
17
|
+
this.name = this.constructor.name;
|
|
18
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/** Thrown when state is illegal. */
|
|
22
|
+
export class IllegalStateException extends EDSMException {
|
|
23
|
+
}
|
|
24
|
+
/** Thrown when some resource was not found. */
|
|
25
|
+
export class NotFoundException extends EDSMException {
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Helper function to iterate over the lines of a data stream.
|
|
29
|
+
*
|
|
30
|
+
* @param stream - The input stream.
|
|
31
|
+
* @yields The created iterable for iterating over the lines of the stream.
|
|
32
|
+
*/
|
|
33
|
+
async function* parseLines(stream) {
|
|
34
|
+
let line = "";
|
|
35
|
+
const decoder = new TextDecoder();
|
|
36
|
+
for await (const chunk of stream) {
|
|
37
|
+
const data = decoder.decode(chunk);
|
|
38
|
+
const parts = data.split("\n");
|
|
39
|
+
const numParts = parts.length;
|
|
40
|
+
for (let i = 0; i < numParts; i++) {
|
|
41
|
+
line += parts[i];
|
|
42
|
+
if (i < numParts - 1) {
|
|
43
|
+
yield line;
|
|
44
|
+
line = "";
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (line !== "") {
|
|
49
|
+
yield line;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Helper function to iterate over the array entries of the given stream. The stream must be a JSON file with an array
|
|
54
|
+
* bracket in the first and last line and all other lines must contain a single dataset each. So it's actually a JSONL
|
|
55
|
+
* file but wrapped in an array and with comma character suffixes.
|
|
56
|
+
*
|
|
57
|
+
* @param stream - The JSON input as an async iterable.
|
|
58
|
+
* @yields The created iterable for iterating over the array entries of the JSON stream.
|
|
59
|
+
*/
|
|
60
|
+
export async function* parseJSONArray(stream) {
|
|
61
|
+
let inData = false;
|
|
62
|
+
for await (let line of parseLines(stream)) {
|
|
63
|
+
if (!inData) {
|
|
64
|
+
if (line === "[") {
|
|
65
|
+
inData = true;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
throw new IllegalStateException(`Expected array start but got: ${line}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
if (line === "]") {
|
|
73
|
+
inData = false;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
if (line.endsWith(",")) {
|
|
77
|
+
line = line.substring(0, line.length - 1);
|
|
78
|
+
}
|
|
79
|
+
yield JSON.parse(line, jsonReviver);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* JSON reviver function which converts numbers of ID properties (property names ending with 'ID' or 'Address') to bigint if needed.
|
|
86
|
+
*
|
|
87
|
+
* @param key - The JSON property key.
|
|
88
|
+
* @param value - The parsed JSON property value.
|
|
89
|
+
* @param context - The reviver context containing the raw JSON source string.
|
|
90
|
+
* @returns The already parsed JSON property value if suitable or the raw source converted into a bigint.
|
|
91
|
+
*/
|
|
92
|
+
export function jsonReviver(key, value, context) {
|
|
93
|
+
if (context != null && typeof value === "number" && (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER)) {
|
|
94
|
+
const source = context.source;
|
|
95
|
+
if (key === "id64" || key === "systemId64") {
|
|
96
|
+
return BigInt(source);
|
|
97
|
+
}
|
|
98
|
+
else if (String(value) !== source && /^[-+]?\d+$/.test(source)) {
|
|
99
|
+
throw new IllegalStateException(`Value of property '${key}' looks like a bigint (${source}) but was parsed as an imprecise number (${value})`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return value;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/main/util.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/PowerPlay",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"Coordinates": {
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"x": {
|
|
9
|
+
"type": "number"
|
|
10
|
+
},
|
|
11
|
+
"y": {
|
|
12
|
+
"type": "number"
|
|
13
|
+
},
|
|
14
|
+
"z": {
|
|
15
|
+
"type": "number"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"required": [
|
|
19
|
+
"x",
|
|
20
|
+
"y",
|
|
21
|
+
"z"
|
|
22
|
+
],
|
|
23
|
+
"type": "object"
|
|
24
|
+
},
|
|
25
|
+
"Id64": {
|
|
26
|
+
"description": "A 64 bit ID. Can be a `number` if ID does not need more then 53 bit. Must be `bigint` if ID needs more than 53 bit.",
|
|
27
|
+
"type": [
|
|
28
|
+
"number"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"PowerPlay": {
|
|
32
|
+
"additionalProperties": false,
|
|
33
|
+
"description": "Single EDSM power play information.",
|
|
34
|
+
"properties": {
|
|
35
|
+
"allegiance": {
|
|
36
|
+
"type": [
|
|
37
|
+
"string",
|
|
38
|
+
"null"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"coords": {
|
|
42
|
+
"$ref": "#/definitions/Coordinates"
|
|
43
|
+
},
|
|
44
|
+
"date": {
|
|
45
|
+
"type": "string"
|
|
46
|
+
},
|
|
47
|
+
"government": {
|
|
48
|
+
"type": [
|
|
49
|
+
"string",
|
|
50
|
+
"null"
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"id": {
|
|
54
|
+
"type": "number"
|
|
55
|
+
},
|
|
56
|
+
"id64": {
|
|
57
|
+
"$ref": "#/definitions/Id64"
|
|
58
|
+
},
|
|
59
|
+
"name": {
|
|
60
|
+
"type": "string"
|
|
61
|
+
},
|
|
62
|
+
"power": {
|
|
63
|
+
"type": "string"
|
|
64
|
+
},
|
|
65
|
+
"powerState": {
|
|
66
|
+
"type": "string"
|
|
67
|
+
},
|
|
68
|
+
"state": {
|
|
69
|
+
"type": [
|
|
70
|
+
"string",
|
|
71
|
+
"null"
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"required": [
|
|
76
|
+
"power",
|
|
77
|
+
"powerState",
|
|
78
|
+
"id",
|
|
79
|
+
"id64",
|
|
80
|
+
"name",
|
|
81
|
+
"coords",
|
|
82
|
+
"allegiance",
|
|
83
|
+
"government",
|
|
84
|
+
"state",
|
|
85
|
+
"date"
|
|
86
|
+
],
|
|
87
|
+
"type": "object"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/StationMarketResponse",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"Commodity": {
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"buyPrice": {
|
|
9
|
+
"type": "number"
|
|
10
|
+
},
|
|
11
|
+
"demand": {
|
|
12
|
+
"type": "number"
|
|
13
|
+
},
|
|
14
|
+
"id": {
|
|
15
|
+
"type": [
|
|
16
|
+
"string",
|
|
17
|
+
"null"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"name": {
|
|
21
|
+
"type": "string"
|
|
22
|
+
},
|
|
23
|
+
"sellPrice": {
|
|
24
|
+
"type": "number"
|
|
25
|
+
},
|
|
26
|
+
"stock": {
|
|
27
|
+
"type": "number"
|
|
28
|
+
},
|
|
29
|
+
"stockBracket": {
|
|
30
|
+
"type": "number"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"required": [
|
|
34
|
+
"id",
|
|
35
|
+
"name",
|
|
36
|
+
"buyPrice",
|
|
37
|
+
"stock",
|
|
38
|
+
"sellPrice",
|
|
39
|
+
"demand",
|
|
40
|
+
"stockBracket"
|
|
41
|
+
],
|
|
42
|
+
"type": "object"
|
|
43
|
+
},
|
|
44
|
+
"Id64": {
|
|
45
|
+
"description": "A 64 bit ID. Can be a `number` if ID does not need more then 53 bit. Must be `bigint` if ID needs more than 53 bit.",
|
|
46
|
+
"type": [
|
|
47
|
+
"number"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"StationMarketResponse": {
|
|
51
|
+
"additionalProperties": false,
|
|
52
|
+
"description": "Response structure of the EDSM system stations market request.",
|
|
53
|
+
"properties": {
|
|
54
|
+
"commodities": {
|
|
55
|
+
"items": {
|
|
56
|
+
"$ref": "#/definitions/Commodity"
|
|
57
|
+
},
|
|
58
|
+
"type": "array"
|
|
59
|
+
},
|
|
60
|
+
"id": {
|
|
61
|
+
"type": "number"
|
|
62
|
+
},
|
|
63
|
+
"id64": {
|
|
64
|
+
"$ref": "#/definitions/Id64"
|
|
65
|
+
},
|
|
66
|
+
"marketId": {
|
|
67
|
+
"type": "number"
|
|
68
|
+
},
|
|
69
|
+
"name": {
|
|
70
|
+
"type": "string"
|
|
71
|
+
},
|
|
72
|
+
"sId": {
|
|
73
|
+
"type": "number"
|
|
74
|
+
},
|
|
75
|
+
"sName": {
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
"url": {
|
|
79
|
+
"type": "string"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"required": [
|
|
83
|
+
"id",
|
|
84
|
+
"id64",
|
|
85
|
+
"name",
|
|
86
|
+
"marketId",
|
|
87
|
+
"sId",
|
|
88
|
+
"sName",
|
|
89
|
+
"url",
|
|
90
|
+
"commodities"
|
|
91
|
+
],
|
|
92
|
+
"type": "object"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/StationOutfittingResponse",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"Id64": {
|
|
6
|
+
"description": "A 64 bit ID. Can be a `number` if ID does not need more then 53 bit. Must be `bigint` if ID needs more than 53 bit.",
|
|
7
|
+
"type": [
|
|
8
|
+
"number"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"Outfitting": {
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"properties": {
|
|
14
|
+
"id": {
|
|
15
|
+
"type": [
|
|
16
|
+
"string",
|
|
17
|
+
"null"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"name": {
|
|
21
|
+
"type": "string"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"required": [
|
|
25
|
+
"id",
|
|
26
|
+
"name"
|
|
27
|
+
],
|
|
28
|
+
"type": "object"
|
|
29
|
+
},
|
|
30
|
+
"StationOutfittingResponse": {
|
|
31
|
+
"additionalProperties": false,
|
|
32
|
+
"description": "Response structure of the EDSM system stations outfitting request.",
|
|
33
|
+
"properties": {
|
|
34
|
+
"id": {
|
|
35
|
+
"type": "number"
|
|
36
|
+
},
|
|
37
|
+
"id64": {
|
|
38
|
+
"$ref": "#/definitions/Id64"
|
|
39
|
+
},
|
|
40
|
+
"marketId": {
|
|
41
|
+
"type": "number"
|
|
42
|
+
},
|
|
43
|
+
"name": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
},
|
|
46
|
+
"outfitting": {
|
|
47
|
+
"items": {
|
|
48
|
+
"$ref": "#/definitions/Outfitting"
|
|
49
|
+
},
|
|
50
|
+
"type": "array"
|
|
51
|
+
},
|
|
52
|
+
"sId": {
|
|
53
|
+
"type": "number"
|
|
54
|
+
},
|
|
55
|
+
"sName": {
|
|
56
|
+
"type": "string"
|
|
57
|
+
},
|
|
58
|
+
"url": {
|
|
59
|
+
"type": "string"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"required": [
|
|
63
|
+
"id",
|
|
64
|
+
"id64",
|
|
65
|
+
"name",
|
|
66
|
+
"marketId",
|
|
67
|
+
"sId",
|
|
68
|
+
"sName",
|
|
69
|
+
"url",
|
|
70
|
+
"outfitting"
|
|
71
|
+
],
|
|
72
|
+
"type": "object"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/StationShipyardResponse",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"Id64": {
|
|
6
|
+
"description": "A 64 bit ID. Can be a `number` if ID does not need more then 53 bit. Must be `bigint` if ID needs more than 53 bit.",
|
|
7
|
+
"type": [
|
|
8
|
+
"number"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"Ship": {
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"properties": {
|
|
14
|
+
"id": {
|
|
15
|
+
"type": "number"
|
|
16
|
+
},
|
|
17
|
+
"name": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"required": [
|
|
22
|
+
"id",
|
|
23
|
+
"name"
|
|
24
|
+
],
|
|
25
|
+
"type": "object"
|
|
26
|
+
},
|
|
27
|
+
"StationShipyardResponse": {
|
|
28
|
+
"additionalProperties": false,
|
|
29
|
+
"description": "Response structure of the EDSM system stations shipyard request.",
|
|
30
|
+
"properties": {
|
|
31
|
+
"id": {
|
|
32
|
+
"type": "number"
|
|
33
|
+
},
|
|
34
|
+
"id64": {
|
|
35
|
+
"$ref": "#/definitions/Id64"
|
|
36
|
+
},
|
|
37
|
+
"marketId": {
|
|
38
|
+
"type": "number"
|
|
39
|
+
},
|
|
40
|
+
"name": {
|
|
41
|
+
"type": "string"
|
|
42
|
+
},
|
|
43
|
+
"sId": {
|
|
44
|
+
"type": "number"
|
|
45
|
+
},
|
|
46
|
+
"sName": {
|
|
47
|
+
"type": "string"
|
|
48
|
+
},
|
|
49
|
+
"ships": {
|
|
50
|
+
"items": {
|
|
51
|
+
"$ref": "#/definitions/Ship"
|
|
52
|
+
},
|
|
53
|
+
"type": "array"
|
|
54
|
+
},
|
|
55
|
+
"url": {
|
|
56
|
+
"type": "string"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"required": [
|
|
60
|
+
"id",
|
|
61
|
+
"id64",
|
|
62
|
+
"name",
|
|
63
|
+
"marketId",
|
|
64
|
+
"sId",
|
|
65
|
+
"sName",
|
|
66
|
+
"url",
|
|
67
|
+
"ships"
|
|
68
|
+
],
|
|
69
|
+
"type": "object"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|