@layer-drone/protocol 0.1.3 → 0.3.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 +869 -5
- package/dist/index.d.ts +869 -5
- package/dist/index.js +380 -1
- package/dist/index.mjs +362 -1
- package/package.json +2 -2
- package/src/client/sdk.gen.ts +539 -0
- package/src/client/transformers.gen.ts +130 -0
- package/src/client/types.gen.ts +967 -0
- package/src/event/types.gen.ts +11 -0
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
import type {
|
|
3
3
|
ApiTokenControllerUpdateTokenResponse,
|
|
4
4
|
ConditionsControllerGetSunAltitudeTimeLimitsResponse,
|
|
5
|
+
ContractsControllerGetAllContractsResponse,
|
|
6
|
+
FlightPlansControllerCreateResponse,
|
|
7
|
+
FlightPlansControllerGetManyResponse,
|
|
8
|
+
FlightPlansControllerGetResponse,
|
|
5
9
|
FlightsControllerValidateFlightResponse,
|
|
10
|
+
InboundWebhookConfigsControllerCreateResponse,
|
|
11
|
+
InboundWebhookConfigsControllerGetManyResponse,
|
|
12
|
+
InboundWebhookConfigsControllerGetResponse,
|
|
13
|
+
InboundWebhookConfigsControllerUpdateResponse,
|
|
6
14
|
MissionsControllerCreateMissionsResponse,
|
|
7
15
|
} from "./types.gen.js";
|
|
8
16
|
|
|
@@ -41,6 +49,23 @@ export const conditionsControllerGetSunAltitudeTimeLimitsResponseTransformer =
|
|
|
41
49
|
return data;
|
|
42
50
|
};
|
|
43
51
|
|
|
52
|
+
const getContractsResponseDtoSchemaResponseTransformer = (data: any) => {
|
|
53
|
+
data.data = data.data.map((item: any) => {
|
|
54
|
+
if (item.deployedAt) {
|
|
55
|
+
item.deployedAt = new Date(item.deployedAt);
|
|
56
|
+
}
|
|
57
|
+
return item;
|
|
58
|
+
});
|
|
59
|
+
return data;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const contractsControllerGetAllContractsResponseTransformer = async (
|
|
63
|
+
data: any,
|
|
64
|
+
): Promise<ContractsControllerGetAllContractsResponse> => {
|
|
65
|
+
data = getContractsResponseDtoSchemaResponseTransformer(data);
|
|
66
|
+
return data;
|
|
67
|
+
};
|
|
68
|
+
|
|
44
69
|
const validateFlightResponseDtoSchemaResponseTransformer = (data: any) => {
|
|
45
70
|
data.flightId = BigInt(data.flightId.toString());
|
|
46
71
|
return data;
|
|
@@ -53,6 +78,48 @@ export const flightsControllerValidateFlightResponseTransformer = async (
|
|
|
53
78
|
return data;
|
|
54
79
|
};
|
|
55
80
|
|
|
81
|
+
const getFlightPlansResponseSchemaResponseTransformer = (data: any) => {
|
|
82
|
+
data.data = data.data.map((item: any) => {
|
|
83
|
+
item.created_at = new Date(item.created_at);
|
|
84
|
+
item.updated_at = new Date(item.updated_at);
|
|
85
|
+
return item;
|
|
86
|
+
});
|
|
87
|
+
return data;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const flightPlansControllerGetManyResponseTransformer = async (
|
|
91
|
+
data: any,
|
|
92
|
+
): Promise<FlightPlansControllerGetManyResponse> => {
|
|
93
|
+
data = getFlightPlansResponseSchemaResponseTransformer(data);
|
|
94
|
+
return data;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const createFlightPlanResponseSchemaResponseTransformer = (data: any) => {
|
|
98
|
+
data.created_at = new Date(data.created_at);
|
|
99
|
+
data.updated_at = new Date(data.updated_at);
|
|
100
|
+
return data;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const flightPlansControllerCreateResponseTransformer = async (
|
|
104
|
+
data: any,
|
|
105
|
+
): Promise<FlightPlansControllerCreateResponse> => {
|
|
106
|
+
data = createFlightPlanResponseSchemaResponseTransformer(data);
|
|
107
|
+
return data;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const getFlightPlanResponseSchemaResponseTransformer = (data: any) => {
|
|
111
|
+
data.created_at = new Date(data.created_at);
|
|
112
|
+
data.updated_at = new Date(data.updated_at);
|
|
113
|
+
return data;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export const flightPlansControllerGetResponseTransformer = async (
|
|
117
|
+
data: any,
|
|
118
|
+
): Promise<FlightPlansControllerGetResponse> => {
|
|
119
|
+
data = getFlightPlanResponseSchemaResponseTransformer(data);
|
|
120
|
+
return data;
|
|
121
|
+
};
|
|
122
|
+
|
|
56
123
|
const createMissionResponseDtoSchemaResponseTransformer = (data: any) => {
|
|
57
124
|
data.data.missions = data.data.missions.map((item: any) => {
|
|
58
125
|
item.captureStartTime = new Date(item.captureStartTime);
|
|
@@ -68,3 +135,66 @@ export const missionsControllerCreateMissionsResponseTransformer = async (
|
|
|
68
135
|
data = createMissionResponseDtoSchemaResponseTransformer(data);
|
|
69
136
|
return data;
|
|
70
137
|
};
|
|
138
|
+
|
|
139
|
+
const getInboundWebhookConfigsResponseSchemaResponseTransformer = (
|
|
140
|
+
data: any,
|
|
141
|
+
) => {
|
|
142
|
+
data = data.map((item: any) => {
|
|
143
|
+
item.created_at = new Date(item.created_at);
|
|
144
|
+
item.updated_at = new Date(item.updated_at);
|
|
145
|
+
return item;
|
|
146
|
+
});
|
|
147
|
+
return data;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export const inboundWebhookConfigsControllerGetManyResponseTransformer = async (
|
|
151
|
+
data: any,
|
|
152
|
+
): Promise<InboundWebhookConfigsControllerGetManyResponse> => {
|
|
153
|
+
data = getInboundWebhookConfigsResponseSchemaResponseTransformer(data);
|
|
154
|
+
return data;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const createInboundWebhookConfigResponseSchemaResponseTransformer = (
|
|
158
|
+
data: any,
|
|
159
|
+
) => {
|
|
160
|
+
data.created_at = new Date(data.created_at);
|
|
161
|
+
data.updated_at = new Date(data.updated_at);
|
|
162
|
+
return data;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export const inboundWebhookConfigsControllerCreateResponseTransformer = async (
|
|
166
|
+
data: any,
|
|
167
|
+
): Promise<InboundWebhookConfigsControllerCreateResponse> => {
|
|
168
|
+
data = createInboundWebhookConfigResponseSchemaResponseTransformer(data);
|
|
169
|
+
return data;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const getInboundWebhookConfigResponseSchemaResponseTransformer = (
|
|
173
|
+
data: any,
|
|
174
|
+
) => {
|
|
175
|
+
data.created_at = new Date(data.created_at);
|
|
176
|
+
data.updated_at = new Date(data.updated_at);
|
|
177
|
+
return data;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export const inboundWebhookConfigsControllerGetResponseTransformer = async (
|
|
181
|
+
data: any,
|
|
182
|
+
): Promise<InboundWebhookConfigsControllerGetResponse> => {
|
|
183
|
+
data = getInboundWebhookConfigResponseSchemaResponseTransformer(data);
|
|
184
|
+
return data;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
const updateInboundWebhookConfigResponseSchemaResponseTransformer = (
|
|
188
|
+
data: any,
|
|
189
|
+
) => {
|
|
190
|
+
data.created_at = new Date(data.created_at);
|
|
191
|
+
data.updated_at = new Date(data.updated_at);
|
|
192
|
+
return data;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
export const inboundWebhookConfigsControllerUpdateResponseTransformer = async (
|
|
196
|
+
data: any,
|
|
197
|
+
): Promise<InboundWebhookConfigsControllerUpdateResponse> => {
|
|
198
|
+
data = updateInboundWebhookConfigResponseSchemaResponseTransformer(data);
|
|
199
|
+
return data;
|
|
200
|
+
};
|