@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,51 @@
|
|
|
1
|
+
import type { Coordinates, Id64 } from "../common.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Response of a {@link sendEvents} request.
|
|
4
|
+
*/
|
|
5
|
+
export interface EventResponse {
|
|
6
|
+
/** Responses for each sent event. */
|
|
7
|
+
events: Array<{
|
|
8
|
+
/**
|
|
9
|
+
* 100 means the event was accepted. Every other code means the event was rejected for some reason.
|
|
10
|
+
* See https://www.edsm.net/en/api-journal-v1 for details.
|
|
11
|
+
*/
|
|
12
|
+
msgnum: number;
|
|
13
|
+
/** Response code in text form. */
|
|
14
|
+
msg: string;
|
|
15
|
+
/** True if new system was created, false if not. */
|
|
16
|
+
systemCreated?: boolean;
|
|
17
|
+
/** EDSM system ID. */
|
|
18
|
+
systemId?: number;
|
|
19
|
+
}>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Base data for EDSM event to be sent to EDSM. This must be the unmodified event read from the Journal, optionally enriched with additional
|
|
23
|
+
* context information.
|
|
24
|
+
*/
|
|
25
|
+
export interface EDSMEvent {
|
|
26
|
+
_systemAddress?: Id64;
|
|
27
|
+
_systemName?: string;
|
|
28
|
+
_systemCoordinates?: Coordinates;
|
|
29
|
+
_marketId?: number;
|
|
30
|
+
_stationName?: string;
|
|
31
|
+
_shipId?: number;
|
|
32
|
+
event: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Sends journal events to EDSM.
|
|
36
|
+
*
|
|
37
|
+
* @param commanderName - The name of the commander as registered on EDSM.
|
|
38
|
+
* @param apiKey - The API Key associated with the EDSM account.
|
|
39
|
+
* @param fromSoftware - Name of the software (YOUR software using this library, not the name of this library!) used to submit the data.
|
|
40
|
+
* @param fromSoftwareVersion - Version of the software used to submit the data.
|
|
41
|
+
* @param fromGameVersion - Version of the game which generated the journal messages.
|
|
42
|
+
* @param fromGameBuild - Build of the game which generated the journal messages.
|
|
43
|
+
* @param message - The journal event (or multiple events to send).
|
|
44
|
+
*/
|
|
45
|
+
export declare function sendEvents(commanderName: string, apiKey: string, fromSoftware: string, fromSoftwareVersion: string, fromGameVersion: string, fromGameBuild: string, message: EDSMEvent | EDSMEvent[]): Promise<EventResponse>;
|
|
46
|
+
/**
|
|
47
|
+
* Returns the events which must be discarded from the list of journal events sent to EDSM.
|
|
48
|
+
*
|
|
49
|
+
* @returns The list of event names to be discarded.
|
|
50
|
+
*/
|
|
51
|
+
export declare function getDiscardEvents(): Promise<string[]>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2025 Klaus Reimer <k@ailis.de>
|
|
3
|
+
* See LICENSE.md for licensing information.
|
|
4
|
+
*/
|
|
5
|
+
import { request } from "./common.js";
|
|
6
|
+
/**
|
|
7
|
+
* Sends journal events to EDSM.
|
|
8
|
+
*
|
|
9
|
+
* @param commanderName - The name of the commander as registered on EDSM.
|
|
10
|
+
* @param apiKey - The API Key associated with the EDSM account.
|
|
11
|
+
* @param fromSoftware - Name of the software (YOUR software using this library, not the name of this library!) used to submit the data.
|
|
12
|
+
* @param fromSoftwareVersion - Version of the software used to submit the data.
|
|
13
|
+
* @param fromGameVersion - Version of the game which generated the journal messages.
|
|
14
|
+
* @param fromGameBuild - Build of the game which generated the journal messages.
|
|
15
|
+
* @param message - The journal event (or multiple events to send).
|
|
16
|
+
*/
|
|
17
|
+
export async function sendEvents(commanderName, apiKey, fromSoftware, fromSoftwareVersion, fromGameVersion, fromGameBuild, message) {
|
|
18
|
+
return (await request("api-journal-v1", {
|
|
19
|
+
apiKey,
|
|
20
|
+
fromSoftware,
|
|
21
|
+
fromSoftwareVersion,
|
|
22
|
+
fromGameVersion,
|
|
23
|
+
fromGameBuild,
|
|
24
|
+
message
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Returns the events which must be discarded from the list of journal events sent to EDSM.
|
|
29
|
+
*
|
|
30
|
+
* @returns The list of event names to be discarded.
|
|
31
|
+
*/
|
|
32
|
+
export async function getDiscardEvents() {
|
|
33
|
+
return (await request("api-journal-v1/discard"));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=journal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journal.js","sourceRoot":"","sources":["../../../src/main/api/journal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAuCtC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,aAAqB,EAAE,MAAc,EAAE,YAAoB,EAAE,mBAA2B,EAAE,eAAuB,EAC1I,aAAqB,EAAE,OAAgC;IAC3D,OAAO,CAAC,MAAM,OAAO,CAAC,gBAAgB,EAAE;QACpC,MAAM;QACN,YAAY;QACZ,mBAAmB;QACnB,eAAe;QACf,aAAa;QACb,OAAO;KACV,CAAC,CAAE,CAAC;AACT,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IAClC,OAAO,CAAC,MAAM,OAAO,CAAC,wBAAwB,CAAC,CAAE,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { Coordinates, Id64 } from "../common.ts";
|
|
2
|
+
import { type SystemIdRequestOptions } from "./common.ts";
|
|
3
|
+
export interface FlightLog {
|
|
4
|
+
shipId: number | null;
|
|
5
|
+
system: string;
|
|
6
|
+
systemId?: number;
|
|
7
|
+
systemId64?: Id64;
|
|
8
|
+
firstDiscover: boolean;
|
|
9
|
+
date: string;
|
|
10
|
+
}
|
|
11
|
+
export interface FlightLogsResponse {
|
|
12
|
+
startDateTime: string;
|
|
13
|
+
endDateTime: string;
|
|
14
|
+
logs: FlightLog[];
|
|
15
|
+
}
|
|
16
|
+
export interface FlightLogFilter {
|
|
17
|
+
/** Filters flight logs by system name. */
|
|
18
|
+
systemName?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Filters for flight logs after this date & time (inclusive). Must be specified in UTC in the format
|
|
21
|
+
* YYYY-MM-DD HH:MM:SS.
|
|
22
|
+
*/
|
|
23
|
+
startDateTime?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Filters for flight logs before this date & time (inclusive). Must be specified in UTC in the format
|
|
26
|
+
* YYYY-MM-DD HH:MM:SS.
|
|
27
|
+
*/
|
|
28
|
+
endDateTime?: string;
|
|
29
|
+
/** Set to 1 if you want to get the EDSM internal id. Useful to handle duplicated name systems of the game. */
|
|
30
|
+
showId?: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Returns the flight log entries.
|
|
34
|
+
*
|
|
35
|
+
* @param commanderName - The name of the commander as registered on EDSM.
|
|
36
|
+
* @param apiKey - The API key of the commander.
|
|
37
|
+
* @param filter - Optional filter properties.
|
|
38
|
+
* @returns The flight log entries.
|
|
39
|
+
*/
|
|
40
|
+
export declare function getFlightLogs(commanderName: string, apiKey: string, filter?: FlightLogFilter): Promise<FlightLogsResponse>;
|
|
41
|
+
/**
|
|
42
|
+
* Commander position response returned by {@link getCommanderPosition} request.
|
|
43
|
+
*/
|
|
44
|
+
export interface CommanderPositionResponse {
|
|
45
|
+
system: string | null;
|
|
46
|
+
systemId?: number;
|
|
47
|
+
systemId64?: Id64;
|
|
48
|
+
firstDiscover: boolean | null;
|
|
49
|
+
date: string | null;
|
|
50
|
+
coordinates?: Coordinates;
|
|
51
|
+
isDocked?: boolean;
|
|
52
|
+
station?: string;
|
|
53
|
+
stationId?: number;
|
|
54
|
+
dateDocked?: string;
|
|
55
|
+
shipId?: number;
|
|
56
|
+
shipType?: string;
|
|
57
|
+
shipFuel?: number | null;
|
|
58
|
+
dateLastActivity?: string;
|
|
59
|
+
url?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface CommanderPositionOptions {
|
|
62
|
+
/**
|
|
63
|
+
* If not provided, information will only be returned if the commander has enabled his public profile, and share
|
|
64
|
+
* logs or map.
|
|
65
|
+
*/
|
|
66
|
+
apiKey?: string;
|
|
67
|
+
/** Set to 1 if you want to get the EDSM internal id. Useful to handle duplicated name systems of the game. */
|
|
68
|
+
showId?: number;
|
|
69
|
+
/** Set to 1 if you want to get the coordinates of the system. */
|
|
70
|
+
showCoordinates?: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Returns the last position of the given commander.
|
|
74
|
+
*
|
|
75
|
+
* @param commanderName - The name of the commander as registered on EDSM.
|
|
76
|
+
* @param options - Options.
|
|
77
|
+
* @returns The last position.
|
|
78
|
+
*/
|
|
79
|
+
export declare function getCommanderPosition(commanderName: string, options?: CommanderPositionOptions): Promise<CommanderPositionResponse>;
|
|
80
|
+
/** Response type of {@link setSystemComment} */
|
|
81
|
+
export interface SystemCommentResponse {
|
|
82
|
+
comment: string | null;
|
|
83
|
+
lastUpdate: string | null;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Sets/Updates a comment.
|
|
87
|
+
*
|
|
88
|
+
* @param commanderName - The name of the commander as registered on EDSM.
|
|
89
|
+
* @param apiKey - The API key associated with the commander.
|
|
90
|
+
* @param systemName - The system name for which to set a comment.
|
|
91
|
+
* @param comment - The comment to set. Empty string to remove.
|
|
92
|
+
* @param options - Additional options.
|
|
93
|
+
*/
|
|
94
|
+
export declare function setSystemComment(commanderName: string, apiKey: string, systemName: string, comment: string, options?: SystemIdRequestOptions): Promise<SystemCommentResponse>;
|
|
95
|
+
/**
|
|
96
|
+
* Returns a system comment.
|
|
97
|
+
*
|
|
98
|
+
* @param commanderName - The name of the commander as registered on EDSM.
|
|
99
|
+
* @param apiKey - The API key associated with the commander.
|
|
100
|
+
* @param systemName - The system name for which to return the comment.
|
|
101
|
+
* @param options - Additional options.
|
|
102
|
+
*/
|
|
103
|
+
export declare function getSystemComment(commanderName: string, apiKey: string, systemName: string, options?: SystemIdRequestOptions): Promise<SystemCommentResponse>;
|
|
104
|
+
/** Response of a {@link getSystemComments} request. */
|
|
105
|
+
export interface SystemCommentsResponse {
|
|
106
|
+
comments: Array<{
|
|
107
|
+
system: string;
|
|
108
|
+
systemId?: number;
|
|
109
|
+
comment: string;
|
|
110
|
+
lastUpdate: string;
|
|
111
|
+
}>;
|
|
112
|
+
}
|
|
113
|
+
/** Options for {@link getSystemComments} request. */
|
|
114
|
+
export interface SystemCommentsOptions {
|
|
115
|
+
/**
|
|
116
|
+
* If you only want to receive comments updated after a specific date & time, use this parameter.
|
|
117
|
+
* That parameter is inclusive. All dates must be UTC.
|
|
118
|
+
*/
|
|
119
|
+
startDateTime?: string;
|
|
120
|
+
/** Set to 1 if you want to get the EDSM internal id. Useful to handle duplicated name systems of the game. */
|
|
121
|
+
showId?: number;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Returns comments set for various systems.
|
|
125
|
+
*
|
|
126
|
+
* @param commanderName - The name of the commander as registered on EDSM.
|
|
127
|
+
* @param apiKey - The API key associated with the commander.
|
|
128
|
+
* @param options - Additional options.
|
|
129
|
+
*/
|
|
130
|
+
export declare function getSystemComments(commanderName: string, apiKey: string, options?: SystemCommentsOptions): Promise<SystemCommentsResponse>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2020 Klaus Reimer <k@ailis.de>
|
|
3
|
+
* See LICENSE.md for licensing information.
|
|
4
|
+
*/
|
|
5
|
+
import { request } from "./common.js";
|
|
6
|
+
/**
|
|
7
|
+
* Returns the flight log entries.
|
|
8
|
+
*
|
|
9
|
+
* @param commanderName - The name of the commander as registered on EDSM.
|
|
10
|
+
* @param apiKey - The API key of the commander.
|
|
11
|
+
* @param filter - Optional filter properties.
|
|
12
|
+
* @returns The flight log entries.
|
|
13
|
+
*/
|
|
14
|
+
export async function getFlightLogs(commanderName, apiKey, filter) {
|
|
15
|
+
return (await request("api-logs-v1/get-logs", { commanderName, apiKey, ...filter }));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Returns the last position of the given commander.
|
|
19
|
+
*
|
|
20
|
+
* @param commanderName - The name of the commander as registered on EDSM.
|
|
21
|
+
* @param options - Options.
|
|
22
|
+
* @returns The last position.
|
|
23
|
+
*/
|
|
24
|
+
export async function getCommanderPosition(commanderName, options) {
|
|
25
|
+
return (await request("api-logs-v1/get-position", { commanderName, ...options }));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Sets/Updates a comment.
|
|
29
|
+
*
|
|
30
|
+
* @param commanderName - The name of the commander as registered on EDSM.
|
|
31
|
+
* @param apiKey - The API key associated with the commander.
|
|
32
|
+
* @param systemName - The system name for which to set a comment.
|
|
33
|
+
* @param comment - The comment to set. Empty string to remove.
|
|
34
|
+
* @param options - Additional options.
|
|
35
|
+
*/
|
|
36
|
+
export async function setSystemComment(commanderName, apiKey, systemName, comment, options) {
|
|
37
|
+
return (await request("api-logs-v1/set-comment", { commanderName, apiKey, systemName, comment, ...options }));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Returns a system comment.
|
|
41
|
+
*
|
|
42
|
+
* @param commanderName - The name of the commander as registered on EDSM.
|
|
43
|
+
* @param apiKey - The API key associated with the commander.
|
|
44
|
+
* @param systemName - The system name for which to return the comment.
|
|
45
|
+
* @param options - Additional options.
|
|
46
|
+
*/
|
|
47
|
+
export async function getSystemComment(commanderName, apiKey, systemName, options) {
|
|
48
|
+
return (await request("api-logs-v1/get-comment", { commanderName, apiKey, systemName, ...options }));
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Returns comments set for various systems.
|
|
52
|
+
*
|
|
53
|
+
* @param commanderName - The name of the commander as registered on EDSM.
|
|
54
|
+
* @param apiKey - The API key associated with the commander.
|
|
55
|
+
* @param options - Additional options.
|
|
56
|
+
*/
|
|
57
|
+
export async function getSystemComments(commanderName, apiKey, options) {
|
|
58
|
+
return (await request("api-logs-v1/get-comments", { commanderName, apiKey, ...options }));
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=logs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../../src/main/api/logs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAA+B,OAAO,EAAE,MAAM,aAAa,CAAC;AAqCnE;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,aAAqB,EAAE,MAAc,EAAE,MAAwB;IAC/F,OAAO,CAAC,MAAM,OAAO,CAAC,sBAAsB,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAE,CAAC;AAC1F,CAAC;AAqCD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,aAAqB,EAAE,OAAkC;IAChG,OAAO,CAAC,MAAM,OAAO,CAAC,0BAA0B,EAAE,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC,CAAE,CAAC;AACvF,CAAC;AAQD;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,aAAqB,EAAE,MAAc,EAAE,UAAkB,EAAE,OAAe,EAAE,OAAgC;IAE/I,OAAO,CAAC,MAAM,OAAO,CAAC,yBAAyB,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC,CAAE,CAAC;AACnH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,aAAqB,EAAE,MAAc,EAAE,UAAkB,EAAE,OAAgC;IAE9H,OAAO,CAAC,MAAM,OAAO,CAAC,yBAAyB,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,EAAE,CAAC,CAAE,CAAC;AAC1G,CAAC;AAwBD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,aAAqB,EAAE,MAAc,EAAE,OAA+B;IAC1G,OAAO,CAAC,MAAM,OAAO,CAAC,0BAA0B,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,CAAE,CAAC;AAC/F,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type EliteServerStatusType = "success" | "warning" | "danger";
|
|
2
|
+
export interface EliteServerStatusResponse {
|
|
3
|
+
lastUpdate: string;
|
|
4
|
+
type: EliteServerStatusType;
|
|
5
|
+
message: string;
|
|
6
|
+
status: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Returns the elite server status.
|
|
10
|
+
*
|
|
11
|
+
* @returns The elite server status.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getEliteServerStatus(): Promise<EliteServerStatusResponse>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2020 Klaus Reimer <k@ailis.de>
|
|
3
|
+
* See LICENSE.md for licensing information.
|
|
4
|
+
*/
|
|
5
|
+
import { request } from "./common.js";
|
|
6
|
+
/**
|
|
7
|
+
* Returns the elite server status.
|
|
8
|
+
*
|
|
9
|
+
* @returns The elite server status.
|
|
10
|
+
*/
|
|
11
|
+
export async function getEliteServerStatus() {
|
|
12
|
+
return (await request("api-status-v1/elite-server"));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/main/api/status.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAWtC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACtC,OAAO,CAAC,MAAM,OAAO,CAAC,4BAA4B,CAAC,CAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import type { SystemBody } from "../bodies.ts";
|
|
2
|
+
import type { Id64 } from "../common.ts";
|
|
3
|
+
import type { Commodity, Outfitting, Ship, SystemStation } from "../stations.ts";
|
|
4
|
+
import { type SystemIdRequestOptions } from "./common.ts";
|
|
5
|
+
export interface BodyScanValue {
|
|
6
|
+
bodyId: number;
|
|
7
|
+
bodyName: string;
|
|
8
|
+
distance: number;
|
|
9
|
+
valueMax: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Response structure of the EDSM system bodies request.
|
|
13
|
+
*/
|
|
14
|
+
export interface SystemBodiesResponse {
|
|
15
|
+
id: number;
|
|
16
|
+
id64: Id64;
|
|
17
|
+
name: string;
|
|
18
|
+
url: string;
|
|
19
|
+
bodies: SystemBody[];
|
|
20
|
+
bodyCount: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Response structure of the EDSM system estimated value request.
|
|
24
|
+
*/
|
|
25
|
+
export interface SystemEstimatedValueResponse {
|
|
26
|
+
id: number;
|
|
27
|
+
id64: Id64;
|
|
28
|
+
name: string;
|
|
29
|
+
url: string;
|
|
30
|
+
estimatedValue: number;
|
|
31
|
+
estimatedValueMapped: number;
|
|
32
|
+
valuableBodies: BodyScanValue[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Response structure of the EDSM system stations request.
|
|
36
|
+
*/
|
|
37
|
+
export interface SystemStationsResponse {
|
|
38
|
+
id: number;
|
|
39
|
+
id64: Id64;
|
|
40
|
+
name: string;
|
|
41
|
+
url: string;
|
|
42
|
+
stations: SystemStation[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Response structure of the EDSM system stations market request.
|
|
46
|
+
*/
|
|
47
|
+
export interface StationMarketResponse {
|
|
48
|
+
id: number;
|
|
49
|
+
id64: Id64;
|
|
50
|
+
name: string;
|
|
51
|
+
marketId: number;
|
|
52
|
+
sId: number;
|
|
53
|
+
sName: string;
|
|
54
|
+
url: string;
|
|
55
|
+
commodities: Commodity[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Response structure of the EDSM system stations shipyard request.
|
|
59
|
+
*/
|
|
60
|
+
export interface StationShipyardResponse {
|
|
61
|
+
id: number;
|
|
62
|
+
id64: Id64;
|
|
63
|
+
name: string;
|
|
64
|
+
marketId: number;
|
|
65
|
+
sId: number;
|
|
66
|
+
sName: string;
|
|
67
|
+
url: string;
|
|
68
|
+
ships: Ship[];
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Response structure of the EDSM system stations outfitting request.
|
|
72
|
+
*/
|
|
73
|
+
export interface StationOutfittingResponse {
|
|
74
|
+
id: number;
|
|
75
|
+
id64: Id64;
|
|
76
|
+
name: string;
|
|
77
|
+
marketId: number;
|
|
78
|
+
sId: number;
|
|
79
|
+
sName: string;
|
|
80
|
+
url: string;
|
|
81
|
+
outfitting: Outfitting[];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Returns the system bodies of the given star system.
|
|
85
|
+
*
|
|
86
|
+
* @param systemName - The system name.
|
|
87
|
+
* @param ids - Optional system IDs if you seek for a duplicate system and want to force a specific ID.
|
|
88
|
+
* @returns The bodies found on EDSM.
|
|
89
|
+
* @throws NotFoundException - When system was not found.
|
|
90
|
+
*/
|
|
91
|
+
export declare function getSystemBodies(systemName: string, ids?: {
|
|
92
|
+
systemId?: number;
|
|
93
|
+
systemId64?: Id64;
|
|
94
|
+
}): Promise<SystemBodiesResponse>;
|
|
95
|
+
/**
|
|
96
|
+
* Returns the estimated scan values of a system.
|
|
97
|
+
*
|
|
98
|
+
* @param systemName - The system name.
|
|
99
|
+
* @param ids - Optional parameters.
|
|
100
|
+
* @returns The scan values.
|
|
101
|
+
* @throws NotFoundException - When system was not found.
|
|
102
|
+
*/
|
|
103
|
+
export declare function getSystemEstimatedValue(systemName: string, ids?: SystemIdRequestOptions): Promise<SystemEstimatedValueResponse>;
|
|
104
|
+
/**
|
|
105
|
+
* Returns information about stations in a system.
|
|
106
|
+
*
|
|
107
|
+
* @param systemName - The system name.
|
|
108
|
+
* @param ids - Optional parameters.
|
|
109
|
+
* @returns The information about stations in a system.
|
|
110
|
+
* @throws NotFoundException - When system was not found.
|
|
111
|
+
*/
|
|
112
|
+
export declare function getSystemStations(systemName: string, ids?: SystemIdRequestOptions): Promise<SystemStationsResponse>;
|
|
113
|
+
/**
|
|
114
|
+
* Returns information about market in a station.
|
|
115
|
+
*
|
|
116
|
+
* @param marketId - The market ID.
|
|
117
|
+
* @returns The information about market in given station.
|
|
118
|
+
* @throws NotFoundException - When market was not found.
|
|
119
|
+
*/
|
|
120
|
+
export declare function getStationMarket(marketId: number): Promise<StationMarketResponse>;
|
|
121
|
+
/**
|
|
122
|
+
* Returns information about market in a station.
|
|
123
|
+
*
|
|
124
|
+
* @param systemName - The system name.
|
|
125
|
+
* @param stationName - The station name.
|
|
126
|
+
* @param params - Optional parameters.
|
|
127
|
+
* @returns The information about market in given station.
|
|
128
|
+
* @throws NotFoundException - When market was not found.
|
|
129
|
+
*/
|
|
130
|
+
export declare function getStationMarket(systemName: string, stationName: string, params?: SystemIdRequestOptions): Promise<StationMarketResponse>;
|
|
131
|
+
/**
|
|
132
|
+
* Returns information about shipyard in a station.
|
|
133
|
+
*
|
|
134
|
+
* @param marketId - The market ID.
|
|
135
|
+
* @returns The information about shipyard in given station.
|
|
136
|
+
* @throws NotFoundException - When shipyard was not found.
|
|
137
|
+
*/
|
|
138
|
+
export declare function getStationShipyard(marketId: number): Promise<StationShipyardResponse>;
|
|
139
|
+
/**
|
|
140
|
+
* Returns information about shipyard in a station.
|
|
141
|
+
*
|
|
142
|
+
* @param systemName - The system name.
|
|
143
|
+
* @param stationName - The station name.
|
|
144
|
+
* @param params - Optional parameters.
|
|
145
|
+
* @returns The information about shipyard in given station.
|
|
146
|
+
* @throws NotFoundException - When shipyard was not found.
|
|
147
|
+
*/
|
|
148
|
+
export declare function getStationShipyard(systemName: string, stationName: string, params?: SystemIdRequestOptions): Promise<StationShipyardResponse>;
|
|
149
|
+
/**
|
|
150
|
+
* Returns information about outfitting in a station.
|
|
151
|
+
*
|
|
152
|
+
* @param marketId - The market ID.
|
|
153
|
+
* @returns The information about outfitting in given station.
|
|
154
|
+
* @throws NotFoundException - When station was not found.
|
|
155
|
+
*/
|
|
156
|
+
export declare function getStationOutfitting(marketId: number): Promise<StationOutfittingResponse>;
|
|
157
|
+
/**
|
|
158
|
+
* Returns information about outfitting in a station.
|
|
159
|
+
*
|
|
160
|
+
* @param systemName - The system name.
|
|
161
|
+
* @param stationName - The station name.
|
|
162
|
+
* @param params - Optional parameters.
|
|
163
|
+
* @returns The information about outfitting in given station.
|
|
164
|
+
* @throws NotFoundException - When station was not found.
|
|
165
|
+
*/
|
|
166
|
+
export declare function getStationOutfitting(systemName: string, stationName: string, params?: SystemIdRequestOptions): Promise<StationOutfittingResponse>;
|
|
167
|
+
export interface SystemFactionsOptions extends SystemIdRequestOptions {
|
|
168
|
+
/** Set to 1 to get the factions history under the requested system. */
|
|
169
|
+
showHistory?: number;
|
|
170
|
+
}
|
|
171
|
+
export interface ShortSystemFaction {
|
|
172
|
+
id: number;
|
|
173
|
+
name: string;
|
|
174
|
+
allegiance: string;
|
|
175
|
+
government: string;
|
|
176
|
+
}
|
|
177
|
+
export interface SystemFaction extends ShortSystemFaction {
|
|
178
|
+
influence: number;
|
|
179
|
+
influenceHistory?: Record<string, number> | [];
|
|
180
|
+
state: string;
|
|
181
|
+
stateHistory?: Record<string, string> | [];
|
|
182
|
+
activeStates: Array<{
|
|
183
|
+
state: string;
|
|
184
|
+
}>;
|
|
185
|
+
activeStatesHistory?: Record<string, Array<{
|
|
186
|
+
state: string;
|
|
187
|
+
}>> | [];
|
|
188
|
+
recoveringStates: Array<{
|
|
189
|
+
state: string;
|
|
190
|
+
trend?: number;
|
|
191
|
+
}>;
|
|
192
|
+
recoveringStatesHistory?: Record<string, Array<{
|
|
193
|
+
state: string;
|
|
194
|
+
trend?: number;
|
|
195
|
+
}>> | [];
|
|
196
|
+
pendingStates: Array<{
|
|
197
|
+
state: string;
|
|
198
|
+
trend?: number;
|
|
199
|
+
}>;
|
|
200
|
+
pendingStatesHistory?: Record<string, Array<{
|
|
201
|
+
state: string;
|
|
202
|
+
trend?: number;
|
|
203
|
+
}>> | [];
|
|
204
|
+
happiness: string;
|
|
205
|
+
happinessHistory?: Record<string, string> | [];
|
|
206
|
+
isPlayer: boolean;
|
|
207
|
+
lastUpdate: number;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Response structure of the EDSM system factions request.
|
|
211
|
+
*/
|
|
212
|
+
export interface SystemFactionsResponse {
|
|
213
|
+
id: number;
|
|
214
|
+
id64: Id64;
|
|
215
|
+
name: string;
|
|
216
|
+
url: string;
|
|
217
|
+
controllingFaction?: ShortSystemFaction;
|
|
218
|
+
factions: SystemFaction[];
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Returns information about factions in a system.
|
|
222
|
+
*
|
|
223
|
+
* @param systemName - The system name.
|
|
224
|
+
* @param options - Optional parameters.
|
|
225
|
+
* @returns The information about stations in a system.
|
|
226
|
+
* @throws NotFoundException - When system was not found.
|
|
227
|
+
*/
|
|
228
|
+
export declare function getSystemFactions(systemName: string, options?: SystemFactionsOptions): Promise<SystemFactionsResponse>;
|
|
229
|
+
/**
|
|
230
|
+
* Response structure of the EDSM system traffic request.
|
|
231
|
+
*/
|
|
232
|
+
export interface SystemTrafficResponse {
|
|
233
|
+
id: number;
|
|
234
|
+
id64: Id64;
|
|
235
|
+
name: string;
|
|
236
|
+
url: string;
|
|
237
|
+
discovery: {
|
|
238
|
+
commander: string;
|
|
239
|
+
date: string;
|
|
240
|
+
};
|
|
241
|
+
traffic: {
|
|
242
|
+
total: number;
|
|
243
|
+
week: number;
|
|
244
|
+
day: number;
|
|
245
|
+
};
|
|
246
|
+
breakdown: Record<string, number>;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Returns information about traffic in a system.
|
|
250
|
+
*
|
|
251
|
+
* @param systemName - The system name.
|
|
252
|
+
* @param ids - Optional parameters.
|
|
253
|
+
* @returns The information about traffic in a system.
|
|
254
|
+
* @throws NotFoundException - When system was not found.
|
|
255
|
+
*/
|
|
256
|
+
export declare function getSystemTraffic(systemName: string, ids?: SystemIdRequestOptions): Promise<SystemTrafficResponse>;
|
|
257
|
+
/**
|
|
258
|
+
* Response structure of the EDSM system deaths request.
|
|
259
|
+
*/
|
|
260
|
+
export interface SystemDeathsResponse {
|
|
261
|
+
id: number;
|
|
262
|
+
id64: Id64;
|
|
263
|
+
name: string;
|
|
264
|
+
url: string;
|
|
265
|
+
deaths: {
|
|
266
|
+
total: number;
|
|
267
|
+
week: number;
|
|
268
|
+
day: number;
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Returns information about deaths in a system.
|
|
273
|
+
*
|
|
274
|
+
* @param systemName - The system name.
|
|
275
|
+
* @param ids - Optional parameters.
|
|
276
|
+
* @returns The information about deaths in a system.
|
|
277
|
+
* @throws NotFoundException - When system was not found.
|
|
278
|
+
*/
|
|
279
|
+
export declare function getSystemDeaths(systemName: string, ids?: SystemIdRequestOptions): Promise<SystemDeathsResponse>;
|