@layer-drone/protocol 0.0.15 → 0.0.17
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 +354 -73
- package/dist/index.d.ts +354 -73
- package/dist/index.js +83 -15
- package/dist/index.mjs +82 -14
- package/package.json +1 -1
- package/src/client/sdk.gen.ts +13 -9
- package/src/client/transformers.gen.ts +27 -0
- package/src/client/types.gen.ts +25 -20
- package/src/event/types.gen.ts +56 -8
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ __export(index_exports, {
|
|
|
32
32
|
createClient: () => createClient,
|
|
33
33
|
createConfig: () => createConfig,
|
|
34
34
|
flightsControllerCreatePresignedUrls: () => flightsControllerCreatePresignedUrls,
|
|
35
|
-
|
|
35
|
+
flightsControllerGenerateStorageKey: () => flightsControllerGenerateStorageKey,
|
|
36
36
|
flightsControllerGetFlight: () => flightsControllerGetFlight,
|
|
37
37
|
flightsControllerValidateFlight: () => flightsControllerValidateFlight,
|
|
38
38
|
formDataBodySerializer: () => formDataBodySerializer,
|
|
@@ -756,6 +756,23 @@ var apiTokenControllerUpdateTokenResponseTransformer = /* @__PURE__ */ __name(as
|
|
|
756
756
|
data = updateApiTokenResponseDtoSchemaResponseTransformer(data);
|
|
757
757
|
return data;
|
|
758
758
|
}, "apiTokenControllerUpdateTokenResponseTransformer");
|
|
759
|
+
var flightDtoSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
|
|
760
|
+
data.token_id = BigInt(data.token_id.toString());
|
|
761
|
+
data.mission_id = BigInt(data.mission_id.toString());
|
|
762
|
+
return data;
|
|
763
|
+
}, "flightDtoSchemaResponseTransformer");
|
|
764
|
+
var flightsControllerGetFlightResponseTransformer = /* @__PURE__ */ __name(async (data) => {
|
|
765
|
+
data = flightDtoSchemaResponseTransformer(data);
|
|
766
|
+
return data;
|
|
767
|
+
}, "flightsControllerGetFlightResponseTransformer");
|
|
768
|
+
var validateFlightResponseDtoSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
|
|
769
|
+
data.flightId = BigInt(data.flightId.toString());
|
|
770
|
+
return data;
|
|
771
|
+
}, "validateFlightResponseDtoSchemaResponseTransformer");
|
|
772
|
+
var flightsControllerValidateFlightResponseTransformer = /* @__PURE__ */ __name(async (data) => {
|
|
773
|
+
data = validateFlightResponseDtoSchemaResponseTransformer(data);
|
|
774
|
+
return data;
|
|
775
|
+
}, "flightsControllerValidateFlightResponseTransformer");
|
|
759
776
|
var getTimeLimitsForSunAltitudeResponseSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
|
|
760
777
|
data.OptimalSunAltitudePeriod.StartTime = new Date(data.OptimalSunAltitudePeriod.StartTime);
|
|
761
778
|
data.OptimalSunAltitudePeriod.EndTime = new Date(data.OptimalSunAltitudePeriod.EndTime);
|
|
@@ -896,7 +913,7 @@ var missionsControllerClaimRewards = /* @__PURE__ */ __name((options) => {
|
|
|
896
913
|
}
|
|
897
914
|
});
|
|
898
915
|
}, "missionsControllerClaimRewards");
|
|
899
|
-
var
|
|
916
|
+
var flightsControllerGenerateStorageKey = /* @__PURE__ */ __name((options) => {
|
|
900
917
|
return (options.client ?? client).get({
|
|
901
918
|
security: [
|
|
902
919
|
{
|
|
@@ -904,10 +921,10 @@ var flightsControllerGenerateFlightId = /* @__PURE__ */ __name((options) => {
|
|
|
904
921
|
type: "apiKey"
|
|
905
922
|
}
|
|
906
923
|
],
|
|
907
|
-
url: "/flights/
|
|
924
|
+
url: "/flights/storage-key",
|
|
908
925
|
...options
|
|
909
926
|
});
|
|
910
|
-
}, "
|
|
927
|
+
}, "flightsControllerGenerateStorageKey");
|
|
911
928
|
var flightsControllerGetFlight = /* @__PURE__ */ __name((options) => {
|
|
912
929
|
return (options.client ?? client).get({
|
|
913
930
|
security: [
|
|
@@ -916,6 +933,7 @@ var flightsControllerGetFlight = /* @__PURE__ */ __name((options) => {
|
|
|
916
933
|
type: "apiKey"
|
|
917
934
|
}
|
|
918
935
|
],
|
|
936
|
+
responseTransformer: flightsControllerGetFlightResponseTransformer,
|
|
919
937
|
url: "/flights/{flightId}",
|
|
920
938
|
...options
|
|
921
939
|
});
|
|
@@ -928,7 +946,7 @@ var flightsControllerCreatePresignedUrls = /* @__PURE__ */ __name((options) => {
|
|
|
928
946
|
type: "apiKey"
|
|
929
947
|
}
|
|
930
948
|
],
|
|
931
|
-
url: "/flights/
|
|
949
|
+
url: "/flights/files",
|
|
932
950
|
...options,
|
|
933
951
|
headers: {
|
|
934
952
|
"Content-Type": "application/json",
|
|
@@ -944,6 +962,7 @@ var flightsControllerValidateFlight = /* @__PURE__ */ __name((options) => {
|
|
|
944
962
|
type: "apiKey"
|
|
945
963
|
}
|
|
946
964
|
],
|
|
965
|
+
responseTransformer: flightsControllerValidateFlightResponseTransformer,
|
|
947
966
|
url: "/flights",
|
|
948
967
|
...options,
|
|
949
968
|
headers: {
|
|
@@ -1086,10 +1105,13 @@ var Event = import_zod.z.union([
|
|
|
1086
1105
|
event_type: import_zod.z.literal("protocol.flight.submitted"),
|
|
1087
1106
|
timestamp: import_zod.z.any(),
|
|
1088
1107
|
data: import_zod.z.object({
|
|
1089
|
-
|
|
1108
|
+
storageKey: import_zod.z.string(),
|
|
1090
1109
|
pilotAddress: import_zod.z.string(),
|
|
1091
1110
|
flightManifestUri: import_zod.z.string(),
|
|
1092
|
-
missionId: import_zod.z.
|
|
1111
|
+
missionId: import_zod.z.object({
|
|
1112
|
+
__type: import_zod.z.literal("bigint"),
|
|
1113
|
+
value: import_zod.z.string()
|
|
1114
|
+
}).transform((wire) => BigInt(wire.value))
|
|
1093
1115
|
}).strict()
|
|
1094
1116
|
}).strict(),
|
|
1095
1117
|
import_zod.z.object({
|
|
@@ -1097,9 +1119,18 @@ var Event = import_zod.z.union([
|
|
|
1097
1119
|
event_type: import_zod.z.literal("protocol.mission.created"),
|
|
1098
1120
|
timestamp: import_zod.z.any(),
|
|
1099
1121
|
data: import_zod.z.object({
|
|
1100
|
-
id: import_zod.z.
|
|
1101
|
-
|
|
1102
|
-
|
|
1122
|
+
id: import_zod.z.object({
|
|
1123
|
+
__type: import_zod.z.literal("bigint"),
|
|
1124
|
+
value: import_zod.z.string()
|
|
1125
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1126
|
+
vaultId: import_zod.z.object({
|
|
1127
|
+
__type: import_zod.z.literal("bigint"),
|
|
1128
|
+
value: import_zod.z.string()
|
|
1129
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1130
|
+
amount: import_zod.z.object({
|
|
1131
|
+
__type: import_zod.z.literal("bigint"),
|
|
1132
|
+
value: import_zod.z.string()
|
|
1133
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1103
1134
|
zoneId: import_zod.z.string(),
|
|
1104
1135
|
flightPlanId: import_zod.z.number(),
|
|
1105
1136
|
captureStartTime: import_zod.z.string().datetime({
|
|
@@ -1117,8 +1148,14 @@ var Event = import_zod.z.union([
|
|
|
1117
1148
|
event_type: import_zod.z.literal("protocol.mission.updated"),
|
|
1118
1149
|
timestamp: import_zod.z.any(),
|
|
1119
1150
|
data: import_zod.z.object({
|
|
1120
|
-
id: import_zod.z.
|
|
1121
|
-
|
|
1151
|
+
id: import_zod.z.object({
|
|
1152
|
+
__type: import_zod.z.literal("bigint"),
|
|
1153
|
+
value: import_zod.z.string()
|
|
1154
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1155
|
+
amount: import_zod.z.object({
|
|
1156
|
+
__type: import_zod.z.literal("bigint"),
|
|
1157
|
+
value: import_zod.z.string()
|
|
1158
|
+
}).transform((wire) => BigInt(wire.value)).optional(),
|
|
1122
1159
|
isOpen: import_zod.z.boolean().optional()
|
|
1123
1160
|
}).strict()
|
|
1124
1161
|
}).strict(),
|
|
@@ -1127,11 +1164,42 @@ var Event = import_zod.z.union([
|
|
|
1127
1164
|
event_type: import_zod.z.literal("protocol.flight.reviewed"),
|
|
1128
1165
|
timestamp: import_zod.z.any(),
|
|
1129
1166
|
data: import_zod.z.object({
|
|
1130
|
-
flightId: import_zod.z.
|
|
1167
|
+
flightId: import_zod.z.object({
|
|
1168
|
+
__type: import_zod.z.literal("bigint"),
|
|
1169
|
+
value: import_zod.z.string()
|
|
1170
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1131
1171
|
isApproved: import_zod.z.boolean(),
|
|
1132
1172
|
validationLogUri: import_zod.z.string(),
|
|
1133
1173
|
validator: import_zod.z.string(),
|
|
1134
|
-
filesHash: import_zod.z.string()
|
|
1174
|
+
filesHash: import_zod.z.string(),
|
|
1175
|
+
storageKey: import_zod.z.string(),
|
|
1176
|
+
missionId: import_zod.z.object({
|
|
1177
|
+
__type: import_zod.z.literal("bigint"),
|
|
1178
|
+
value: import_zod.z.string()
|
|
1179
|
+
}).transform((wire) => BigInt(wire.value))
|
|
1180
|
+
}).strict()
|
|
1181
|
+
}).strict(),
|
|
1182
|
+
import_zod.z.object({
|
|
1183
|
+
id: import_zod.z.any(),
|
|
1184
|
+
event_type: import_zod.z.literal("internal.flight.reviewed"),
|
|
1185
|
+
timestamp: import_zod.z.any(),
|
|
1186
|
+
data: import_zod.z.object({
|
|
1187
|
+
isApproved: import_zod.z.boolean(),
|
|
1188
|
+
storageKey: import_zod.z.string(),
|
|
1189
|
+
provenanceDataVersion: import_zod.z.string(),
|
|
1190
|
+
validationLogUri: import_zod.z.string(),
|
|
1191
|
+
provenanceDataUri: import_zod.z.string(),
|
|
1192
|
+
tokenId: import_zod.z.object({
|
|
1193
|
+
__type: import_zod.z.literal("bigint"),
|
|
1194
|
+
value: import_zod.z.string()
|
|
1195
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1196
|
+
missionId: import_zod.z.object({
|
|
1197
|
+
__type: import_zod.z.literal("bigint"),
|
|
1198
|
+
value: import_zod.z.string()
|
|
1199
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1200
|
+
validator: import_zod.z.any(),
|
|
1201
|
+
filesHash: import_zod.z.string(),
|
|
1202
|
+
to: import_zod.z.any()
|
|
1135
1203
|
}).strict()
|
|
1136
1204
|
}).strict()
|
|
1137
1205
|
]);
|
|
@@ -1173,7 +1241,7 @@ __name(getSecretHeader, "getSecretHeader");
|
|
|
1173
1241
|
createClient,
|
|
1174
1242
|
createConfig,
|
|
1175
1243
|
flightsControllerCreatePresignedUrls,
|
|
1176
|
-
|
|
1244
|
+
flightsControllerGenerateStorageKey,
|
|
1177
1245
|
flightsControllerGetFlight,
|
|
1178
1246
|
flightsControllerValidateFlight,
|
|
1179
1247
|
formDataBodySerializer,
|
package/dist/index.mjs
CHANGED
|
@@ -699,6 +699,23 @@ var apiTokenControllerUpdateTokenResponseTransformer = /* @__PURE__ */ __name(as
|
|
|
699
699
|
data = updateApiTokenResponseDtoSchemaResponseTransformer(data);
|
|
700
700
|
return data;
|
|
701
701
|
}, "apiTokenControllerUpdateTokenResponseTransformer");
|
|
702
|
+
var flightDtoSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
|
|
703
|
+
data.token_id = BigInt(data.token_id.toString());
|
|
704
|
+
data.mission_id = BigInt(data.mission_id.toString());
|
|
705
|
+
return data;
|
|
706
|
+
}, "flightDtoSchemaResponseTransformer");
|
|
707
|
+
var flightsControllerGetFlightResponseTransformer = /* @__PURE__ */ __name(async (data) => {
|
|
708
|
+
data = flightDtoSchemaResponseTransformer(data);
|
|
709
|
+
return data;
|
|
710
|
+
}, "flightsControllerGetFlightResponseTransformer");
|
|
711
|
+
var validateFlightResponseDtoSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
|
|
712
|
+
data.flightId = BigInt(data.flightId.toString());
|
|
713
|
+
return data;
|
|
714
|
+
}, "validateFlightResponseDtoSchemaResponseTransformer");
|
|
715
|
+
var flightsControllerValidateFlightResponseTransformer = /* @__PURE__ */ __name(async (data) => {
|
|
716
|
+
data = validateFlightResponseDtoSchemaResponseTransformer(data);
|
|
717
|
+
return data;
|
|
718
|
+
}, "flightsControllerValidateFlightResponseTransformer");
|
|
702
719
|
var getTimeLimitsForSunAltitudeResponseSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
|
|
703
720
|
data.OptimalSunAltitudePeriod.StartTime = new Date(data.OptimalSunAltitudePeriod.StartTime);
|
|
704
721
|
data.OptimalSunAltitudePeriod.EndTime = new Date(data.OptimalSunAltitudePeriod.EndTime);
|
|
@@ -839,7 +856,7 @@ var missionsControllerClaimRewards = /* @__PURE__ */ __name((options) => {
|
|
|
839
856
|
}
|
|
840
857
|
});
|
|
841
858
|
}, "missionsControllerClaimRewards");
|
|
842
|
-
var
|
|
859
|
+
var flightsControllerGenerateStorageKey = /* @__PURE__ */ __name((options) => {
|
|
843
860
|
return (options.client ?? client).get({
|
|
844
861
|
security: [
|
|
845
862
|
{
|
|
@@ -847,10 +864,10 @@ var flightsControllerGenerateFlightId = /* @__PURE__ */ __name((options) => {
|
|
|
847
864
|
type: "apiKey"
|
|
848
865
|
}
|
|
849
866
|
],
|
|
850
|
-
url: "/flights/
|
|
867
|
+
url: "/flights/storage-key",
|
|
851
868
|
...options
|
|
852
869
|
});
|
|
853
|
-
}, "
|
|
870
|
+
}, "flightsControllerGenerateStorageKey");
|
|
854
871
|
var flightsControllerGetFlight = /* @__PURE__ */ __name((options) => {
|
|
855
872
|
return (options.client ?? client).get({
|
|
856
873
|
security: [
|
|
@@ -859,6 +876,7 @@ var flightsControllerGetFlight = /* @__PURE__ */ __name((options) => {
|
|
|
859
876
|
type: "apiKey"
|
|
860
877
|
}
|
|
861
878
|
],
|
|
879
|
+
responseTransformer: flightsControllerGetFlightResponseTransformer,
|
|
862
880
|
url: "/flights/{flightId}",
|
|
863
881
|
...options
|
|
864
882
|
});
|
|
@@ -871,7 +889,7 @@ var flightsControllerCreatePresignedUrls = /* @__PURE__ */ __name((options) => {
|
|
|
871
889
|
type: "apiKey"
|
|
872
890
|
}
|
|
873
891
|
],
|
|
874
|
-
url: "/flights/
|
|
892
|
+
url: "/flights/files",
|
|
875
893
|
...options,
|
|
876
894
|
headers: {
|
|
877
895
|
"Content-Type": "application/json",
|
|
@@ -887,6 +905,7 @@ var flightsControllerValidateFlight = /* @__PURE__ */ __name((options) => {
|
|
|
887
905
|
type: "apiKey"
|
|
888
906
|
}
|
|
889
907
|
],
|
|
908
|
+
responseTransformer: flightsControllerValidateFlightResponseTransformer,
|
|
890
909
|
url: "/flights",
|
|
891
910
|
...options,
|
|
892
911
|
headers: {
|
|
@@ -1029,10 +1048,13 @@ var Event = z.union([
|
|
|
1029
1048
|
event_type: z.literal("protocol.flight.submitted"),
|
|
1030
1049
|
timestamp: z.any(),
|
|
1031
1050
|
data: z.object({
|
|
1032
|
-
|
|
1051
|
+
storageKey: z.string(),
|
|
1033
1052
|
pilotAddress: z.string(),
|
|
1034
1053
|
flightManifestUri: z.string(),
|
|
1035
|
-
missionId: z.
|
|
1054
|
+
missionId: z.object({
|
|
1055
|
+
__type: z.literal("bigint"),
|
|
1056
|
+
value: z.string()
|
|
1057
|
+
}).transform((wire) => BigInt(wire.value))
|
|
1036
1058
|
}).strict()
|
|
1037
1059
|
}).strict(),
|
|
1038
1060
|
z.object({
|
|
@@ -1040,9 +1062,18 @@ var Event = z.union([
|
|
|
1040
1062
|
event_type: z.literal("protocol.mission.created"),
|
|
1041
1063
|
timestamp: z.any(),
|
|
1042
1064
|
data: z.object({
|
|
1043
|
-
id: z.
|
|
1044
|
-
|
|
1045
|
-
|
|
1065
|
+
id: z.object({
|
|
1066
|
+
__type: z.literal("bigint"),
|
|
1067
|
+
value: z.string()
|
|
1068
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1069
|
+
vaultId: z.object({
|
|
1070
|
+
__type: z.literal("bigint"),
|
|
1071
|
+
value: z.string()
|
|
1072
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1073
|
+
amount: z.object({
|
|
1074
|
+
__type: z.literal("bigint"),
|
|
1075
|
+
value: z.string()
|
|
1076
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1046
1077
|
zoneId: z.string(),
|
|
1047
1078
|
flightPlanId: z.number(),
|
|
1048
1079
|
captureStartTime: z.string().datetime({
|
|
@@ -1060,8 +1091,14 @@ var Event = z.union([
|
|
|
1060
1091
|
event_type: z.literal("protocol.mission.updated"),
|
|
1061
1092
|
timestamp: z.any(),
|
|
1062
1093
|
data: z.object({
|
|
1063
|
-
id: z.
|
|
1064
|
-
|
|
1094
|
+
id: z.object({
|
|
1095
|
+
__type: z.literal("bigint"),
|
|
1096
|
+
value: z.string()
|
|
1097
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1098
|
+
amount: z.object({
|
|
1099
|
+
__type: z.literal("bigint"),
|
|
1100
|
+
value: z.string()
|
|
1101
|
+
}).transform((wire) => BigInt(wire.value)).optional(),
|
|
1065
1102
|
isOpen: z.boolean().optional()
|
|
1066
1103
|
}).strict()
|
|
1067
1104
|
}).strict(),
|
|
@@ -1070,11 +1107,42 @@ var Event = z.union([
|
|
|
1070
1107
|
event_type: z.literal("protocol.flight.reviewed"),
|
|
1071
1108
|
timestamp: z.any(),
|
|
1072
1109
|
data: z.object({
|
|
1073
|
-
flightId: z.
|
|
1110
|
+
flightId: z.object({
|
|
1111
|
+
__type: z.literal("bigint"),
|
|
1112
|
+
value: z.string()
|
|
1113
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1074
1114
|
isApproved: z.boolean(),
|
|
1075
1115
|
validationLogUri: z.string(),
|
|
1076
1116
|
validator: z.string(),
|
|
1077
|
-
filesHash: z.string()
|
|
1117
|
+
filesHash: z.string(),
|
|
1118
|
+
storageKey: z.string(),
|
|
1119
|
+
missionId: z.object({
|
|
1120
|
+
__type: z.literal("bigint"),
|
|
1121
|
+
value: z.string()
|
|
1122
|
+
}).transform((wire) => BigInt(wire.value))
|
|
1123
|
+
}).strict()
|
|
1124
|
+
}).strict(),
|
|
1125
|
+
z.object({
|
|
1126
|
+
id: z.any(),
|
|
1127
|
+
event_type: z.literal("internal.flight.reviewed"),
|
|
1128
|
+
timestamp: z.any(),
|
|
1129
|
+
data: z.object({
|
|
1130
|
+
isApproved: z.boolean(),
|
|
1131
|
+
storageKey: z.string(),
|
|
1132
|
+
provenanceDataVersion: z.string(),
|
|
1133
|
+
validationLogUri: z.string(),
|
|
1134
|
+
provenanceDataUri: z.string(),
|
|
1135
|
+
tokenId: z.object({
|
|
1136
|
+
__type: z.literal("bigint"),
|
|
1137
|
+
value: z.string()
|
|
1138
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1139
|
+
missionId: z.object({
|
|
1140
|
+
__type: z.literal("bigint"),
|
|
1141
|
+
value: z.string()
|
|
1142
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1143
|
+
validator: z.any(),
|
|
1144
|
+
filesHash: z.string(),
|
|
1145
|
+
to: z.any()
|
|
1078
1146
|
}).strict()
|
|
1079
1147
|
}).strict()
|
|
1080
1148
|
]);
|
|
@@ -1115,7 +1183,7 @@ export {
|
|
|
1115
1183
|
createClient,
|
|
1116
1184
|
createConfig,
|
|
1117
1185
|
flightsControllerCreatePresignedUrls,
|
|
1118
|
-
|
|
1186
|
+
flightsControllerGenerateStorageKey,
|
|
1119
1187
|
flightsControllerGetFlight,
|
|
1120
1188
|
flightsControllerValidateFlight,
|
|
1121
1189
|
formDataBodySerializer,
|
package/package.json
CHANGED
package/src/client/sdk.gen.ts
CHANGED
|
@@ -8,6 +8,8 @@ import type {
|
|
|
8
8
|
import {
|
|
9
9
|
apiTokenControllerUpdateTokenResponseTransformer,
|
|
10
10
|
conditionsControllerGetSunAltitudeTimeLimitsResponseTransformer,
|
|
11
|
+
flightsControllerGetFlightResponseTransformer,
|
|
12
|
+
flightsControllerValidateFlightResponseTransformer,
|
|
11
13
|
} from "./transformers.gen.js";
|
|
12
14
|
import type {
|
|
13
15
|
ApiTokenControllerCreateTokenData,
|
|
@@ -29,9 +31,9 @@ import type {
|
|
|
29
31
|
FlightsControllerCreatePresignedUrlsData,
|
|
30
32
|
FlightsControllerCreatePresignedUrlsErrors,
|
|
31
33
|
FlightsControllerCreatePresignedUrlsResponses,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
FlightsControllerGenerateStorageKeyData,
|
|
35
|
+
FlightsControllerGenerateStorageKeyErrors,
|
|
36
|
+
FlightsControllerGenerateStorageKeyResponses,
|
|
35
37
|
FlightsControllerGetFlightData,
|
|
36
38
|
FlightsControllerGetFlightErrors,
|
|
37
39
|
FlightsControllerGetFlightResponses,
|
|
@@ -333,14 +335,14 @@ export const missionsControllerClaimRewards = <
|
|
|
333
335
|
});
|
|
334
336
|
};
|
|
335
337
|
|
|
336
|
-
export const
|
|
338
|
+
export const flightsControllerGenerateStorageKey = <
|
|
337
339
|
ThrowOnError extends boolean = false,
|
|
338
340
|
>(
|
|
339
|
-
options: Options<
|
|
341
|
+
options: Options<FlightsControllerGenerateStorageKeyData, ThrowOnError>,
|
|
340
342
|
) => {
|
|
341
343
|
return (options.client ?? _heyApiClient).get<
|
|
342
|
-
|
|
343
|
-
|
|
344
|
+
FlightsControllerGenerateStorageKeyResponses,
|
|
345
|
+
FlightsControllerGenerateStorageKeyErrors,
|
|
344
346
|
ThrowOnError
|
|
345
347
|
>({
|
|
346
348
|
security: [
|
|
@@ -349,7 +351,7 @@ export const flightsControllerGenerateFlightId = <
|
|
|
349
351
|
type: "apiKey",
|
|
350
352
|
},
|
|
351
353
|
],
|
|
352
|
-
url: "/flights/
|
|
354
|
+
url: "/flights/storage-key",
|
|
353
355
|
...options,
|
|
354
356
|
});
|
|
355
357
|
};
|
|
@@ -370,6 +372,7 @@ export const flightsControllerGetFlight = <
|
|
|
370
372
|
type: "apiKey",
|
|
371
373
|
},
|
|
372
374
|
],
|
|
375
|
+
responseTransformer: flightsControllerGetFlightResponseTransformer,
|
|
373
376
|
url: "/flights/{flightId}",
|
|
374
377
|
...options,
|
|
375
378
|
});
|
|
@@ -391,7 +394,7 @@ export const flightsControllerCreatePresignedUrls = <
|
|
|
391
394
|
type: "apiKey",
|
|
392
395
|
},
|
|
393
396
|
],
|
|
394
|
-
url: "/flights/
|
|
397
|
+
url: "/flights/files",
|
|
395
398
|
...options,
|
|
396
399
|
headers: {
|
|
397
400
|
"Content-Type": "application/json",
|
|
@@ -416,6 +419,7 @@ export const flightsControllerValidateFlight = <
|
|
|
416
419
|
type: "apiKey",
|
|
417
420
|
},
|
|
418
421
|
],
|
|
422
|
+
responseTransformer: flightsControllerValidateFlightResponseTransformer,
|
|
419
423
|
url: "/flights",
|
|
420
424
|
...options,
|
|
421
425
|
headers: {
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import type {
|
|
3
3
|
ApiTokenControllerUpdateTokenResponse,
|
|
4
4
|
ConditionsControllerGetSunAltitudeTimeLimitsResponse,
|
|
5
|
+
FlightsControllerGetFlightResponse,
|
|
6
|
+
FlightsControllerValidateFlightResponse,
|
|
5
7
|
} from "./types.gen.js";
|
|
6
8
|
|
|
7
9
|
const updateApiTokenResponseDtoSchemaResponseTransformer = (data: any) => {
|
|
@@ -17,6 +19,31 @@ export const apiTokenControllerUpdateTokenResponseTransformer = async (
|
|
|
17
19
|
return data;
|
|
18
20
|
};
|
|
19
21
|
|
|
22
|
+
const flightDtoSchemaResponseTransformer = (data: any) => {
|
|
23
|
+
data.token_id = BigInt(data.token_id.toString());
|
|
24
|
+
data.mission_id = BigInt(data.mission_id.toString());
|
|
25
|
+
return data;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const flightsControllerGetFlightResponseTransformer = async (
|
|
29
|
+
data: any,
|
|
30
|
+
): Promise<FlightsControllerGetFlightResponse> => {
|
|
31
|
+
data = flightDtoSchemaResponseTransformer(data);
|
|
32
|
+
return data;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const validateFlightResponseDtoSchemaResponseTransformer = (data: any) => {
|
|
36
|
+
data.flightId = BigInt(data.flightId.toString());
|
|
37
|
+
return data;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const flightsControllerValidateFlightResponseTransformer = async (
|
|
41
|
+
data: any,
|
|
42
|
+
): Promise<FlightsControllerValidateFlightResponse> => {
|
|
43
|
+
data = validateFlightResponseDtoSchemaResponseTransformer(data);
|
|
44
|
+
return data;
|
|
45
|
+
};
|
|
46
|
+
|
|
20
47
|
const getTimeLimitsForSunAltitudeResponseSchemaResponseTransformer = (
|
|
21
48
|
data: any,
|
|
22
49
|
) => {
|
package/src/client/types.gen.ts
CHANGED
|
@@ -129,7 +129,8 @@ export type ClaimRewardsResponseDto = {
|
|
|
129
129
|
};
|
|
130
130
|
|
|
131
131
|
export type FlightDto = {
|
|
132
|
-
token_id:
|
|
132
|
+
token_id: bigint;
|
|
133
|
+
mission_id: bigint;
|
|
133
134
|
owner: string;
|
|
134
135
|
validator: string;
|
|
135
136
|
is_approved: boolean;
|
|
@@ -142,6 +143,7 @@ export type FlightDto = {
|
|
|
142
143
|
|
|
143
144
|
export type CreateFileRequestDto = {
|
|
144
145
|
filenames: Array<string>;
|
|
146
|
+
storageKey: string;
|
|
145
147
|
};
|
|
146
148
|
|
|
147
149
|
export type CreateFileResponseDto = {
|
|
@@ -150,10 +152,10 @@ export type CreateFileResponseDto = {
|
|
|
150
152
|
};
|
|
151
153
|
};
|
|
152
154
|
|
|
153
|
-
export type
|
|
154
|
-
|
|
155
|
+
export type ValidateFlightRequestDto = {
|
|
156
|
+
storageKey: string;
|
|
155
157
|
pilotAddress: string;
|
|
156
|
-
missionId:
|
|
158
|
+
missionId: bigint;
|
|
157
159
|
flightTimestamp: string;
|
|
158
160
|
flightRequestInfo: {
|
|
159
161
|
filePaths: Array<string>;
|
|
@@ -164,7 +166,7 @@ export type ValidateFlightDto = {
|
|
|
164
166
|
};
|
|
165
167
|
|
|
166
168
|
export type ValidateFlightResponseDto = {
|
|
167
|
-
flightId:
|
|
169
|
+
flightId: bigint;
|
|
168
170
|
flightManifestUri: string;
|
|
169
171
|
};
|
|
170
172
|
|
|
@@ -191,6 +193,7 @@ export type CreateWebhookBody = {
|
|
|
191
193
|
| "protocol.mission.created"
|
|
192
194
|
| "protocol.mission.updated"
|
|
193
195
|
| "protocol.flight.reviewed"
|
|
196
|
+
| "internal.flight.reviewed"
|
|
194
197
|
| "*"
|
|
195
198
|
>;
|
|
196
199
|
active: boolean;
|
|
@@ -211,6 +214,7 @@ export type GetWebhooksResponse = Array<{
|
|
|
211
214
|
| "protocol.mission.created"
|
|
212
215
|
| "protocol.mission.updated"
|
|
213
216
|
| "protocol.flight.reviewed"
|
|
217
|
+
| "internal.flight.reviewed"
|
|
214
218
|
| "*"
|
|
215
219
|
>;
|
|
216
220
|
active: boolean;
|
|
@@ -230,6 +234,7 @@ export type GetWebhookResponse = {
|
|
|
230
234
|
| "protocol.mission.created"
|
|
231
235
|
| "protocol.mission.updated"
|
|
232
236
|
| "protocol.flight.reviewed"
|
|
237
|
+
| "internal.flight.reviewed"
|
|
233
238
|
| "*"
|
|
234
239
|
>;
|
|
235
240
|
active: boolean;
|
|
@@ -248,6 +253,7 @@ export type UpdateWebhookBody = {
|
|
|
248
253
|
| "protocol.mission.created"
|
|
249
254
|
| "protocol.mission.updated"
|
|
250
255
|
| "protocol.flight.reviewed"
|
|
256
|
+
| "internal.flight.reviewed"
|
|
251
257
|
| "*"
|
|
252
258
|
>;
|
|
253
259
|
active?: boolean;
|
|
@@ -263,6 +269,7 @@ export type UpdateWebhookResponse = {
|
|
|
263
269
|
| "protocol.mission.created"
|
|
264
270
|
| "protocol.mission.updated"
|
|
265
271
|
| "protocol.flight.reviewed"
|
|
272
|
+
| "internal.flight.reviewed"
|
|
266
273
|
| "*"
|
|
267
274
|
>;
|
|
268
275
|
active: boolean;
|
|
@@ -508,36 +515,36 @@ export type MissionsControllerClaimRewardsResponses = {
|
|
|
508
515
|
export type MissionsControllerClaimRewardsResponse =
|
|
509
516
|
MissionsControllerClaimRewardsResponses[keyof MissionsControllerClaimRewardsResponses];
|
|
510
517
|
|
|
511
|
-
export type
|
|
518
|
+
export type FlightsControllerGenerateStorageKeyData = {
|
|
512
519
|
body?: never;
|
|
513
520
|
path?: never;
|
|
514
521
|
query: {
|
|
515
|
-
missionId:
|
|
522
|
+
missionId: bigint;
|
|
516
523
|
pilotAddress: string;
|
|
517
524
|
flightTimestamp?: string;
|
|
518
525
|
};
|
|
519
|
-
url: "/flights/
|
|
526
|
+
url: "/flights/storage-key";
|
|
520
527
|
};
|
|
521
528
|
|
|
522
|
-
export type
|
|
529
|
+
export type FlightsControllerGenerateStorageKeyErrors = {
|
|
523
530
|
401: unknown;
|
|
524
531
|
403: unknown;
|
|
525
532
|
};
|
|
526
533
|
|
|
527
|
-
export type
|
|
534
|
+
export type FlightsControllerGenerateStorageKeyResponses = {
|
|
528
535
|
/**
|
|
529
|
-
* Returns the generated
|
|
536
|
+
* Returns the generated storage key
|
|
530
537
|
*/
|
|
531
|
-
200:
|
|
538
|
+
200: string;
|
|
532
539
|
};
|
|
533
540
|
|
|
534
|
-
export type
|
|
535
|
-
|
|
541
|
+
export type FlightsControllerGenerateStorageKeyResponse =
|
|
542
|
+
FlightsControllerGenerateStorageKeyResponses[keyof FlightsControllerGenerateStorageKeyResponses];
|
|
536
543
|
|
|
537
544
|
export type FlightsControllerGetFlightData = {
|
|
538
545
|
body?: never;
|
|
539
546
|
path: {
|
|
540
|
-
flightId:
|
|
547
|
+
flightId: bigint;
|
|
541
548
|
};
|
|
542
549
|
query?: never;
|
|
543
550
|
url: "/flights/{flightId}";
|
|
@@ -560,11 +567,9 @@ export type FlightsControllerGetFlightResponse =
|
|
|
560
567
|
|
|
561
568
|
export type FlightsControllerCreatePresignedUrlsData = {
|
|
562
569
|
body: CreateFileRequestDto;
|
|
563
|
-
path
|
|
564
|
-
flightId: number;
|
|
565
|
-
};
|
|
570
|
+
path?: never;
|
|
566
571
|
query?: never;
|
|
567
|
-
url: "/flights/
|
|
572
|
+
url: "/flights/files";
|
|
568
573
|
};
|
|
569
574
|
|
|
570
575
|
export type FlightsControllerCreatePresignedUrlsErrors = {
|
|
@@ -583,7 +588,7 @@ export type FlightsControllerCreatePresignedUrlsResponse =
|
|
|
583
588
|
FlightsControllerCreatePresignedUrlsResponses[keyof FlightsControllerCreatePresignedUrlsResponses];
|
|
584
589
|
|
|
585
590
|
export type FlightsControllerValidateFlightData = {
|
|
586
|
-
body:
|
|
591
|
+
body: ValidateFlightRequestDto;
|
|
587
592
|
path?: never;
|
|
588
593
|
query?: never;
|
|
589
594
|
url: "/flights";
|