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