@layer-drone/protocol 0.2.0 → 0.5.0
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.d.mts +391 -7
- package/dist/index.d.ts +391 -7
- package/dist/index.js +193 -0
- package/dist/index.mjs +186 -0
- package/package.json +1 -1
- package/src/client/client/types.ts +4 -5
- package/src/client/core/pathSerializer.ts +1 -2
- package/src/client/sdk.gen.ts +211 -0
- package/src/client/transformers.gen.ts +120 -0
- package/src/client/types.gen.ts +451 -1
package/src/client/sdk.gen.ts
CHANGED
|
@@ -9,12 +9,19 @@ import {
|
|
|
9
9
|
apiTokenControllerUpdateTokenResponseTransformer,
|
|
10
10
|
conditionsControllerGetSunAltitudeTimeLimitsResponseTransformer,
|
|
11
11
|
contractsControllerGetAllContractsResponseTransformer,
|
|
12
|
+
flightPlansControllerCreateResponseTransformer,
|
|
13
|
+
flightPlansControllerGetManyResponseTransformer,
|
|
14
|
+
flightPlansControllerGetResponseTransformer,
|
|
15
|
+
flightReviewsControllerGetFlightReviewResponseTransformer,
|
|
16
|
+
flightReviewsControllerGetFlightReviewsResponseTransformer,
|
|
12
17
|
flightsControllerValidateFlightResponseTransformer,
|
|
13
18
|
inboundWebhookConfigsControllerCreateResponseTransformer,
|
|
14
19
|
inboundWebhookConfigsControllerGetManyResponseTransformer,
|
|
15
20
|
inboundWebhookConfigsControllerGetResponseTransformer,
|
|
16
21
|
inboundWebhookConfigsControllerUpdateResponseTransformer,
|
|
17
22
|
missionsControllerCreateMissionsResponseTransformer,
|
|
23
|
+
missionsControllerGetMissionResponseTransformer,
|
|
24
|
+
missionsControllerGetMissionsResponseTransformer,
|
|
18
25
|
} from "./transformers.gen.js";
|
|
19
26
|
import type {
|
|
20
27
|
AlchemyControllerHandleWebhookData,
|
|
@@ -55,6 +62,21 @@ import type {
|
|
|
55
62
|
DlqRedriverControllerRedriveDlqData,
|
|
56
63
|
DlqRedriverControllerRedriveDlqErrors,
|
|
57
64
|
DlqRedriverControllerRedriveDlqResponses,
|
|
65
|
+
FlightPlansControllerCreateData,
|
|
66
|
+
FlightPlansControllerCreateErrors,
|
|
67
|
+
FlightPlansControllerCreateResponses,
|
|
68
|
+
FlightPlansControllerGetData,
|
|
69
|
+
FlightPlansControllerGetErrors,
|
|
70
|
+
FlightPlansControllerGetManyData,
|
|
71
|
+
FlightPlansControllerGetManyErrors,
|
|
72
|
+
FlightPlansControllerGetManyResponses,
|
|
73
|
+
FlightPlansControllerGetResponses,
|
|
74
|
+
FlightReviewsControllerGetFlightReviewData,
|
|
75
|
+
FlightReviewsControllerGetFlightReviewErrors,
|
|
76
|
+
FlightReviewsControllerGetFlightReviewResponses,
|
|
77
|
+
FlightReviewsControllerGetFlightReviewsData,
|
|
78
|
+
FlightReviewsControllerGetFlightReviewsErrors,
|
|
79
|
+
FlightReviewsControllerGetFlightReviewsResponses,
|
|
58
80
|
FlightsControllerCreatePresignedUrlsData,
|
|
59
81
|
FlightsControllerCreatePresignedUrlsErrors,
|
|
60
82
|
FlightsControllerCreatePresignedUrlsResponses,
|
|
@@ -90,6 +112,12 @@ import type {
|
|
|
90
112
|
MissionsControllerCreateMissionsData,
|
|
91
113
|
MissionsControllerCreateMissionsErrors,
|
|
92
114
|
MissionsControllerCreateMissionsResponses,
|
|
115
|
+
MissionsControllerGetMissionData,
|
|
116
|
+
MissionsControllerGetMissionErrors,
|
|
117
|
+
MissionsControllerGetMissionResponses,
|
|
118
|
+
MissionsControllerGetMissionsData,
|
|
119
|
+
MissionsControllerGetMissionsErrors,
|
|
120
|
+
MissionsControllerGetMissionsResponses,
|
|
93
121
|
MissionsControllerRepriceMissionsData,
|
|
94
122
|
MissionsControllerRepriceMissionsErrors,
|
|
95
123
|
MissionsControllerRepriceMissionsResponses,
|
|
@@ -545,6 +573,138 @@ export const flightsControllerValidateFlight = <
|
|
|
545
573
|
});
|
|
546
574
|
};
|
|
547
575
|
|
|
576
|
+
/**
|
|
577
|
+
* Get all flight plans
|
|
578
|
+
* Returns all available flight plan templates. These define capture patterns (map, panorama) that can be used for drone missions.
|
|
579
|
+
*/
|
|
580
|
+
export const flightPlansControllerGetMany = <
|
|
581
|
+
ThrowOnError extends boolean = false,
|
|
582
|
+
>(
|
|
583
|
+
options?: Options<FlightPlansControllerGetManyData, ThrowOnError>,
|
|
584
|
+
) => {
|
|
585
|
+
return (options?.client ?? _heyApiClient).get<
|
|
586
|
+
FlightPlansControllerGetManyResponses,
|
|
587
|
+
FlightPlansControllerGetManyErrors,
|
|
588
|
+
ThrowOnError
|
|
589
|
+
>({
|
|
590
|
+
security: [
|
|
591
|
+
{
|
|
592
|
+
name: "x-api-token",
|
|
593
|
+
type: "apiKey",
|
|
594
|
+
},
|
|
595
|
+
],
|
|
596
|
+
responseTransformer: flightPlansControllerGetManyResponseTransformer,
|
|
597
|
+
url: "/flight-plans",
|
|
598
|
+
...options,
|
|
599
|
+
});
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Create a new flight plan
|
|
604
|
+
* Creates a new flight plan template with sections and connection strategy.
|
|
605
|
+
*/
|
|
606
|
+
export const flightPlansControllerCreate = <
|
|
607
|
+
ThrowOnError extends boolean = false,
|
|
608
|
+
>(
|
|
609
|
+
options: Options<FlightPlansControllerCreateData, ThrowOnError>,
|
|
610
|
+
) => {
|
|
611
|
+
return (options.client ?? _heyApiClient).post<
|
|
612
|
+
FlightPlansControllerCreateResponses,
|
|
613
|
+
FlightPlansControllerCreateErrors,
|
|
614
|
+
ThrowOnError
|
|
615
|
+
>({
|
|
616
|
+
security: [
|
|
617
|
+
{
|
|
618
|
+
name: "x-api-token",
|
|
619
|
+
type: "apiKey",
|
|
620
|
+
},
|
|
621
|
+
],
|
|
622
|
+
responseTransformer: flightPlansControllerCreateResponseTransformer,
|
|
623
|
+
url: "/flight-plans",
|
|
624
|
+
...options,
|
|
625
|
+
headers: {
|
|
626
|
+
"Content-Type": "application/json",
|
|
627
|
+
...options.headers,
|
|
628
|
+
},
|
|
629
|
+
});
|
|
630
|
+
};
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Get a flight plan by ID
|
|
634
|
+
* Returns a single flight plan template by its ID.
|
|
635
|
+
*/
|
|
636
|
+
export const flightPlansControllerGet = <ThrowOnError extends boolean = false>(
|
|
637
|
+
options: Options<FlightPlansControllerGetData, ThrowOnError>,
|
|
638
|
+
) => {
|
|
639
|
+
return (options.client ?? _heyApiClient).get<
|
|
640
|
+
FlightPlansControllerGetResponses,
|
|
641
|
+
FlightPlansControllerGetErrors,
|
|
642
|
+
ThrowOnError
|
|
643
|
+
>({
|
|
644
|
+
security: [
|
|
645
|
+
{
|
|
646
|
+
name: "x-api-token",
|
|
647
|
+
type: "apiKey",
|
|
648
|
+
},
|
|
649
|
+
],
|
|
650
|
+
responseTransformer: flightPlansControllerGetResponseTransformer,
|
|
651
|
+
url: "/flight-plans/{id}",
|
|
652
|
+
...options,
|
|
653
|
+
});
|
|
654
|
+
};
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* Get a flight review by ID
|
|
658
|
+
*/
|
|
659
|
+
export const flightReviewsControllerGetFlightReview = <
|
|
660
|
+
ThrowOnError extends boolean = false,
|
|
661
|
+
>(
|
|
662
|
+
options: Options<FlightReviewsControllerGetFlightReviewData, ThrowOnError>,
|
|
663
|
+
) => {
|
|
664
|
+
return (options.client ?? _heyApiClient).get<
|
|
665
|
+
FlightReviewsControllerGetFlightReviewResponses,
|
|
666
|
+
FlightReviewsControllerGetFlightReviewErrors,
|
|
667
|
+
ThrowOnError
|
|
668
|
+
>({
|
|
669
|
+
security: [
|
|
670
|
+
{
|
|
671
|
+
name: "x-api-token",
|
|
672
|
+
type: "apiKey",
|
|
673
|
+
},
|
|
674
|
+
],
|
|
675
|
+
responseTransformer:
|
|
676
|
+
flightReviewsControllerGetFlightReviewResponseTransformer,
|
|
677
|
+
url: "/flight-reviews/{id}",
|
|
678
|
+
...options,
|
|
679
|
+
});
|
|
680
|
+
};
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* Get flight reviews by updated_at time range
|
|
684
|
+
*/
|
|
685
|
+
export const flightReviewsControllerGetFlightReviews = <
|
|
686
|
+
ThrowOnError extends boolean = false,
|
|
687
|
+
>(
|
|
688
|
+
options: Options<FlightReviewsControllerGetFlightReviewsData, ThrowOnError>,
|
|
689
|
+
) => {
|
|
690
|
+
return (options.client ?? _heyApiClient).get<
|
|
691
|
+
FlightReviewsControllerGetFlightReviewsResponses,
|
|
692
|
+
FlightReviewsControllerGetFlightReviewsErrors,
|
|
693
|
+
ThrowOnError
|
|
694
|
+
>({
|
|
695
|
+
security: [
|
|
696
|
+
{
|
|
697
|
+
name: "x-api-token",
|
|
698
|
+
type: "apiKey",
|
|
699
|
+
},
|
|
700
|
+
],
|
|
701
|
+
responseTransformer:
|
|
702
|
+
flightReviewsControllerGetFlightReviewsResponseTransformer,
|
|
703
|
+
url: "/flight-reviews",
|
|
704
|
+
...options,
|
|
705
|
+
});
|
|
706
|
+
};
|
|
707
|
+
|
|
548
708
|
export const keysControllerGetProvenanceCryptoKey = <
|
|
549
709
|
ThrowOnError extends boolean = false,
|
|
550
710
|
>(
|
|
@@ -560,6 +720,57 @@ export const keysControllerGetProvenanceCryptoKey = <
|
|
|
560
720
|
});
|
|
561
721
|
};
|
|
562
722
|
|
|
723
|
+
/**
|
|
724
|
+
* Get a mission by ID
|
|
725
|
+
*/
|
|
726
|
+
export const missionsControllerGetMission = <
|
|
727
|
+
ThrowOnError extends boolean = false,
|
|
728
|
+
>(
|
|
729
|
+
options: Options<MissionsControllerGetMissionData, ThrowOnError>,
|
|
730
|
+
) => {
|
|
731
|
+
return (options.client ?? _heyApiClient).get<
|
|
732
|
+
MissionsControllerGetMissionResponses,
|
|
733
|
+
MissionsControllerGetMissionErrors,
|
|
734
|
+
ThrowOnError
|
|
735
|
+
>({
|
|
736
|
+
security: [
|
|
737
|
+
{
|
|
738
|
+
name: "x-api-token",
|
|
739
|
+
type: "apiKey",
|
|
740
|
+
},
|
|
741
|
+
],
|
|
742
|
+
responseTransformer: missionsControllerGetMissionResponseTransformer,
|
|
743
|
+
url: "/missions/{id}",
|
|
744
|
+
...options,
|
|
745
|
+
});
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* Get missions
|
|
750
|
+
* Returns up to 500 missions per page, sorted by id ascending. All filters are optional. Use `page` (0-indexed, default 0) to paginate. `hasNextPage` is true when additional pages are available. `zone_id` may be repeated to filter by multiple zones.
|
|
751
|
+
*/
|
|
752
|
+
export const missionsControllerGetMissions = <
|
|
753
|
+
ThrowOnError extends boolean = false,
|
|
754
|
+
>(
|
|
755
|
+
options?: Options<MissionsControllerGetMissionsData, ThrowOnError>,
|
|
756
|
+
) => {
|
|
757
|
+
return (options?.client ?? _heyApiClient).get<
|
|
758
|
+
MissionsControllerGetMissionsResponses,
|
|
759
|
+
MissionsControllerGetMissionsErrors,
|
|
760
|
+
ThrowOnError
|
|
761
|
+
>({
|
|
762
|
+
security: [
|
|
763
|
+
{
|
|
764
|
+
name: "x-api-token",
|
|
765
|
+
type: "apiKey",
|
|
766
|
+
},
|
|
767
|
+
],
|
|
768
|
+
responseTransformer: missionsControllerGetMissionsResponseTransformer,
|
|
769
|
+
url: "/missions",
|
|
770
|
+
...options,
|
|
771
|
+
});
|
|
772
|
+
};
|
|
773
|
+
|
|
563
774
|
/**
|
|
564
775
|
* Create new missions
|
|
565
776
|
* Create missions for specified zones and mission types.
|
|
@@ -3,12 +3,19 @@ import type {
|
|
|
3
3
|
ApiTokenControllerUpdateTokenResponse,
|
|
4
4
|
ConditionsControllerGetSunAltitudeTimeLimitsResponse,
|
|
5
5
|
ContractsControllerGetAllContractsResponse,
|
|
6
|
+
FlightPlansControllerCreateResponse,
|
|
7
|
+
FlightPlansControllerGetManyResponse,
|
|
8
|
+
FlightPlansControllerGetResponse,
|
|
9
|
+
FlightReviewsControllerGetFlightReviewResponse,
|
|
10
|
+
FlightReviewsControllerGetFlightReviewsResponse,
|
|
6
11
|
FlightsControllerValidateFlightResponse,
|
|
7
12
|
InboundWebhookConfigsControllerCreateResponse,
|
|
8
13
|
InboundWebhookConfigsControllerGetManyResponse,
|
|
9
14
|
InboundWebhookConfigsControllerGetResponse,
|
|
10
15
|
InboundWebhookConfigsControllerUpdateResponse,
|
|
11
16
|
MissionsControllerCreateMissionsResponse,
|
|
17
|
+
MissionsControllerGetMissionResponse,
|
|
18
|
+
MissionsControllerGetMissionsResponse,
|
|
12
19
|
} from "./types.gen.js";
|
|
13
20
|
|
|
14
21
|
const updateApiTokenResponseDtoSchemaResponseTransformer = (data: any) => {
|
|
@@ -75,6 +82,119 @@ export const flightsControllerValidateFlightResponseTransformer = async (
|
|
|
75
82
|
return data;
|
|
76
83
|
};
|
|
77
84
|
|
|
85
|
+
const getFlightPlansResponseSchemaResponseTransformer = (data: any) => {
|
|
86
|
+
data.data = data.data.map((item: any) => {
|
|
87
|
+
item.created_at = new Date(item.created_at);
|
|
88
|
+
item.updated_at = new Date(item.updated_at);
|
|
89
|
+
return item;
|
|
90
|
+
});
|
|
91
|
+
return data;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const flightPlansControllerGetManyResponseTransformer = async (
|
|
95
|
+
data: any,
|
|
96
|
+
): Promise<FlightPlansControllerGetManyResponse> => {
|
|
97
|
+
data = getFlightPlansResponseSchemaResponseTransformer(data);
|
|
98
|
+
return data;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const createFlightPlanResponseSchemaResponseTransformer = (data: any) => {
|
|
102
|
+
data.created_at = new Date(data.created_at);
|
|
103
|
+
data.updated_at = new Date(data.updated_at);
|
|
104
|
+
return data;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export const flightPlansControllerCreateResponseTransformer = async (
|
|
108
|
+
data: any,
|
|
109
|
+
): Promise<FlightPlansControllerCreateResponse> => {
|
|
110
|
+
data = createFlightPlanResponseSchemaResponseTransformer(data);
|
|
111
|
+
return data;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const getFlightPlanResponseSchemaResponseTransformer = (data: any) => {
|
|
115
|
+
data.created_at = new Date(data.created_at);
|
|
116
|
+
data.updated_at = new Date(data.updated_at);
|
|
117
|
+
return data;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export const flightPlansControllerGetResponseTransformer = async (
|
|
121
|
+
data: any,
|
|
122
|
+
): Promise<FlightPlansControllerGetResponse> => {
|
|
123
|
+
data = getFlightPlanResponseSchemaResponseTransformer(data);
|
|
124
|
+
return data;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const getFlightReviewResponseDtoSchemaResponseTransformer = (data: any) => {
|
|
128
|
+
data.createdAt = new Date(data.createdAt);
|
|
129
|
+
data.updatedAt = new Date(data.updatedAt);
|
|
130
|
+
return data;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export const flightReviewsControllerGetFlightReviewResponseTransformer = async (
|
|
134
|
+
data: any,
|
|
135
|
+
): Promise<FlightReviewsControllerGetFlightReviewResponse> => {
|
|
136
|
+
data = getFlightReviewResponseDtoSchemaResponseTransformer(data);
|
|
137
|
+
return data;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const getFlightReviewsResponseDtoSchemaResponseTransformer = (data: any) => {
|
|
141
|
+
data.flightReviews = data.flightReviews.map((item: any) => {
|
|
142
|
+
item.createdAt = new Date(item.createdAt);
|
|
143
|
+
item.updatedAt = new Date(item.updatedAt);
|
|
144
|
+
return item;
|
|
145
|
+
});
|
|
146
|
+
return data;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export const flightReviewsControllerGetFlightReviewsResponseTransformer =
|
|
150
|
+
async (
|
|
151
|
+
data: any,
|
|
152
|
+
): Promise<FlightReviewsControllerGetFlightReviewsResponse> => {
|
|
153
|
+
data = getFlightReviewsResponseDtoSchemaResponseTransformer(data);
|
|
154
|
+
return data;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const getMissionResponseDtoSchemaResponseTransformer = (data: any) => {
|
|
158
|
+
data.mission.captureStartTime = new Date(data.mission.captureStartTime);
|
|
159
|
+
data.mission.captureEndTime = new Date(data.mission.captureEndTime);
|
|
160
|
+
data.mission.createdAt = new Date(data.mission.createdAt);
|
|
161
|
+
data.mission.updatedAt = new Date(data.mission.updatedAt);
|
|
162
|
+
if (data.vault) {
|
|
163
|
+
data.vault.createdAt = new Date(data.vault.createdAt);
|
|
164
|
+
data.vault.updatedAt = new Date(data.vault.updatedAt);
|
|
165
|
+
}
|
|
166
|
+
return data;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export const missionsControllerGetMissionResponseTransformer = async (
|
|
170
|
+
data: any,
|
|
171
|
+
): Promise<MissionsControllerGetMissionResponse> => {
|
|
172
|
+
data = getMissionResponseDtoSchemaResponseTransformer(data);
|
|
173
|
+
return data;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
const getMissionsResponseDtoSchemaResponseTransformer = (data: any) => {
|
|
177
|
+
data.missions = data.missions.map((item: any) => {
|
|
178
|
+
item.mission.captureStartTime = new Date(item.mission.captureStartTime);
|
|
179
|
+
item.mission.captureEndTime = new Date(item.mission.captureEndTime);
|
|
180
|
+
item.mission.createdAt = new Date(item.mission.createdAt);
|
|
181
|
+
item.mission.updatedAt = new Date(item.mission.updatedAt);
|
|
182
|
+
if (item.vault) {
|
|
183
|
+
item.vault.createdAt = new Date(item.vault.createdAt);
|
|
184
|
+
item.vault.updatedAt = new Date(item.vault.updatedAt);
|
|
185
|
+
}
|
|
186
|
+
return item;
|
|
187
|
+
});
|
|
188
|
+
return data;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export const missionsControllerGetMissionsResponseTransformer = async (
|
|
192
|
+
data: any,
|
|
193
|
+
): Promise<MissionsControllerGetMissionsResponse> => {
|
|
194
|
+
data = getMissionsResponseDtoSchemaResponseTransformer(data);
|
|
195
|
+
return data;
|
|
196
|
+
};
|
|
197
|
+
|
|
78
198
|
const createMissionResponseDtoSchemaResponseTransformer = (data: any) => {
|
|
79
199
|
data.data.missions = data.data.missions.map((item: any) => {
|
|
80
200
|
item.captureStartTime = new Date(item.captureStartTime);
|