@volant-autonomy/via-sdk 1.2773.1 → 1.2801.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/README.md +3 -2
- package/dist/direct.d.ts +0 -37
- package/dist/direct.js +0 -9
- package/dist/docstringTransformer.js +5 -0
- package/dist/volant-schema.d.ts +10 -138
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
`@volant-autonomy/via-sdk` is an auto-generated type-safe wrapper for the Via API with automatic authentication handling.
|
|
4
4
|
Usable in TypeScript or JavaScript.
|
|
5
5
|
|
|
6
|
-
**Note:** To use this SDK you need access to [the Via API](https://via.volantautonomy.com/api/v1.0/docs). Please contact us at via@volantautonomy.com to obtain access.
|
|
6
|
+
**Note:** To use this SDK you need access to [the Via API](https://via.volantautonomy.com/api/v1.0/docs). Please contact us at <via@volantautonomy.com> to obtain access.
|
|
7
7
|
|
|
8
8
|
## Installation
|
|
9
9
|
|
|
@@ -45,8 +45,10 @@ For example, `GET /flightplans/` takes in a filter from a query parameter. The S
|
|
|
45
45
|
Another example, `GET /flightplans/{flightplan_id}` takes in a flightplan ID through the path. The SDK does this through function arguments, ie: `SDK.direct.getFlightplan('aaaaa-bbbbb-ccccc')`
|
|
46
46
|
|
|
47
47
|
## Feature list
|
|
48
|
+
|
|
48
49
|
As well as offering methods for all endpoints within the API, you have access to a variety of features in this API
|
|
49
50
|
Wrapper that help make some common workflows more convenient. These features are as follows:
|
|
51
|
+
|
|
50
52
|
| Feature | Remark | Method |
|
|
51
53
|
| -------------------------- |-------------------------------------------------------------------------------------| -------------------------------|
|
|
52
54
|
| Upsert Flightplan | Create a flightplan no ID is supplied. Update existing flightplan if ID is supplied | upsertFlightplan() |
|
|
@@ -58,7 +60,6 @@ Wrapper that help make some common workflows more convenient. These features are
|
|
|
58
60
|
| Temporal Deconfliction | Will attempt to temporally deconflict your flightplan and update the departure time | attemptTemporalDeconfliction() |
|
|
59
61
|
| Pathing | Will perform a pathing request and return the pathing result | doPathingTask() |
|
|
60
62
|
|
|
61
|
-
|
|
62
63
|
### Response data format
|
|
63
64
|
|
|
64
65
|
Direct functions return an object with a data field and an error field. Only exactly one of these is defined, the other is undefined.
|
package/dist/direct.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export type getFlightplan = paths['/flightplans/{flightplan_id}']['get'];
|
|
|
12
12
|
export type getFlightplanWaypointsDetailed = paths['/flightplans/{flightplan_id}/waypoints_detail']['get'];
|
|
13
13
|
export type getFlightplanStatistics = paths['/flightplans/{flightplan_id}/statistics']['get'];
|
|
14
14
|
export type getFlightplanVolumes = paths['/flightplans/{flightplan_id}/volumes']['get'];
|
|
15
|
-
export type getFlightplanConflicts = paths['/flightplans/{flightplan_id}/conflicts']['get'];
|
|
16
15
|
export type getFlightplanDeconflictedStartTime = paths['/flightplans/{flightplan_id}/start_time_deconflict']['get'];
|
|
17
16
|
export type changeFlightplanState = paths['/flightplans/{flightplan_id}/state']['post'];
|
|
18
17
|
export type getFlightplanAsFile = paths['/flightplans/{flightplan_id}/content']['get'];
|
|
@@ -267,42 +266,6 @@ export declare class Direct {
|
|
|
267
266
|
response: Response;
|
|
268
267
|
aborted: false;
|
|
269
268
|
}>;
|
|
270
|
-
/**
|
|
271
|
-
* Retrieve Flightplan Conflicts
|
|
272
|
-
* @deprecated
|
|
273
|
-
* @description Retrieve all the conflicts for the specified flightplan, categorised by their state.
|
|
274
|
-
*
|
|
275
|
-
* Flightplans of state `Closed` are ignored.
|
|
276
|
-
*
|
|
277
|
-
* Note that Flightplans which are in the category `Draft` will not prevent transitioning the specified flightplan in
|
|
278
|
-
* to the `Accepted` state and instead are intended as a warning. Flightplans in the `Accepted` state will prevent
|
|
279
|
-
* transition of the specified flightplan to `Accepted`.
|
|
280
|
-
*/
|
|
281
|
-
getFlightplanConflicts<Opts extends requestOptions = {}>(id: pathOf<getFlightplanConflicts>['flightplan_id'], opts?: Opts | requestOptions): Promise<{
|
|
282
|
-
data?: never;
|
|
283
|
-
error: {
|
|
284
|
-
errors: {
|
|
285
|
-
detail: string;
|
|
286
|
-
status: "401" | "400" | "422" | "404";
|
|
287
|
-
}[];
|
|
288
|
-
status: "401" | "400" | "422" | "404";
|
|
289
|
-
};
|
|
290
|
-
response: Response;
|
|
291
|
-
aborted: false;
|
|
292
|
-
} | (keyof Opts extends never ? never : Opts["abortKey"] extends undefined ? never : Opts["abortKey"] extends string | undefined ? {
|
|
293
|
-
data?: never;
|
|
294
|
-
error?: never;
|
|
295
|
-
response?: never;
|
|
296
|
-
aborted: true;
|
|
297
|
-
} : never) | {
|
|
298
|
-
data: {
|
|
299
|
-
data: import("./volant-schema").components["schemas"]["FlightplanConflictResponse"] | import("./volant-schema").components["schemas"]["AirspaceConstraintConflictResponse"];
|
|
300
|
-
links: import("./volant-schema").components["schemas"]["Links"];
|
|
301
|
-
}[];
|
|
302
|
-
error?: never;
|
|
303
|
-
response: Response;
|
|
304
|
-
aborted: false;
|
|
305
|
-
}>;
|
|
306
269
|
/**
|
|
307
270
|
* Returns the inputted flightplan with an updated start time that does not conflict
|
|
308
271
|
* @description Get a new start time for a draft flightplan which will not conflict with any occupied airspace.
|
package/dist/direct.js
CHANGED
|
@@ -81,15 +81,6 @@ class Direct {
|
|
|
81
81
|
return resp;
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
getFlightplanConflicts(id, opts) {
|
|
85
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
-
const resp = yield this.fetcher.GET('/flightplans/{flightplan_id}/conflicts', { path: { flightplan_id: id } }, opts);
|
|
87
|
-
if (resp.error === undefined && !resp.aborted) {
|
|
88
|
-
return Object.assign(Object.assign({}, resp), { data: resp.data.data });
|
|
89
|
-
}
|
|
90
|
-
return resp;
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
84
|
// TODO: make a wrapper for this which updates the existing flightplan to have this new start time
|
|
94
85
|
getFlightplanDeconflictedStartTime(id, args, opts) {
|
|
95
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = default_1;
|
|
4
|
+
let schemaLocated = false;
|
|
4
5
|
/**
|
|
5
6
|
* Follows the 'paths' import to get a mapping of endpoint -> docstrings from the schema file.
|
|
6
7
|
* The relevant part of the schema is in the shape below
|
|
@@ -29,6 +30,7 @@ function gatherDocstrings(node, tsInstance, program) {
|
|
|
29
30
|
// if this import is not the schema, stop
|
|
30
31
|
if (!(importSymbol === null || importSymbol === void 0 ? void 0 : importSymbol.getName().includes('schema')))
|
|
31
32
|
return;
|
|
33
|
+
schemaLocated = true;
|
|
32
34
|
const exportSymbols = typeChecker.getExportsOfModule(importSymbol);
|
|
33
35
|
for (const rootSymbol of exportSymbols) {
|
|
34
36
|
if (rootSymbol.getName() === 'paths') {
|
|
@@ -146,6 +148,9 @@ function default_1(program, _pluginConfig, { ts: tsInstance }) {
|
|
|
146
148
|
const endpointDocstrings = gatherDocstrings(sourceFile, tsInstance, program);
|
|
147
149
|
if (endpointDocstrings === undefined) {
|
|
148
150
|
console.error('endpoint docstrings were not found');
|
|
151
|
+
if (!schemaLocated) {
|
|
152
|
+
console.error('the schema file was not found at all, file is likely missing (try npm run gen-schema)');
|
|
153
|
+
}
|
|
149
154
|
return sourceFile;
|
|
150
155
|
}
|
|
151
156
|
const endpointIdentifiers = gatherIdentifiers(sourceFile, {}, tsInstance, program);
|
package/dist/volant-schema.d.ts
CHANGED
|
@@ -157,33 +157,6 @@ export interface paths {
|
|
|
157
157
|
patch?: never;
|
|
158
158
|
trace?: never;
|
|
159
159
|
};
|
|
160
|
-
"/flightplans/{flightplan_id}/conflicts": {
|
|
161
|
-
parameters: {
|
|
162
|
-
query?: never;
|
|
163
|
-
header?: never;
|
|
164
|
-
path?: never;
|
|
165
|
-
cookie?: never;
|
|
166
|
-
};
|
|
167
|
-
/**
|
|
168
|
-
* Retrieve Flightplan Conflicts
|
|
169
|
-
* @deprecated
|
|
170
|
-
* @description Retrieve all the conflicts for the specified flightplan, categorised by their state.
|
|
171
|
-
*
|
|
172
|
-
* Flightplans of state `Closed` are ignored.
|
|
173
|
-
*
|
|
174
|
-
* Note that Flightplans which are in the category `Draft` will not prevent transitioning the specified flightplan in
|
|
175
|
-
* to the `Accepted` state and instead are intended as a warning. Flightplans in the `Accepted` state will prevent
|
|
176
|
-
* transition of the specified flightplan to `Accepted`.
|
|
177
|
-
*/
|
|
178
|
-
get: operations["flightplan_conflicts_v1_flightplans__flightplan_id__conflicts_get"];
|
|
179
|
-
put?: never;
|
|
180
|
-
post?: never;
|
|
181
|
-
delete?: never;
|
|
182
|
-
options?: never;
|
|
183
|
-
head?: never;
|
|
184
|
-
patch?: never;
|
|
185
|
-
trace?: never;
|
|
186
|
-
};
|
|
187
160
|
"/flightplans/{flightplan_id}/start_time_deconflict": {
|
|
188
161
|
parameters: {
|
|
189
162
|
query?: never;
|
|
@@ -794,26 +767,6 @@ export interface components {
|
|
|
794
767
|
*/
|
|
795
768
|
volumes: components["schemas"]["Volume4D-Output"][];
|
|
796
769
|
};
|
|
797
|
-
/**
|
|
798
|
-
* AirspaceConstraintConflictResponse
|
|
799
|
-
* @description Summary of a Conflicting Airspace Constraint Resource.
|
|
800
|
-
*/
|
|
801
|
-
AirspaceConstraintConflictResponse: {
|
|
802
|
-
/**
|
|
803
|
-
* Airspace Constraint ID
|
|
804
|
-
* Format: uuid
|
|
805
|
-
* @description Unique identifier of the Airspace Constraint.
|
|
806
|
-
*/
|
|
807
|
-
id: string;
|
|
808
|
-
/**
|
|
809
|
-
* Type
|
|
810
|
-
* @default airspace_constraint
|
|
811
|
-
* @constant
|
|
812
|
-
* @enum {string}
|
|
813
|
-
*/
|
|
814
|
-
type?: "airspace_constraint";
|
|
815
|
-
meta: components["schemas"]["AirspaceConstraintMeta"];
|
|
816
|
-
};
|
|
817
770
|
/** AirspaceConstraintMeta */
|
|
818
771
|
AirspaceConstraintMeta: {
|
|
819
772
|
/** @description State of an airspace constraint.
|
|
@@ -1225,26 +1178,6 @@ export interface components {
|
|
|
1225
1178
|
/** @default {} */
|
|
1226
1179
|
volume_settings?: components["schemas"]["VolumeSettings"];
|
|
1227
1180
|
};
|
|
1228
|
-
/**
|
|
1229
|
-
* FlightplanConflictResponse
|
|
1230
|
-
* @description Summary of a Conflicting Flightplan Resource.
|
|
1231
|
-
*/
|
|
1232
|
-
FlightplanConflictResponse: {
|
|
1233
|
-
/**
|
|
1234
|
-
* Flightplan ID
|
|
1235
|
-
* Format: uuid
|
|
1236
|
-
* @description Unique identifier of the flightplan.
|
|
1237
|
-
*/
|
|
1238
|
-
id: string;
|
|
1239
|
-
/**
|
|
1240
|
-
* Type
|
|
1241
|
-
* @default flightplan
|
|
1242
|
-
* @constant
|
|
1243
|
-
* @enum {string}
|
|
1244
|
-
*/
|
|
1245
|
-
type?: "flightplan";
|
|
1246
|
-
meta: components["schemas"]["FlightplanMeta"];
|
|
1247
|
-
};
|
|
1248
1181
|
/** FlightplanMeta */
|
|
1249
1182
|
FlightplanMeta: {
|
|
1250
1183
|
/** @description State of a flightplan.
|
|
@@ -1649,12 +1582,6 @@ export interface components {
|
|
|
1649
1582
|
data: components["schemas"]["JsonApiResponse_FlightplanResponse_"][];
|
|
1650
1583
|
links: components["schemas"]["Links"];
|
|
1651
1584
|
};
|
|
1652
|
-
/** JsonApiListResponse[JsonApiResponse[Union[FlightplanConflictResponse, AirspaceConstraintConflictResponse]]] */
|
|
1653
|
-
JsonApiListResponse_JsonApiResponse_Union_FlightplanConflictResponse__AirspaceConstraintConflictResponse___: {
|
|
1654
|
-
/** Data */
|
|
1655
|
-
data: components["schemas"]["JsonApiResponse_Union_FlightplanConflictResponse__AirspaceConstraintConflictResponse__"][];
|
|
1656
|
-
links: components["schemas"]["Links"];
|
|
1657
|
-
};
|
|
1658
1585
|
/** JsonApiListResponse[JsonApiResponse[VolumeResponse]] */
|
|
1659
1586
|
JsonApiListResponse_JsonApiResponse_VolumeResponse__: {
|
|
1660
1587
|
/** Data */
|
|
@@ -1731,12 +1658,6 @@ export interface components {
|
|
|
1731
1658
|
data: components["schemas"]["StatisticsResponse"];
|
|
1732
1659
|
links: components["schemas"]["Links"];
|
|
1733
1660
|
};
|
|
1734
|
-
/** JsonApiResponse[Union[FlightplanConflictResponse, AirspaceConstraintConflictResponse]] */
|
|
1735
|
-
JsonApiResponse_Union_FlightplanConflictResponse__AirspaceConstraintConflictResponse__: {
|
|
1736
|
-
/** Data */
|
|
1737
|
-
data: components["schemas"]["FlightplanConflictResponse"] | components["schemas"]["AirspaceConstraintConflictResponse"];
|
|
1738
|
-
links: components["schemas"]["Links"];
|
|
1739
|
-
};
|
|
1740
1661
|
/** JsonApiResponse[VolumeResponse] */
|
|
1741
1662
|
JsonApiResponse_VolumeResponse_: {
|
|
1742
1663
|
data: components["schemas"]["VolumeResponse"];
|
|
@@ -2208,6 +2129,16 @@ export interface components {
|
|
|
2208
2129
|
* @description The ground risk buffer is an area on the ground that surrounds the footprint of the contingency volume. It is expected that if the flight exits the contingency volume during a loss of control of the operation that the flight will be terminated within this lateral distance.
|
|
2209
2130
|
*/
|
|
2210
2131
|
ground_risk_buffer: number;
|
|
2132
|
+
/**
|
|
2133
|
+
* Controlled Ground Area Id
|
|
2134
|
+
* @description Applies a Controlled Ground Area to the determination of the GRC for the provided waypoints. If any 2 waypoints and their associated ground risk footprint are found to be wholly contained within the Controlled Ground Area then the intrinsic GRC for this section will be equal to that of a Controlled Ground Area for the supplied aircraft. If there is partial overlap, then any population within it will be set to 0 for the purposes of determining maximum overflown population density.
|
|
2135
|
+
*/
|
|
2136
|
+
controlled_ground_area_id?: string | null;
|
|
2137
|
+
/**
|
|
2138
|
+
* Atypical Airspace Id
|
|
2139
|
+
* @description Applies an Atypical Airspace to the determination of the ARC for the provided waypoints. If any 2 waypoints and their associated operational volume are found to be wholly contained within the the Atypical Airspace in 3D space then the ARC for this section will be ARC-A. Atypical Airspaces will not have an effect if there is only partial overlap.
|
|
2140
|
+
*/
|
|
2141
|
+
atypical_airspace_id?: string | null;
|
|
2211
2142
|
};
|
|
2212
2143
|
/** SoraReportResponse */
|
|
2213
2144
|
SoraReportResponse: {
|
|
@@ -3147,65 +3078,6 @@ export interface operations {
|
|
|
3147
3078
|
};
|
|
3148
3079
|
};
|
|
3149
3080
|
};
|
|
3150
|
-
flightplan_conflicts_v1_flightplans__flightplan_id__conflicts_get: {
|
|
3151
|
-
parameters: {
|
|
3152
|
-
query?: never;
|
|
3153
|
-
header?: never;
|
|
3154
|
-
path: {
|
|
3155
|
-
/** @description Unique identifier of the flightplan. */
|
|
3156
|
-
flightplan_id: string;
|
|
3157
|
-
};
|
|
3158
|
-
cookie?: never;
|
|
3159
|
-
};
|
|
3160
|
-
requestBody?: never;
|
|
3161
|
-
responses: {
|
|
3162
|
-
/** @description Successful Response */
|
|
3163
|
-
200: {
|
|
3164
|
-
headers: {
|
|
3165
|
-
[name: string]: unknown;
|
|
3166
|
-
};
|
|
3167
|
-
content: {
|
|
3168
|
-
"application/json": components["schemas"]["JsonApiListResponse_JsonApiResponse_Union_FlightplanConflictResponse__AirspaceConstraintConflictResponse___"];
|
|
3169
|
-
};
|
|
3170
|
-
};
|
|
3171
|
-
/** @description One or more input parameters were missing or invalid. */
|
|
3172
|
-
400: {
|
|
3173
|
-
headers: {
|
|
3174
|
-
[name: string]: unknown;
|
|
3175
|
-
};
|
|
3176
|
-
content: {
|
|
3177
|
-
"application/json": components["schemas"]["JsonApiExceptionResponse"];
|
|
3178
|
-
};
|
|
3179
|
-
};
|
|
3180
|
-
/** @description Bearer access token was not provided in Authorization header, token could not be decoded, or token was invalid. */
|
|
3181
|
-
401: {
|
|
3182
|
-
headers: {
|
|
3183
|
-
[name: string]: unknown;
|
|
3184
|
-
};
|
|
3185
|
-
content: {
|
|
3186
|
-
"application/json": components["schemas"]["JsonApiExceptionResponse"];
|
|
3187
|
-
};
|
|
3188
|
-
};
|
|
3189
|
-
/** @description The requested resource could not be found */
|
|
3190
|
-
404: {
|
|
3191
|
-
headers: {
|
|
3192
|
-
[name: string]: unknown;
|
|
3193
|
-
};
|
|
3194
|
-
content: {
|
|
3195
|
-
"application/json": components["schemas"]["JsonApiExceptionResponse"];
|
|
3196
|
-
};
|
|
3197
|
-
};
|
|
3198
|
-
/** @description Validation Error */
|
|
3199
|
-
422: {
|
|
3200
|
-
headers: {
|
|
3201
|
-
[name: string]: unknown;
|
|
3202
|
-
};
|
|
3203
|
-
content: {
|
|
3204
|
-
"application/json": components["schemas"]["HTTPValidationError"];
|
|
3205
|
-
};
|
|
3206
|
-
};
|
|
3207
|
-
};
|
|
3208
|
-
};
|
|
3209
3081
|
flightplan_deconflicted_start_time_v1_flightplans__flightplan_id__start_time_deconflict_get: {
|
|
3210
3082
|
parameters: {
|
|
3211
3083
|
query?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volant-autonomy/via-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2801.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"standard": "^17.0.0",
|
|
33
33
|
"ts-jest": "^29.1.5",
|
|
34
34
|
"ts-node": "^10.9.2",
|
|
35
|
-
"ts-patch": "^3.
|
|
36
|
-
"typescript": "^5.
|
|
35
|
+
"ts-patch": "^3.3.0",
|
|
36
|
+
"typescript": "^5.7.2"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"prepack": "npm run build",
|
|
40
|
-
"build": "
|
|
40
|
+
"build": "./build.sh",
|
|
41
41
|
"build-test": "./build-test.sh",
|
|
42
42
|
"gen-schema": "./gen-schema.sh",
|
|
43
43
|
"test": "node --experimental-vm-modules ./node_modules/.bin/jest --silent",
|