@layer-drone/protocol 0.0.10 → 0.0.12
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 +296 -27
- package/dist/index.d.ts +296 -27
- package/dist/index.js +79 -6
- package/dist/index.mjs +76 -6
- package/package.json +2 -1
- package/src/client/sdk.gen.ts +87 -10
- package/src/client/types.gen.ts +203 -22
- package/src/event/types.gen.ts +49 -0
package/dist/index.mjs
CHANGED
|
@@ -841,7 +841,37 @@ var quotesControllerGetQuote = /* @__PURE__ */ __name((options) => {
|
|
|
841
841
|
...options
|
|
842
842
|
});
|
|
843
843
|
}, "quotesControllerGetQuote");
|
|
844
|
-
var
|
|
844
|
+
var missionsControllerCreateMissions = /* @__PURE__ */ __name((options) => {
|
|
845
|
+
return (options.client ?? client).post({
|
|
846
|
+
url: "/missions",
|
|
847
|
+
...options,
|
|
848
|
+
headers: {
|
|
849
|
+
"Content-Type": "application/json",
|
|
850
|
+
...options.headers
|
|
851
|
+
}
|
|
852
|
+
});
|
|
853
|
+
}, "missionsControllerCreateMissions");
|
|
854
|
+
var missionsControllerUpdateMissions = /* @__PURE__ */ __name((options) => {
|
|
855
|
+
return (options.client ?? client).put({
|
|
856
|
+
url: "/missions",
|
|
857
|
+
...options,
|
|
858
|
+
headers: {
|
|
859
|
+
"Content-Type": "application/json",
|
|
860
|
+
...options.headers
|
|
861
|
+
}
|
|
862
|
+
});
|
|
863
|
+
}, "missionsControllerUpdateMissions");
|
|
864
|
+
var missionsControllerClaimRewards = /* @__PURE__ */ __name((options) => {
|
|
865
|
+
return (options.client ?? client).post({
|
|
866
|
+
url: "/missions/{id}/rewards",
|
|
867
|
+
...options,
|
|
868
|
+
headers: {
|
|
869
|
+
"Content-Type": "application/json",
|
|
870
|
+
...options.headers
|
|
871
|
+
}
|
|
872
|
+
});
|
|
873
|
+
}, "missionsControllerClaimRewards");
|
|
874
|
+
var flightsControllerGenerateFlightId = /* @__PURE__ */ __name((options) => {
|
|
845
875
|
return (options.client ?? client).get({
|
|
846
876
|
security: [
|
|
847
877
|
{
|
|
@@ -849,11 +879,11 @@ var flightsControllerGetFlight = /* @__PURE__ */ __name((options) => {
|
|
|
849
879
|
type: "apiKey"
|
|
850
880
|
}
|
|
851
881
|
],
|
|
852
|
-
url: "/flights/
|
|
882
|
+
url: "/flights/id",
|
|
853
883
|
...options
|
|
854
884
|
});
|
|
855
|
-
}, "
|
|
856
|
-
var
|
|
885
|
+
}, "flightsControllerGenerateFlightId");
|
|
886
|
+
var flightsControllerGetFlight = /* @__PURE__ */ __name((options) => {
|
|
857
887
|
return (options.client ?? client).get({
|
|
858
888
|
security: [
|
|
859
889
|
{
|
|
@@ -861,10 +891,10 @@ var flightsControllerGenerateFlightId = /* @__PURE__ */ __name((options) => {
|
|
|
861
891
|
type: "apiKey"
|
|
862
892
|
}
|
|
863
893
|
],
|
|
864
|
-
url: "/flights/
|
|
894
|
+
url: "/flights/{flightId}",
|
|
865
895
|
...options
|
|
866
896
|
});
|
|
867
|
-
}, "
|
|
897
|
+
}, "flightsControllerGetFlight");
|
|
868
898
|
var flightsControllerCreatePresignedUrls = /* @__PURE__ */ __name((options) => {
|
|
869
899
|
return (options.client ?? client).post({
|
|
870
900
|
security: [
|
|
@@ -1035,6 +1065,43 @@ var Event = z.union([
|
|
|
1035
1065
|
pilotAddress: z.string(),
|
|
1036
1066
|
flightManifestUri: z.string()
|
|
1037
1067
|
}).strict()
|
|
1068
|
+
}).strict(),
|
|
1069
|
+
z.object({
|
|
1070
|
+
id: z.any(),
|
|
1071
|
+
event_type: z.literal("protocol.mission.created"),
|
|
1072
|
+
timestamp: z.any(),
|
|
1073
|
+
data: z.object({
|
|
1074
|
+
missionId: z.string(),
|
|
1075
|
+
vaultId: z.string(),
|
|
1076
|
+
amount: z.string(),
|
|
1077
|
+
zoneId: z.string(),
|
|
1078
|
+
flightPlanId: z.number(),
|
|
1079
|
+
captureStartTime: z.string(),
|
|
1080
|
+
captureEndTime: z.string(),
|
|
1081
|
+
detailsHash: z.string()
|
|
1082
|
+
}).strict()
|
|
1083
|
+
}).strict(),
|
|
1084
|
+
z.object({
|
|
1085
|
+
id: z.any(),
|
|
1086
|
+
event_type: z.literal("protocol.mission.updated"),
|
|
1087
|
+
timestamp: z.any(),
|
|
1088
|
+
data: z.object({
|
|
1089
|
+
id: z.string(),
|
|
1090
|
+
amount: z.number().optional(),
|
|
1091
|
+
isOpen: z.boolean().optional()
|
|
1092
|
+
}).strict()
|
|
1093
|
+
}).strict(),
|
|
1094
|
+
z.object({
|
|
1095
|
+
id: z.any(),
|
|
1096
|
+
event_type: z.literal("protocol.flight.reviewed"),
|
|
1097
|
+
timestamp: z.any(),
|
|
1098
|
+
data: z.object({
|
|
1099
|
+
flightId: z.number(),
|
|
1100
|
+
isApproved: z.boolean(),
|
|
1101
|
+
validationLogUri: z.string(),
|
|
1102
|
+
validator: z.string(),
|
|
1103
|
+
filesHash: z.string()
|
|
1104
|
+
}).strict()
|
|
1038
1105
|
}).strict()
|
|
1039
1106
|
]);
|
|
1040
1107
|
|
|
@@ -1081,6 +1148,9 @@ export {
|
|
|
1081
1148
|
jsonBodySerializer,
|
|
1082
1149
|
keysControllerGetProvenanceCryptoKey,
|
|
1083
1150
|
mergeHeaders,
|
|
1151
|
+
missionsControllerClaimRewards,
|
|
1152
|
+
missionsControllerCreateMissions,
|
|
1153
|
+
missionsControllerUpdateMissions,
|
|
1084
1154
|
parseWebhookEvent,
|
|
1085
1155
|
quotesControllerCreateQuote,
|
|
1086
1156
|
quotesControllerGetQuote,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layer-drone/protocol",
|
|
3
3
|
"description": "Layer Drone protocol SDK with typed API client and event parsing",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.12",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"generate-api": "openapi-ts",
|
|
40
40
|
"generate-event": "ts-node ./scripts/generate-event-type.ts",
|
|
41
41
|
"generate": "pnpm generate-api && pnpm generate-event && pnpm lint --fix && pnpm build",
|
|
42
|
+
"type-check": "tsc --noEmit",
|
|
42
43
|
"sonar": "sonar"
|
|
43
44
|
}
|
|
44
45
|
}
|
package/src/client/sdk.gen.ts
CHANGED
|
@@ -40,6 +40,14 @@ import type {
|
|
|
40
40
|
FlightsControllerValidateFlightResponses,
|
|
41
41
|
KeysControllerGetProvenanceCryptoKeyData,
|
|
42
42
|
KeysControllerGetProvenanceCryptoKeyResponses,
|
|
43
|
+
MissionsControllerClaimRewardsData,
|
|
44
|
+
MissionsControllerClaimRewardsErrors,
|
|
45
|
+
MissionsControllerClaimRewardsResponses,
|
|
46
|
+
MissionsControllerCreateMissionsData,
|
|
47
|
+
MissionsControllerCreateMissionsErrors,
|
|
48
|
+
MissionsControllerCreateMissionsResponses,
|
|
49
|
+
MissionsControllerUpdateMissionsData,
|
|
50
|
+
MissionsControllerUpdateMissionsResponses,
|
|
43
51
|
QuotesControllerCreateQuoteData,
|
|
44
52
|
QuotesControllerCreateQuoteErrors,
|
|
45
53
|
QuotesControllerCreateQuoteResponses,
|
|
@@ -312,14 +320,83 @@ export const quotesControllerGetQuote = <ThrowOnError extends boolean = false>(
|
|
|
312
320
|
});
|
|
313
321
|
};
|
|
314
322
|
|
|
315
|
-
|
|
323
|
+
/**
|
|
324
|
+
* Create new missions
|
|
325
|
+
* Create missions for specified zones and mission types.
|
|
326
|
+
*/
|
|
327
|
+
export const missionsControllerCreateMissions = <
|
|
316
328
|
ThrowOnError extends boolean = false,
|
|
317
329
|
>(
|
|
318
|
-
options: Options<
|
|
330
|
+
options: Options<MissionsControllerCreateMissionsData, ThrowOnError>,
|
|
331
|
+
) => {
|
|
332
|
+
return (options.client ?? _heyApiClient).post<
|
|
333
|
+
MissionsControllerCreateMissionsResponses,
|
|
334
|
+
MissionsControllerCreateMissionsErrors,
|
|
335
|
+
ThrowOnError
|
|
336
|
+
>({
|
|
337
|
+
url: "/missions",
|
|
338
|
+
...options,
|
|
339
|
+
headers: {
|
|
340
|
+
"Content-Type": "application/json",
|
|
341
|
+
...options.headers,
|
|
342
|
+
},
|
|
343
|
+
});
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Update missions
|
|
348
|
+
* Update missions' rewards or cancel them altogether
|
|
349
|
+
*/
|
|
350
|
+
export const missionsControllerUpdateMissions = <
|
|
351
|
+
ThrowOnError extends boolean = false,
|
|
352
|
+
>(
|
|
353
|
+
options: Options<MissionsControllerUpdateMissionsData, ThrowOnError>,
|
|
354
|
+
) => {
|
|
355
|
+
return (options.client ?? _heyApiClient).put<
|
|
356
|
+
MissionsControllerUpdateMissionsResponses,
|
|
357
|
+
unknown,
|
|
358
|
+
ThrowOnError
|
|
359
|
+
>({
|
|
360
|
+
url: "/missions",
|
|
361
|
+
...options,
|
|
362
|
+
headers: {
|
|
363
|
+
"Content-Type": "application/json",
|
|
364
|
+
...options.headers,
|
|
365
|
+
},
|
|
366
|
+
});
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Claim rewards for a mission
|
|
371
|
+
* Claim rewards for a completed flight within a mission
|
|
372
|
+
*/
|
|
373
|
+
export const missionsControllerClaimRewards = <
|
|
374
|
+
ThrowOnError extends boolean = false,
|
|
375
|
+
>(
|
|
376
|
+
options: Options<MissionsControllerClaimRewardsData, ThrowOnError>,
|
|
377
|
+
) => {
|
|
378
|
+
return (options.client ?? _heyApiClient).post<
|
|
379
|
+
MissionsControllerClaimRewardsResponses,
|
|
380
|
+
MissionsControllerClaimRewardsErrors,
|
|
381
|
+
ThrowOnError
|
|
382
|
+
>({
|
|
383
|
+
url: "/missions/{id}/rewards",
|
|
384
|
+
...options,
|
|
385
|
+
headers: {
|
|
386
|
+
"Content-Type": "application/json",
|
|
387
|
+
...options.headers,
|
|
388
|
+
},
|
|
389
|
+
});
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
export const flightsControllerGenerateFlightId = <
|
|
393
|
+
ThrowOnError extends boolean = false,
|
|
394
|
+
>(
|
|
395
|
+
options: Options<FlightsControllerGenerateFlightIdData, ThrowOnError>,
|
|
319
396
|
) => {
|
|
320
397
|
return (options.client ?? _heyApiClient).get<
|
|
321
|
-
|
|
322
|
-
|
|
398
|
+
FlightsControllerGenerateFlightIdResponses,
|
|
399
|
+
FlightsControllerGenerateFlightIdErrors,
|
|
323
400
|
ThrowOnError
|
|
324
401
|
>({
|
|
325
402
|
security: [
|
|
@@ -328,19 +405,19 @@ export const flightsControllerGetFlight = <
|
|
|
328
405
|
type: "apiKey",
|
|
329
406
|
},
|
|
330
407
|
],
|
|
331
|
-
url: "/flights/
|
|
408
|
+
url: "/flights/id",
|
|
332
409
|
...options,
|
|
333
410
|
});
|
|
334
411
|
};
|
|
335
412
|
|
|
336
|
-
export const
|
|
413
|
+
export const flightsControllerGetFlight = <
|
|
337
414
|
ThrowOnError extends boolean = false,
|
|
338
415
|
>(
|
|
339
|
-
options: Options<
|
|
416
|
+
options: Options<FlightsControllerGetFlightData, ThrowOnError>,
|
|
340
417
|
) => {
|
|
341
418
|
return (options.client ?? _heyApiClient).get<
|
|
342
|
-
|
|
343
|
-
|
|
419
|
+
FlightsControllerGetFlightResponses,
|
|
420
|
+
FlightsControllerGetFlightErrors,
|
|
344
421
|
ThrowOnError
|
|
345
422
|
>({
|
|
346
423
|
security: [
|
|
@@ -349,7 +426,7 @@ export const flightsControllerGenerateFlightId = <
|
|
|
349
426
|
type: "apiKey",
|
|
350
427
|
},
|
|
351
428
|
],
|
|
352
|
-
url: "/flights/
|
|
429
|
+
url: "/flights/{flightId}",
|
|
353
430
|
...options,
|
|
354
431
|
});
|
|
355
432
|
};
|
package/src/client/types.gen.ts
CHANGED
|
@@ -87,6 +87,72 @@ export type CreateQuoteRequestDto = {
|
|
|
87
87
|
mintOnChain: boolean;
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
+
export type CreateMissionRequestDto = {
|
|
91
|
+
missions: Array<{
|
|
92
|
+
zoneId: string;
|
|
93
|
+
flightPlanId: number;
|
|
94
|
+
amount: number;
|
|
95
|
+
startTime: Date;
|
|
96
|
+
endTime: Date;
|
|
97
|
+
}>;
|
|
98
|
+
campaignId: number;
|
|
99
|
+
requestor: string;
|
|
100
|
+
mintOnChain?: boolean;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export type CreateMissionResponseDto = {
|
|
104
|
+
success: boolean;
|
|
105
|
+
data:
|
|
106
|
+
| {
|
|
107
|
+
missions: Array<{
|
|
108
|
+
missionId: string;
|
|
109
|
+
vaultId: string;
|
|
110
|
+
amount: number;
|
|
111
|
+
zoneId: string;
|
|
112
|
+
flightPlanId: number;
|
|
113
|
+
captureStartTime: Date;
|
|
114
|
+
captureEndTime: Date;
|
|
115
|
+
requestor: string;
|
|
116
|
+
}>;
|
|
117
|
+
totalAmount: number;
|
|
118
|
+
}
|
|
119
|
+
| string;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export type UpdateMissionsRequestDto = {
|
|
123
|
+
missions: Array<
|
|
124
|
+
| {
|
|
125
|
+
id: string;
|
|
126
|
+
amount: number;
|
|
127
|
+
}
|
|
128
|
+
| {
|
|
129
|
+
id: string;
|
|
130
|
+
isOpen: false;
|
|
131
|
+
}
|
|
132
|
+
>;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export type UpdateMissionsResponseDto = {
|
|
136
|
+
success: boolean;
|
|
137
|
+
data: {
|
|
138
|
+
rewardUpdatesQueued: Array<string>;
|
|
139
|
+
cancelUpdatesQueued: Array<string>;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export type ClaimRewardsRequestDto = {
|
|
144
|
+
flightIds: Array<number>;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export type ClaimRewardsResponseDto = {
|
|
148
|
+
success: boolean;
|
|
149
|
+
data:
|
|
150
|
+
| {
|
|
151
|
+
cancelUpdatesQueued: Array<string>;
|
|
152
|
+
}
|
|
153
|
+
| string;
|
|
154
|
+
};
|
|
155
|
+
|
|
90
156
|
export type FlightDto = {
|
|
91
157
|
token_id: number;
|
|
92
158
|
owner: string;
|
|
@@ -110,14 +176,10 @@ export type CreateFileResponseDto = {
|
|
|
110
176
|
};
|
|
111
177
|
|
|
112
178
|
export type ValidateFlightDto = {
|
|
179
|
+
flightId?: number;
|
|
113
180
|
pilotAddress: string;
|
|
114
181
|
missionId: number;
|
|
115
182
|
flightTimestamp: string;
|
|
116
|
-
externalBucketInfo?: {
|
|
117
|
-
prefix: string;
|
|
118
|
-
bucketName: string;
|
|
119
|
-
region: string;
|
|
120
|
-
};
|
|
121
183
|
flightRequestInfo: {
|
|
122
184
|
filePaths: Array<string>;
|
|
123
185
|
flightPlanId: number;
|
|
@@ -148,7 +210,14 @@ export type GetTimeLimitsForSunAltitudeResponse = {
|
|
|
148
210
|
export type CreateWebhookBody = {
|
|
149
211
|
name: string;
|
|
150
212
|
url: string;
|
|
151
|
-
event_types: Array<
|
|
213
|
+
event_types: Array<
|
|
214
|
+
| "test"
|
|
215
|
+
| "protocol.flight.submitted"
|
|
216
|
+
| "protocol.mission.created"
|
|
217
|
+
| "protocol.mission.updated"
|
|
218
|
+
| "protocol.flight.reviewed"
|
|
219
|
+
| "*"
|
|
220
|
+
>;
|
|
152
221
|
active: boolean;
|
|
153
222
|
};
|
|
154
223
|
|
|
@@ -161,7 +230,14 @@ export type GetWebhooksResponse = Array<{
|
|
|
161
230
|
id: number;
|
|
162
231
|
name: string;
|
|
163
232
|
url: string;
|
|
164
|
-
event_types: Array<
|
|
233
|
+
event_types: Array<
|
|
234
|
+
| "test"
|
|
235
|
+
| "protocol.flight.submitted"
|
|
236
|
+
| "protocol.mission.created"
|
|
237
|
+
| "protocol.mission.updated"
|
|
238
|
+
| "protocol.flight.reviewed"
|
|
239
|
+
| "*"
|
|
240
|
+
>;
|
|
165
241
|
active: boolean;
|
|
166
242
|
failure_count: number;
|
|
167
243
|
last_failure_reason: string;
|
|
@@ -173,7 +249,14 @@ export type GetWebhookResponse = {
|
|
|
173
249
|
id: number;
|
|
174
250
|
name: string;
|
|
175
251
|
url: string;
|
|
176
|
-
event_types: Array<
|
|
252
|
+
event_types: Array<
|
|
253
|
+
| "test"
|
|
254
|
+
| "protocol.flight.submitted"
|
|
255
|
+
| "protocol.mission.created"
|
|
256
|
+
| "protocol.mission.updated"
|
|
257
|
+
| "protocol.flight.reviewed"
|
|
258
|
+
| "*"
|
|
259
|
+
>;
|
|
177
260
|
active: boolean;
|
|
178
261
|
failure_count: number;
|
|
179
262
|
last_failure_reason: string;
|
|
@@ -184,7 +267,14 @@ export type GetWebhookResponse = {
|
|
|
184
267
|
export type UpdateWebhookBody = {
|
|
185
268
|
name?: string;
|
|
186
269
|
url?: string;
|
|
187
|
-
event_types?: Array<
|
|
270
|
+
event_types?: Array<
|
|
271
|
+
| "test"
|
|
272
|
+
| "protocol.flight.submitted"
|
|
273
|
+
| "protocol.mission.created"
|
|
274
|
+
| "protocol.mission.updated"
|
|
275
|
+
| "protocol.flight.reviewed"
|
|
276
|
+
| "*"
|
|
277
|
+
>;
|
|
188
278
|
active?: boolean;
|
|
189
279
|
};
|
|
190
280
|
|
|
@@ -192,7 +282,14 @@ export type UpdateWebhookResponse = {
|
|
|
192
282
|
id: number;
|
|
193
283
|
name: string;
|
|
194
284
|
url: string;
|
|
195
|
-
event_types: Array<
|
|
285
|
+
event_types: Array<
|
|
286
|
+
| "test"
|
|
287
|
+
| "protocol.flight.submitted"
|
|
288
|
+
| "protocol.mission.created"
|
|
289
|
+
| "protocol.mission.updated"
|
|
290
|
+
| "protocol.flight.reviewed"
|
|
291
|
+
| "*"
|
|
292
|
+
>;
|
|
196
293
|
active: boolean;
|
|
197
294
|
failure_count: number;
|
|
198
295
|
last_failure_reason: string;
|
|
@@ -391,29 +488,88 @@ export type QuotesControllerGetQuoteResponses = {
|
|
|
391
488
|
200: unknown;
|
|
392
489
|
};
|
|
393
490
|
|
|
394
|
-
export type
|
|
395
|
-
body
|
|
491
|
+
export type MissionsControllerCreateMissionsData = {
|
|
492
|
+
body: CreateMissionRequestDto;
|
|
493
|
+
path?: never;
|
|
494
|
+
query?: never;
|
|
495
|
+
url: "/missions";
|
|
496
|
+
};
|
|
497
|
+
|
|
498
|
+
export type MissionsControllerCreateMissionsErrors = {
|
|
499
|
+
/**
|
|
500
|
+
* Validation failed - invalid Zones, mission types, or times
|
|
501
|
+
*/
|
|
502
|
+
400: unknown;
|
|
503
|
+
/**
|
|
504
|
+
* Insufficient treasury spending limit
|
|
505
|
+
*/
|
|
506
|
+
403: unknown;
|
|
507
|
+
/**
|
|
508
|
+
* Internal server error during mission creation
|
|
509
|
+
*/
|
|
510
|
+
500: unknown;
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
export type MissionsControllerCreateMissionsResponses = {
|
|
514
|
+
/**
|
|
515
|
+
* Mission creation transaction queued successfully
|
|
516
|
+
*/
|
|
517
|
+
201: CreateMissionResponseDto;
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
export type MissionsControllerCreateMissionsResponse =
|
|
521
|
+
MissionsControllerCreateMissionsResponses[keyof MissionsControllerCreateMissionsResponses];
|
|
522
|
+
|
|
523
|
+
export type MissionsControllerUpdateMissionsData = {
|
|
524
|
+
body: UpdateMissionsRequestDto;
|
|
525
|
+
path?: never;
|
|
526
|
+
query?: never;
|
|
527
|
+
url: "/missions";
|
|
528
|
+
};
|
|
529
|
+
|
|
530
|
+
export type MissionsControllerUpdateMissionsResponses = {
|
|
531
|
+
/**
|
|
532
|
+
* Missions update transaction queued successfully
|
|
533
|
+
*/
|
|
534
|
+
200: UpdateMissionsResponseDto;
|
|
535
|
+
};
|
|
536
|
+
|
|
537
|
+
export type MissionsControllerUpdateMissionsResponse =
|
|
538
|
+
MissionsControllerUpdateMissionsResponses[keyof MissionsControllerUpdateMissionsResponses];
|
|
539
|
+
|
|
540
|
+
export type MissionsControllerClaimRewardsData = {
|
|
541
|
+
body: ClaimRewardsRequestDto;
|
|
396
542
|
path: {
|
|
397
|
-
|
|
543
|
+
id: bigint;
|
|
398
544
|
};
|
|
399
545
|
query?: never;
|
|
400
|
-
url: "/
|
|
546
|
+
url: "/missions/{id}/rewards";
|
|
401
547
|
};
|
|
402
548
|
|
|
403
|
-
export type
|
|
404
|
-
|
|
405
|
-
|
|
549
|
+
export type MissionsControllerClaimRewardsErrors = {
|
|
550
|
+
/**
|
|
551
|
+
* Flight not approved or validation failed
|
|
552
|
+
*/
|
|
553
|
+
400: unknown;
|
|
554
|
+
/**
|
|
555
|
+
* Mission or Flight not found
|
|
556
|
+
*/
|
|
557
|
+
404: unknown;
|
|
558
|
+
/**
|
|
559
|
+
* Internal server error during reward claiming
|
|
560
|
+
*/
|
|
561
|
+
500: unknown;
|
|
406
562
|
};
|
|
407
563
|
|
|
408
|
-
export type
|
|
564
|
+
export type MissionsControllerClaimRewardsResponses = {
|
|
409
565
|
/**
|
|
410
|
-
*
|
|
566
|
+
* Rewards claimed successfully
|
|
411
567
|
*/
|
|
412
|
-
200:
|
|
568
|
+
200: ClaimRewardsResponseDto;
|
|
413
569
|
};
|
|
414
570
|
|
|
415
|
-
export type
|
|
416
|
-
|
|
571
|
+
export type MissionsControllerClaimRewardsResponse =
|
|
572
|
+
MissionsControllerClaimRewardsResponses[keyof MissionsControllerClaimRewardsResponses];
|
|
417
573
|
|
|
418
574
|
export type FlightsControllerGenerateFlightIdData = {
|
|
419
575
|
body?: never;
|
|
@@ -421,6 +577,7 @@ export type FlightsControllerGenerateFlightIdData = {
|
|
|
421
577
|
query: {
|
|
422
578
|
missionId: number;
|
|
423
579
|
pilotAddress: string;
|
|
580
|
+
flightTimestamp?: string;
|
|
424
581
|
};
|
|
425
582
|
url: "/flights/id";
|
|
426
583
|
};
|
|
@@ -440,6 +597,30 @@ export type FlightsControllerGenerateFlightIdResponses = {
|
|
|
440
597
|
export type FlightsControllerGenerateFlightIdResponse =
|
|
441
598
|
FlightsControllerGenerateFlightIdResponses[keyof FlightsControllerGenerateFlightIdResponses];
|
|
442
599
|
|
|
600
|
+
export type FlightsControllerGetFlightData = {
|
|
601
|
+
body?: never;
|
|
602
|
+
path: {
|
|
603
|
+
flightId: number;
|
|
604
|
+
};
|
|
605
|
+
query?: never;
|
|
606
|
+
url: "/flights/{flightId}";
|
|
607
|
+
};
|
|
608
|
+
|
|
609
|
+
export type FlightsControllerGetFlightErrors = {
|
|
610
|
+
401: unknown;
|
|
611
|
+
403: unknown;
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
export type FlightsControllerGetFlightResponses = {
|
|
615
|
+
/**
|
|
616
|
+
* Returns flight details
|
|
617
|
+
*/
|
|
618
|
+
200: FlightDto;
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
export type FlightsControllerGetFlightResponse =
|
|
622
|
+
FlightsControllerGetFlightResponses[keyof FlightsControllerGetFlightResponses];
|
|
623
|
+
|
|
443
624
|
export type FlightsControllerCreatePresignedUrlsData = {
|
|
444
625
|
body: CreateFileRequestDto;
|
|
445
626
|
path: {
|
package/src/event/types.gen.ts
CHANGED
|
@@ -24,5 +24,54 @@ export const Event = z.union([
|
|
|
24
24
|
.strict(),
|
|
25
25
|
})
|
|
26
26
|
.strict(),
|
|
27
|
+
z
|
|
28
|
+
.object({
|
|
29
|
+
id: z.any(),
|
|
30
|
+
event_type: z.literal("protocol.mission.created"),
|
|
31
|
+
timestamp: z.any(),
|
|
32
|
+
data: z
|
|
33
|
+
.object({
|
|
34
|
+
missionId: z.string(),
|
|
35
|
+
vaultId: z.string(),
|
|
36
|
+
amount: z.string(),
|
|
37
|
+
zoneId: z.string(),
|
|
38
|
+
flightPlanId: z.number(),
|
|
39
|
+
captureStartTime: z.string(),
|
|
40
|
+
captureEndTime: z.string(),
|
|
41
|
+
detailsHash: z.string(),
|
|
42
|
+
})
|
|
43
|
+
.strict(),
|
|
44
|
+
})
|
|
45
|
+
.strict(),
|
|
46
|
+
z
|
|
47
|
+
.object({
|
|
48
|
+
id: z.any(),
|
|
49
|
+
event_type: z.literal("protocol.mission.updated"),
|
|
50
|
+
timestamp: z.any(),
|
|
51
|
+
data: z
|
|
52
|
+
.object({
|
|
53
|
+
id: z.string(),
|
|
54
|
+
amount: z.number().optional(),
|
|
55
|
+
isOpen: z.boolean().optional(),
|
|
56
|
+
})
|
|
57
|
+
.strict(),
|
|
58
|
+
})
|
|
59
|
+
.strict(),
|
|
60
|
+
z
|
|
61
|
+
.object({
|
|
62
|
+
id: z.any(),
|
|
63
|
+
event_type: z.literal("protocol.flight.reviewed"),
|
|
64
|
+
timestamp: z.any(),
|
|
65
|
+
data: z
|
|
66
|
+
.object({
|
|
67
|
+
flightId: z.number(),
|
|
68
|
+
isApproved: z.boolean(),
|
|
69
|
+
validationLogUri: z.string(),
|
|
70
|
+
validator: z.string(),
|
|
71
|
+
filesHash: z.string(),
|
|
72
|
+
})
|
|
73
|
+
.strict(),
|
|
74
|
+
})
|
|
75
|
+
.strict(),
|
|
27
76
|
]);
|
|
28
77
|
export type Event = z.infer<typeof Event>;
|