@headwindsimulations/api-client 1.3.5 → 1.3.6

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/index.esm.js CHANGED
@@ -60,7 +60,7 @@ var SayIntentions = /** @class */ (function () {
60
60
  return post(new URL('/api/v1/sayintentions/_metar', NXApi.url), body);
61
61
  };
62
62
  SayIntentions.getAtis = function (body) {
63
- return post(new URL('/api/v1/_atis', NXApi.url), body);
63
+ return post(new URL('/api/v1/sayintentions/_atis', NXApi.url), body);
64
64
  };
65
65
  SayIntentions.validateKey = function (key) {
66
66
  var url = new URL("/api/v1/sayintentions/_validate", NXApi.url);
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/utils/index.ts","../src/apis/Hoppie.ts","../src/apis/SayIntentions.ts","../src/apis/BeyondAtc.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 { 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","import { NXApi } from \"../index\";\nimport { post, get } from \"../utils\";\n\nexport declare class SayIntentionsResponse {\n response: string;\n}\n\nexport declare class SayIntentionsValidateResponse {\n isValid: boolean;\n flightId: string;\n}\n\nexport class SayIntentions {\n public static sendRequest(body: any): Promise<SayIntentionsResponse> {\n return post<SayIntentionsResponse>(new URL('/api/v1/sayintentions', NXApi.url), body);\n }\n\n public static getMetar(body: any): Promise<string> {\n return post<string>(new URL('/api/v1/sayintentions/_metar', NXApi.url), body);\n }\n\n public static getAtis(body: any): Promise<string> {\n return post<string>(new URL('/api/v1/_atis', NXApi.url), body);\n }\n\n public static validateKey(\n key: string\n ): Promise<SayIntentionsValidateResponse> {\n const url = new URL(\"/api/v1/sayintentions/_validate\", NXApi.url);\n url.searchParams.set(\"key\", key);\n \n return get<SayIntentionsValidateResponse>(url);\n }\n}\n\n","import { get } from \"../utils\";\n\nexport class BeyondATC {\n public static sendRequest(message: any): Promise<string> {\n const url = new URL('/connect.html', 'http://localhost:57698');\n\n // Query-Parameter setzen (URLSearchParams kümmert sich ums Escaping)\n url.searchParams.set('logon', message.logon);\n url.searchParams.set('from', message.from);\n url.searchParams.set('to', message.to);\n url.searchParams.set('type', message.type);\n\n if (message.packet) {\n url.searchParams.set('packet', message.packet);\n }\n\n return get<string>(url);\n }\n\n public static getMetar(icao: string): Promise<string> {\n const url = new URL('/acars/metar/' + icao, 'http://localhost:57698');\n return get<string>(url);\n }\n\n public static getAtis(icao: string): Promise<string> {\n const url = new URL('/acars/atis/' + icao, 'http://localhost:57698');\n return get<string>(url);\n }\n}","export class NXApi {\n public static url = new URL('https://api.headwindsim.net');\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;SAOe,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BAAW,GAAzB,UAA0B,OAAY;QAClC,IAAM,GAAG,GAAG,IAAI,GAAG,CAAC,eAAe,EAAE,wBAAwB,CAAC,CAAC;;QAG/D,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAC7C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QACvC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAE3C,IAAI,OAAO,CAAC,MAAM,EAAE;YAClB,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;SAChD;QAED,OAAO,GAAG,CAAS,GAAG,CAAC,CAAC;KAC3B;IAEa,kBAAQ,GAAtB,UAAuB,IAAY;QAC/B,IAAM,GAAG,GAAG,IAAI,GAAG,CAAC,eAAe,GAAG,IAAI,EAAE,wBAAwB,CAAC,CAAC;QACtE,OAAO,GAAG,CAAS,GAAG,CAAC,CAAC;KAC3B;IAEa,iBAAO,GAArB,UAAsB,IAAY;QAC9B,IAAM,GAAG,GAAG,IAAI,GAAG,CAAC,cAAc,GAAG,IAAI,EAAE,wBAAwB,CAAC,CAAC;QACrE,OAAO,GAAG,CAAS,GAAG,CAAC,CAAC;KAC3B;IACH,gBAAC;AAAD,CAAC;;;IC5BD;KAEC;IADiB,SAAG,GAAG,IAAI,GAAG,CAAC,6BAA6B,CAAC,CAAC;IAC/D,YAAC;CAFD;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/utils/index.ts","../src/apis/Hoppie.ts","../src/apis/SayIntentions.ts","../src/apis/BeyondAtc.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 { 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","import { NXApi } from \"../index\";\nimport { post, get } from \"../utils\";\n\nexport declare class SayIntentionsResponse {\n response: string;\n}\n\nexport declare class SayIntentionsValidateResponse {\n isValid: boolean;\n flightId: string;\n}\n\nexport class SayIntentions {\n public static sendRequest(body: any): Promise<SayIntentionsResponse> {\n return post<SayIntentionsResponse>(new URL('/api/v1/sayintentions', NXApi.url), body);\n }\n\n public static getMetar(body: any): Promise<string> {\n return post<string>(new URL('/api/v1/sayintentions/_metar', NXApi.url), body);\n }\n\n public static getAtis(body: any): Promise<string> {\n return post<string>(new URL('/api/v1/sayintentions/_atis', NXApi.url), body);\n }\n\n public static validateKey(\n key: string\n ): Promise<SayIntentionsValidateResponse> {\n const url = new URL(\"/api/v1/sayintentions/_validate\", NXApi.url);\n url.searchParams.set(\"key\", key);\n \n return get<SayIntentionsValidateResponse>(url);\n }\n}\n\n","import { get } from \"../utils\";\n\nexport class BeyondATC {\n public static sendRequest(message: any): Promise<string> {\n const url = new URL('/connect.html', 'http://localhost:57698');\n\n // Query-Parameter setzen (URLSearchParams kümmert sich ums Escaping)\n url.searchParams.set('logon', message.logon);\n url.searchParams.set('from', message.from);\n url.searchParams.set('to', message.to);\n url.searchParams.set('type', message.type);\n\n if (message.packet) {\n url.searchParams.set('packet', message.packet);\n }\n\n return get<string>(url);\n }\n\n public static getMetar(icao: string): Promise<string> {\n const url = new URL('/acars/metar/' + icao, 'http://localhost:57698');\n return get<string>(url);\n }\n\n public static getAtis(icao: string): Promise<string> {\n const url = new URL('/acars/atis/' + icao, 'http://localhost:57698');\n return get<string>(url);\n }\n}","export class NXApi {\n public static url = new URL('https://api.headwindsim.net');\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;SAOe,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;;;ICbA;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;;;ICCD;KAqBC;IApBe,yBAAW,GAAzB,UAA0B,IAAS;QAC/B,OAAO,IAAI,CAAwB,IAAI,G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QAED,OAAO,GAAG,CAAS,GAAG,CAAC,CAAC;KAC3B;IAEa,kBAAQ,GAAtB,UAAuB,IAAY;QAC/B,IAAM,GAAG,GAAG,IAAI,GAAG,CAAC,eAAe,GAAG,IAAI,EAAE,wBAAwB,CAAC,CAAC;QACtE,OAAO,GAAG,CAAS,GAAG,CAAC,CAAC;KAC3B;IAEa,iBAAO,GAArB,UAAsB,IAAY;QAC9B,IAAM,GAAG,GAAG,IAAI,GAAG,CAAC,cAAc,GAAG,IAAI,EAAE,wBAAwB,CAAC,CAAC;QACrE,OAAO,GAAG,CAAS,GAAG,CAAC,CAAC;KAC3B;IACH,gBAAC;AAAD,CAAC;;;IC5BD;KAEC;IADiB,SAAG,GAAG,IAAI,GAAG,CAAC,6BAA6B,CAAC,CAAC;IAC/D,YAAC;CAFD;;;;"}
package/dist/index.js CHANGED
@@ -68,7 +68,7 @@ var SayIntentions = /** @class */ (function () {
68
68
  return post(new URL('/api/v1/sayintentions/_metar', NXApi.url), body);
69
69
  };
70
70
  SayIntentions.getAtis = function (body) {
71
- return post(new URL('/api/v1/_atis', NXApi.url), body);
71
+ return post(new URL('/api/v1/sayintentions/_atis', NXApi.url), body);
72
72
  };
73
73
  SayIntentions.validateKey = function (key) {
74
74
  var url = new URL("/api/v1/sayintentions/_validate", NXApi.url);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/utils/index.ts","../src/apis/Hoppie.ts","../src/apis/SayIntentions.ts","../src/apis/BeyondAtc.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 { 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","import { NXApi } from \"../index\";\nimport { post, get } from \"../utils\";\n\nexport declare class SayIntentionsResponse {\n response: string;\n}\n\nexport declare class SayIntentionsValidateResponse {\n isValid: boolean;\n flightId: string;\n}\n\nexport class SayIntentions {\n public static sendRequest(body: any): Promise<SayIntentionsResponse> {\n return post<SayIntentionsResponse>(new URL('/api/v1/sayintentions', NXApi.url), body);\n }\n\n public static getMetar(body: any): Promise<string> {\n return post<string>(new URL('/api/v1/sayintentions/_metar', NXApi.url), body);\n }\n\n public static getAtis(body: any): Promise<string> {\n return post<string>(new URL('/api/v1/_atis', NXApi.url), body);\n }\n\n public static validateKey(\n key: string\n ): Promise<SayIntentionsValidateResponse> {\n const url = new URL(\"/api/v1/sayintentions/_validate\", NXApi.url);\n url.searchParams.set(\"key\", key);\n \n return get<SayIntentionsValidateResponse>(url);\n }\n}\n\n","import { get } from \"../utils\";\n\nexport class BeyondATC {\n public static sendRequest(message: any): Promise<string> {\n const url = new URL('/connect.html', 'http://localhost:57698');\n\n // Query-Parameter setzen (URLSearchParams kümmert sich ums Escaping)\n url.searchParams.set('logon', message.logon);\n url.searchParams.set('from', message.from);\n url.searchParams.set('to', message.to);\n url.searchParams.set('type', message.type);\n\n if (message.packet) {\n url.searchParams.set('packet', message.packet);\n }\n\n return get<string>(url);\n }\n\n public static getMetar(icao: string): Promise<string> {\n const url = new URL('/acars/metar/' + icao, 'http://localhost:57698');\n return get<string>(url);\n }\n\n public static getAtis(icao: string): Promise<string> {\n const url = new URL('/acars/atis/' + icao, 'http://localhost:57698');\n return get<string>(url);\n }\n}","export class NXApi {\n public static url = new URL('https://api.headwindsim.net');\n}\n\nexport * from './apis';\n"],"names":["axios"],"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;SAOe,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;;;ICbA;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;;;ICCD;KAqBC;IApBe,yBAAW,GAAzB,UAA0B,IAAS;QAC/B,OAAO,IAAI,CAAwB,IAAI,GAAG,CAAC,uBAAuB,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;KACzF;IAEa,sBAAQ,GAAtB,UAAuB,IAAS;QAC5B,OAAO,IAAI,CAAS,IAAI,GAAG,CAAC,8BAA8B,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;KACjF;IAEa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GAArB,UAAsB,IAAY;QAC9B,IAAM,GAAG,GAAG,IAAI,GAAG,CAAC,cAAc,GAAG,IAAI,EAAE,wBAAwB,CAAC,CAAC;QACrE,OAAO,GAAG,CAAS,GAAG,CAAC,CAAC;KAC3B;IACH,gBAAC;AAAD,CAAC;;;IC5BD;KAEC;IADiB,SAAG,GAAG,IAAI,GAAG,CAAC,6BAA6B,CAAC,CAAC;IAC/D,YAAC;CAFD;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/utils/index.ts","../src/apis/Hoppie.ts","../src/apis/SayIntentions.ts","../src/apis/BeyondAtc.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 { 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","import { NXApi } from \"../index\";\nimport { post, get } from \"../utils\";\n\nexport declare class SayIntentionsResponse {\n response: string;\n}\n\nexport declare class SayIntentionsValidateResponse {\n isValid: boolean;\n flightId: string;\n}\n\nexport class SayIntentions {\n public static sendRequest(body: any): Promise<SayIntentionsResponse> {\n return post<SayIntentionsResponse>(new URL('/api/v1/sayintentions', NXApi.url), body);\n }\n\n public static getMetar(body: any): Promise<string> {\n return post<string>(new URL('/api/v1/sayintentions/_metar', NXApi.url), body);\n }\n\n public static getAtis(body: any): Promise<string> {\n return post<string>(new URL('/api/v1/sayintentions/_atis', NXApi.url), body);\n }\n\n public static validateKey(\n key: string\n ): Promise<SayIntentionsValidateResponse> {\n const url = new URL(\"/api/v1/sayintentions/_validate\", NXApi.url);\n url.searchParams.set(\"key\", key);\n \n return get<SayIntentionsValidateResponse>(url);\n }\n}\n\n","import { get } from \"../utils\";\n\nexport class BeyondATC {\n public static sendRequest(message: any): Promise<string> {\n const url = new URL('/connect.html', 'http://localhost:57698');\n\n // Query-Parameter setzen (URLSearchParams kümmert sich ums Escaping)\n url.searchParams.set('logon', message.logon);\n url.searchParams.set('from', message.from);\n url.searchParams.set('to', message.to);\n url.searchParams.set('type', message.type);\n\n if (message.packet) {\n url.searchParams.set('packet', message.packet);\n }\n\n return get<string>(url);\n }\n\n public static getMetar(icao: string): Promise<string> {\n const url = new URL('/acars/metar/' + icao, 'http://localhost:57698');\n return get<string>(url);\n }\n\n public static getAtis(icao: string): Promise<string> {\n const url = new URL('/acars/atis/' + icao, 'http://localhost:57698');\n return get<string>(url);\n }\n}","export class NXApi {\n public static url = new URL('https://api.headwindsim.net');\n}\n\nexport * from './apis';\n"],"names":["axios"],"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;SAOe,IAAI,CAAI,GAAQ,EAAE,IAAS,EAAE,OAAa;IACtD,IAAM,aAAa,cACf,cAAc,EAAE,kBAAkB,IAC/B,OAAO,CACb,CAAC;IAEF,OAAOA,yBAAK,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,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAC7C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QACvC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAE3C,IAAI,OAAO,CAAC,MAAM,EAAE;YAClB,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;SAChD;QAED,OAAO,GAAG,CAAS,GAAG,CAAC,CAAC;KAC3B;IAEa,kBAAQ,GAAtB,UAAuB,IAAY;QAC/B,IAAM,GAAG,GAAG,IAAI,GAAG,CAAC,eAAe,GAAG,IAAI,EAAE,wBAAwB,CAAC,CAAC;QACtE,OAAO,GAAG,CAAS,GAAG,CAAC,CAAC;KAC3B;IAEa,iBAAO,GAArB,UAAsB,IAAY;QAC9B,IAAM,GAAG,GAAG,IAAI,GAAG,CAAC,cAAc,GAAG,IAAI,EAAE,wBAAwB,CAAC,CAAC;QACrE,OAAO,GAAG,CAAS,GAAG,CAAC,CAAC;KAC3B;IACH,gBAAC;AAAD,CAAC;;;IC5BD;KAEC;IADiB,SAAG,GAAG,IAAI,GAAG,CAAC,6BAA6B,CAAC,CAAC;IAC/D,YAAC;CAFD;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headwindsimulations/api-client",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "Client library for the Headwind Simulations API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",