@headwindsimulations/api-client 1.2.0 → 1.2.2
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/SayIntentions.d.ts +5 -0
- package/dist/index.esm.js +9 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export declare class SayIntentionsResponse {
|
|
2
2
|
response: string;
|
|
3
3
|
}
|
|
4
|
+
export declare class SayIntentionsValidateResponse {
|
|
5
|
+
isValid: boolean;
|
|
6
|
+
flightId: string;
|
|
7
|
+
}
|
|
4
8
|
export declare class SayIntentions {
|
|
5
9
|
static sendRequest(body: any): Promise<SayIntentionsResponse>;
|
|
10
|
+
static validateKey(key: string): Promise<SayIntentionsValidateResponse>;
|
|
6
11
|
}
|
package/dist/index.esm.js
CHANGED
|
@@ -26,6 +26,10 @@ var __assign = function() {
|
|
|
26
26
|
return __assign.apply(this, arguments);
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
+
function get(url, headers) {
|
|
30
|
+
return axios.get(url.href, { headers: headers })
|
|
31
|
+
.then(function (res) { return res.data; });
|
|
32
|
+
}
|
|
29
33
|
function post(url, body, headers) {
|
|
30
34
|
var headersToSend = __assign({ 'Content-Type': 'application/json' }, headers);
|
|
31
35
|
return axios.post(url.href, body, { headers: headersToSend })
|
|
@@ -47,6 +51,11 @@ var SayIntentions = /** @class */ (function () {
|
|
|
47
51
|
SayIntentions.sendRequest = function (body) {
|
|
48
52
|
return post(new URL('/api/v1/sayintentions', NXApi.url), body);
|
|
49
53
|
};
|
|
54
|
+
SayIntentions.validateKey = function (key) {
|
|
55
|
+
var url = new URL("/api/v1/sayintentions/_validate", NXApi.url);
|
|
56
|
+
url.searchParams.set("key", key);
|
|
57
|
+
return get(url);
|
|
58
|
+
};
|
|
50
59
|
return SayIntentions;
|
|
51
60
|
}());
|
|
52
61
|
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/utils/index.ts","../src/apis/Hoppie.ts","../src/apis/SayIntentions.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
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/utils/index.ts","../src/apis/Hoppie.ts","../src/apis/SayIntentions.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 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","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;KAaC;IAZe,yBAAW,GAAzB,UAA0B,IAAS;QAC/B,OAAO,IAAI,CAAwB,IAAI,GAAG,CAAC,uBAAuB,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;KACzF;IAEa,yBAAW,GAAzB,UACI,GAAW;QAEX,IAAM,GAAG,GAAG,IAAI,GAAG,CAAC,iCAAiC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QAClE,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAEjC,OAAO,GAAG,CAAgC,GAAG,CAAC,CAAC;KAChD;IACL,oBAAC;AAAD,CAAC;;;ICzBD;KAEC;IADiB,SAAG,GAAG,IAAI,GAAG,CAAC,6BAA6B,CAAC,CAAC;IAC/D,YAAC;CAFD;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -34,6 +34,10 @@ var __assign = function() {
|
|
|
34
34
|
return __assign.apply(this, arguments);
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
function get(url, headers) {
|
|
38
|
+
return axios__default["default"].get(url.href, { headers: headers })
|
|
39
|
+
.then(function (res) { return res.data; });
|
|
40
|
+
}
|
|
37
41
|
function post(url, body, headers) {
|
|
38
42
|
var headersToSend = __assign({ 'Content-Type': 'application/json' }, headers);
|
|
39
43
|
return axios__default["default"].post(url.href, body, { headers: headersToSend })
|
|
@@ -55,6 +59,11 @@ var SayIntentions = /** @class */ (function () {
|
|
|
55
59
|
SayIntentions.sendRequest = function (body) {
|
|
56
60
|
return post(new URL('/api/v1/sayintentions', NXApi.url), body);
|
|
57
61
|
};
|
|
62
|
+
SayIntentions.validateKey = function (key) {
|
|
63
|
+
var url = new URL("/api/v1/sayintentions/_validate", NXApi.url);
|
|
64
|
+
url.searchParams.set("key", key);
|
|
65
|
+
return get(url);
|
|
66
|
+
};
|
|
58
67
|
return SayIntentions;
|
|
59
68
|
}());
|
|
60
69
|
|
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/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
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/utils/index.ts","../src/apis/Hoppie.ts","../src/apis/SayIntentions.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 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","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,aAA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