@kquika-inc/s-system 1.0.7 → 1.0.8
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/sdk.gen.d.ts +10 -1
- package/dist/sdk.gen.js +20 -0
- package/dist/types.gen.d.ts +85 -2
- package/package.json +1 -1
package/dist/sdk.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
|
|
2
|
-
import type { ListFlightsData, GetFlightData, GetFlightMetricsData, GetRouteAnalyticsData, SearchFlightsData, RefreshFlightsData, GetAirportOverviewData, GetAirportHeatmapData, GetAirportCongestionData } from './types.gen';
|
|
2
|
+
import type { ListFlightsData, GetFlightData, GetFlightMetricsData, GetRouteAnalyticsData, SearchFlightsData, RefreshFlightsData, GetAirportOverviewData, GetAirportHeatmapData, GetAirportCongestionData, GetUsageData } from './types.gen';
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -96,3 +96,12 @@ export declare const getAirportHeatmap: <ThrowOnError extends boolean = false>(o
|
|
|
96
96
|
* immigration and customs.
|
|
97
97
|
*/
|
|
98
98
|
export declare const getAirportCongestion: <ThrowOnError extends boolean = false>(options: Options<GetAirportCongestionData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").CongestionResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
|
|
99
|
+
/**
|
|
100
|
+
* Usage against your allowance
|
|
101
|
+
* Calls made this period, the allowance, and what remains.
|
|
102
|
+
*
|
|
103
|
+
* **Requires Standard.**
|
|
104
|
+
*
|
|
105
|
+
* Every response already carries the same position in its `quota` block and in the `X-Quota-*` headers, so polling this endpoint to watch consumption wastes the allowance it reports. Call it when you want the breakdown by endpoint, which headers cannot carry.
|
|
106
|
+
*/
|
|
107
|
+
export declare const getUsage: <ThrowOnError extends boolean = false>(options?: Options<GetUsageData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").UsageResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
|
package/dist/sdk.gen.js
CHANGED
|
@@ -182,3 +182,23 @@ export const getAirportCongestion = (options) => {
|
|
|
182
182
|
...options
|
|
183
183
|
});
|
|
184
184
|
};
|
|
185
|
+
/**
|
|
186
|
+
* Usage against your allowance
|
|
187
|
+
* Calls made this period, the allowance, and what remains.
|
|
188
|
+
*
|
|
189
|
+
* **Requires Standard.**
|
|
190
|
+
*
|
|
191
|
+
* Every response already carries the same position in its `quota` block and in the `X-Quota-*` headers, so polling this endpoint to watch consumption wastes the allowance it reports. Call it when you want the breakdown by endpoint, which headers cannot carry.
|
|
192
|
+
*/
|
|
193
|
+
export const getUsage = (options) => {
|
|
194
|
+
return (options?.client ?? _heyApiClient).get({
|
|
195
|
+
security: [
|
|
196
|
+
{
|
|
197
|
+
name: 'X-API-Key',
|
|
198
|
+
type: 'apiKey'
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
url: '/api/v1/usage',
|
|
202
|
+
...options
|
|
203
|
+
});
|
|
204
|
+
};
|
package/dist/types.gen.d.ts
CHANGED
|
@@ -16,6 +16,20 @@ export type Envelope = {
|
|
|
16
16
|
* contract; branch on the HTTP status or on `error`.
|
|
17
17
|
*/
|
|
18
18
|
message: string;
|
|
19
|
+
/**
|
|
20
|
+
* Your consumption after this call, on every response. A client can slow down before it is throttled rather than after: a quota you discover only by being refused is not a quota. Mirrored in the X-Quota-Remaining and X-RateLimit-Remaining headers, so a caller that does not parse the body still sees it.
|
|
21
|
+
*/
|
|
22
|
+
quota?: {
|
|
23
|
+
/**
|
|
24
|
+
* Null on plans metered by rate rather than volume.
|
|
25
|
+
*/
|
|
26
|
+
calls_remaining?: number | null;
|
|
27
|
+
percent_used?: number | null;
|
|
28
|
+
/**
|
|
29
|
+
* Requests left in the current minute.
|
|
30
|
+
*/
|
|
31
|
+
rate_limit_remaining?: number | null;
|
|
32
|
+
};
|
|
19
33
|
};
|
|
20
34
|
export type Flight = {
|
|
21
35
|
flight_number: string;
|
|
@@ -56,10 +70,13 @@ export type FlightListResponse = Envelope & {
|
|
|
56
70
|
flights?: Array<Flight>;
|
|
57
71
|
count?: number;
|
|
58
72
|
/**
|
|
59
|
-
* Provenance of the returned records. `generated`
|
|
60
|
-
* data.
|
|
73
|
+
* Provenance of the returned records. `generated` appears only when it was requested explicitly, since the default excludes it.
|
|
61
74
|
*/
|
|
62
75
|
source?: 'live_feed' | 'database' | 'generated' | 'mixed';
|
|
76
|
+
/**
|
|
77
|
+
* Records matching the other filters but removed by `confidence`. With no filter this counts the generated rows the default excluded, so a non-zero value here on a default query means the feed is carrying synthetic data.
|
|
78
|
+
*/
|
|
79
|
+
excluded_by_confidence?: number | null;
|
|
63
80
|
};
|
|
64
81
|
};
|
|
65
82
|
export type FlightResponse = Envelope & {
|
|
@@ -179,10 +196,40 @@ export type ErrorResponse = Envelope & {
|
|
|
179
196
|
*/
|
|
180
197
|
retry_after_seconds?: number | null;
|
|
181
198
|
};
|
|
199
|
+
export type UsageResponse = Envelope & {
|
|
200
|
+
data?: {
|
|
201
|
+
period_start?: string;
|
|
202
|
+
period_end?: string;
|
|
203
|
+
plan?: 'Standard' | 'Professional' | 'Enterprise';
|
|
204
|
+
calls_made?: number;
|
|
205
|
+
/**
|
|
206
|
+
* Monthly allowance. Null on plans metered by rate rather than volume, which is not the same as unlimited: the per-minute limit still applies.
|
|
207
|
+
*/
|
|
208
|
+
calls_included?: number | null;
|
|
209
|
+
calls_remaining?: number | null;
|
|
210
|
+
percent_used?: number | null;
|
|
211
|
+
/**
|
|
212
|
+
* Where the calls went. The reason to call this endpoint.
|
|
213
|
+
*/
|
|
214
|
+
by_endpoint?: Array<{
|
|
215
|
+
endpoint?: string;
|
|
216
|
+
calls?: number;
|
|
217
|
+
}>;
|
|
218
|
+
rate_limit_per_minute?: number;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
182
221
|
/**
|
|
183
222
|
* IATA code, three letters. Case insensitive.
|
|
184
223
|
*/
|
|
185
224
|
export type AirportCode = string;
|
|
225
|
+
/**
|
|
226
|
+
* Restrict to records of this provenance. Repeat the parameter for more than one value.
|
|
227
|
+
*
|
|
228
|
+
* **Defaults to `live_feed` and `database`.** Generated records must be asked for by name. A generated row filled a gap in the feed and carries a real carrier code on a route that carrier may not fly, so it does not reach a planner who did not ask for it.
|
|
229
|
+
*
|
|
230
|
+
* `count` reflects what was returned. `excluded_by_confidence` reports what the filter removed, so a small result can be told apart from a thin feed.
|
|
231
|
+
*/
|
|
232
|
+
export type Confidence = Array<'live_feed' | 'database' | 'generated'>;
|
|
186
233
|
export type ListFlightsData = {
|
|
187
234
|
body?: never;
|
|
188
235
|
path?: never;
|
|
@@ -197,6 +244,14 @@ export type ListFlightsData = {
|
|
|
197
244
|
*/
|
|
198
245
|
date?: string;
|
|
199
246
|
limit?: number;
|
|
247
|
+
/**
|
|
248
|
+
* Restrict to records of this provenance. Repeat the parameter for more than one value.
|
|
249
|
+
*
|
|
250
|
+
* **Defaults to `live_feed` and `database`.** Generated records must be asked for by name. A generated row filled a gap in the feed and carries a real carrier code on a route that carrier may not fly, so it does not reach a planner who did not ask for it.
|
|
251
|
+
*
|
|
252
|
+
* `count` reflects what was returned. `excluded_by_confidence` reports what the filter removed, so a small result can be told apart from a thin feed.
|
|
253
|
+
*/
|
|
254
|
+
confidence?: Array<'live_feed' | 'database' | 'generated'>;
|
|
200
255
|
};
|
|
201
256
|
url: '/api/v1/flights';
|
|
202
257
|
};
|
|
@@ -310,6 +365,14 @@ export type SearchFlightsData = {
|
|
|
310
365
|
*/
|
|
311
366
|
q: string;
|
|
312
367
|
limit?: number;
|
|
368
|
+
/**
|
|
369
|
+
* Restrict to records of this provenance. Repeat the parameter for more than one value.
|
|
370
|
+
*
|
|
371
|
+
* **Defaults to `live_feed` and `database`.** Generated records must be asked for by name. A generated row filled a gap in the feed and carries a real carrier code on a route that carrier may not fly, so it does not reach a planner who did not ask for it.
|
|
372
|
+
*
|
|
373
|
+
* `count` reflects what was returned. `excluded_by_confidence` reports what the filter removed, so a small result can be told apart from a thin feed.
|
|
374
|
+
*/
|
|
375
|
+
confidence?: Array<'live_feed' | 'database' | 'generated'>;
|
|
313
376
|
};
|
|
314
377
|
url: '/api/v1/flights/search';
|
|
315
378
|
};
|
|
@@ -446,6 +509,26 @@ export type GetAirportCongestionResponses = {
|
|
|
446
509
|
200: CongestionResponse;
|
|
447
510
|
};
|
|
448
511
|
export type GetAirportCongestionResponse = GetAirportCongestionResponses[keyof GetAirportCongestionResponses];
|
|
512
|
+
export type GetUsageData = {
|
|
513
|
+
body?: never;
|
|
514
|
+
path?: never;
|
|
515
|
+
query?: never;
|
|
516
|
+
url: '/api/v1/usage';
|
|
517
|
+
};
|
|
518
|
+
export type GetUsageErrors = {
|
|
519
|
+
/**
|
|
520
|
+
* Missing or invalid API key.
|
|
521
|
+
*/
|
|
522
|
+
401: ErrorResponse;
|
|
523
|
+
};
|
|
524
|
+
export type GetUsageError = GetUsageErrors[keyof GetUsageErrors];
|
|
525
|
+
export type GetUsageResponses = {
|
|
526
|
+
/**
|
|
527
|
+
* Usage for the current period.
|
|
528
|
+
*/
|
|
529
|
+
200: UsageResponse;
|
|
530
|
+
};
|
|
531
|
+
export type GetUsageResponse = GetUsageResponses[keyof GetUsageResponses];
|
|
449
532
|
export type ClientOptions = {
|
|
450
533
|
baseUrl: 'https://www.s-system.cloud' | (string & {});
|
|
451
534
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kquika-inc/s-system",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Predict flight disruption, price the passenger-rights exposure it carries, and rebook before it costs you.",
|
|
5
5
|
"author": { "name": "Kquika, Inc.", "email": "support@kquika.com" },
|
|
6
6
|
"homepage": "https://www.s-system.cloud/document",
|