@volant-autonomy/via-sdk 1.4775.1 → 1.4808.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/index.cjs.js +92 -122
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +92 -122
- package/dist/index.esm.js.map +1 -1
- package/package.json +15 -14
package/dist/index.esm.js
CHANGED
|
@@ -171,7 +171,7 @@ class Direct {
|
|
|
171
171
|
async getAllFlightplans(args, opts) {
|
|
172
172
|
const resp = await this.fetcher.GET('/flightplans/', { query: args }, opts);
|
|
173
173
|
if (resp.error === undefined && !resp.aborted) {
|
|
174
|
-
return
|
|
174
|
+
return { ...resp, data: resp.data.data.map((flightplan) => flightplan.data) };
|
|
175
175
|
}
|
|
176
176
|
else {
|
|
177
177
|
return resp;
|
|
@@ -180,21 +180,21 @@ class Direct {
|
|
|
180
180
|
async createDraftFlightplan(args, opts) {
|
|
181
181
|
const resp = await this.fetcher.POST('/flightplans/', { body: args }, opts);
|
|
182
182
|
if (resp.error === undefined && !resp.aborted) {
|
|
183
|
-
return
|
|
183
|
+
return { ...resp, data: resp.data.data };
|
|
184
184
|
}
|
|
185
185
|
return resp;
|
|
186
186
|
}
|
|
187
187
|
async modifyDraftFlightplan(id, args, opts) {
|
|
188
188
|
const resp = await this.fetcher.PUT('/flightplans/{flightplan_id}', { body: args, path: { flightplan_id: id } }, opts);
|
|
189
189
|
if (resp.error === undefined && !resp.aborted) {
|
|
190
|
-
return
|
|
190
|
+
return { ...resp, data: resp.data.data };
|
|
191
191
|
}
|
|
192
192
|
return resp;
|
|
193
193
|
}
|
|
194
194
|
async getFlightplan(id, opts) {
|
|
195
195
|
const resp = await this.fetcher.GET('/flightplans/{flightplan_id}', { path: { flightplan_id: id } }, opts);
|
|
196
196
|
if (resp.error === undefined && !resp.aborted) {
|
|
197
|
-
return
|
|
197
|
+
return { ...resp, data: resp.data.data };
|
|
198
198
|
}
|
|
199
199
|
return resp;
|
|
200
200
|
}
|
|
@@ -202,28 +202,28 @@ class Direct {
|
|
|
202
202
|
async getFlightplanWaypointsDetailed(id, opts) {
|
|
203
203
|
const resp = await this.fetcher.GET('/flightplans/{flightplan_id}/waypoints_detail', { path: { flightplan_id: id } }, opts);
|
|
204
204
|
if (resp.error === undefined && !resp.aborted) {
|
|
205
|
-
return
|
|
205
|
+
return { ...resp, data: resp.data.data };
|
|
206
206
|
}
|
|
207
207
|
return resp;
|
|
208
208
|
}
|
|
209
209
|
async getFlightplanProfile(id, args, opts) {
|
|
210
210
|
const resp = await this.fetcher.GET('/flightplans/{flightplan_id}/profile', { path: { flightplan_id: id }, query: args }, opts);
|
|
211
211
|
if (resp.error === undefined && !resp.aborted) {
|
|
212
|
-
return
|
|
212
|
+
return { ...resp, data: resp.data.data };
|
|
213
213
|
}
|
|
214
214
|
return resp;
|
|
215
215
|
}
|
|
216
216
|
async getFlightplanStatistics(id, args, opts) {
|
|
217
217
|
const resp = await this.fetcher.GET('/flightplans/{flightplan_id}/statistics', { path: { flightplan_id: id }, query: args }, opts);
|
|
218
218
|
if (resp.error === undefined && !resp.aborted) {
|
|
219
|
-
return
|
|
219
|
+
return { ...resp, data: resp.data.data };
|
|
220
220
|
}
|
|
221
221
|
return resp;
|
|
222
222
|
}
|
|
223
223
|
async getFlightplanVolumes(id, args, opts) {
|
|
224
224
|
const resp = await this.fetcher.GET('/flightplans/{flightplan_id}/volumes', { path: { flightplan_id: id }, query: args }, opts);
|
|
225
225
|
if (resp.error === undefined && !resp.aborted) {
|
|
226
|
-
return
|
|
226
|
+
return { ...resp, data: resp.data.data };
|
|
227
227
|
}
|
|
228
228
|
return resp;
|
|
229
229
|
}
|
|
@@ -231,22 +231,22 @@ class Direct {
|
|
|
231
231
|
async getFlightplanDeconflictedStartTime(id, args, opts) {
|
|
232
232
|
const resp = await this.fetcher.GET('/flightplans/{flightplan_id}/start_time_deconflict', { path: { flightplan_id: id }, query: args }, opts);
|
|
233
233
|
if (resp.error === undefined && !resp.aborted) {
|
|
234
|
-
return
|
|
234
|
+
return { ...resp, data: resp.data.data };
|
|
235
235
|
}
|
|
236
236
|
return resp;
|
|
237
237
|
}
|
|
238
238
|
async changeFlightplanState(id, state, opts) {
|
|
239
239
|
const resp = await this.fetcher.POST('/flightplans/{flightplan_id}/state', { path: { flightplan_id: id }, body: { state } }, opts);
|
|
240
240
|
if (!resp.error && resp.aborted === false) {
|
|
241
|
-
return
|
|
241
|
+
return { ...resp, data: true };
|
|
242
242
|
}
|
|
243
243
|
return resp;
|
|
244
244
|
}
|
|
245
245
|
// TODO: use `args` instead of fileFormat
|
|
246
246
|
async getFlightplanAsFile(id, opts) {
|
|
247
|
-
const resp = await this.fetcher.GET('/flightplans/{flightplan_id}/content', { path: { flightplan_id: id }, header: { accept: 'application/vnd.google-earth.kml+xml' } },
|
|
247
|
+
const resp = await this.fetcher.GET('/flightplans/{flightplan_id}/content', { path: { flightplan_id: id }, header: { accept: 'application/vnd.google-earth.kml+xml' } }, { ...opts, parseAs: 'blob' });
|
|
248
248
|
if (resp.error === undefined && !resp.aborted) {
|
|
249
|
-
return
|
|
249
|
+
return { ...resp, data: { file: resp.data, fileName: resp.response.headers.get('filename') } };
|
|
250
250
|
}
|
|
251
251
|
return resp;
|
|
252
252
|
}
|
|
@@ -254,35 +254,35 @@ class Direct {
|
|
|
254
254
|
async createAirspaceConstraint(args, opts) {
|
|
255
255
|
const resp = await this.fetcher.POST('/airspace_constraints/', { body: args }, opts);
|
|
256
256
|
if (resp.error === undefined && !resp.aborted) {
|
|
257
|
-
return
|
|
257
|
+
return { ...resp, data: resp.data.data };
|
|
258
258
|
}
|
|
259
259
|
return resp;
|
|
260
260
|
}
|
|
261
261
|
async getAllAirspaceConstraints(opts) {
|
|
262
262
|
const resp = await this.fetcher.GET('/airspace_constraints/', {}, opts);
|
|
263
263
|
if (resp.error === undefined && !resp.aborted) {
|
|
264
|
-
return
|
|
264
|
+
return { ...resp, data: resp.data.data.map((constraint) => constraint.data) };
|
|
265
265
|
}
|
|
266
266
|
return resp;
|
|
267
267
|
}
|
|
268
268
|
async getAirspaceConstraint(id, opts) {
|
|
269
269
|
const resp = await this.fetcher.GET('/airspace_constraints/{airspace_constraint_id}', { path: { airspace_constraint_id: id } }, opts);
|
|
270
270
|
if (resp.error === undefined && !resp.aborted) {
|
|
271
|
-
return
|
|
271
|
+
return { ...resp, data: resp.data.data };
|
|
272
272
|
}
|
|
273
273
|
return resp;
|
|
274
274
|
}
|
|
275
275
|
async modifyAirspaceConstraint(id, args, opts) {
|
|
276
276
|
const resp = await this.fetcher.PUT('/airspace_constraints/{airspace_constraint_id}', { path: { airspace_constraint_id: id }, body: args }, opts);
|
|
277
277
|
if (resp.error === undefined && !resp.aborted) {
|
|
278
|
-
return
|
|
278
|
+
return { ...resp, data: resp.data.data };
|
|
279
279
|
}
|
|
280
280
|
return resp;
|
|
281
281
|
}
|
|
282
282
|
async changeAirspaceConstraintState(id, state, opts) {
|
|
283
283
|
const resp = await this.fetcher.POST('/airspace_constraints/{airspace_constraints_id}/state', { path: { airspace_constraints_id: id }, body: { state } }, opts);
|
|
284
284
|
if (!resp.error && resp.aborted === false) {
|
|
285
|
-
return
|
|
285
|
+
return { ...resp, data: true };
|
|
286
286
|
}
|
|
287
287
|
return resp;
|
|
288
288
|
}
|
|
@@ -290,14 +290,14 @@ class Direct {
|
|
|
290
290
|
async createPathingTask(args, opts) {
|
|
291
291
|
const resp = await this.fetcher.POST('/pathing_tasks/', { body: args }, opts);
|
|
292
292
|
if (resp.error === undefined && !resp.aborted) {
|
|
293
|
-
return
|
|
293
|
+
return { ...resp, data: resp.data.data };
|
|
294
294
|
}
|
|
295
295
|
return resp;
|
|
296
296
|
}
|
|
297
297
|
async getPathingTask(id, opts) {
|
|
298
298
|
const resp = await this.fetcher.GET('/pathing_tasks/{pathing_task_id}', { path: { pathing_task_id: id } }, opts);
|
|
299
299
|
if (resp.error === undefined && !resp.aborted) {
|
|
300
|
-
return
|
|
300
|
+
return { ...resp, data: resp.data.data };
|
|
301
301
|
}
|
|
302
302
|
return resp;
|
|
303
303
|
}
|
|
@@ -310,14 +310,14 @@ class Direct {
|
|
|
310
310
|
async getAllCharts(opts) {
|
|
311
311
|
const resp = await this.fetcher.GET('/charts/', {}, opts);
|
|
312
312
|
if (resp.error === undefined && !resp.aborted) {
|
|
313
|
-
return
|
|
313
|
+
return { ...resp, data: resp.data.data.map((chart) => chart.data) };
|
|
314
314
|
}
|
|
315
315
|
return resp;
|
|
316
316
|
}
|
|
317
317
|
async getChart(id, opts) {
|
|
318
318
|
const resp = await this.fetcher.GET('/charts/{chart_id}', { path: { chart_id: id } }, opts);
|
|
319
319
|
if (resp.error === undefined && !resp.aborted) {
|
|
320
|
-
return
|
|
320
|
+
return { ...resp, data: resp.data.data };
|
|
321
321
|
}
|
|
322
322
|
return resp;
|
|
323
323
|
}
|
|
@@ -325,105 +325,105 @@ class Direct {
|
|
|
325
325
|
async getSailV2_5(args, opts) {
|
|
326
326
|
const resp = await this.fetcher.GET('/risk_assessment/sora/v2.5/sail', { query: args }, opts);
|
|
327
327
|
if (resp.error === undefined && !resp.aborted) {
|
|
328
|
-
return
|
|
328
|
+
return { ...resp, data: resp.data.data };
|
|
329
329
|
}
|
|
330
330
|
return resp;
|
|
331
331
|
}
|
|
332
332
|
async calculateResidualArcV2_5(args, opts) {
|
|
333
333
|
const resp = await this.fetcher.POST('/risk_assessment/sora/v2.5/residual_arc', { body: args }, opts);
|
|
334
334
|
if (resp.error === undefined && !resp.aborted) {
|
|
335
|
-
return
|
|
335
|
+
return { ...resp, data: resp.data.data };
|
|
336
336
|
}
|
|
337
337
|
return resp;
|
|
338
338
|
}
|
|
339
339
|
async getAllArcsV2_5(opts) {
|
|
340
340
|
const resp = await this.fetcher.GET('/risk_assessment/sora/v2.5/air_risk_classifications', {}, opts);
|
|
341
341
|
if (resp.error === undefined && !resp.aborted) {
|
|
342
|
-
return
|
|
342
|
+
return { ...resp, data: resp.data.data.map((arc) => arc.data) };
|
|
343
343
|
}
|
|
344
344
|
return resp;
|
|
345
345
|
}
|
|
346
346
|
async getArcV2_5(args, opts) {
|
|
347
347
|
const resp = await this.fetcher.GET('/risk_assessment/sora/v2.5/air_risk_classifications/{arc_id}', { path: args }, opts);
|
|
348
348
|
if (resp.error === undefined && !resp.aborted) {
|
|
349
|
-
return
|
|
349
|
+
return { ...resp, data: resp.data.data };
|
|
350
350
|
}
|
|
351
351
|
return resp;
|
|
352
352
|
}
|
|
353
353
|
async generateSoraReportV2_5(args, opts) {
|
|
354
354
|
const resp = await this.fetcher.POST('/risk_assessment/sora/v2.5/report', { body: args }, opts);
|
|
355
355
|
if (resp.error === undefined && !resp.aborted) {
|
|
356
|
-
return
|
|
356
|
+
return { ...resp, data: resp.data.data };
|
|
357
357
|
}
|
|
358
358
|
return resp;
|
|
359
359
|
}
|
|
360
360
|
async generateSoraSemanticModelVolumesV2_5(args, opts) {
|
|
361
361
|
const resp = await this.fetcher.POST('/risk_assessment/sora/v2.5/semantic_model_volumes', { body: args }, opts);
|
|
362
362
|
if (resp.error === undefined && !resp.aborted) {
|
|
363
|
-
return
|
|
363
|
+
return { ...resp, data: resp.data.data };
|
|
364
364
|
}
|
|
365
365
|
return resp;
|
|
366
366
|
}
|
|
367
367
|
async getAllArcsUk(opts) {
|
|
368
368
|
const resp = await this.fetcher.GET('/risk_assessment/sora/uk/air_risk_classifications', {}, opts);
|
|
369
369
|
if (resp.error === undefined && !resp.aborted) {
|
|
370
|
-
return
|
|
370
|
+
return { ...resp, data: resp.data.data.map((arc) => arc.data) };
|
|
371
371
|
}
|
|
372
372
|
return resp;
|
|
373
373
|
}
|
|
374
374
|
async getArcUk(args, opts) {
|
|
375
375
|
const resp = await this.fetcher.GET('/risk_assessment/sora/uk/air_risk_classifications/{arc_id}', { path: args }, opts);
|
|
376
376
|
if (resp.error === undefined && !resp.aborted) {
|
|
377
|
-
return
|
|
377
|
+
return { ...resp, data: resp.data.data };
|
|
378
378
|
}
|
|
379
379
|
return resp;
|
|
380
380
|
}
|
|
381
381
|
async getSailUk(args, opts) {
|
|
382
382
|
const resp = await this.fetcher.GET('/risk_assessment/sora/uk/sail', { query: args }, opts);
|
|
383
383
|
if (resp.error === undefined && !resp.aborted) {
|
|
384
|
-
return
|
|
384
|
+
return { ...resp, data: resp.data.data };
|
|
385
385
|
}
|
|
386
386
|
return resp;
|
|
387
387
|
}
|
|
388
388
|
async calculateResidualArcUk(args, opts) {
|
|
389
389
|
const resp = await this.fetcher.POST('/risk_assessment/sora/uk/residual_arc', { body: args }, opts);
|
|
390
390
|
if (resp.error === undefined && !resp.aborted) {
|
|
391
|
-
return
|
|
391
|
+
return { ...resp, data: resp.data.data };
|
|
392
392
|
}
|
|
393
393
|
return resp;
|
|
394
394
|
}
|
|
395
395
|
async generateSoraReportUk(args, opts) {
|
|
396
396
|
const resp = await this.fetcher.POST('/risk_assessment/sora/uk/report', { body: args }, opts);
|
|
397
397
|
if (resp.error === undefined && !resp.aborted) {
|
|
398
|
-
return
|
|
398
|
+
return { ...resp, data: resp.data.data };
|
|
399
399
|
}
|
|
400
400
|
return resp;
|
|
401
401
|
}
|
|
402
402
|
async generateSoraSemanticModelVolumesUk(args, opts) {
|
|
403
403
|
const resp = await this.fetcher.POST('/risk_assessment/sora/uk/semantic_model_volumes', { body: args }, opts);
|
|
404
404
|
if (resp.error === undefined && !resp.aborted) {
|
|
405
|
-
return
|
|
405
|
+
return { ...resp, data: resp.data.data };
|
|
406
406
|
}
|
|
407
407
|
return resp;
|
|
408
408
|
}
|
|
409
409
|
async createSoraClassification(args, opts) {
|
|
410
410
|
const resp = await this.fetcher.POST('/risk_assessment/sora/classifications', { body: args }, opts);
|
|
411
411
|
if (resp.error === undefined && !resp.aborted) {
|
|
412
|
-
return
|
|
412
|
+
return { ...resp, data: resp.data.data };
|
|
413
413
|
}
|
|
414
414
|
return resp;
|
|
415
415
|
}
|
|
416
416
|
async updateSoraClassification(id, args, opts) {
|
|
417
417
|
const resp = await this.fetcher.PUT('/risk_assessment/sora/classifications/{classification_id}', { body: args, path: { classification_id: id } }, opts);
|
|
418
418
|
if (resp.error === undefined && !resp.aborted) {
|
|
419
|
-
return
|
|
419
|
+
return { ...resp, data: resp.data.data };
|
|
420
420
|
}
|
|
421
421
|
return resp;
|
|
422
422
|
}
|
|
423
423
|
async getSoraClassification(id, opts) {
|
|
424
424
|
const resp = await this.fetcher.GET('/risk_assessment/sora/classifications/{classification_id}', { path: { classification_id: id } }, opts);
|
|
425
425
|
if (resp.error === undefined && !resp.aborted) {
|
|
426
|
-
return
|
|
426
|
+
return { ...resp, data: resp.data.data };
|
|
427
427
|
}
|
|
428
428
|
return resp;
|
|
429
429
|
}
|
|
@@ -431,7 +431,10 @@ class Direct {
|
|
|
431
431
|
async getAllControlledGroundAreas(args, opts) {
|
|
432
432
|
const resp = await this.fetcher.GET('/risk_assessment/sora/controlled_ground_areas/', { query: args }, opts);
|
|
433
433
|
if (resp.error === undefined && !resp.aborted) {
|
|
434
|
-
return
|
|
434
|
+
return {
|
|
435
|
+
...resp,
|
|
436
|
+
data: resp.data.data.map((controlledGroundArea) => controlledGroundArea.data)
|
|
437
|
+
};
|
|
435
438
|
}
|
|
436
439
|
else {
|
|
437
440
|
return resp;
|
|
@@ -440,28 +443,28 @@ class Direct {
|
|
|
440
443
|
async createControlledGroundArea(args, opts) {
|
|
441
444
|
const resp = await this.fetcher.POST('/risk_assessment/sora/controlled_ground_areas/', { body: args }, opts);
|
|
442
445
|
if (resp.error === undefined && !resp.aborted) {
|
|
443
|
-
return
|
|
446
|
+
return { ...resp, data: resp.data.data };
|
|
444
447
|
}
|
|
445
448
|
return resp;
|
|
446
449
|
}
|
|
447
450
|
async getControlledGroundArea(args, opts) {
|
|
448
451
|
const resp = await this.fetcher.GET('/risk_assessment/sora/controlled_ground_areas/{controlled_ground_area_id}', { path: args }, opts);
|
|
449
452
|
if (resp.error === undefined && !resp.aborted) {
|
|
450
|
-
return
|
|
453
|
+
return { ...resp, data: resp.data.data };
|
|
451
454
|
}
|
|
452
455
|
return resp;
|
|
453
456
|
}
|
|
454
457
|
async updateControlledGroundArea(id, args, opts) {
|
|
455
458
|
const resp = await this.fetcher.PUT('/risk_assessment/sora/controlled_ground_areas/{controlled_ground_area_id}', { body: args, path: { controlled_ground_area_id: id } }, opts);
|
|
456
459
|
if (resp.error === undefined && !resp.aborted) {
|
|
457
|
-
return
|
|
460
|
+
return { ...resp, data: resp.data.data };
|
|
458
461
|
}
|
|
459
462
|
return resp;
|
|
460
463
|
}
|
|
461
464
|
async deleteControlledGroundArea(args, opts) {
|
|
462
465
|
const resp = await this.fetcher.DELETE('/risk_assessment/sora/controlled_ground_areas/{controlled_ground_area_id}', { path: args }, opts);
|
|
463
466
|
if (resp.error === undefined && !resp.aborted) {
|
|
464
|
-
return
|
|
467
|
+
return { ...resp, data: true };
|
|
465
468
|
}
|
|
466
469
|
return resp;
|
|
467
470
|
}
|
|
@@ -469,7 +472,7 @@ class Direct {
|
|
|
469
472
|
async getAllAtypicalAirspaces(args, opts) {
|
|
470
473
|
const resp = await this.fetcher.GET('/risk_assessment/sora/atypical_airspaces/', { query: args }, opts);
|
|
471
474
|
if (resp.error === undefined && !resp.aborted) {
|
|
472
|
-
return
|
|
475
|
+
return { ...resp, data: resp.data.data.map((atypicalAirspace) => atypicalAirspace.data) };
|
|
473
476
|
}
|
|
474
477
|
else {
|
|
475
478
|
return resp;
|
|
@@ -478,28 +481,28 @@ class Direct {
|
|
|
478
481
|
async createAtypicalAirspace(args, opts) {
|
|
479
482
|
const resp = await this.fetcher.POST('/risk_assessment/sora/atypical_airspaces/', { body: args }, opts);
|
|
480
483
|
if (resp.error === undefined && !resp.aborted) {
|
|
481
|
-
return
|
|
484
|
+
return { ...resp, data: resp.data.data };
|
|
482
485
|
}
|
|
483
486
|
return resp;
|
|
484
487
|
}
|
|
485
488
|
async getAtypicalAirspace(args, opts) {
|
|
486
489
|
const resp = await this.fetcher.GET('/risk_assessment/sora/atypical_airspaces/{atypical_airspace_id}', { path: args }, opts);
|
|
487
490
|
if (resp.error === undefined && !resp.aborted) {
|
|
488
|
-
return
|
|
491
|
+
return { ...resp, data: resp.data.data };
|
|
489
492
|
}
|
|
490
493
|
return resp;
|
|
491
494
|
}
|
|
492
495
|
async updateAtypicalAirspace(id, args, opts) {
|
|
493
496
|
const resp = await this.fetcher.PUT('/risk_assessment/sora/atypical_airspaces/{atypical_airspace_id}', { body: args, path: { atypical_airspace_id: id } }, opts);
|
|
494
497
|
if (resp.error === undefined && !resp.aborted) {
|
|
495
|
-
return
|
|
498
|
+
return { ...resp, data: resp.data.data };
|
|
496
499
|
}
|
|
497
500
|
return resp;
|
|
498
501
|
}
|
|
499
502
|
async deleteAtypicalAirspace(args, opts) {
|
|
500
503
|
const resp = await this.fetcher.DELETE('/risk_assessment/sora/atypical_airspaces/{atypical_airspace_id}', { path: args }, opts);
|
|
501
504
|
if (resp.error === undefined && !resp.aborted) {
|
|
502
|
-
return
|
|
505
|
+
return { ...resp, data: true };
|
|
503
506
|
}
|
|
504
507
|
return resp;
|
|
505
508
|
}
|
|
@@ -507,21 +510,21 @@ class Direct {
|
|
|
507
510
|
async createGeocage(args, opts) {
|
|
508
511
|
const resp = await this.fetcher.POST('/geocages/', { body: args }, opts);
|
|
509
512
|
if (resp.error === undefined && !resp.aborted) {
|
|
510
|
-
return
|
|
513
|
+
return { ...resp, data: resp.data.data };
|
|
511
514
|
}
|
|
512
515
|
return resp;
|
|
513
516
|
}
|
|
514
517
|
async getGeocage(args, opts) {
|
|
515
518
|
const resp = await this.fetcher.GET('/geocages/{geocage_id}', { path: args }, opts);
|
|
516
519
|
if (resp.error === undefined && !resp.aborted) {
|
|
517
|
-
return
|
|
520
|
+
return { ...resp, data: resp.data.data };
|
|
518
521
|
}
|
|
519
522
|
return resp;
|
|
520
523
|
}
|
|
521
524
|
async getAllGeocages(args, opts) {
|
|
522
525
|
const resp = await this.fetcher.GET('/geocages/', { query: args }, opts);
|
|
523
526
|
if (resp.error === undefined && !resp.aborted) {
|
|
524
|
-
return
|
|
527
|
+
return { ...resp, data: resp.data.data };
|
|
525
528
|
}
|
|
526
529
|
else {
|
|
527
530
|
return resp;
|
|
@@ -530,14 +533,14 @@ class Direct {
|
|
|
530
533
|
async updateGeocage(id, args, opts) {
|
|
531
534
|
const resp = await this.fetcher.PUT('/geocages/{geocage_id}', { body: args, path: { geocage_id: id } }, opts);
|
|
532
535
|
if (resp.error === undefined && !resp.aborted) {
|
|
533
|
-
return
|
|
536
|
+
return { ...resp, data: resp.data.data };
|
|
534
537
|
}
|
|
535
538
|
return resp;
|
|
536
539
|
}
|
|
537
540
|
async deleteGeocage(args, opts) {
|
|
538
541
|
const resp = await this.fetcher.DELETE('/geocages/{geocage_id}', { path: args }, opts);
|
|
539
542
|
if (resp.error === undefined && !resp.aborted) {
|
|
540
|
-
return
|
|
543
|
+
return { ...resp, data: true };
|
|
541
544
|
}
|
|
542
545
|
return resp;
|
|
543
546
|
}
|
|
@@ -545,14 +548,14 @@ class Direct {
|
|
|
545
548
|
async getCostDataset(id, opts) {
|
|
546
549
|
const resp = await this.fetcher.GET('/cost_datasets/{cost_dataset_id}', { path: { cost_dataset_id: id } }, opts);
|
|
547
550
|
if (resp.error === undefined && !resp.aborted) {
|
|
548
|
-
return
|
|
551
|
+
return { ...resp, data: resp.data.data };
|
|
549
552
|
}
|
|
550
553
|
return resp;
|
|
551
554
|
}
|
|
552
555
|
async getAllCostDatasets(args, opts) {
|
|
553
556
|
const resp = await this.fetcher.GET('/cost_datasets/', { query: args }, opts);
|
|
554
557
|
if (resp.error === undefined && !resp.aborted) {
|
|
555
|
-
return
|
|
558
|
+
return { ...resp, data: resp.data.data.map((x) => x.data) };
|
|
556
559
|
}
|
|
557
560
|
return resp;
|
|
558
561
|
}
|
|
@@ -562,20 +565,22 @@ class Direct {
|
|
|
562
565
|
formData.append('name', args.name);
|
|
563
566
|
formData.append('valid_time_ranges', JSON.stringify(args.valid_time_ranges));
|
|
564
567
|
formData.append('geotiff', args.geotiff);
|
|
565
|
-
const resp = await this.fetcher.POST('/cost_datasets/', { body: formData },
|
|
568
|
+
const resp = await this.fetcher.POST('/cost_datasets/', { body: formData }, {
|
|
569
|
+
...opts,
|
|
566
570
|
// when sending a FormData object the browser will automatically
|
|
567
571
|
// set the Content-Type header to the correct value, if (and only if)
|
|
568
572
|
// you don't set it yourself
|
|
569
|
-
contentType: 'none'
|
|
573
|
+
contentType: 'none'
|
|
574
|
+
});
|
|
570
575
|
if (resp.error === undefined && !resp.aborted) {
|
|
571
|
-
return
|
|
576
|
+
return { ...resp, data: resp.data.data };
|
|
572
577
|
}
|
|
573
578
|
return resp;
|
|
574
579
|
}
|
|
575
580
|
async deleteCostDataset(id, opts) {
|
|
576
581
|
const resp = await this.fetcher.DELETE('/cost_datasets/{cost_dataset_id}', { path: { cost_dataset_id: id } }, opts);
|
|
577
582
|
if (resp.error === undefined && !resp.aborted) {
|
|
578
|
-
return
|
|
583
|
+
return { ...resp, data: true };
|
|
579
584
|
}
|
|
580
585
|
return resp;
|
|
581
586
|
}
|
|
@@ -583,73 +588,54 @@ class Direct {
|
|
|
583
588
|
async createRasterPattern(args, opts) {
|
|
584
589
|
const resp = await this.fetcher.POST('/flight_patterns/raster', { body: args }, opts);
|
|
585
590
|
if (resp.error === undefined && !resp.aborted) {
|
|
586
|
-
return
|
|
591
|
+
return { ...resp, data: resp.data.data };
|
|
587
592
|
}
|
|
588
593
|
return resp;
|
|
589
594
|
}
|
|
590
595
|
}
|
|
591
596
|
|
|
592
|
-
// settings & const
|
|
593
|
-
|
|
594
597
|
const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
595
|
-
|
|
596
|
-
// utils
|
|
597
|
-
|
|
598
|
-
/**
|
|
599
|
-
* Serialize primitive param values
|
|
600
|
-
* @type {import("./index.js").serializePrimitiveParam}
|
|
601
|
-
*/
|
|
602
598
|
function serializePrimitiveParam(name, value, options) {
|
|
603
|
-
if (value ===
|
|
599
|
+
if (value === void 0 || value === null) {
|
|
604
600
|
return "";
|
|
605
601
|
}
|
|
606
602
|
if (typeof value === "object") {
|
|
607
603
|
throw new Error(
|
|
608
|
-
"Deeply-nested arrays/objects aren
|
|
604
|
+
"Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these."
|
|
609
605
|
);
|
|
610
606
|
}
|
|
611
607
|
return `${name}=${options?.allowReserved === true ? value : encodeURIComponent(value)}`;
|
|
612
608
|
}
|
|
613
|
-
|
|
614
|
-
/**
|
|
615
|
-
* Serialize object param (shallow only)
|
|
616
|
-
* @type {import("./index.js").serializeObjectParam}
|
|
617
|
-
*/
|
|
618
609
|
function serializeObjectParam(name, value, options) {
|
|
619
610
|
if (!value || typeof value !== "object") {
|
|
620
611
|
return "";
|
|
621
612
|
}
|
|
622
613
|
const values = [];
|
|
623
|
-
const joiner =
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
}[options.style] || "&";
|
|
629
|
-
|
|
630
|
-
// explode: false
|
|
614
|
+
const joiner = {
|
|
615
|
+
simple: ",",
|
|
616
|
+
label: ".",
|
|
617
|
+
matrix: ";"
|
|
618
|
+
}[options.style] || "&";
|
|
631
619
|
if (options.style !== "deepObject" && options.explode === false) {
|
|
632
620
|
for (const k in value) {
|
|
633
621
|
values.push(k, options.allowReserved === true ? value[k] : encodeURIComponent(value[k]));
|
|
634
622
|
}
|
|
635
|
-
const
|
|
623
|
+
const final2 = values.join(",");
|
|
636
624
|
switch (options.style) {
|
|
637
625
|
case "form": {
|
|
638
|
-
return `${name}=${
|
|
626
|
+
return `${name}=${final2}`;
|
|
639
627
|
}
|
|
640
628
|
case "label": {
|
|
641
|
-
return `.${
|
|
629
|
+
return `.${final2}`;
|
|
642
630
|
}
|
|
643
631
|
case "matrix": {
|
|
644
|
-
return `;${name}=${
|
|
632
|
+
return `;${name}=${final2}`;
|
|
645
633
|
}
|
|
646
634
|
default: {
|
|
647
|
-
return
|
|
635
|
+
return final2;
|
|
648
636
|
}
|
|
649
637
|
}
|
|
650
638
|
}
|
|
651
|
-
|
|
652
|
-
// explode: true
|
|
653
639
|
for (const k in value) {
|
|
654
640
|
const finalName = options.style === "deepObject" ? `${name}[${k}]` : k;
|
|
655
641
|
values.push(serializePrimitiveParam(finalName, value[k], options));
|
|
@@ -657,20 +643,13 @@ function serializeObjectParam(name, value, options) {
|
|
|
657
643
|
const final = values.join(joiner);
|
|
658
644
|
return options.style === "label" || options.style === "matrix" ? `${joiner}${final}` : final;
|
|
659
645
|
}
|
|
660
|
-
|
|
661
|
-
/**
|
|
662
|
-
* Serialize array param (shallow only)
|
|
663
|
-
* @type {import("./index.js").serializeArrayParam}
|
|
664
|
-
*/
|
|
665
646
|
function serializeArrayParam(name, value, options) {
|
|
666
647
|
if (!Array.isArray(value)) {
|
|
667
648
|
return "";
|
|
668
649
|
}
|
|
669
|
-
|
|
670
|
-
// explode: false
|
|
671
650
|
if (options.explode === false) {
|
|
672
|
-
const
|
|
673
|
-
const final = (options.allowReserved === true ? value : value.map((v) => encodeURIComponent(v))).join(
|
|
651
|
+
const joiner2 = { form: ",", spaceDelimited: "%20", pipeDelimited: "|" }[options.style] || ",";
|
|
652
|
+
const final = (options.allowReserved === true ? value : value.map((v) => encodeURIComponent(v))).join(joiner2);
|
|
674
653
|
switch (options.style) {
|
|
675
654
|
case "simple": {
|
|
676
655
|
return final;
|
|
@@ -688,8 +667,6 @@ function serializeArrayParam(name, value, options) {
|
|
|
688
667
|
}
|
|
689
668
|
}
|
|
690
669
|
}
|
|
691
|
-
|
|
692
|
-
// explode: true
|
|
693
670
|
const joiner = { simple: ",", label: ".", matrix: ";" }[options.style] || "&";
|
|
694
671
|
const values = [];
|
|
695
672
|
for (const v of value) {
|
|
@@ -699,32 +676,28 @@ function serializeArrayParam(name, value, options) {
|
|
|
699
676
|
values.push(serializePrimitiveParam(name, v, options));
|
|
700
677
|
}
|
|
701
678
|
}
|
|
702
|
-
return options.style === "label" || options.style === "matrix"
|
|
703
|
-
? `${joiner}${values.join(joiner)}`
|
|
704
|
-
: values.join(joiner);
|
|
679
|
+
return options.style === "label" || options.style === "matrix" ? `${joiner}${values.join(joiner)}` : values.join(joiner);
|
|
705
680
|
}
|
|
706
|
-
|
|
707
|
-
/**
|
|
708
|
-
* Serialize query params to string
|
|
709
|
-
* @type {import("./index.js").createQuerySerializer}
|
|
710
|
-
*/
|
|
711
681
|
function createQuerySerializer(options) {
|
|
712
682
|
return function querySerializer(queryParams) {
|
|
713
683
|
const search = [];
|
|
714
684
|
if (queryParams && typeof queryParams === "object") {
|
|
715
685
|
for (const name in queryParams) {
|
|
716
686
|
const value = queryParams[name];
|
|
717
|
-
if (value ===
|
|
687
|
+
if (value === void 0 || value === null) {
|
|
718
688
|
continue;
|
|
719
689
|
}
|
|
720
690
|
if (Array.isArray(value)) {
|
|
691
|
+
if (value.length === 0) {
|
|
692
|
+
continue;
|
|
693
|
+
}
|
|
721
694
|
search.push(
|
|
722
695
|
serializeArrayParam(name, value, {
|
|
723
696
|
style: "form",
|
|
724
697
|
explode: true,
|
|
725
698
|
...options?.array,
|
|
726
|
-
allowReserved: false
|
|
727
|
-
})
|
|
699
|
+
allowReserved: false
|
|
700
|
+
})
|
|
728
701
|
);
|
|
729
702
|
continue;
|
|
730
703
|
}
|
|
@@ -734,8 +707,8 @@ function createQuerySerializer(options) {
|
|
|
734
707
|
style: "deepObject",
|
|
735
708
|
explode: true,
|
|
736
709
|
...options?.object,
|
|
737
|
-
allowReserved: false
|
|
738
|
-
})
|
|
710
|
+
allowReserved: false
|
|
711
|
+
})
|
|
739
712
|
);
|
|
740
713
|
continue;
|
|
741
714
|
}
|
|
@@ -745,12 +718,6 @@ function createQuerySerializer(options) {
|
|
|
745
718
|
return search.join("&");
|
|
746
719
|
};
|
|
747
720
|
}
|
|
748
|
-
|
|
749
|
-
/**
|
|
750
|
-
* Handle different OpenAPI 3.x serialization styles
|
|
751
|
-
* @type {import("./index.js").defaultPathSerializer}
|
|
752
|
-
* @see https://swagger.io/docs/specification/serialization/#path
|
|
753
|
-
*/
|
|
754
721
|
function defaultPathSerializer(pathname, pathParams) {
|
|
755
722
|
let nextURL = pathname;
|
|
756
723
|
for (const match of pathname.match(PATH_PARAM_RE) ?? []) {
|
|
@@ -768,7 +735,7 @@ function defaultPathSerializer(pathname, pathParams) {
|
|
|
768
735
|
style = "matrix";
|
|
769
736
|
name = name.substring(1);
|
|
770
737
|
}
|
|
771
|
-
if (!pathParams || pathParams[name] ===
|
|
738
|
+
if (!pathParams || pathParams[name] === void 0 || pathParams[name] === null) {
|
|
772
739
|
continue;
|
|
773
740
|
}
|
|
774
741
|
const value = pathParams[name];
|
|
@@ -789,7 +756,7 @@ function defaultPathSerializer(pathname, pathParams) {
|
|
|
789
756
|
return nextURL;
|
|
790
757
|
}
|
|
791
758
|
|
|
792
|
-
var version = "1.
|
|
759
|
+
var version = "1.4808.1";
|
|
793
760
|
|
|
794
761
|
const querySerializer = createQuerySerializer();
|
|
795
762
|
class Fetcher {
|
|
@@ -924,7 +891,10 @@ class Fetcher {
|
|
|
924
891
|
redirect: 'follow',
|
|
925
892
|
signal: this.handleAbortKey(opts === null || opts === void 0 ? void 0 : opts.abortKey),
|
|
926
893
|
body,
|
|
927
|
-
headers:
|
|
894
|
+
headers: {
|
|
895
|
+
...headers,
|
|
896
|
+
...data === null || data === void 0 ? void 0 : data.header
|
|
897
|
+
},
|
|
928
898
|
method
|
|
929
899
|
});
|
|
930
900
|
if (!this.opts.ignoreAuth) {
|