@headwindsimulations/api-client 1.0.0 → 1.1.1
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/dist/apis/telex.d.ts +2 -0
- package/dist/index.esm.js +2 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/apis/telex.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare class TelexConnection {
|
|
|
12
12
|
heading: number;
|
|
13
13
|
freetextEnabled: boolean;
|
|
14
14
|
aircraftType: string;
|
|
15
|
+
airline: string;
|
|
15
16
|
origin: string;
|
|
16
17
|
destination: string;
|
|
17
18
|
}
|
|
@@ -45,6 +46,7 @@ export declare class AircraftStatus {
|
|
|
45
46
|
freetextEnabled: boolean;
|
|
46
47
|
flight: string;
|
|
47
48
|
aircraftType: string;
|
|
49
|
+
airline: string;
|
|
48
50
|
}
|
|
49
51
|
export declare class Paginated<T> {
|
|
50
52
|
results: T[];
|
package/dist/index.esm.js
CHANGED
|
@@ -428,6 +428,7 @@ var Telex = /** @class */ (function () {
|
|
|
428
428
|
freetextEnabled: status.freetextEnabled,
|
|
429
429
|
flight: status.flight,
|
|
430
430
|
aircraftType: status.aircraftType,
|
|
431
|
+
airline: status.airline
|
|
431
432
|
};
|
|
432
433
|
};
|
|
433
434
|
Telex.buildToken = function () {
|
|
@@ -466,7 +467,7 @@ var Hoppie = /** @class */ (function () {
|
|
|
466
467
|
var NXApi = /** @class */ (function () {
|
|
467
468
|
function NXApi() {
|
|
468
469
|
}
|
|
469
|
-
NXApi.url = new URL('https://api.
|
|
470
|
+
NXApi.url = new URL('https://api.headwindsim.net');
|
|
470
471
|
return NXApi;
|
|
471
472
|
}());
|
|
472
473
|
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/utils/index.ts","../src/apis/airport.ts","../src/apis/atc.ts","../src/apis/atis.ts","../src/apis/charts.ts","../src/apis/git-versions.ts","../src/apis/gnss.ts","../src/apis/metar.ts","../src/apis/taf.ts","../src/apis/telex.ts","../src/apis/Hoppie.ts","../src/index.ts"],"sourcesContent":["import axios from 'axios';\n\nexport function get<T>(url: URL, headers?: any): Promise<T> {\n return axios.get<T>(url.href, { headers })\n .then((res) => res.data);\n}\n\nexport function del(url: URL, headers?: any): Promise<void> {\n return axios.delete(url.href, { headers })\n .then((res) => res.data);\n}\n\nexport function post<T>(url: URL, body: any, headers?: any): Promise<T> {\n const headersToSend = {\n 'Content-Type': 'application/json',\n ...headers,\n };\n\n return axios.post<T>(url.href, body, { headers: headersToSend })\n .then((res) => res.data);\n}\n\nexport function put<T>(url: URL, body: any, headers?: any): Promise<T> {\n const headersToSend = {\n 'Content-Type': 'application/json',\n ...headers,\n };\n\n return axios.put<T>(url.href, body, { headers: headersToSend })\n .then((res) => res.data);\n}\n","import { NXApi } from '../index';\nimport { get, post } from '../utils';\n\nexport declare class AirportResponse {\n icao: string;\n\n iata: string;\n\n type: string;\n\n name: string;\n\n lat: number;\n\n lon: number;\n\n elevation: number;\n\n continent: string;\n\n country: string;\n\n transAlt: number;\n}\n\nexport class Airport {\n public static get(icao: string): Promise<AirportResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n return get<AirportResponse>(new URL(`/api/v1/airport/${icao}`, NXApi.url));\n }\n\n public static getBatch(icaos: string[]): Promise<AirportResponse[]> {\n if (!icaos) {\n throw new Error('No ICAOs provided');\n }\n\n return post<AirportResponse[]>(new URL('/api/v1/airport/_batch', NXApi.url), { icaos });\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport enum AtcType {\n UNKNOWN,\n DELIVERY,\n GROUND,\n TOWER,\n DEPARTURE,\n APPROACH,\n RADAR,\n ATIS\n}\n\nexport declare class ATCInfo {\n callsign: string;\n\n frequency: string;\n\n visualRange: number;\n\n textAtis: string[];\n\n type: AtcType;\n\n latitude?: number;\n\n longitude?: number;\n}\n\nexport class ATC {\n public static async get(source: string): Promise<ATCInfo[]> {\n if (!source) {\n throw new Error('No source provided');\n }\n\n const url = new URL(`/api/v1/atc?source=${source}`, NXApi.url);\n return get<ATCInfo[]>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class AtisResponse {\n icao: string;\n\n source: string;\n\n combined?: string;\n\n arr?: string;\n\n dep?: string;\n}\n\nexport class Atis {\n public static async get(icao: string, source?: string): Promise<AtisResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n const url = new URL(`/atis/${icao}`, NXApi.url);\n if (source) {\n url.searchParams.set('source', source);\n }\n\n return get<AtisResponse>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class Chart {\n url: string;\n\n name: string;\n}\n\nexport declare class ChartsResponse {\n icao: string;\n\n charts?: Chart[];\n}\n\nexport class Charts {\n public static async get(icao: string): Promise<ChartsResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n const url = new URL(`/api/v1/charts/${icao}`, NXApi.url);\n\n return get<ChartsResponse>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class CommitInfo {\n sha: string;\n\n shortSha: string;\n\n timestamp: Date;\n}\n\nexport declare class ReleaseInfo {\n name: string;\n\n isPreRelease: boolean;\n\n publishedAt: Date;\n\n htmlUrl: string;\n\n body: string;\n}\n\nexport declare class PullLabel {\n id: string;\n\n name: string;\n\n color: string;\n}\n\nexport declare class PullInfo {\n number: number;\n\n title: string;\n\n author: string;\n\n labels: PullLabel[];\n\n isDraft: boolean;\n}\n\nexport declare class ArtifactInfo {\n artifactUrl: string;\n}\n\nexport class GitVersions {\n public static async getNewestCommit(user: string, repo: string, branch: string): Promise<CommitInfo> {\n if (!user || !repo || !branch) {\n throw new Error('Missing argument');\n }\n\n return get<CommitInfo>(new URL(`/api/v1/git-versions/${user}/${repo}/branches/${branch}`, NXApi.url))\n .then((res: CommitInfo) => ({\n ...res,\n timestamp: new Date(res.timestamp),\n }));\n }\n\n public static async getReleases(user: string, repo: string, includePreReleases?: boolean, skip?: number, take?: number): Promise<ReleaseInfo[]> {\n if (!user || !repo) {\n throw new Error('Missing argument');\n }\n\n if (skip < 0 || take < 0) {\n throw new Error(\"skip or take cannot be negative\");\n }\n\n const takePreReleasesArg = `?includePreReleases=${includePreReleases === true}`;\n const skipArg = skip !== undefined ? `&skip=` + skip : \"\";\n const takeArg = take !== undefined ? `&take=` + take : \"\";\n\n return get<ReleaseInfo[]>(\n new URL(`/api/v1/git-versions/${user}/${repo}/releases${takePreReleasesArg}${skipArg}${takeArg}`, NXApi.url),\n )\n .then((res) => res.map((rel) => ({\n ...rel,\n publishedAt: new Date(rel.publishedAt),\n })));\n }\n\n public static async getPulls(user: string, repo: string): Promise<PullInfo[]> {\n if (!user || !repo) {\n throw new Error('Missing argument');\n }\n\n return get<PullInfo[]>(new URL(`/api/v1/git-versions/${user}/${repo}/pulls`, NXApi.url));\n }\n\n public static async getArtifact(user: string, repo: string, pull: string): Promise<ArtifactInfo> {\n if (!user || !repo || !pull) {\n throw new Error('Missing argument');\n }\n\n return get<ArtifactInfo>(new URL(`/api/v1/git-versions/${user}/${repo}/pulls/${pull}/artifact`, NXApi.url));\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class GNSSResponse {\n name: string;\n\n id: string;\n\n epoch: Date;\n\n meanMotion: number;\n\n eccentricity: number;\n\n inclination: number;\n\n raOfAscNode: number;\n\n argOfPericenter: number;\n\n meanAnomaly: number;\n\n ephemerisType: number;\n\n classificationType: string;\n\n noradCatId: number;\n\n elementSetNo: number;\n\n revAtEpoch: number;\n\n bstar: number;\n\n meanMotionDot: number;\n\n meanMotionDdot: number;\n}\n\nexport class GNSS {\n public static get(): Promise<GNSSResponse[]> {\n const url = new URL('/api/v1/gnss', NXApi.url);\n\n return get<GNSSResponse[]>(url)\n .then((res) => res.map(GNSS.mapResult));\n }\n\n private static mapResult(response: GNSSResponse): GNSSResponse {\n return {\n ...response,\n epoch: new Date(response.epoch),\n };\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class MetarResponse {\n icao: string;\n\n source: string;\n\n metar: string;\n}\n\nexport class Metar {\n public static async get(icao: string, source?: string): Promise<MetarResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n const url = new URL(`/metar/${icao}`, NXApi.url);\n if (source) {\n url.searchParams.set('source', source);\n }\n\n return get<MetarResponse>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class TafResponse {\n icao: string;\n\n source: string;\n\n taf: string;\n}\n\nexport class Taf {\n public static async get(icao: string, source?: string): Promise<TafResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n const url = new URL(`/taf/${icao}`, NXApi.url);\n if (source) {\n url.searchParams.set('source', source);\n }\n\n return get<TafResponse>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { del, get, post, put } from '../utils';\n\nexport declare class TelexConnection {\n id: string;\n\n isActive: boolean;\n\n firstContact: Date;\n\n lastContact: Date;\n\n flight: string;\n\n location: {\n x: number;\n y: number;\n };\n\n trueAltitude: number;\n\n heading: number;\n\n freetextEnabled: boolean;\n\n aircraftType: string;\n\n origin: string;\n\n destination: string;\n}\n\nexport declare class SearchResult<T> {\n fullMatch?: T;\n\n matches: T[];\n}\n\nexport declare class TelexMessage {\n id: string;\n\n createdAt: Date;\n\n received: boolean;\n\n message: string;\n\n isProfane: boolean;\n\n from: TelexConnection;\n\n to?: TelexConnection;\n}\n\nexport declare class Token {\n accessToken: string;\n\n connection: string;\n\n flight: string;\n}\n\nexport declare class AircraftStatus {\n location: {\n long: number;\n lat: number;\n };\n\n trueAltitude: number;\n\n heading: number;\n\n origin: string;\n\n destination: string;\n\n freetextEnabled: boolean;\n\n flight: string;\n\n aircraftType: string;\n}\n\nexport declare class Paginated<T> {\n results: T[];\n\n count: number;\n\n total: number;\n}\n\nexport declare class Bounds {\n north: number;\n\n east: number;\n\n south: number;\n\n west: number;\n}\n\nexport declare type StageCallback = (flights: TelexConnection[]) => void;\n\nexport class TelexNotConnectedError extends Error {\n constructor() {\n super('TELEX is not connected');\n }\n}\n\nexport class Telex {\n private static accessToken: string;\n\n public static connect(status: AircraftStatus): Promise<Token> {\n return post<Token>(new URL('/txcxn', NXApi.url), Telex.buildBody(status))\n .then((res) => {\n Telex.accessToken = res.accessToken;\n return res;\n });\n }\n\n public static async update(status: AircraftStatus): Promise<TelexConnection> {\n Telex.connectionOrThrow();\n\n return put<TelexConnection>(new URL('/txcxn', NXApi.url), Telex.buildBody(status), { Authorization: Telex.buildToken() })\n .then(Telex.mapConnection);\n }\n\n public static async disconnect(): Promise<void> {\n Telex.connectionOrThrow();\n\n return del(new URL('/txcxn', NXApi.url), { Authorization: Telex.buildToken() })\n .then(() => {\n Telex.accessToken = '';\n });\n }\n\n public static async sendMessage(recipientFlight: string, message: string): Promise<TelexMessage> {\n Telex.connectionOrThrow();\n\n return post<TelexMessage>(new URL('/txmsg', NXApi.url), {\n to: recipientFlight,\n message,\n }, { Authorization: Telex.buildToken() })\n .then(Telex.mapMessage);\n }\n\n public static async fetchMessages(): Promise<TelexMessage[]> {\n Telex.connectionOrThrow();\n\n return get<TelexMessage[]>(new URL('/txmsg', NXApi.url), { Authorization: Telex.buildToken() })\n .then((res) => res.map(Telex.mapMessage));\n }\n\n public static fetchConnections(skip?: number, take?: number, bounds?: Bounds): Promise<Paginated<TelexConnection>> {\n const url = new URL('/txcxn', NXApi.url);\n if (skip) {\n url.searchParams.set('skip', skip.toString());\n }\n if (take) {\n url.searchParams.append('take', take.toString());\n }\n if (bounds) {\n url.searchParams.append('north', bounds.north.toString());\n url.searchParams.append('east', bounds.east.toString());\n url.searchParams.append('south', bounds.south.toString());\n url.searchParams.append('west', bounds.west.toString());\n }\n\n return get<Paginated<TelexConnection>>(url)\n .then((res) => ({\n ...res,\n results: res.results.map(Telex.mapConnection),\n }));\n }\n\n public static async fetchAllConnections(bounds?: Bounds, stageCallback?: StageCallback): Promise<TelexConnection[]> {\n let flights: TelexConnection[] = [];\n let skip = 0;\n let total = 0;\n\n do {\n const data = await Telex.fetchConnections(skip, 100, bounds);\n\n total = data.total;\n skip += data.count;\n flights = flights.concat(data.results);\n\n if (stageCallback) {\n stageCallback(flights);\n }\n }\n while (total > skip);\n\n return flights;\n }\n\n public static fetchConnection(id: string): Promise<TelexConnection> {\n return get<TelexConnection>(new URL(`/txcxn/${id}`, NXApi.url))\n .then(Telex.mapConnection);\n }\n\n public static findConnections(flightNumber: string): Promise<SearchResult<TelexConnection>> {\n const url = new URL('/txcxn/_find', NXApi.url);\n url.searchParams.set('flight', flightNumber);\n\n return get<SearchResult<TelexConnection>>(url)\n .then((res) => ({\n matches: res.matches.map(Telex.mapConnection),\n fullMatch: res.fullMatch ? Telex.mapConnection(res.fullMatch) : undefined,\n }));\n }\n\n public static countConnections(): Promise<number> {\n return get<number>(new URL('/txcxn/_count', NXApi.url));\n }\n\n private static buildBody(status: AircraftStatus) {\n return {\n location: {\n x: status.location.long,\n y: status.location.lat,\n },\n trueAltitude: status.trueAltitude,\n heading: status.heading,\n origin: status.origin,\n destination: status.destination,\n freetextEnabled: status.freetextEnabled,\n flight: status.flight,\n aircraftType: status.aircraftType,\n };\n }\n\n private static buildToken(): string {\n return `Bearer ${Telex.accessToken}`;\n }\n\n private static connectionOrThrow() {\n if (!Telex.accessToken) {\n throw new TelexNotConnectedError();\n }\n }\n\n private static mapConnection(connection: TelexConnection): TelexConnection {\n return {\n ...connection,\n firstContact: new Date(connection.firstContact),\n lastContact: new Date(connection.lastContact),\n };\n }\n\n private static mapMessage(message: TelexMessage): TelexMessage {\n const msg: TelexMessage = {\n ...message,\n createdAt: new Date(message.createdAt),\n };\n\n if (message.from) {\n msg.from = Telex.mapConnection(message.from);\n }\n\n if (message.to) {\n msg.to = Telex.mapConnection(message.to);\n }\n\n return msg;\n }\n}\n","import { NXApi } from '../index';\nimport { post } from '../utils';\n\nexport declare class HoppieResponse {\n response: string;\n}\n\nexport class Hoppie {\n public static sendRequest(body: any): Promise<HoppieResponse> {\n return post<HoppieResponse>(new URL('/api/v1/hoppie', NXApi.url), body);\n }\n}\n","export class NXApi {\n public static url = new URL('https://api.flybywiresim.com');\n}\n\nexport * from './apis';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAEgB,GAAG,CAAI,GAAQ,EAAE,OAAa;IAC1C,OAAO,KAAK,CAAC,GAAG,CAAI,GAAG,CAAC,IAAI,EAAE,EAAE,OAAO,SAAA,EAAE,CAAC;SACrC,IAAI,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,CAAC,IAAI,GAAA,CAAC,CAAC;AACjC,CAAC;SAEe,GAAG,CAAC,GAAQ,EAAE,OAAa;IACvC,OAAO,KAAK,CAAC,QAAM,CAAA,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,OAAO,SAAA,EAAE,CAAC;SACrC,IAAI,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,CAAC,IAAI,GAAA,CAAC,CAAC;AACjC,CAAC;SAEe,IAAI,CAAI,GAAQ,EAAE,IAAS,EAAE,OAAa;IACtD,IAAM,aAAa,cACf,cAAc,EAAE,kBAAkB,IAC/B,OAAO,CACb,CAAC;IAEF,OAAO,KAAK,CAAC,IAAI,CAAI,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;SAC3D,IAAI,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,CAAC,IAAI,GAAA,CAAC,CAAC;AACjC,CAAC;SAEe,GAAG,CAAI,GAAQ,EAAE,IAAS,EAAE,OAAa;IACrD,IAAM,aAAa,cACf,cAAc,EAAE,kBAAkB,IAC/B,OAAO,CACb,CAAC;IAEF,OAAO,K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AAE,CAAC;SACtC;KACJ;IAEc,mBAAa,GAA5B,UAA6B,UAA2B;QACpD,6BACO,UAAU,KACb,YAAY,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAC/C,WAAW,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAC/C;KACL;IAEc,gBAAU,GAAzB,UAA0B,OAAqB;QAC3C,IAAM,GAAG,yBACF,OAAO,KACV,SAAS,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GACzC,CAAC;QAEF,IAAI,OAAO,CAAC,IAAI,EAAE;YACd,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAChD;QAED,IAAI,OAAO,CAAC,EAAE,EAAE;YACZ,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;SAC5C;QAED,OAAO,GAAG,CAAC;KACd;IACL,YAAC;AAAD,CAAC;;;ICnQD;KAIC;IAHiB,kBAAW,GAAzB,UAA0B,IAAS;QAC/B,OAAO,IAAI,CAAiB,IAAI,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;KAC3E;IACL,aAAC;AAAD,CAAC;;;ICXD;KAEC;IADiB,SAAG,GAAG,IAAI,GAAG,CAAC,8BAA8B,CAAC,CAAC;IAChE,YAAC;CAFD;;;;"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/utils/index.ts","../src/apis/airport.ts","../src/apis/atc.ts","../src/apis/atis.ts","../src/apis/charts.ts","../src/apis/git-versions.ts","../src/apis/gnss.ts","../src/apis/metar.ts","../src/apis/taf.ts","../src/apis/telex.ts","../src/apis/Hoppie.ts","../src/index.ts"],"sourcesContent":["import axios from 'axios';\n\nexport function get<T>(url: URL, headers?: any): Promise<T> {\n return axios.get<T>(url.href, { headers })\n .then((res) => res.data);\n}\n\nexport function del(url: URL, headers?: any): Promise<void> {\n return axios.delete(url.href, { headers })\n .then((res) => res.data);\n}\n\nexport function post<T>(url: URL, body: any, headers?: any): Promise<T> {\n const headersToSend = {\n 'Content-Type': 'application/json',\n ...headers,\n };\n\n return axios.post<T>(url.href, body, { headers: headersToSend })\n .then((res) => res.data);\n}\n\nexport function put<T>(url: URL, body: any, headers?: any): Promise<T> {\n const headersToSend = {\n 'Content-Type': 'application/json',\n ...headers,\n };\n\n return axios.put<T>(url.href, body, { headers: headersToSend })\n .then((res) => res.data);\n}\n","import { NXApi } from '../index';\nimport { get, post } from '../utils';\n\nexport declare class AirportResponse {\n icao: string;\n\n iata: string;\n\n type: string;\n\n name: string;\n\n lat: number;\n\n lon: number;\n\n elevation: number;\n\n continent: string;\n\n country: string;\n\n transAlt: number;\n}\n\nexport class Airport {\n public static get(icao: string): Promise<AirportResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n return get<AirportResponse>(new URL(`/api/v1/airport/${icao}`, NXApi.url));\n }\n\n public static getBatch(icaos: string[]): Promise<AirportResponse[]> {\n if (!icaos) {\n throw new Error('No ICAOs provided');\n }\n\n return post<AirportResponse[]>(new URL('/api/v1/airport/_batch', NXApi.url), { icaos });\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport enum AtcType {\n UNKNOWN,\n DELIVERY,\n GROUND,\n TOWER,\n DEPARTURE,\n APPROACH,\n RADAR,\n ATIS\n}\n\nexport declare class ATCInfo {\n callsign: string;\n\n frequency: string;\n\n visualRange: number;\n\n textAtis: string[];\n\n type: AtcType;\n\n latitude?: number;\n\n longitude?: number;\n}\n\nexport class ATC {\n public static async get(source: string): Promise<ATCInfo[]> {\n if (!source) {\n throw new Error('No source provided');\n }\n\n const url = new URL(`/api/v1/atc?source=${source}`, NXApi.url);\n return get<ATCInfo[]>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class AtisResponse {\n icao: string;\n\n source: string;\n\n combined?: string;\n\n arr?: string;\n\n dep?: string;\n}\n\nexport class Atis {\n public static async get(icao: string, source?: string): Promise<AtisResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n const url = new URL(`/atis/${icao}`, NXApi.url);\n if (source) {\n url.searchParams.set('source', source);\n }\n\n return get<AtisResponse>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class Chart {\n url: string;\n\n name: string;\n}\n\nexport declare class ChartsResponse {\n icao: string;\n\n charts?: Chart[];\n}\n\nexport class Charts {\n public static async get(icao: string): Promise<ChartsResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n const url = new URL(`/api/v1/charts/${icao}`, NXApi.url);\n\n return get<ChartsResponse>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class CommitInfo {\n sha: string;\n\n shortSha: string;\n\n timestamp: Date;\n}\n\nexport declare class ReleaseInfo {\n name: string;\n\n isPreRelease: boolean;\n\n publishedAt: Date;\n\n htmlUrl: string;\n\n body: string;\n}\n\nexport declare class PullLabel {\n id: string;\n\n name: string;\n\n color: string;\n}\n\nexport declare class PullInfo {\n number: number;\n\n title: string;\n\n author: string;\n\n labels: PullLabel[];\n\n isDraft: boolean;\n}\n\nexport declare class ArtifactInfo {\n artifactUrl: string;\n}\n\nexport class GitVersions {\n public static async getNewestCommit(user: string, repo: string, branch: string): Promise<CommitInfo> {\n if (!user || !repo || !branch) {\n throw new Error('Missing argument');\n }\n\n return get<CommitInfo>(new URL(`/api/v1/git-versions/${user}/${repo}/branches/${branch}`, NXApi.url))\n .then((res: CommitInfo) => ({\n ...res,\n timestamp: new Date(res.timestamp),\n }));\n }\n\n public static async getReleases(user: string, repo: string, includePreReleases?: boolean, skip?: number, take?: number): Promise<ReleaseInfo[]> {\n if (!user || !repo) {\n throw new Error('Missing argument');\n }\n\n if (skip < 0 || take < 0) {\n throw new Error(\"skip or take cannot be negative\");\n }\n\n const takePreReleasesArg = `?includePreReleases=${includePreReleases === true}`;\n const skipArg = skip !== undefined ? `&skip=` + skip : \"\";\n const takeArg = take !== undefined ? `&take=` + take : \"\";\n\n return get<ReleaseInfo[]>(\n new URL(`/api/v1/git-versions/${user}/${repo}/releases${takePreReleasesArg}${skipArg}${takeArg}`, NXApi.url),\n )\n .then((res) => res.map((rel) => ({\n ...rel,\n publishedAt: new Date(rel.publishedAt),\n })));\n }\n\n public static async getPulls(user: string, repo: string): Promise<PullInfo[]> {\n if (!user || !repo) {\n throw new Error('Missing argument');\n }\n\n return get<PullInfo[]>(new URL(`/api/v1/git-versions/${user}/${repo}/pulls`, NXApi.url));\n }\n\n public static async getArtifact(user: string, repo: string, pull: string): Promise<ArtifactInfo> {\n if (!user || !repo || !pull) {\n throw new Error('Missing argument');\n }\n\n return get<ArtifactInfo>(new URL(`/api/v1/git-versions/${user}/${repo}/pulls/${pull}/artifact`, NXApi.url));\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class GNSSResponse {\n name: string;\n\n id: string;\n\n epoch: Date;\n\n meanMotion: number;\n\n eccentricity: number;\n\n inclination: number;\n\n raOfAscNode: number;\n\n argOfPericenter: number;\n\n meanAnomaly: number;\n\n ephemerisType: number;\n\n classificationType: string;\n\n noradCatId: number;\n\n elementSetNo: number;\n\n revAtEpoch: number;\n\n bstar: number;\n\n meanMotionDot: number;\n\n meanMotionDdot: number;\n}\n\nexport class GNSS {\n public static get(): Promise<GNSSResponse[]> {\n const url = new URL('/api/v1/gnss', NXApi.url);\n\n return get<GNSSResponse[]>(url)\n .then((res) => res.map(GNSS.mapResult));\n }\n\n private static mapResult(response: GNSSResponse): GNSSResponse {\n return {\n ...response,\n epoch: new Date(response.epoch),\n };\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class MetarResponse {\n icao: string;\n\n source: string;\n\n metar: string;\n}\n\nexport class Metar {\n public static async get(icao: string, source?: string): Promise<MetarResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n const url = new URL(`/metar/${icao}`, NXApi.url);\n if (source) {\n url.searchParams.set('source', source);\n }\n\n return get<MetarResponse>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class TafResponse {\n icao: string;\n\n source: string;\n\n taf: string;\n}\n\nexport class Taf {\n public static async get(icao: string, source?: string): Promise<TafResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n const url = new URL(`/taf/${icao}`, NXApi.url);\n if (source) {\n url.searchParams.set('source', source);\n }\n\n return get<TafResponse>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { del, get, post, put } from '../utils';\n\nexport declare class TelexConnection {\n id: string;\n\n isActive: boolean;\n\n firstContact: Date;\n\n lastContact: Date;\n\n flight: string;\n\n location: {\n x: number;\n y: number;\n };\n\n trueAltitude: number;\n\n heading: number;\n\n freetextEnabled: boolean;\n\n aircraftType: string;\n \n airline: string;\n\n origin: string;\n\n destination: string;\n}\n\nexport declare class SearchResult<T> {\n fullMatch?: T;\n\n matches: T[];\n}\n\nexport declare class TelexMessage {\n id: string;\n\n createdAt: Date;\n\n received: boolean;\n\n message: string;\n\n isProfane: boolean;\n\n from: TelexConnection;\n\n to?: TelexConnection;\n}\n\nexport declare class Token {\n accessToken: string;\n\n connection: string;\n\n flight: string;\n}\n\nexport declare class AircraftStatus {\n location: {\n long: number;\n lat: number;\n };\n\n trueAltitude: number;\n\n heading: number;\n\n origin: string;\n\n destination: string;\n\n freetextEnabled: boolean;\n\n flight: string;\n\n aircraftType: string;\n \n airline: string;\n}\n\nexport declare class Paginated<T> {\n results: T[];\n\n count: number;\n\n total: number;\n}\n\nexport declare class Bounds {\n north: number;\n\n east: number;\n\n south: number;\n\n west: number;\n}\n\nexport declare type StageCallback = (flights: TelexConnection[]) => void;\n\nexport class TelexNotConnectedError extends Error {\n constructor() {\n super('TELEX is not connected');\n }\n}\n\nexport class Telex {\n private static accessToken: string;\n\n public static connect(status: AircraftStatus): Promise<Token> {\n return post<Token>(new URL('/txcxn', NXApi.url), Telex.buildBody(status))\n .then((res) => {\n Telex.accessToken = res.accessToken;\n return res;\n });\n }\n\n public static async update(status: AircraftStatus): Promise<TelexConnection> {\n Telex.connectionOrThrow();\n\n return put<TelexConnection>(new URL('/txcxn', NXApi.url), Telex.buildBody(status), { Authorization: Telex.buildToken() })\n .then(Telex.mapConnection);\n }\n\n public static async disconnect(): Promise<void> {\n Telex.connectionOrThrow();\n\n return del(new URL('/txcxn', NXApi.url), { Authorization: Telex.buildToken() })\n .then(() => {\n Telex.accessToken = '';\n });\n }\n\n public static async sendMessage(recipientFlight: string, message: string): Promise<TelexMessage> {\n Telex.connectionOrThrow();\n\n return post<TelexMessage>(new URL('/txmsg', NXApi.url), {\n to: recipientFlight,\n message,\n }, { Authorization: Telex.buildToken() })\n .then(Telex.mapMessage);\n }\n\n public static async fetchMessages(): Promise<TelexMessage[]> {\n Telex.connectionOrThrow();\n\n return get<TelexMessage[]>(new URL('/txmsg', NXApi.url), { Authorization: Telex.buildToken() })\n .then((res) => res.map(Telex.mapMessage));\n }\n\n public static fetchConnections(skip?: number, take?: number, bounds?: Bounds): Promise<Paginated<TelexConnection>> {\n const url = new URL('/txcxn', NXApi.url);\n if (skip) {\n url.searchParams.set('skip', skip.toString());\n }\n if (take) {\n url.searchParams.append('take', take.toString());\n }\n if (bounds) {\n url.searchParams.append('north', bounds.north.toString());\n url.searchParams.append('east', bounds.east.toString());\n url.searchParams.append('south', bounds.south.toString());\n url.searchParams.append('west', bounds.west.toString());\n }\n\n return get<Paginated<TelexConnection>>(url)\n .then((res) => ({\n ...res,\n results: res.results.map(Telex.mapConnection),\n }));\n }\n\n public static async fetchAllConnections(bounds?: Bounds, stageCallback?: StageCallback): Promise<TelexConnection[]> {\n let flights: TelexConnection[] = [];\n let skip = 0;\n let total = 0;\n\n do {\n const data = await Telex.fetchConnections(skip, 100, bounds);\n\n total = data.total;\n skip += data.count;\n flights = flights.concat(data.results);\n\n if (stageCallback) {\n stageCallback(flights);\n }\n }\n while (total > skip);\n\n return flights;\n }\n\n public static fetchConnection(id: string): Promise<TelexConnection> {\n return get<TelexConnection>(new URL(`/txcxn/${id}`, NXApi.url))\n .then(Telex.mapConnection);\n }\n\n public static findConnections(flightNumber: string): Promise<SearchResult<TelexConnection>> {\n const url = new URL('/txcxn/_find', NXApi.url);\n url.searchParams.set('flight', flightNumber);\n\n return get<SearchResult<TelexConnection>>(url)\n .then((res) => ({\n matches: res.matches.map(Telex.mapConnection),\n fullMatch: res.fullMatch ? Telex.mapConnection(res.fullMatch) : undefined,\n }));\n }\n\n public static countConnections(): Promise<number> {\n return get<number>(new URL('/txcxn/_count', NXApi.url));\n }\n\n private static buildBody(status: AircraftStatus) {\n return {\n location: {\n x: status.location.long,\n y: status.location.lat,\n },\n trueAltitude: status.trueAltitude,\n heading: status.heading,\n origin: status.origin,\n destination: status.destination,\n freetextEnabled: status.freetextEnabled,\n flight: status.flight,\n aircraftType: status.aircraftType,\n airline: status.airline\n };\n }\n\n private static buildToken(): string {\n return `Bearer ${Telex.accessToken}`;\n }\n\n private static connectionOrThrow() {\n if (!Telex.accessToken) {\n throw new TelexNotConnectedError();\n }\n }\n\n private static mapConnection(connection: TelexConnection): TelexConnection {\n return {\n ...connection,\n firstContact: new Date(connection.firstContact),\n lastContact: new Date(connection.lastContact),\n };\n }\n\n private static mapMessage(message: TelexMessage): TelexMessage {\n const msg: TelexMessage = {\n ...message,\n createdAt: new Date(message.createdAt),\n };\n\n if (message.from) {\n msg.from = Telex.mapConnection(message.from);\n }\n\n if (message.to) {\n msg.to = Telex.mapConnection(message.to);\n }\n\n return msg;\n }\n}\n","import { NXApi } from '../index';\nimport { post } from '../utils';\n\nexport declare class HoppieResponse {\n response: string;\n}\n\nexport class Hoppie {\n public static sendRequest(body: any): Promise<HoppieResponse> {\n return post<HoppieResponse>(new URL('/api/v1/hoppie', NXApi.url), body);\n }\n}\n","export class NXApi {\n public static url = new URL('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AI,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAC/C;KACL;IAEc,gBAAU,GAAzB,UAA0B,OAAqB;QAC3C,IAAM,GAAG,yBACF,OAAO,KACV,SAAS,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GACzC,CAAC;QAEF,IAAI,OAAO,CAAC,IAAI,EAAE;YACd,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAChD;QAED,IAAI,OAAO,CAAC,EAAE,EAAE;YACZ,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;SAC5C;QAED,OAAO,GAAG,CAAC;KACd;IACL,YAAC;AAAD,CAAC;;;ICxQD;KAIC;IAHiB,kBAAW,GAAzB,UAA0B,IAAS;QAC/B,OAAO,IAAI,CAAiB,IAAI,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;KAC3E;IACL,aAAC;AAAD,CAAC;;;ICXD;KAEC;IADiB,SAAG,GAAG,IAAI,GAAG,CAAC,6BAA6B,CAAC,CAAC;IAC/D,YAAC;CAFD;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -436,6 +436,7 @@ var Telex = /** @class */ (function () {
|
|
|
436
436
|
freetextEnabled: status.freetextEnabled,
|
|
437
437
|
flight: status.flight,
|
|
438
438
|
aircraftType: status.aircraftType,
|
|
439
|
+
airline: status.airline
|
|
439
440
|
};
|
|
440
441
|
};
|
|
441
442
|
Telex.buildToken = function () {
|
|
@@ -474,7 +475,7 @@ var Hoppie = /** @class */ (function () {
|
|
|
474
475
|
var NXApi = /** @class */ (function () {
|
|
475
476
|
function NXApi() {
|
|
476
477
|
}
|
|
477
|
-
NXApi.url = new URL('https://api.
|
|
478
|
+
NXApi.url = new URL('https://api.headwindsim.net');
|
|
478
479
|
return NXApi;
|
|
479
480
|
}());
|
|
480
481
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/utils/index.ts","../src/apis/airport.ts","../src/apis/atc.ts","../src/apis/atis.ts","../src/apis/charts.ts","../src/apis/git-versions.ts","../src/apis/gnss.ts","../src/apis/metar.ts","../src/apis/taf.ts","../src/apis/telex.ts","../src/apis/Hoppie.ts","../src/index.ts"],"sourcesContent":["import axios from 'axios';\n\nexport function get<T>(url: URL, headers?: any): Promise<T> {\n return axios.get<T>(url.href, { headers })\n .then((res) => res.data);\n}\n\nexport function del(url: URL, headers?: any): Promise<void> {\n return axios.delete(url.href, { headers })\n .then((res) => res.data);\n}\n\nexport function post<T>(url: URL, body: any, headers?: any): Promise<T> {\n const headersToSend = {\n 'Content-Type': 'application/json',\n ...headers,\n };\n\n return axios.post<T>(url.href, body, { headers: headersToSend })\n .then((res) => res.data);\n}\n\nexport function put<T>(url: URL, body: any, headers?: any): Promise<T> {\n const headersToSend = {\n 'Content-Type': 'application/json',\n ...headers,\n };\n\n return axios.put<T>(url.href, body, { headers: headersToSend })\n .then((res) => res.data);\n}\n","import { NXApi } from '../index';\nimport { get, post } from '../utils';\n\nexport declare class AirportResponse {\n icao: string;\n\n iata: string;\n\n type: string;\n\n name: string;\n\n lat: number;\n\n lon: number;\n\n elevation: number;\n\n continent: string;\n\n country: string;\n\n transAlt: number;\n}\n\nexport class Airport {\n public static get(icao: string): Promise<AirportResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n return get<AirportResponse>(new URL(`/api/v1/airport/${icao}`, NXApi.url));\n }\n\n public static getBatch(icaos: string[]): Promise<AirportResponse[]> {\n if (!icaos) {\n throw new Error('No ICAOs provided');\n }\n\n return post<AirportResponse[]>(new URL('/api/v1/airport/_batch', NXApi.url), { icaos });\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport enum AtcType {\n UNKNOWN,\n DELIVERY,\n GROUND,\n TOWER,\n DEPARTURE,\n APPROACH,\n RADAR,\n ATIS\n}\n\nexport declare class ATCInfo {\n callsign: string;\n\n frequency: string;\n\n visualRange: number;\n\n textAtis: string[];\n\n type: AtcType;\n\n latitude?: number;\n\n longitude?: number;\n}\n\nexport class ATC {\n public static async get(source: string): Promise<ATCInfo[]> {\n if (!source) {\n throw new Error('No source provided');\n }\n\n const url = new URL(`/api/v1/atc?source=${source}`, NXApi.url);\n return get<ATCInfo[]>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class AtisResponse {\n icao: string;\n\n source: string;\n\n combined?: string;\n\n arr?: string;\n\n dep?: string;\n}\n\nexport class Atis {\n public static async get(icao: string, source?: string): Promise<AtisResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n const url = new URL(`/atis/${icao}`, NXApi.url);\n if (source) {\n url.searchParams.set('source', source);\n }\n\n return get<AtisResponse>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class Chart {\n url: string;\n\n name: string;\n}\n\nexport declare class ChartsResponse {\n icao: string;\n\n charts?: Chart[];\n}\n\nexport class Charts {\n public static async get(icao: string): Promise<ChartsResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n const url = new URL(`/api/v1/charts/${icao}`, NXApi.url);\n\n return get<ChartsResponse>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class CommitInfo {\n sha: string;\n\n shortSha: string;\n\n timestamp: Date;\n}\n\nexport declare class ReleaseInfo {\n name: string;\n\n isPreRelease: boolean;\n\n publishedAt: Date;\n\n htmlUrl: string;\n\n body: string;\n}\n\nexport declare class PullLabel {\n id: string;\n\n name: string;\n\n color: string;\n}\n\nexport declare class PullInfo {\n number: number;\n\n title: string;\n\n author: string;\n\n labels: PullLabel[];\n\n isDraft: boolean;\n}\n\nexport declare class ArtifactInfo {\n artifactUrl: string;\n}\n\nexport class GitVersions {\n public static async getNewestCommit(user: string, repo: string, branch: string): Promise<CommitInfo> {\n if (!user || !repo || !branch) {\n throw new Error('Missing argument');\n }\n\n return get<CommitInfo>(new URL(`/api/v1/git-versions/${user}/${repo}/branches/${branch}`, NXApi.url))\n .then((res: CommitInfo) => ({\n ...res,\n timestamp: new Date(res.timestamp),\n }));\n }\n\n public static async getReleases(user: string, repo: string, includePreReleases?: boolean, skip?: number, take?: number): Promise<ReleaseInfo[]> {\n if (!user || !repo) {\n throw new Error('Missing argument');\n }\n\n if (skip < 0 || take < 0) {\n throw new Error(\"skip or take cannot be negative\");\n }\n\n const takePreReleasesArg = `?includePreReleases=${includePreReleases === true}`;\n const skipArg = skip !== undefined ? `&skip=` + skip : \"\";\n const takeArg = take !== undefined ? `&take=` + take : \"\";\n\n return get<ReleaseInfo[]>(\n new URL(`/api/v1/git-versions/${user}/${repo}/releases${takePreReleasesArg}${skipArg}${takeArg}`, NXApi.url),\n )\n .then((res) => res.map((rel) => ({\n ...rel,\n publishedAt: new Date(rel.publishedAt),\n })));\n }\n\n public static async getPulls(user: string, repo: string): Promise<PullInfo[]> {\n if (!user || !repo) {\n throw new Error('Missing argument');\n }\n\n return get<PullInfo[]>(new URL(`/api/v1/git-versions/${user}/${repo}/pulls`, NXApi.url));\n }\n\n public static async getArtifact(user: string, repo: string, pull: string): Promise<ArtifactInfo> {\n if (!user || !repo || !pull) {\n throw new Error('Missing argument');\n }\n\n return get<ArtifactInfo>(new URL(`/api/v1/git-versions/${user}/${repo}/pulls/${pull}/artifact`, NXApi.url));\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class GNSSResponse {\n name: string;\n\n id: string;\n\n epoch: Date;\n\n meanMotion: number;\n\n eccentricity: number;\n\n inclination: number;\n\n raOfAscNode: number;\n\n argOfPericenter: number;\n\n meanAnomaly: number;\n\n ephemerisType: number;\n\n classificationType: string;\n\n noradCatId: number;\n\n elementSetNo: number;\n\n revAtEpoch: number;\n\n bstar: number;\n\n meanMotionDot: number;\n\n meanMotionDdot: number;\n}\n\nexport class GNSS {\n public static get(): Promise<GNSSResponse[]> {\n const url = new URL('/api/v1/gnss', NXApi.url);\n\n return get<GNSSResponse[]>(url)\n .then((res) => res.map(GNSS.mapResult));\n }\n\n private static mapResult(response: GNSSResponse): GNSSResponse {\n return {\n ...response,\n epoch: new Date(response.epoch),\n };\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class MetarResponse {\n icao: string;\n\n source: string;\n\n metar: string;\n}\n\nexport class Metar {\n public static async get(icao: string, source?: string): Promise<MetarResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n const url = new URL(`/metar/${icao}`, NXApi.url);\n if (source) {\n url.searchParams.set('source', source);\n }\n\n return get<MetarResponse>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class TafResponse {\n icao: string;\n\n source: string;\n\n taf: string;\n}\n\nexport class Taf {\n public static async get(icao: string, source?: string): Promise<TafResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n const url = new URL(`/taf/${icao}`, NXApi.url);\n if (source) {\n url.searchParams.set('source', source);\n }\n\n return get<TafResponse>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { del, get, post, put } from '../utils';\n\nexport declare class TelexConnection {\n id: string;\n\n isActive: boolean;\n\n firstContact: Date;\n\n lastContact: Date;\n\n flight: string;\n\n location: {\n x: number;\n y: number;\n };\n\n trueAltitude: number;\n\n heading: number;\n\n freetextEnabled: boolean;\n\n aircraftType: string;\n\n origin: string;\n\n destination: string;\n}\n\nexport declare class SearchResult<T> {\n fullMatch?: T;\n\n matches: T[];\n}\n\nexport declare class TelexMessage {\n id: string;\n\n createdAt: Date;\n\n received: boolean;\n\n message: string;\n\n isProfane: boolean;\n\n from: TelexConnection;\n\n to?: TelexConnection;\n}\n\nexport declare class Token {\n accessToken: string;\n\n connection: string;\n\n flight: string;\n}\n\nexport declare class AircraftStatus {\n location: {\n long: number;\n lat: number;\n };\n\n trueAltitude: number;\n\n heading: number;\n\n origin: string;\n\n destination: string;\n\n freetextEnabled: boolean;\n\n flight: string;\n\n aircraftType: string;\n}\n\nexport declare class Paginated<T> {\n results: T[];\n\n count: number;\n\n total: number;\n}\n\nexport declare class Bounds {\n north: number;\n\n east: number;\n\n south: number;\n\n west: number;\n}\n\nexport declare type StageCallback = (flights: TelexConnection[]) => void;\n\nexport class TelexNotConnectedError extends Error {\n constructor() {\n super('TELEX is not connected');\n }\n}\n\nexport class Telex {\n private static accessToken: string;\n\n public static connect(status: AircraftStatus): Promise<Token> {\n return post<Token>(new URL('/txcxn', NXApi.url), Telex.buildBody(status))\n .then((res) => {\n Telex.accessToken = res.accessToken;\n return res;\n });\n }\n\n public static async update(status: AircraftStatus): Promise<TelexConnection> {\n Telex.connectionOrThrow();\n\n return put<TelexConnection>(new URL('/txcxn', NXApi.url), Telex.buildBody(status), { Authorization: Telex.buildToken() })\n .then(Telex.mapConnection);\n }\n\n public static async disconnect(): Promise<void> {\n Telex.connectionOrThrow();\n\n return del(new URL('/txcxn', NXApi.url), { Authorization: Telex.buildToken() })\n .then(() => {\n Telex.accessToken = '';\n });\n }\n\n public static async sendMessage(recipientFlight: string, message: string): Promise<TelexMessage> {\n Telex.connectionOrThrow();\n\n return post<TelexMessage>(new URL('/txmsg', NXApi.url), {\n to: recipientFlight,\n message,\n }, { Authorization: Telex.buildToken() })\n .then(Telex.mapMessage);\n }\n\n public static async fetchMessages(): Promise<TelexMessage[]> {\n Telex.connectionOrThrow();\n\n return get<TelexMessage[]>(new URL('/txmsg', NXApi.url), { Authorization: Telex.buildToken() })\n .then((res) => res.map(Telex.mapMessage));\n }\n\n public static fetchConnections(skip?: number, take?: number, bounds?: Bounds): Promise<Paginated<TelexConnection>> {\n const url = new URL('/txcxn', NXApi.url);\n if (skip) {\n url.searchParams.set('skip', skip.toString());\n }\n if (take) {\n url.searchParams.append('take', take.toString());\n }\n if (bounds) {\n url.searchParams.append('north', bounds.north.toString());\n url.searchParams.append('east', bounds.east.toString());\n url.searchParams.append('south', bounds.south.toString());\n url.searchParams.append('west', bounds.west.toString());\n }\n\n return get<Paginated<TelexConnection>>(url)\n .then((res) => ({\n ...res,\n results: res.results.map(Telex.mapConnection),\n }));\n }\n\n public static async fetchAllConnections(bounds?: Bounds, stageCallback?: StageCallback): Promise<TelexConnection[]> {\n let flights: TelexConnection[] = [];\n let skip = 0;\n let total = 0;\n\n do {\n const data = await Telex.fetchConnections(skip, 100, bounds);\n\n total = data.total;\n skip += data.count;\n flights = flights.concat(data.results);\n\n if (stageCallback) {\n stageCallback(flights);\n }\n }\n while (total > skip);\n\n return flights;\n }\n\n public static fetchConnection(id: string): Promise<TelexConnection> {\n return get<TelexConnection>(new URL(`/txcxn/${id}`, NXApi.url))\n .then(Telex.mapConnection);\n }\n\n public static findConnections(flightNumber: string): Promise<SearchResult<TelexConnection>> {\n const url = new URL('/txcxn/_find', NXApi.url);\n url.searchParams.set('flight', flightNumber);\n\n return get<SearchResult<TelexConnection>>(url)\n .then((res) => ({\n matches: res.matches.map(Telex.mapConnection),\n fullMatch: res.fullMatch ? Telex.mapConnection(res.fullMatch) : undefined,\n }));\n }\n\n public static countConnections(): Promise<number> {\n return get<number>(new URL('/txcxn/_count', NXApi.url));\n }\n\n private static buildBody(status: AircraftStatus) {\n return {\n location: {\n x: status.location.long,\n y: status.location.lat,\n },\n trueAltitude: status.trueAltitude,\n heading: status.heading,\n origin: status.origin,\n destination: status.destination,\n freetextEnabled: status.freetextEnabled,\n flight: status.flight,\n aircraftType: status.aircraftType,\n };\n }\n\n private static buildToken(): string {\n return `Bearer ${Telex.accessToken}`;\n }\n\n private static connectionOrThrow() {\n if (!Telex.accessToken) {\n throw new TelexNotConnectedError();\n }\n }\n\n private static mapConnection(connection: TelexConnection): TelexConnection {\n return {\n ...connection,\n firstContact: new Date(connection.firstContact),\n lastContact: new Date(connection.lastContact),\n };\n }\n\n private static mapMessage(message: TelexMessage): TelexMessage {\n const msg: TelexMessage = {\n ...message,\n createdAt: new Date(message.createdAt),\n };\n\n if (message.from) {\n msg.from = Telex.mapConnection(message.from);\n }\n\n if (message.to) {\n msg.to = Telex.mapConnection(message.to);\n }\n\n return msg;\n }\n}\n","import { NXApi } from '../index';\nimport { post } from '../utils';\n\nexport declare class HoppieResponse {\n response: string;\n}\n\nexport class Hoppie {\n public static sendRequest(body: any): Promise<HoppieResponse> {\n return post<HoppieResponse>(new URL('/api/v1/hoppie', NXApi.url), body);\n }\n}\n","export class NXApi {\n public static url = new URL('https://api.flybywiresim.com');\n}\n\nexport * from './apis';\n"],"names":["axios","AtcType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAEgB,GAAG,CAAI,GAAQ,EAAE,OAAa;IAC1C,OAAOA,yBAAK,CAAC,GAAG,CAAI,GAAG,CAAC,IAAI,EAAE,EAAE,OAAO,SAAA,EAAE,CAAC;SACrC,IAAI,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,CAAC,IAAI,GAAA,CAAC,CAAC;AACjC,CAAC;SAEe,GAAG,CAAC,GAAQ,EAAE,OAAa;IACvC,OAAOA,yBAAK,CAAC,QAAM,CAAA,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,OAAO,SAAA,EAAE,CAAC;SACrC,IAAI,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,CAAC,IAAI,GAAA,CAAC,CAAC;AACjC,CAAC;SAEe,IAAI,CAAI,GAAQ,EAAE,IAAS,EAAE,OAAa;IACtD,IAAM,aAAa,cACf,cAAc,EAAE,kBAAkB,IAC/B,OAAO,CACb,CAAC;IAEF,OAAOA,yBAAK,CAAC,IAAI,CAAI,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;SAC3D,IAAI,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,CAAC,IAAI,GAAA,CA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IAEc,gBAAU,GAAzB;QACI,OAAO,YAAU,KAAK,CAAC,WAAa,CAAC;KACxC;IAEc,uBAAiB,GAAhC;QACI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YACpB,MAAM,IAAI,sBAAsB,EAAE,CAAC;SACtC;KACJ;IAEc,mBAAa,GAA5B,UAA6B,UAA2B;QACpD,6BACO,UAAU,KACb,YAAY,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAC/C,WAAW,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAC/C;KACL;IAEc,gBAAU,GAAzB,UAA0B,OAAqB;QAC3C,IAAM,GAAG,yBACF,OAAO,KACV,SAAS,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GACzC,CAAC;QAEF,IAAI,OAAO,CAAC,IAAI,EAAE;YACd,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAChD;QAED,IAAI,OAAO,CAAC,EAAE,EAAE;YACZ,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;SAC5C;QAED,OAAO,GAAG,CAAC;KACd;IACL,YAAC;AAAD,CAAC;;;ICnQD;KAIC;IAHiB,kBAAW,GAAzB,UAA0B,IAAS;QAC/B,OAAO,IAAI,CAAiB,IAAI,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;KAC3E;IACL,aAAC;AAAD,CAAC;;;ICXD;KAEC;IADiB,SAAG,GAAG,IAAI,GAAG,CAAC,8BAA8B,CAAC,CAAC;IAChE,YAAC;CAFD;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/utils/index.ts","../src/apis/airport.ts","../src/apis/atc.ts","../src/apis/atis.ts","../src/apis/charts.ts","../src/apis/git-versions.ts","../src/apis/gnss.ts","../src/apis/metar.ts","../src/apis/taf.ts","../src/apis/telex.ts","../src/apis/Hoppie.ts","../src/index.ts"],"sourcesContent":["import axios from 'axios';\n\nexport function get<T>(url: URL, headers?: any): Promise<T> {\n return axios.get<T>(url.href, { headers })\n .then((res) => res.data);\n}\n\nexport function del(url: URL, headers?: any): Promise<void> {\n return axios.delete(url.href, { headers })\n .then((res) => res.data);\n}\n\nexport function post<T>(url: URL, body: any, headers?: any): Promise<T> {\n const headersToSend = {\n 'Content-Type': 'application/json',\n ...headers,\n };\n\n return axios.post<T>(url.href, body, { headers: headersToSend })\n .then((res) => res.data);\n}\n\nexport function put<T>(url: URL, body: any, headers?: any): Promise<T> {\n const headersToSend = {\n 'Content-Type': 'application/json',\n ...headers,\n };\n\n return axios.put<T>(url.href, body, { headers: headersToSend })\n .then((res) => res.data);\n}\n","import { NXApi } from '../index';\nimport { get, post } from '../utils';\n\nexport declare class AirportResponse {\n icao: string;\n\n iata: string;\n\n type: string;\n\n name: string;\n\n lat: number;\n\n lon: number;\n\n elevation: number;\n\n continent: string;\n\n country: string;\n\n transAlt: number;\n}\n\nexport class Airport {\n public static get(icao: string): Promise<AirportResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n return get<AirportResponse>(new URL(`/api/v1/airport/${icao}`, NXApi.url));\n }\n\n public static getBatch(icaos: string[]): Promise<AirportResponse[]> {\n if (!icaos) {\n throw new Error('No ICAOs provided');\n }\n\n return post<AirportResponse[]>(new URL('/api/v1/airport/_batch', NXApi.url), { icaos });\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport enum AtcType {\n UNKNOWN,\n DELIVERY,\n GROUND,\n TOWER,\n DEPARTURE,\n APPROACH,\n RADAR,\n ATIS\n}\n\nexport declare class ATCInfo {\n callsign: string;\n\n frequency: string;\n\n visualRange: number;\n\n textAtis: string[];\n\n type: AtcType;\n\n latitude?: number;\n\n longitude?: number;\n}\n\nexport class ATC {\n public static async get(source: string): Promise<ATCInfo[]> {\n if (!source) {\n throw new Error('No source provided');\n }\n\n const url = new URL(`/api/v1/atc?source=${source}`, NXApi.url);\n return get<ATCInfo[]>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class AtisResponse {\n icao: string;\n\n source: string;\n\n combined?: string;\n\n arr?: string;\n\n dep?: string;\n}\n\nexport class Atis {\n public static async get(icao: string, source?: string): Promise<AtisResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n const url = new URL(`/atis/${icao}`, NXApi.url);\n if (source) {\n url.searchParams.set('source', source);\n }\n\n return get<AtisResponse>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class Chart {\n url: string;\n\n name: string;\n}\n\nexport declare class ChartsResponse {\n icao: string;\n\n charts?: Chart[];\n}\n\nexport class Charts {\n public static async get(icao: string): Promise<ChartsResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n const url = new URL(`/api/v1/charts/${icao}`, NXApi.url);\n\n return get<ChartsResponse>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class CommitInfo {\n sha: string;\n\n shortSha: string;\n\n timestamp: Date;\n}\n\nexport declare class ReleaseInfo {\n name: string;\n\n isPreRelease: boolean;\n\n publishedAt: Date;\n\n htmlUrl: string;\n\n body: string;\n}\n\nexport declare class PullLabel {\n id: string;\n\n name: string;\n\n color: string;\n}\n\nexport declare class PullInfo {\n number: number;\n\n title: string;\n\n author: string;\n\n labels: PullLabel[];\n\n isDraft: boolean;\n}\n\nexport declare class ArtifactInfo {\n artifactUrl: string;\n}\n\nexport class GitVersions {\n public static async getNewestCommit(user: string, repo: string, branch: string): Promise<CommitInfo> {\n if (!user || !repo || !branch) {\n throw new Error('Missing argument');\n }\n\n return get<CommitInfo>(new URL(`/api/v1/git-versions/${user}/${repo}/branches/${branch}`, NXApi.url))\n .then((res: CommitInfo) => ({\n ...res,\n timestamp: new Date(res.timestamp),\n }));\n }\n\n public static async getReleases(user: string, repo: string, includePreReleases?: boolean, skip?: number, take?: number): Promise<ReleaseInfo[]> {\n if (!user || !repo) {\n throw new Error('Missing argument');\n }\n\n if (skip < 0 || take < 0) {\n throw new Error(\"skip or take cannot be negative\");\n }\n\n const takePreReleasesArg = `?includePreReleases=${includePreReleases === true}`;\n const skipArg = skip !== undefined ? `&skip=` + skip : \"\";\n const takeArg = take !== undefined ? `&take=` + take : \"\";\n\n return get<ReleaseInfo[]>(\n new URL(`/api/v1/git-versions/${user}/${repo}/releases${takePreReleasesArg}${skipArg}${takeArg}`, NXApi.url),\n )\n .then((res) => res.map((rel) => ({\n ...rel,\n publishedAt: new Date(rel.publishedAt),\n })));\n }\n\n public static async getPulls(user: string, repo: string): Promise<PullInfo[]> {\n if (!user || !repo) {\n throw new Error('Missing argument');\n }\n\n return get<PullInfo[]>(new URL(`/api/v1/git-versions/${user}/${repo}/pulls`, NXApi.url));\n }\n\n public static async getArtifact(user: string, repo: string, pull: string): Promise<ArtifactInfo> {\n if (!user || !repo || !pull) {\n throw new Error('Missing argument');\n }\n\n return get<ArtifactInfo>(new URL(`/api/v1/git-versions/${user}/${repo}/pulls/${pull}/artifact`, NXApi.url));\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class GNSSResponse {\n name: string;\n\n id: string;\n\n epoch: Date;\n\n meanMotion: number;\n\n eccentricity: number;\n\n inclination: number;\n\n raOfAscNode: number;\n\n argOfPericenter: number;\n\n meanAnomaly: number;\n\n ephemerisType: number;\n\n classificationType: string;\n\n noradCatId: number;\n\n elementSetNo: number;\n\n revAtEpoch: number;\n\n bstar: number;\n\n meanMotionDot: number;\n\n meanMotionDdot: number;\n}\n\nexport class GNSS {\n public static get(): Promise<GNSSResponse[]> {\n const url = new URL('/api/v1/gnss', NXApi.url);\n\n return get<GNSSResponse[]>(url)\n .then((res) => res.map(GNSS.mapResult));\n }\n\n private static mapResult(response: GNSSResponse): GNSSResponse {\n return {\n ...response,\n epoch: new Date(response.epoch),\n };\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class MetarResponse {\n icao: string;\n\n source: string;\n\n metar: string;\n}\n\nexport class Metar {\n public static async get(icao: string, source?: string): Promise<MetarResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n const url = new URL(`/metar/${icao}`, NXApi.url);\n if (source) {\n url.searchParams.set('source', source);\n }\n\n return get<MetarResponse>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { get } from '../utils';\n\nexport declare class TafResponse {\n icao: string;\n\n source: string;\n\n taf: string;\n}\n\nexport class Taf {\n public static async get(icao: string, source?: string): Promise<TafResponse> {\n if (!icao) {\n throw new Error('No ICAO provided');\n }\n\n const url = new URL(`/taf/${icao}`, NXApi.url);\n if (source) {\n url.searchParams.set('source', source);\n }\n\n return get<TafResponse>(url);\n }\n}\n","import { NXApi } from '../index';\nimport { del, get, post, put } from '../utils';\n\nexport declare class TelexConnection {\n id: string;\n\n isActive: boolean;\n\n firstContact: Date;\n\n lastContact: Date;\n\n flight: string;\n\n location: {\n x: number;\n y: number;\n };\n\n trueAltitude: number;\n\n heading: number;\n\n freetextEnabled: boolean;\n\n aircraftType: string;\n \n airline: string;\n\n origin: string;\n\n destination: string;\n}\n\nexport declare class SearchResult<T> {\n fullMatch?: T;\n\n matches: T[];\n}\n\nexport declare class TelexMessage {\n id: string;\n\n createdAt: Date;\n\n received: boolean;\n\n message: string;\n\n isProfane: boolean;\n\n from: TelexConnection;\n\n to?: TelexConnection;\n}\n\nexport declare class Token {\n accessToken: string;\n\n connection: string;\n\n flight: string;\n}\n\nexport declare class AircraftStatus {\n location: {\n long: number;\n lat: number;\n };\n\n trueAltitude: number;\n\n heading: number;\n\n origin: string;\n\n destination: string;\n\n freetextEnabled: boolean;\n\n flight: string;\n\n aircraftType: string;\n \n airline: string;\n}\n\nexport declare class Paginated<T> {\n results: T[];\n\n count: number;\n\n total: number;\n}\n\nexport declare class Bounds {\n north: number;\n\n east: number;\n\n south: number;\n\n west: number;\n}\n\nexport declare type StageCallback = (flights: TelexConnection[]) => void;\n\nexport class TelexNotConnectedError extends Error {\n constructor() {\n super('TELEX is not connected');\n }\n}\n\nexport class Telex {\n private static accessToken: string;\n\n public static connect(status: AircraftStatus): Promise<Token> {\n return post<Token>(new URL('/txcxn', NXApi.url), Telex.buildBody(status))\n .then((res) => {\n Telex.accessToken = res.accessToken;\n return res;\n });\n }\n\n public static async update(status: AircraftStatus): Promise<TelexConnection> {\n Telex.connectionOrThrow();\n\n return put<TelexConnection>(new URL('/txcxn', NXApi.url), Telex.buildBody(status), { Authorization: Telex.buildToken() })\n .then(Telex.mapConnection);\n }\n\n public static async disconnect(): Promise<void> {\n Telex.connectionOrThrow();\n\n return del(new URL('/txcxn', NXApi.url), { Authorization: Telex.buildToken() })\n .then(() => {\n Telex.accessToken = '';\n });\n }\n\n public static async sendMessage(recipientFlight: string, message: string): Promise<TelexMessage> {\n Telex.connectionOrThrow();\n\n return post<TelexMessage>(new URL('/txmsg', NXApi.url), {\n to: recipientFlight,\n message,\n }, { Authorization: Telex.buildToken() })\n .then(Telex.mapMessage);\n }\n\n public static async fetchMessages(): Promise<TelexMessage[]> {\n Telex.connectionOrThrow();\n\n return get<TelexMessage[]>(new URL('/txmsg', NXApi.url), { Authorization: Telex.buildToken() })\n .then((res) => res.map(Telex.mapMessage));\n }\n\n public static fetchConnections(skip?: number, take?: number, bounds?: Bounds): Promise<Paginated<TelexConnection>> {\n const url = new URL('/txcxn', NXApi.url);\n if (skip) {\n url.searchParams.set('skip', skip.toString());\n }\n if (take) {\n url.searchParams.append('take', take.toString());\n }\n if (bounds) {\n url.searchParams.append('north', bounds.north.toString());\n url.searchParams.append('east', bounds.east.toString());\n url.searchParams.append('south', bounds.south.toString());\n url.searchParams.append('west', bounds.west.toString());\n }\n\n return get<Paginated<TelexConnection>>(url)\n .then((res) => ({\n ...res,\n results: res.results.map(Telex.mapConnection),\n }));\n }\n\n public static async fetchAllConnections(bounds?: Bounds, stageCallback?: StageCallback): Promise<TelexConnection[]> {\n let flights: TelexConnection[] = [];\n let skip = 0;\n let total = 0;\n\n do {\n const data = await Telex.fetchConnections(skip, 100, bounds);\n\n total = data.total;\n skip += data.count;\n flights = flights.concat(data.results);\n\n if (stageCallback) {\n stageCallback(flights);\n }\n }\n while (total > skip);\n\n return flights;\n }\n\n public static fetchConnection(id: string): Promise<TelexConnection> {\n return get<TelexConnection>(new URL(`/txcxn/${id}`, NXApi.url))\n .then(Telex.mapConnection);\n }\n\n public static findConnections(flightNumber: string): Promise<SearchResult<TelexConnection>> {\n const url = new URL('/txcxn/_find', NXApi.url);\n url.searchParams.set('flight', flightNumber);\n\n return get<SearchResult<TelexConnection>>(url)\n .then((res) => ({\n matches: res.matches.map(Telex.mapConnection),\n fullMatch: res.fullMatch ? Telex.mapConnection(res.fullMatch) : undefined,\n }));\n }\n\n public static countConnections(): Promise<number> {\n return get<number>(new URL('/txcxn/_count', NXApi.url));\n }\n\n private static buildBody(status: AircraftStatus) {\n return {\n location: {\n x: status.location.long,\n y: status.location.lat,\n },\n trueAltitude: status.trueAltitude,\n heading: status.heading,\n origin: status.origin,\n destination: status.destination,\n freetextEnabled: status.freetextEnabled,\n flight: status.flight,\n aircraftType: status.aircraftType,\n airline: status.airline\n };\n }\n\n private static buildToken(): string {\n return `Bearer ${Telex.accessToken}`;\n }\n\n private static connectionOrThrow() {\n if (!Telex.accessToken) {\n throw new TelexNotConnectedError();\n }\n }\n\n private static mapConnection(connection: TelexConnection): TelexConnection {\n return {\n ...connection,\n firstContact: new Date(connection.firstContact),\n lastContact: new Date(connection.lastContact),\n };\n }\n\n private static mapMessage(message: TelexMessage): TelexMessage {\n const msg: TelexMessage = {\n ...message,\n createdAt: new Date(message.createdAt),\n };\n\n if (message.from) {\n msg.from = Telex.mapConnection(message.from);\n }\n\n if (message.to) {\n msg.to = Telex.mapConnection(message.to);\n }\n\n return msg;\n }\n}\n","import { NXApi } from '../index';\nimport { post } from '../utils';\n\nexport declare class HoppieResponse {\n response: string;\n}\n\nexport class Hoppie {\n public static sendRequest(body: any): Promise<HoppieResponse> {\n return post<HoppieResponse>(new URL('/api/v1/hoppie', NXApi.url), body);\n }\n}\n","export class NXApi {\n public static url = new URL('https://api.headwindsim.net');\n}\n\nexport * from './apis';\n"],"names":["axios","AtcType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAEgB,GAAG,CAAI,GAAQ,EAAE,OAAa;IAC1C,OAAOA,yBAAK,CAAC,GAAG,CAAI,GAAG,CAAC,IAAI,EAAE,EAAE,OAAO,SAAA,EAAE,CAAC;SACrC,IAAI,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,CAAC,IAAI,GAAA,CAAC,CAAC;AACjC,CAAC;SAEe,GAAG,CAAC,GAAQ,EAAE,OAAa;IACvC,OAAOA,yBAAK,CAAC,QAAM,CAAA,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,OAAO,SAAA,EAAE,CAAC;SACrC,IAAI,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,CAAC,IAAI,GAAA,CAAC,CAAC;AACjC,CAAC;SAEe,IAAI,CAAI,GAAQ,EAAE,IAAS,EAAE,OAAa;IACtD,IAAM,aAAa,cACf,cAAc,EAAE,kBAAkB,IAC/B,OAAO,CACb,CAAC;IAEF,OAAOA,yBAAK,CAAC,IAAI,CAAI,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;SAC3D,IAAI,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,CAAC,IAAI,GAAA,CAAC,CAAC;AACjC,CAAC;SAEe,GAAG,CAAI,GAAQ,EAAE,IAAS,EAAE,OAAa;IACrD,IAAM,aAAa,cACf,cAAc,EAAE,kBAAkB,IAC/B,OAAO,CACb,CAAC;IAEF,OAAOA,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