@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,125 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2020 Klaus Reimer <k@ailis.de>
|
|
3
|
+
* See LICENSE.md for licensing information.
|
|
4
|
+
*/
|
|
5
|
+
import { NotFoundException } from "../util.js";
|
|
6
|
+
import { request } from "./common.js";
|
|
7
|
+
/**
|
|
8
|
+
* Returns the system bodies of the given star system.
|
|
9
|
+
*
|
|
10
|
+
* @param systemName - The system name.
|
|
11
|
+
* @param ids - Optional system IDs if you seek for a duplicate system and want to force a specific ID.
|
|
12
|
+
* @returns The bodies found on EDSM.
|
|
13
|
+
* @throws NotFoundException - When system was not found.
|
|
14
|
+
*/
|
|
15
|
+
export async function getSystemBodies(systemName, ids) {
|
|
16
|
+
const response = await request("api-system-v1/bodies", { systemName, ...ids });
|
|
17
|
+
if (response == null) {
|
|
18
|
+
throw new NotFoundException(`System not found: ${systemName}`);
|
|
19
|
+
}
|
|
20
|
+
return response;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Returns the estimated scan values of a system.
|
|
24
|
+
*
|
|
25
|
+
* @param systemName - The system name.
|
|
26
|
+
* @param ids - Optional parameters.
|
|
27
|
+
* @returns The scan values.
|
|
28
|
+
* @throws NotFoundException - When system was not found.
|
|
29
|
+
*/
|
|
30
|
+
export async function getSystemEstimatedValue(systemName, ids) {
|
|
31
|
+
const response = await request("api-system-v1/estimated-value", { systemName, ...ids });
|
|
32
|
+
if (response == null) {
|
|
33
|
+
throw new NotFoundException(`System not found: ${systemName}`);
|
|
34
|
+
}
|
|
35
|
+
return response;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Returns information about stations in a system.
|
|
39
|
+
*
|
|
40
|
+
* @param systemName - The system name.
|
|
41
|
+
* @param ids - Optional parameters.
|
|
42
|
+
* @returns The information about stations in a system.
|
|
43
|
+
* @throws NotFoundException - When system was not found.
|
|
44
|
+
*/
|
|
45
|
+
export async function getSystemStations(systemName, ids) {
|
|
46
|
+
const response = await request("api-system-v1/stations", { systemName, ...ids });
|
|
47
|
+
if (response == null) {
|
|
48
|
+
throw new NotFoundException(`System not found: ${systemName}`);
|
|
49
|
+
}
|
|
50
|
+
return response;
|
|
51
|
+
}
|
|
52
|
+
async function getStationDetails(detail, marketIdOrSystemName, stationName, params) {
|
|
53
|
+
const url = `api-system-v1/stations/${detail}`;
|
|
54
|
+
let data;
|
|
55
|
+
if (stationName == null) {
|
|
56
|
+
const marketId = marketIdOrSystemName;
|
|
57
|
+
data = await request(url, { marketId });
|
|
58
|
+
if (data == null) {
|
|
59
|
+
throw new NotFoundException(`Market not found: ${marketId}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
const systemName = marketIdOrSystemName;
|
|
64
|
+
data = await request(url, { systemName, stationName, ...params });
|
|
65
|
+
if (data == null) {
|
|
66
|
+
throw new NotFoundException(`Station '${stationName}' in '${systemName}' not found`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return data;
|
|
70
|
+
}
|
|
71
|
+
export async function getStationMarket(marketIdOrSystemName, stationName, params) {
|
|
72
|
+
return getStationDetails("market", marketIdOrSystemName, stationName, params);
|
|
73
|
+
}
|
|
74
|
+
export async function getStationShipyard(marketIdOrSystemName, stationName, params) {
|
|
75
|
+
return getStationDetails("shipyard", marketIdOrSystemName, stationName, params);
|
|
76
|
+
}
|
|
77
|
+
export async function getStationOutfitting(marketIdOrSystemName, stationName, params) {
|
|
78
|
+
return getStationDetails("outfitting", marketIdOrSystemName, stationName, params);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Returns information about factions in a system.
|
|
82
|
+
*
|
|
83
|
+
* @param systemName - The system name.
|
|
84
|
+
* @param options - Optional parameters.
|
|
85
|
+
* @returns The information about stations in a system.
|
|
86
|
+
* @throws NotFoundException - When system was not found.
|
|
87
|
+
*/
|
|
88
|
+
export async function getSystemFactions(systemName, options) {
|
|
89
|
+
const response = await request("api-system-v1/factions", { systemName, ...options });
|
|
90
|
+
if (response == null) {
|
|
91
|
+
throw new NotFoundException(`System not found: ${systemName}`);
|
|
92
|
+
}
|
|
93
|
+
return response;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Returns information about traffic in a system.
|
|
97
|
+
*
|
|
98
|
+
* @param systemName - The system name.
|
|
99
|
+
* @param ids - Optional parameters.
|
|
100
|
+
* @returns The information about traffic in a system.
|
|
101
|
+
* @throws NotFoundException - When system was not found.
|
|
102
|
+
*/
|
|
103
|
+
export async function getSystemTraffic(systemName, ids) {
|
|
104
|
+
const response = await request("api-system-v1/traffic", { systemName, ...ids });
|
|
105
|
+
if (response == null) {
|
|
106
|
+
throw new NotFoundException(`System not found: ${systemName}`);
|
|
107
|
+
}
|
|
108
|
+
return response;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Returns information about deaths in a system.
|
|
112
|
+
*
|
|
113
|
+
* @param systemName - The system name.
|
|
114
|
+
* @param ids - Optional parameters.
|
|
115
|
+
* @returns The information about deaths in a system.
|
|
116
|
+
* @throws NotFoundException - When system was not found.
|
|
117
|
+
*/
|
|
118
|
+
export async function getSystemDeaths(systemName, ids) {
|
|
119
|
+
const response = await request("api-system-v1/deaths", { systemName, ...ids });
|
|
120
|
+
if (response == null) {
|
|
121
|
+
throw new NotFoundException(`System not found: ${systemName}`);
|
|
122
|
+
}
|
|
123
|
+
return response;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../../src/main/api/system.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import type { Coordinates, Id64 } from "../common.ts";
|
|
2
|
+
import { type SystemIdRequestOptions } from "./common.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Response of a {@link getSystem} request.
|
|
5
|
+
*/
|
|
6
|
+
export interface SystemResponse {
|
|
7
|
+
/** The name of the system. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** The EDSM ID of the system. Only present when {@link SystemRequestOptions#showId} option is set to 1. */
|
|
10
|
+
id?: number;
|
|
11
|
+
/** The Frontier ID of the system. Only present when {@link SystemRequestOptions#showId} option is set to 1. */
|
|
12
|
+
id64?: Id64;
|
|
13
|
+
/**
|
|
14
|
+
* The systems ID having the exact same name in the game. Only present when there are duplicated and
|
|
15
|
+
* {@link SystemRequestOptions#showId} option is set to 1.
|
|
16
|
+
*/
|
|
17
|
+
duplicates?: number[];
|
|
18
|
+
/** The coordinates of the system. Only present when {@link SystemRequestOptions#showCoordinates} option is set to 1. */
|
|
19
|
+
coords?: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
z: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* True when exact coords are known. False when position is trilaterated. Only present when {@link SystemRequestOptions#showCoordinates}
|
|
26
|
+
* option is set to 1
|
|
27
|
+
*/
|
|
28
|
+
coordsLocked?: boolean;
|
|
29
|
+
/** System information. Only present when {@link SystemRequestOptions#showInformation} option is set to 1. */
|
|
30
|
+
information?: {
|
|
31
|
+
allegiance?: string;
|
|
32
|
+
government?: string;
|
|
33
|
+
faction?: string;
|
|
34
|
+
factionState?: string;
|
|
35
|
+
population?: number;
|
|
36
|
+
security?: string;
|
|
37
|
+
economy?: string;
|
|
38
|
+
secondEconomy?: string;
|
|
39
|
+
reserve?: string;
|
|
40
|
+
};
|
|
41
|
+
/** Permit information. Only present when {@link SystemRequestOptions#showPermit} option is set to 1. */
|
|
42
|
+
requirePermit?: boolean;
|
|
43
|
+
/** Permit name if any. Only present when {@link SystemRequestOptions#showPermit} option is set to 1. */
|
|
44
|
+
permitName?: string;
|
|
45
|
+
/** Information about the primary star if any. Only present when {@link SystemRequestOptions#showPrimaryStar} option is set to 1. */
|
|
46
|
+
primaryStar?: {
|
|
47
|
+
type: string;
|
|
48
|
+
name: string;
|
|
49
|
+
isScoopable: boolean;
|
|
50
|
+
};
|
|
51
|
+
/** The time when the system was hidden. Only present when system is hidden and {@link SystemRequestOptions#includeHidden} is set to 1 */
|
|
52
|
+
hidden_at?: string;
|
|
53
|
+
/**
|
|
54
|
+
* The system ID this system was merged to. Only present when system was merged and, {@link SystemRequestOptions#includeHidden} is set to 1
|
|
55
|
+
* and {@link SystemRequestOptions#showId} is also set to 1.
|
|
56
|
+
*/
|
|
57
|
+
mergedTo?: number;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Flags for enabling data in {@link SystemResponse}.
|
|
61
|
+
*/
|
|
62
|
+
export interface SystemRequestFlags {
|
|
63
|
+
/** Set to 1 to get our internal ID for this system. */
|
|
64
|
+
showId?: number;
|
|
65
|
+
/** Set to 1 to get the system coordinates. If coordinates are unknown, the coords key will not be returned. */
|
|
66
|
+
showCoordinates?: number;
|
|
67
|
+
/** Set to 1 to get the system permit if there is one. If the permit is named, also return permitName. */
|
|
68
|
+
showPermit?: number;
|
|
69
|
+
/** Set to 1 to get the system information like allegiance, government... If no information are stored, an empty object will be returned. */
|
|
70
|
+
showInformation?: number;
|
|
71
|
+
/** Set to 1 to get the system primary star if known. If no primary star is stored, null will be returned. */
|
|
72
|
+
showPrimaryStar?: number;
|
|
73
|
+
/** Set to 1 to get system even if hidden in the database. Hidden system are generally typo errors, renamed system in the game... */
|
|
74
|
+
includeHidden?: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Options for {@link getSystem} request.
|
|
78
|
+
*/
|
|
79
|
+
export interface SystemRequestOptions extends SystemIdRequestOptions, SystemRequestFlags {
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Returns information about the given system.
|
|
83
|
+
*
|
|
84
|
+
* @param systemName - The system name.
|
|
85
|
+
* @returns The system information.
|
|
86
|
+
* @throws NotFoundException - When system was not found.
|
|
87
|
+
*/
|
|
88
|
+
export declare function getSystem(systemName: string, options?: SystemRequestOptions): Promise<SystemResponse>;
|
|
89
|
+
/**
|
|
90
|
+
* Options for {@link getSystems} request.
|
|
91
|
+
*/
|
|
92
|
+
export interface SystemsRequestOptions extends SystemRequestFlags {
|
|
93
|
+
/** The systems name to retrieve, can be a start of a name or an array of specific names. */
|
|
94
|
+
systemName?: string | string[];
|
|
95
|
+
/**
|
|
96
|
+
* If you only want to receive systems updated after a specific date & time, use this parameter.
|
|
97
|
+
* Parameter is inclusive. All dates must be UTC.
|
|
98
|
+
* Format: YYYY-MM-DD HH:MM:SS.
|
|
99
|
+
*/
|
|
100
|
+
startDateTime?: string;
|
|
101
|
+
/**
|
|
102
|
+
* If you only want to receive systems updated before a specific date & time, use this parameter.
|
|
103
|
+
* Parameter is inclusive. All dates must be UTC.
|
|
104
|
+
* Format: YYYY-MM-DD HH:MM:SS.
|
|
105
|
+
*/
|
|
106
|
+
endDateTime?: string;
|
|
107
|
+
/** Set to 1 to get only systems with known coordinates. */
|
|
108
|
+
onlyKnownCoordinates?: number;
|
|
109
|
+
/** Set to 1 to get only systems without coordinates. */
|
|
110
|
+
onlyUnknownCoordinates?: number;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Returns information about multiple systems.
|
|
114
|
+
*
|
|
115
|
+
* @param options - The request options.
|
|
116
|
+
* @returns List of system information. Empty if none.
|
|
117
|
+
*/
|
|
118
|
+
export declare function getSystems(options?: SystemsRequestOptions): Promise<SystemResponse[]>;
|
|
119
|
+
/**
|
|
120
|
+
* Options for {@link getSphereSystems} request.
|
|
121
|
+
*/
|
|
122
|
+
export interface SphereSystemsRequestOptions extends SystemRequestFlags, SystemIdRequestOptions {
|
|
123
|
+
/** Desired radius in LY. Defaults to 50, maximum is 100. */
|
|
124
|
+
radius?: number;
|
|
125
|
+
/** The minimum radius in LY. Must be between 0 and {@link radius}. Defaults to 0. */
|
|
126
|
+
minRadius?: number;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Returns information about multiple systems in a given sphere.
|
|
130
|
+
*
|
|
131
|
+
* @param options - The request options.
|
|
132
|
+
* @returns List of system information in given sphere. Empty if none.
|
|
133
|
+
*/
|
|
134
|
+
export declare function getSphereSystems(systemNameOrCoords: string | Coordinates, options?: SphereSystemsRequestOptions): Promise<SystemResponse[]>;
|
|
135
|
+
/**
|
|
136
|
+
* Options for {@link getCubeSystems} request.
|
|
137
|
+
*/
|
|
138
|
+
export interface CubeSystemsRequestOptions extends SystemRequestFlags, SystemIdRequestOptions {
|
|
139
|
+
/** Desired cube size in LY. Defaults to 100, maximum is 200. */
|
|
140
|
+
size?: number;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Returns information about multiple systems in a given cube.
|
|
144
|
+
*
|
|
145
|
+
* @param options - The request options.
|
|
146
|
+
* @returns List of system information in given cube. Empty if none.
|
|
147
|
+
*/
|
|
148
|
+
export declare function getCubeSystems(systemNameOrCoords: string | Coordinates, options?: CubeSystemsRequestOptions): Promise<SystemResponse[]>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2025 Klaus Reimer <k@ailis.de>
|
|
3
|
+
* See LICENSE.md for licensing information.
|
|
4
|
+
*/
|
|
5
|
+
import { NotFoundException } from "../util.js";
|
|
6
|
+
import { request } from "./common.js";
|
|
7
|
+
/**
|
|
8
|
+
* Returns information about the given system.
|
|
9
|
+
*
|
|
10
|
+
* @param systemName - The system name.
|
|
11
|
+
* @returns The system information.
|
|
12
|
+
* @throws NotFoundException - When system was not found.
|
|
13
|
+
*/
|
|
14
|
+
export async function getSystem(systemName, options) {
|
|
15
|
+
const system = await request("api-v1/system", { systemName, ...options });
|
|
16
|
+
if (system == null) {
|
|
17
|
+
throw new NotFoundException(`System not found: ${systemName}`);
|
|
18
|
+
}
|
|
19
|
+
return system;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Returns information about multiple systems.
|
|
23
|
+
*
|
|
24
|
+
* @param options - The request options.
|
|
25
|
+
* @returns List of system information. Empty if none.
|
|
26
|
+
*/
|
|
27
|
+
export async function getSystems(options) {
|
|
28
|
+
const system = await request("api-v1/systems", { ...options });
|
|
29
|
+
return system ?? [];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Returns information about multiple systems in a given sphere.
|
|
33
|
+
*
|
|
34
|
+
* @param options - The request options.
|
|
35
|
+
* @returns List of system information in given sphere. Empty if none.
|
|
36
|
+
*/
|
|
37
|
+
export async function getSphereSystems(systemNameOrCoords, options) {
|
|
38
|
+
const center = typeof systemNameOrCoords === "string" ? { systemName: systemNameOrCoords } : systemNameOrCoords;
|
|
39
|
+
return (await request("api-v1/sphere-systems", { ...center, ...options }));
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Returns information about multiple systems in a given cube.
|
|
43
|
+
*
|
|
44
|
+
* @param options - The request options.
|
|
45
|
+
* @returns List of system information in given cube. Empty if none.
|
|
46
|
+
*/
|
|
47
|
+
export async function getCubeSystems(systemNameOrCoords, options) {
|
|
48
|
+
const center = typeof systemNameOrCoords === "string" ? { systemName: systemNameOrCoords } : systemNameOrCoords;
|
|
49
|
+
return (await request("api-v1/cube-systems", { ...center, ...options }));
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=systems.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"systems.js","sourceRoot":"","sources":["../../../src/main/api/systems.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAA+B,OAAO,EAAE,MAAM,aAAa,CAAC;AAkGnE;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,UAAkB,EAAE,OAA8B;IAC9E,MAAM,MAAM,GAAG,MAAM,OAAO,CAAiB,eAAe,EAAE,EAAE,UAAU,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;QACjB,MAAM,IAAI,iBAAiB,CAAC,qBAAqB,UAAU,EAAE,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AA8BD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAA+B;IAC5D,MAAM,MAAM,GAAG,MAAM,OAAO,CAAmB,gBAAgB,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,OAAO,MAAM,IAAI,EAAE,CAAC;AACxB,CAAC;AAaD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,kBAAwC,EAAE,OAAqC;IAClH,MAAM,MAAM,GAAG,OAAO,kBAAkB,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC;IAChH,OAAO,CAAC,MAAM,OAAO,CAAC,uBAAuB,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,CAAE,CAAC;AAChF,CAAC;AAUD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,kBAAwC,EAAE,OAAmC;IAC9G,MAAM,MAAM,GAAG,OAAO,kBAAkB,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC;IAChH,OAAO,CAAC,MAAM,OAAO,CAAC,qBAAqB,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,CAAE,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { Id64 } from "./common.ts";
|
|
2
|
+
/**
|
|
3
|
+
* EDSM data about asteroid ring/belt.
|
|
4
|
+
*/
|
|
5
|
+
export interface Asteroids {
|
|
6
|
+
name: string;
|
|
7
|
+
type: string;
|
|
8
|
+
mass: number;
|
|
9
|
+
innerRadius: number;
|
|
10
|
+
outerRadius: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* EDSM data about raw materials on a planet.
|
|
14
|
+
*/
|
|
15
|
+
export type Materials = Record<string, number>;
|
|
16
|
+
/**
|
|
17
|
+
* EDSM data about solid composition of a planet.
|
|
18
|
+
*/
|
|
19
|
+
export type SolidComposition = Record<string, number>;
|
|
20
|
+
/**
|
|
21
|
+
* EDSM data about atmosphere composition of a planet.
|
|
22
|
+
*/
|
|
23
|
+
export type AtmosphereComposition = Record<string, number>;
|
|
24
|
+
/**
|
|
25
|
+
* EDSM base body data shared by planets and stars.
|
|
26
|
+
*/
|
|
27
|
+
export interface BaseBody {
|
|
28
|
+
id: number;
|
|
29
|
+
id64: Id64 | null;
|
|
30
|
+
bodyId: number | null;
|
|
31
|
+
systemId: number;
|
|
32
|
+
systemId64: Id64;
|
|
33
|
+
systemName: string;
|
|
34
|
+
name: string;
|
|
35
|
+
discovery?: {
|
|
36
|
+
commander: string;
|
|
37
|
+
date: string;
|
|
38
|
+
};
|
|
39
|
+
subType: string;
|
|
40
|
+
parents: null | Array<{
|
|
41
|
+
Star: number;
|
|
42
|
+
} | {
|
|
43
|
+
Planet: number;
|
|
44
|
+
} | {
|
|
45
|
+
Null: number;
|
|
46
|
+
}>;
|
|
47
|
+
distanceToArrival: number;
|
|
48
|
+
surfaceTemperature: number;
|
|
49
|
+
orbitalPeriod: number | null;
|
|
50
|
+
semiMajorAxis: number | null;
|
|
51
|
+
orbitalEccentricity: number | null;
|
|
52
|
+
orbitalInclination: number | null;
|
|
53
|
+
argOfPeriapsis: number | null;
|
|
54
|
+
rotationalPeriod: number | null;
|
|
55
|
+
rotationalPeriodTidallyLocked: boolean;
|
|
56
|
+
axialTilt: number | null;
|
|
57
|
+
rings?: Asteroids[];
|
|
58
|
+
reserveLevel?: string | null;
|
|
59
|
+
belts?: Asteroids[];
|
|
60
|
+
updateTime: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* EDSM star data.
|
|
64
|
+
*/
|
|
65
|
+
export interface Star extends BaseBody {
|
|
66
|
+
type: "Star";
|
|
67
|
+
isMainStar?: boolean;
|
|
68
|
+
isScoopable?: boolean;
|
|
69
|
+
age: number;
|
|
70
|
+
spectralClass: string | null;
|
|
71
|
+
luminosity: string | null;
|
|
72
|
+
absoluteMagnitude: number;
|
|
73
|
+
solarMasses: number;
|
|
74
|
+
solarRadius: number;
|
|
75
|
+
surfaceTemperature: number;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* EDSM planet data.
|
|
79
|
+
*/
|
|
80
|
+
export interface Planet extends BaseBody {
|
|
81
|
+
type: "Planet";
|
|
82
|
+
isLandable: boolean;
|
|
83
|
+
gravity: number;
|
|
84
|
+
earthMasses: number;
|
|
85
|
+
radius: number;
|
|
86
|
+
surfacePressure: number | null;
|
|
87
|
+
volcanismType: string | null;
|
|
88
|
+
atmosphereType: string | null;
|
|
89
|
+
atmosphereComposition: AtmosphereComposition | null;
|
|
90
|
+
solidComposition: SolidComposition | null;
|
|
91
|
+
terraformingState: string | null;
|
|
92
|
+
materials?: Materials;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Union type for EDSM star and planet data.
|
|
96
|
+
*/
|
|
97
|
+
export type Body = Planet | Star;
|
|
98
|
+
export type SystemStar = Omit<Star, "systemId" | "systemId64" | "systemName">;
|
|
99
|
+
export type SystemPlanet = Omit<Planet, "systemId" | "systemId64" | "systemName">;
|
|
100
|
+
/**
|
|
101
|
+
* Body within a system (without system information because its already in the parent object)
|
|
102
|
+
*/
|
|
103
|
+
export type SystemBody = SystemStar | SystemPlanet;
|
|
104
|
+
export declare function isPlanet(body: Body): body is Planet;
|
|
105
|
+
export declare function isPlanet(body: SystemBody): body is SystemPlanet;
|
|
106
|
+
export declare function isStar(body: Body): body is Star;
|
|
107
|
+
export declare function isStar(body: SystemBody): body is SystemStar;
|
|
108
|
+
/** List of EDSM bodies. */
|
|
109
|
+
export type Bodies = Body[];
|
|
110
|
+
/**
|
|
111
|
+
* Parses bodies from the given JSON stream.
|
|
112
|
+
*
|
|
113
|
+
* @param stream - The JSON input stream.
|
|
114
|
+
* @returns Stream of bodies.
|
|
115
|
+
*/
|
|
116
|
+
export declare function parseBodiesJSON(stream: AsyncIterable<Uint8Array>): AsyncIterable<Body>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2018 Klaus Reimer <k@ailis.de>
|
|
3
|
+
* See LICENSE.md for licensing information.
|
|
4
|
+
*/
|
|
5
|
+
import { parseJSONArray } from "./util.js";
|
|
6
|
+
/**
|
|
7
|
+
* Checks if given body is a planet.
|
|
8
|
+
*
|
|
9
|
+
* @param body - The body to check.
|
|
10
|
+
* @returns True if body is a planet.
|
|
11
|
+
*/
|
|
12
|
+
export function isPlanet(body) {
|
|
13
|
+
return body.type === "Planet";
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Checks if given body is a planet.
|
|
17
|
+
*
|
|
18
|
+
* @param body - The body to check.
|
|
19
|
+
* @returns True if body is a star.
|
|
20
|
+
*/
|
|
21
|
+
export function isStar(body) {
|
|
22
|
+
return body.type === "Star";
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Parses bodies from the given JSON stream.
|
|
26
|
+
*
|
|
27
|
+
* @param stream - The JSON input stream.
|
|
28
|
+
* @returns Stream of bodies.
|
|
29
|
+
*/
|
|
30
|
+
export function parseBodiesJSON(stream) {
|
|
31
|
+
return parseJSONArray(stream);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=bodies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bodies.js","sourceRoot":"","sources":["../../src/main/bodies.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAgH3C;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAuB;IAC5C,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC;AAClC,CAAC;AAKD;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,IAAuB;IAC1C,OAAO,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC;AAChC,CAAC;AAKD;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,MAAiC;IAC7D,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Id64 } from "./common.ts";
|
|
2
|
+
/** Single EDSM codex. */
|
|
3
|
+
export interface Codex {
|
|
4
|
+
systemId: number;
|
|
5
|
+
systemId64: Id64;
|
|
6
|
+
systemName: string;
|
|
7
|
+
region: string;
|
|
8
|
+
type: string | null;
|
|
9
|
+
name: string | number;
|
|
10
|
+
reportedOn: string;
|
|
11
|
+
}
|
|
12
|
+
/** List of EDSM codices. */
|
|
13
|
+
export type Codices = Codex[];
|
|
14
|
+
/**
|
|
15
|
+
* Parses codices from the given JSON stream.
|
|
16
|
+
*
|
|
17
|
+
* @param stream - The JSON input stream.
|
|
18
|
+
* @returns Stream of codices.
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseCodexJSON(stream: AsyncIterable<Uint8Array>): AsyncIterable<Codex>;
|
|
@@ -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 codices from the given JSON stream.
|
|
8
|
+
*
|
|
9
|
+
* @param stream - The JSON input stream.
|
|
10
|
+
* @returns Stream of codices.
|
|
11
|
+
*/
|
|
12
|
+
export function parseCodexJSON(stream) {
|
|
13
|
+
return parseJSONArray(stream);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=codex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../../src/main/codex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAgB3C;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,MAAiC;IAC5D,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Coordinates {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
z: number;
|
|
5
|
+
}
|
|
6
|
+
/** 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
|
+
export type Id64 = number | bigint;
|
|
8
|
+
/**
|
|
9
|
+
* Converts the given date to a UTC date string as expected by the EDSM REST API.
|
|
10
|
+
*
|
|
11
|
+
* @param date - The date to convert.
|
|
12
|
+
* @returns The date as an EDSM-compatible UTC date string.
|
|
13
|
+
*/
|
|
14
|
+
export declare function toUTCString(date: Date): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2020 Klaus Reimer <k@ailis.de>
|
|
3
|
+
* See LICENSE.md for licensing information.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Converts the given date to a UTC date string as expected by the EDSM REST API.
|
|
7
|
+
*
|
|
8
|
+
* @param date - The date to convert.
|
|
9
|
+
* @returns The date as an EDSM-compatible UTC date string.
|
|
10
|
+
*/
|
|
11
|
+
export function toUTCString(date) {
|
|
12
|
+
const year = date.getUTCFullYear().toString().padStart(4, "0");
|
|
13
|
+
const month = (date.getUTCMonth() + 1).toString().padStart(2, "0");
|
|
14
|
+
const day = date.getUTCDate().toString().padStart(2, "0");
|
|
15
|
+
const hour = date.getUTCHours().toString().padStart(2, "0");
|
|
16
|
+
const minute = date.getUTCMinutes().toString().padStart(2, "0");
|
|
17
|
+
const second = date.getUTCSeconds().toString().padStart(2, "0");
|
|
18
|
+
return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/main/common.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,IAAU;IAClC,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC/D,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACnE,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC1D,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAChE,OAAO,GAAG,IAAI,IAAI,KAAK,IAAI,GAAG,IAAI,IAAI,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { type CommanderCreditsResponse, type CommanderInventoryResponse, type CommanderRanksResponse, type CreditsPeriod, getCommanderCredits, getCommanderInventory, getCommanderRanks, type InventoryType } from "./api/commander.ts";
|
|
2
|
+
export { APIException, ServerException, type SystemIdRequestOptions } from "./api/common.ts";
|
|
3
|
+
export { type EDSMEvent, type EventResponse, getDiscardEvents, sendEvents } from "./api/journal.ts";
|
|
4
|
+
export { type CommanderPositionOptions, type CommanderPositionResponse, type FlightLog, type FlightLogFilter, type FlightLogsResponse, getCommanderPosition, getFlightLogs, getSystemComment, getSystemComments, setSystemComment, type SystemCommentResponse, type SystemCommentsOptions, type SystemCommentsResponse } from "./api/logs.ts";
|
|
5
|
+
export { type EliteServerStatusResponse, type EliteServerStatusType, getEliteServerStatus } from "./api/status.ts";
|
|
6
|
+
export { type BodyScanValue, getStationMarket, getStationOutfitting, getStationShipyard, getSystemBodies, getSystemDeaths, getSystemEstimatedValue, getSystemFactions, getSystemStations, getSystemTraffic, type ShortSystemFaction, type StationMarketResponse, type StationOutfittingResponse, type StationShipyardResponse, type SystemBodiesResponse, type SystemDeathsResponse, type SystemEstimatedValueResponse, type SystemFaction, type SystemFactionsOptions, type SystemFactionsResponse, type SystemStationsResponse, type SystemTrafficResponse } from "./api/system.ts";
|
|
7
|
+
export { type CubeSystemsRequestOptions, getCubeSystems, getSphereSystems, getSystem, getSystems, type SphereSystemsRequestOptions, type SystemRequestFlags, type SystemRequestOptions, type SystemResponse, type SystemsRequestOptions } from "./api/systems.ts";
|
|
8
|
+
export { type Asteroids, type AtmosphereComposition, type Bodies, type Body, isPlanet, isStar, type Materials, parseBodiesJSON, type Planet, type SolidComposition, type Star, type SystemBody, type SystemPlanet, type SystemStar } from "./bodies.ts";
|
|
9
|
+
export { type Codex, type Codices, parseCodexJSON } from "./codex.ts";
|
|
10
|
+
export { type Coordinates, type Id64, toUTCString } from "./common.ts";
|
|
11
|
+
export { parsePowerPlayJSON, type PowerPlay, type PowerPlays } from "./powerplay.ts";
|
|
12
|
+
export { type Commodity, type Outfitting, parseStationsJSON, type Ship, type Station, type StationBody, type StationControllingFaction, type Stations, type StationUpdateTime, type SystemStation } from "./stations.ts";
|
|
13
|
+
export { type ControllingFaction, type EstimatedCoordinates, type Faction, parseSystemsJSON, type State, type System, type Systems, type TrendState } from "./systems.ts";
|
|
14
|
+
export { IllegalStateException, NotFoundException } from "./util.ts";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2020 Klaus Reimer <k@ailis.de>
|
|
3
|
+
* See LICENSE.md for licensing information.
|
|
4
|
+
*/
|
|
5
|
+
export { getCommanderCredits, getCommanderInventory, getCommanderRanks } from "./api/commander.js";
|
|
6
|
+
export { APIException, ServerException } from "./api/common.js";
|
|
7
|
+
export { getDiscardEvents, sendEvents } from "./api/journal.js";
|
|
8
|
+
export { getCommanderPosition, getFlightLogs, getSystemComment, getSystemComments, setSystemComment } from "./api/logs.js";
|
|
9
|
+
export { getEliteServerStatus } from "./api/status.js";
|
|
10
|
+
export { getStationMarket, getStationOutfitting, getStationShipyard, getSystemBodies, getSystemDeaths, getSystemEstimatedValue, getSystemFactions, getSystemStations, getSystemTraffic } from "./api/system.js";
|
|
11
|
+
export { getCubeSystems, getSphereSystems, getSystem, getSystems } from "./api/systems.js";
|
|
12
|
+
export { isPlanet, isStar, parseBodiesJSON } from "./bodies.js";
|
|
13
|
+
export { parseCodexJSON } from "./codex.js";
|
|
14
|
+
export { toUTCString } from "./common.js";
|
|
15
|
+
export { parsePowerPlayJSON } from "./powerplay.js";
|
|
16
|
+
export { parseStationsJSON } from "./stations.js";
|
|
17
|
+
export { parseSystemsJSON } from "./systems.js";
|
|
18
|
+
export { IllegalStateException, NotFoundException } from "./util.js";
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/main/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAC8G,mBAAmB,EAAE,qBAAqB,EAC3J,iBAAiB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,eAAe,EAA+B,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAAsC,gBAAgB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACpG,OAAO,EACuH,oBAAoB,EAC9I,aAAa,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAEvE,MAAM,eAAe,CAAC;AACvB,OAAO,EAA8D,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACnH,OAAO,EACiB,gBAAgB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,eAAe,EAAE,eAAe,EAAE,uBAAuB,EACzI,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAGzD,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAC6B,cAAc,EAAE,gBAAgB,EAAE,SAAS,EAAE,UAAU,EAE1F,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACiE,QAAQ,EAAE,MAAM,EAAkB,eAAe,EAExH,MAAM,aAAa,CAAC;AACrB,OAAO,EAA4B,cAAc,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAA+B,WAAW,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAmC,MAAM,gBAAgB,CAAC;AACrF,OAAO,EAC8B,iBAAiB,EAErD,MAAM,eAAe,CAAC;AACvB,OAAO,EAC+D,gBAAgB,EACrF,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Coordinates, Id64 } from "./common.ts";
|
|
2
|
+
/** Single EDSM power play information. */
|
|
3
|
+
export interface PowerPlay {
|
|
4
|
+
power: string;
|
|
5
|
+
powerState: string;
|
|
6
|
+
id: number;
|
|
7
|
+
id64: Id64;
|
|
8
|
+
name: string;
|
|
9
|
+
coords: Coordinates;
|
|
10
|
+
allegiance: string | null;
|
|
11
|
+
government: string | null;
|
|
12
|
+
state: string | null;
|
|
13
|
+
date: string;
|
|
14
|
+
}
|
|
15
|
+
/** List of EDSM power play information. */
|
|
16
|
+
export type PowerPlays = PowerPlay[];
|
|
17
|
+
/**
|
|
18
|
+
* Parses power play information from the given JSON stream.
|
|
19
|
+
*
|
|
20
|
+
* @param stream - The JSON input stream.
|
|
21
|
+
* @returns Stream of power play information.
|
|
22
|
+
*/
|
|
23
|
+
export declare function parsePowerPlayJSON(stream: AsyncIterable<Uint8Array>): AsyncIterable<PowerPlay>;
|
|
@@ -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 power play information from the given JSON stream.
|
|
8
|
+
*
|
|
9
|
+
* @param stream - The JSON input stream.
|
|
10
|
+
* @returns Stream of power play information.
|
|
11
|
+
*/
|
|
12
|
+
export function parsePowerPlayJSON(stream) {
|
|
13
|
+
return parseJSONArray(stream);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=powerplay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"powerplay.js","sourceRoot":"","sources":["../../src/main/powerplay.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAmB3C;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAiC;IAChE,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC"}
|