@layer-drone/protocol 0.0.16 → 0.0.18-alpha
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/README.md +43 -0
- package/dist/index.d.mts +427 -255
- package/dist/index.d.ts +427 -255
- package/dist/index.js +125 -93
- package/dist/index.mjs +123 -90
- package/package.json +7 -2
- package/src/client/client/client.ts +5 -1
- package/src/client/sdk.gen.ts +119 -143
- package/src/client/transformers.gen.ts +13 -0
- package/src/client/types.gen.ts +231 -269
- package/src/event/types.gen.ts +57 -21
package/dist/index.js
CHANGED
|
@@ -22,24 +22,23 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
22
|
var index_exports = {};
|
|
23
23
|
__export(index_exports, {
|
|
24
24
|
Event: () => Event,
|
|
25
|
+
apiControllerGetHello: () => apiControllerGetHello,
|
|
25
26
|
apiTokenControllerCreateToken: () => apiTokenControllerCreateToken,
|
|
26
27
|
apiTokenControllerDeleteToken: () => apiTokenControllerDeleteToken,
|
|
27
28
|
apiTokenControllerGetToken: () => apiTokenControllerGetToken,
|
|
28
29
|
apiTokenControllerUpdateToken: () => apiTokenControllerUpdateToken,
|
|
29
|
-
appControllerGetHello: () => appControllerGetHello,
|
|
30
30
|
buildClientParams: () => buildClientParams,
|
|
31
31
|
conditionsControllerGetSunAltitudeTimeLimits: () => conditionsControllerGetSunAltitudeTimeLimits,
|
|
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,
|
|
39
39
|
jsonBodySerializer: () => jsonBodySerializer,
|
|
40
40
|
keysControllerGetProvenanceCryptoKey: () => keysControllerGetProvenanceCryptoKey,
|
|
41
41
|
mergeHeaders: () => mergeHeaders,
|
|
42
|
-
missionsControllerClaimRewards: () => missionsControllerClaimRewards,
|
|
43
42
|
missionsControllerCreateMissions: () => missionsControllerCreateMissions,
|
|
44
43
|
missionsControllerUpdateMissions: () => missionsControllerUpdateMissions,
|
|
45
44
|
parseWebhookEvent: () => parseWebhookEvent,
|
|
@@ -767,48 +766,22 @@ var conditionsControllerGetSunAltitudeTimeLimitsResponseTransformer = /* @__PURE
|
|
|
767
766
|
data = getTimeLimitsForSunAltitudeResponseSchemaResponseTransformer(data);
|
|
768
767
|
return data;
|
|
769
768
|
}, "conditionsControllerGetSunAltitudeTimeLimitsResponseTransformer");
|
|
769
|
+
var validateFlightResponseDtoSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
|
|
770
|
+
data.flightId = BigInt(data.flightId.toString());
|
|
771
|
+
return data;
|
|
772
|
+
}, "validateFlightResponseDtoSchemaResponseTransformer");
|
|
773
|
+
var flightsControllerValidateFlightResponseTransformer = /* @__PURE__ */ __name(async (data) => {
|
|
774
|
+
data = validateFlightResponseDtoSchemaResponseTransformer(data);
|
|
775
|
+
return data;
|
|
776
|
+
}, "flightsControllerValidateFlightResponseTransformer");
|
|
770
777
|
|
|
771
778
|
// src/client/sdk.gen.ts
|
|
772
|
-
var
|
|
779
|
+
var apiControllerGetHello = /* @__PURE__ */ __name((options) => {
|
|
773
780
|
return (options?.client ?? client).get({
|
|
774
781
|
url: "/",
|
|
775
782
|
...options
|
|
776
783
|
});
|
|
777
|
-
}, "
|
|
778
|
-
var keysControllerGetProvenanceCryptoKey = /* @__PURE__ */ __name((options) => {
|
|
779
|
-
return (options?.client ?? client).get({
|
|
780
|
-
url: "/keys",
|
|
781
|
-
...options
|
|
782
|
-
});
|
|
783
|
-
}, "keysControllerGetProvenanceCryptoKey");
|
|
784
|
-
var quotesControllerCreateQuote = /* @__PURE__ */ __name((options) => {
|
|
785
|
-
return (options.client ?? client).post({
|
|
786
|
-
security: [
|
|
787
|
-
{
|
|
788
|
-
name: "x-api-token",
|
|
789
|
-
type: "apiKey"
|
|
790
|
-
}
|
|
791
|
-
],
|
|
792
|
-
url: "/quotes",
|
|
793
|
-
...options,
|
|
794
|
-
headers: {
|
|
795
|
-
"Content-Type": "application/json",
|
|
796
|
-
...options.headers
|
|
797
|
-
}
|
|
798
|
-
});
|
|
799
|
-
}, "quotesControllerCreateQuote");
|
|
800
|
-
var quotesControllerGetQuote = /* @__PURE__ */ __name((options) => {
|
|
801
|
-
return (options.client ?? client).get({
|
|
802
|
-
security: [
|
|
803
|
-
{
|
|
804
|
-
name: "x-api-token",
|
|
805
|
-
type: "apiKey"
|
|
806
|
-
}
|
|
807
|
-
],
|
|
808
|
-
url: "/quotes/{id}",
|
|
809
|
-
...options
|
|
810
|
-
});
|
|
811
|
-
}, "quotesControllerGetQuote");
|
|
784
|
+
}, "apiControllerGetHello");
|
|
812
785
|
var apiTokenControllerCreateToken = /* @__PURE__ */ __name((options) => {
|
|
813
786
|
return (options.client ?? client).post({
|
|
814
787
|
security: [
|
|
@@ -866,37 +839,14 @@ var apiTokenControllerUpdateToken = /* @__PURE__ */ __name((options) => {
|
|
|
866
839
|
}
|
|
867
840
|
});
|
|
868
841
|
}, "apiTokenControllerUpdateToken");
|
|
869
|
-
var
|
|
870
|
-
return (options.client ?? client).
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
"Content-Type": "application/json",
|
|
875
|
-
...options.headers
|
|
876
|
-
}
|
|
877
|
-
});
|
|
878
|
-
}, "missionsControllerCreateMissions");
|
|
879
|
-
var missionsControllerUpdateMissions = /* @__PURE__ */ __name((options) => {
|
|
880
|
-
return (options.client ?? client).put({
|
|
881
|
-
url: "/missions",
|
|
882
|
-
...options,
|
|
883
|
-
headers: {
|
|
884
|
-
"Content-Type": "application/json",
|
|
885
|
-
...options.headers
|
|
886
|
-
}
|
|
887
|
-
});
|
|
888
|
-
}, "missionsControllerUpdateMissions");
|
|
889
|
-
var missionsControllerClaimRewards = /* @__PURE__ */ __name((options) => {
|
|
890
|
-
return (options.client ?? client).post({
|
|
891
|
-
url: "/missions/{id}/rewards",
|
|
892
|
-
...options,
|
|
893
|
-
headers: {
|
|
894
|
-
"Content-Type": "application/json",
|
|
895
|
-
...options.headers
|
|
896
|
-
}
|
|
842
|
+
var conditionsControllerGetSunAltitudeTimeLimits = /* @__PURE__ */ __name((options) => {
|
|
843
|
+
return (options.client ?? client).get({
|
|
844
|
+
responseTransformer: conditionsControllerGetSunAltitudeTimeLimitsResponseTransformer,
|
|
845
|
+
url: "/conditions/sun-altitude",
|
|
846
|
+
...options
|
|
897
847
|
});
|
|
898
|
-
}, "
|
|
899
|
-
var
|
|
848
|
+
}, "conditionsControllerGetSunAltitudeTimeLimits");
|
|
849
|
+
var flightsControllerGenerateStorageKey = /* @__PURE__ */ __name((options) => {
|
|
900
850
|
return (options.client ?? client).get({
|
|
901
851
|
security: [
|
|
902
852
|
{
|
|
@@ -904,10 +854,10 @@ var flightsControllerGenerateFlightId = /* @__PURE__ */ __name((options) => {
|
|
|
904
854
|
type: "apiKey"
|
|
905
855
|
}
|
|
906
856
|
],
|
|
907
|
-
url: "/flights/
|
|
857
|
+
url: "/flights/storage-key",
|
|
908
858
|
...options
|
|
909
859
|
});
|
|
910
|
-
}, "
|
|
860
|
+
}, "flightsControllerGenerateStorageKey");
|
|
911
861
|
var flightsControllerGetFlight = /* @__PURE__ */ __name((options) => {
|
|
912
862
|
return (options.client ?? client).get({
|
|
913
863
|
security: [
|
|
@@ -928,7 +878,7 @@ var flightsControllerCreatePresignedUrls = /* @__PURE__ */ __name((options) => {
|
|
|
928
878
|
type: "apiKey"
|
|
929
879
|
}
|
|
930
880
|
],
|
|
931
|
-
url: "/flights/
|
|
881
|
+
url: "/flights/files",
|
|
932
882
|
...options,
|
|
933
883
|
headers: {
|
|
934
884
|
"Content-Type": "application/json",
|
|
@@ -944,6 +894,7 @@ var flightsControllerValidateFlight = /* @__PURE__ */ __name((options) => {
|
|
|
944
894
|
type: "apiKey"
|
|
945
895
|
}
|
|
946
896
|
],
|
|
897
|
+
responseTransformer: flightsControllerValidateFlightResponseTransformer,
|
|
947
898
|
url: "/flights",
|
|
948
899
|
...options,
|
|
949
900
|
headers: {
|
|
@@ -952,13 +903,60 @@ var flightsControllerValidateFlight = /* @__PURE__ */ __name((options) => {
|
|
|
952
903
|
}
|
|
953
904
|
});
|
|
954
905
|
}, "flightsControllerValidateFlight");
|
|
955
|
-
var
|
|
906
|
+
var keysControllerGetProvenanceCryptoKey = /* @__PURE__ */ __name((options) => {
|
|
907
|
+
return (options?.client ?? client).get({
|
|
908
|
+
url: "/keys",
|
|
909
|
+
...options
|
|
910
|
+
});
|
|
911
|
+
}, "keysControllerGetProvenanceCryptoKey");
|
|
912
|
+
var missionsControllerCreateMissions = /* @__PURE__ */ __name((options) => {
|
|
913
|
+
return (options.client ?? client).post({
|
|
914
|
+
url: "/missions",
|
|
915
|
+
...options,
|
|
916
|
+
headers: {
|
|
917
|
+
"Content-Type": "application/json",
|
|
918
|
+
...options.headers
|
|
919
|
+
}
|
|
920
|
+
});
|
|
921
|
+
}, "missionsControllerCreateMissions");
|
|
922
|
+
var missionsControllerUpdateMissions = /* @__PURE__ */ __name((options) => {
|
|
923
|
+
return (options.client ?? client).put({
|
|
924
|
+
url: "/missions",
|
|
925
|
+
...options,
|
|
926
|
+
headers: {
|
|
927
|
+
"Content-Type": "application/json",
|
|
928
|
+
...options.headers
|
|
929
|
+
}
|
|
930
|
+
});
|
|
931
|
+
}, "missionsControllerUpdateMissions");
|
|
932
|
+
var quotesControllerCreateQuote = /* @__PURE__ */ __name((options) => {
|
|
933
|
+
return (options.client ?? client).post({
|
|
934
|
+
security: [
|
|
935
|
+
{
|
|
936
|
+
name: "x-api-token",
|
|
937
|
+
type: "apiKey"
|
|
938
|
+
}
|
|
939
|
+
],
|
|
940
|
+
url: "/quotes",
|
|
941
|
+
...options,
|
|
942
|
+
headers: {
|
|
943
|
+
"Content-Type": "application/json",
|
|
944
|
+
...options.headers
|
|
945
|
+
}
|
|
946
|
+
});
|
|
947
|
+
}, "quotesControllerCreateQuote");
|
|
948
|
+
var quotesControllerGetQuote = /* @__PURE__ */ __name((options) => {
|
|
956
949
|
return (options.client ?? client).get({
|
|
957
|
-
|
|
958
|
-
|
|
950
|
+
security: [
|
|
951
|
+
{
|
|
952
|
+
name: "x-api-token",
|
|
953
|
+
type: "apiKey"
|
|
954
|
+
}
|
|
955
|
+
],
|
|
956
|
+
url: "/quotes/{id}",
|
|
959
957
|
...options
|
|
960
958
|
});
|
|
961
|
-
}, "
|
|
959
|
+
}, "quotesControllerGetQuote");
|
|
962
960
|
var schemaControllerGetEventSchema = /* @__PURE__ */ __name((options) => {
|
|
963
961
|
return (options?.client ?? client).get({
|
|
964
962
|
url: "/schema/event",
|
|
@@ -1081,17 +1079,6 @@ var Event = import_zod.z.union([
|
|
|
1081
1079
|
message: import_zod.z.string()
|
|
1082
1080
|
}).strict()
|
|
1083
1081
|
}).strict(),
|
|
1084
|
-
import_zod.z.object({
|
|
1085
|
-
id: import_zod.z.any(),
|
|
1086
|
-
event_type: import_zod.z.literal("protocol.flight.submitted"),
|
|
1087
|
-
timestamp: import_zod.z.any(),
|
|
1088
|
-
data: import_zod.z.object({
|
|
1089
|
-
flightId: import_zod.z.number(),
|
|
1090
|
-
pilotAddress: import_zod.z.string(),
|
|
1091
|
-
flightManifestUri: import_zod.z.string(),
|
|
1092
|
-
missionId: import_zod.z.number()
|
|
1093
|
-
}).strict()
|
|
1094
|
-
}).strict(),
|
|
1095
1082
|
import_zod.z.object({
|
|
1096
1083
|
id: import_zod.z.any(),
|
|
1097
1084
|
event_type: import_zod.z.literal("protocol.mission.created"),
|
|
@@ -1117,7 +1104,6 @@ var Event = import_zod.z.union([
|
|
|
1117
1104
|
captureEndTime: import_zod.z.string().datetime({
|
|
1118
1105
|
offset: true
|
|
1119
1106
|
}),
|
|
1120
|
-
detailsHash: import_zod.z.string(),
|
|
1121
1107
|
requestor: import_zod.z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$"))
|
|
1122
1108
|
}).strict()
|
|
1123
1109
|
}).strict(),
|
|
@@ -1137,16 +1123,63 @@ var Event = import_zod.z.union([
|
|
|
1137
1123
|
isOpen: import_zod.z.boolean().optional()
|
|
1138
1124
|
}).strict()
|
|
1139
1125
|
}).strict(),
|
|
1126
|
+
import_zod.z.object({
|
|
1127
|
+
id: import_zod.z.any(),
|
|
1128
|
+
event_type: import_zod.z.literal("protocol.mission.paid"),
|
|
1129
|
+
timestamp: import_zod.z.any(),
|
|
1130
|
+
data: import_zod.z.object({
|
|
1131
|
+
recipient: import_zod.z.any(),
|
|
1132
|
+
flightId: import_zod.z.object({
|
|
1133
|
+
__type: import_zod.z.literal("bigint"),
|
|
1134
|
+
value: import_zod.z.string()
|
|
1135
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1136
|
+
missionId: import_zod.z.object({
|
|
1137
|
+
__type: import_zod.z.literal("bigint"),
|
|
1138
|
+
value: import_zod.z.string()
|
|
1139
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1140
|
+
vaultId: import_zod.z.object({
|
|
1141
|
+
__type: import_zod.z.literal("bigint"),
|
|
1142
|
+
value: import_zod.z.string()
|
|
1143
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1144
|
+
amount: import_zod.z.object({
|
|
1145
|
+
__type: import_zod.z.literal("bigint"),
|
|
1146
|
+
value: import_zod.z.string()
|
|
1147
|
+
}).transform((wire) => BigInt(wire.value))
|
|
1148
|
+
}).strict()
|
|
1149
|
+
}).strict(),
|
|
1150
|
+
import_zod.z.object({
|
|
1151
|
+
id: import_zod.z.any(),
|
|
1152
|
+
event_type: import_zod.z.literal("protocol.flight.submitted"),
|
|
1153
|
+
timestamp: import_zod.z.any(),
|
|
1154
|
+
data: import_zod.z.object({
|
|
1155
|
+
storageKey: import_zod.z.string(),
|
|
1156
|
+
pilotAddress: import_zod.z.string(),
|
|
1157
|
+
flightManifestUri: import_zod.z.string(),
|
|
1158
|
+
missionId: import_zod.z.object({
|
|
1159
|
+
__type: import_zod.z.literal("bigint"),
|
|
1160
|
+
value: import_zod.z.string()
|
|
1161
|
+
}).transform((wire) => BigInt(wire.value))
|
|
1162
|
+
}).strict()
|
|
1163
|
+
}).strict(),
|
|
1140
1164
|
import_zod.z.object({
|
|
1141
1165
|
id: import_zod.z.any(),
|
|
1142
1166
|
event_type: import_zod.z.literal("protocol.flight.reviewed"),
|
|
1143
1167
|
timestamp: import_zod.z.any(),
|
|
1144
1168
|
data: import_zod.z.object({
|
|
1145
|
-
flightId: import_zod.z.
|
|
1169
|
+
flightId: import_zod.z.object({
|
|
1170
|
+
__type: import_zod.z.literal("bigint"),
|
|
1171
|
+
value: import_zod.z.string()
|
|
1172
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1173
|
+
owner: import_zod.z.any(),
|
|
1146
1174
|
isApproved: import_zod.z.boolean(),
|
|
1147
1175
|
validationLogUri: import_zod.z.string(),
|
|
1148
1176
|
validator: import_zod.z.string(),
|
|
1149
|
-
filesHash: import_zod.z.string()
|
|
1177
|
+
filesHash: import_zod.z.string(),
|
|
1178
|
+
storageKey: import_zod.z.string(),
|
|
1179
|
+
missionId: import_zod.z.object({
|
|
1180
|
+
__type: import_zod.z.literal("bigint"),
|
|
1181
|
+
value: import_zod.z.string()
|
|
1182
|
+
}).transform((wire) => BigInt(wire.value))
|
|
1150
1183
|
}).strict()
|
|
1151
1184
|
}).strict()
|
|
1152
1185
|
]);
|
|
@@ -1178,24 +1211,23 @@ __name(getSecretHeader, "getSecretHeader");
|
|
|
1178
1211
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1179
1212
|
0 && (module.exports = {
|
|
1180
1213
|
Event,
|
|
1214
|
+
apiControllerGetHello,
|
|
1181
1215
|
apiTokenControllerCreateToken,
|
|
1182
1216
|
apiTokenControllerDeleteToken,
|
|
1183
1217
|
apiTokenControllerGetToken,
|
|
1184
1218
|
apiTokenControllerUpdateToken,
|
|
1185
|
-
appControllerGetHello,
|
|
1186
1219
|
buildClientParams,
|
|
1187
1220
|
conditionsControllerGetSunAltitudeTimeLimits,
|
|
1188
1221
|
createClient,
|
|
1189
1222
|
createConfig,
|
|
1190
1223
|
flightsControllerCreatePresignedUrls,
|
|
1191
|
-
|
|
1224
|
+
flightsControllerGenerateStorageKey,
|
|
1192
1225
|
flightsControllerGetFlight,
|
|
1193
1226
|
flightsControllerValidateFlight,
|
|
1194
1227
|
formDataBodySerializer,
|
|
1195
1228
|
jsonBodySerializer,
|
|
1196
1229
|
keysControllerGetProvenanceCryptoKey,
|
|
1197
1230
|
mergeHeaders,
|
|
1198
|
-
missionsControllerClaimRewards,
|
|
1199
1231
|
missionsControllerCreateMissions,
|
|
1200
1232
|
missionsControllerUpdateMissions,
|
|
1201
1233
|
parseWebhookEvent,
|
package/dist/index.mjs
CHANGED
|
@@ -710,48 +710,22 @@ var conditionsControllerGetSunAltitudeTimeLimitsResponseTransformer = /* @__PURE
|
|
|
710
710
|
data = getTimeLimitsForSunAltitudeResponseSchemaResponseTransformer(data);
|
|
711
711
|
return data;
|
|
712
712
|
}, "conditionsControllerGetSunAltitudeTimeLimitsResponseTransformer");
|
|
713
|
+
var validateFlightResponseDtoSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
|
|
714
|
+
data.flightId = BigInt(data.flightId.toString());
|
|
715
|
+
return data;
|
|
716
|
+
}, "validateFlightResponseDtoSchemaResponseTransformer");
|
|
717
|
+
var flightsControllerValidateFlightResponseTransformer = /* @__PURE__ */ __name(async (data) => {
|
|
718
|
+
data = validateFlightResponseDtoSchemaResponseTransformer(data);
|
|
719
|
+
return data;
|
|
720
|
+
}, "flightsControllerValidateFlightResponseTransformer");
|
|
713
721
|
|
|
714
722
|
// src/client/sdk.gen.ts
|
|
715
|
-
var
|
|
723
|
+
var apiControllerGetHello = /* @__PURE__ */ __name((options) => {
|
|
716
724
|
return (options?.client ?? client).get({
|
|
717
725
|
url: "/",
|
|
718
726
|
...options
|
|
719
727
|
});
|
|
720
|
-
}, "
|
|
721
|
-
var keysControllerGetProvenanceCryptoKey = /* @__PURE__ */ __name((options) => {
|
|
722
|
-
return (options?.client ?? client).get({
|
|
723
|
-
url: "/keys",
|
|
724
|
-
...options
|
|
725
|
-
});
|
|
726
|
-
}, "keysControllerGetProvenanceCryptoKey");
|
|
727
|
-
var quotesControllerCreateQuote = /* @__PURE__ */ __name((options) => {
|
|
728
|
-
return (options.client ?? client).post({
|
|
729
|
-
security: [
|
|
730
|
-
{
|
|
731
|
-
name: "x-api-token",
|
|
732
|
-
type: "apiKey"
|
|
733
|
-
}
|
|
734
|
-
],
|
|
735
|
-
url: "/quotes",
|
|
736
|
-
...options,
|
|
737
|
-
headers: {
|
|
738
|
-
"Content-Type": "application/json",
|
|
739
|
-
...options.headers
|
|
740
|
-
}
|
|
741
|
-
});
|
|
742
|
-
}, "quotesControllerCreateQuote");
|
|
743
|
-
var quotesControllerGetQuote = /* @__PURE__ */ __name((options) => {
|
|
744
|
-
return (options.client ?? client).get({
|
|
745
|
-
security: [
|
|
746
|
-
{
|
|
747
|
-
name: "x-api-token",
|
|
748
|
-
type: "apiKey"
|
|
749
|
-
}
|
|
750
|
-
],
|
|
751
|
-
url: "/quotes/{id}",
|
|
752
|
-
...options
|
|
753
|
-
});
|
|
754
|
-
}, "quotesControllerGetQuote");
|
|
728
|
+
}, "apiControllerGetHello");
|
|
755
729
|
var apiTokenControllerCreateToken = /* @__PURE__ */ __name((options) => {
|
|
756
730
|
return (options.client ?? client).post({
|
|
757
731
|
security: [
|
|
@@ -809,37 +783,14 @@ var apiTokenControllerUpdateToken = /* @__PURE__ */ __name((options) => {
|
|
|
809
783
|
}
|
|
810
784
|
});
|
|
811
785
|
}, "apiTokenControllerUpdateToken");
|
|
812
|
-
var
|
|
813
|
-
return (options.client ?? client).
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
"Content-Type": "application/json",
|
|
818
|
-
...options.headers
|
|
819
|
-
}
|
|
820
|
-
});
|
|
821
|
-
}, "missionsControllerCreateMissions");
|
|
822
|
-
var missionsControllerUpdateMissions = /* @__PURE__ */ __name((options) => {
|
|
823
|
-
return (options.client ?? client).put({
|
|
824
|
-
url: "/missions",
|
|
825
|
-
...options,
|
|
826
|
-
headers: {
|
|
827
|
-
"Content-Type": "application/json",
|
|
828
|
-
...options.headers
|
|
829
|
-
}
|
|
830
|
-
});
|
|
831
|
-
}, "missionsControllerUpdateMissions");
|
|
832
|
-
var missionsControllerClaimRewards = /* @__PURE__ */ __name((options) => {
|
|
833
|
-
return (options.client ?? client).post({
|
|
834
|
-
url: "/missions/{id}/rewards",
|
|
835
|
-
...options,
|
|
836
|
-
headers: {
|
|
837
|
-
"Content-Type": "application/json",
|
|
838
|
-
...options.headers
|
|
839
|
-
}
|
|
786
|
+
var conditionsControllerGetSunAltitudeTimeLimits = /* @__PURE__ */ __name((options) => {
|
|
787
|
+
return (options.client ?? client).get({
|
|
788
|
+
responseTransformer: conditionsControllerGetSunAltitudeTimeLimitsResponseTransformer,
|
|
789
|
+
url: "/conditions/sun-altitude",
|
|
790
|
+
...options
|
|
840
791
|
});
|
|
841
|
-
}, "
|
|
842
|
-
var
|
|
792
|
+
}, "conditionsControllerGetSunAltitudeTimeLimits");
|
|
793
|
+
var flightsControllerGenerateStorageKey = /* @__PURE__ */ __name((options) => {
|
|
843
794
|
return (options.client ?? client).get({
|
|
844
795
|
security: [
|
|
845
796
|
{
|
|
@@ -847,10 +798,10 @@ var flightsControllerGenerateFlightId = /* @__PURE__ */ __name((options) => {
|
|
|
847
798
|
type: "apiKey"
|
|
848
799
|
}
|
|
849
800
|
],
|
|
850
|
-
url: "/flights/
|
|
801
|
+
url: "/flights/storage-key",
|
|
851
802
|
...options
|
|
852
803
|
});
|
|
853
|
-
}, "
|
|
804
|
+
}, "flightsControllerGenerateStorageKey");
|
|
854
805
|
var flightsControllerGetFlight = /* @__PURE__ */ __name((options) => {
|
|
855
806
|
return (options.client ?? client).get({
|
|
856
807
|
security: [
|
|
@@ -871,7 +822,7 @@ var flightsControllerCreatePresignedUrls = /* @__PURE__ */ __name((options) => {
|
|
|
871
822
|
type: "apiKey"
|
|
872
823
|
}
|
|
873
824
|
],
|
|
874
|
-
url: "/flights/
|
|
825
|
+
url: "/flights/files",
|
|
875
826
|
...options,
|
|
876
827
|
headers: {
|
|
877
828
|
"Content-Type": "application/json",
|
|
@@ -887,6 +838,7 @@ var flightsControllerValidateFlight = /* @__PURE__ */ __name((options) => {
|
|
|
887
838
|
type: "apiKey"
|
|
888
839
|
}
|
|
889
840
|
],
|
|
841
|
+
responseTransformer: flightsControllerValidateFlightResponseTransformer,
|
|
890
842
|
url: "/flights",
|
|
891
843
|
...options,
|
|
892
844
|
headers: {
|
|
@@ -895,13 +847,60 @@ var flightsControllerValidateFlight = /* @__PURE__ */ __name((options) => {
|
|
|
895
847
|
}
|
|
896
848
|
});
|
|
897
849
|
}, "flightsControllerValidateFlight");
|
|
898
|
-
var
|
|
850
|
+
var keysControllerGetProvenanceCryptoKey = /* @__PURE__ */ __name((options) => {
|
|
851
|
+
return (options?.client ?? client).get({
|
|
852
|
+
url: "/keys",
|
|
853
|
+
...options
|
|
854
|
+
});
|
|
855
|
+
}, "keysControllerGetProvenanceCryptoKey");
|
|
856
|
+
var missionsControllerCreateMissions = /* @__PURE__ */ __name((options) => {
|
|
857
|
+
return (options.client ?? client).post({
|
|
858
|
+
url: "/missions",
|
|
859
|
+
...options,
|
|
860
|
+
headers: {
|
|
861
|
+
"Content-Type": "application/json",
|
|
862
|
+
...options.headers
|
|
863
|
+
}
|
|
864
|
+
});
|
|
865
|
+
}, "missionsControllerCreateMissions");
|
|
866
|
+
var missionsControllerUpdateMissions = /* @__PURE__ */ __name((options) => {
|
|
867
|
+
return (options.client ?? client).put({
|
|
868
|
+
url: "/missions",
|
|
869
|
+
...options,
|
|
870
|
+
headers: {
|
|
871
|
+
"Content-Type": "application/json",
|
|
872
|
+
...options.headers
|
|
873
|
+
}
|
|
874
|
+
});
|
|
875
|
+
}, "missionsControllerUpdateMissions");
|
|
876
|
+
var quotesControllerCreateQuote = /* @__PURE__ */ __name((options) => {
|
|
877
|
+
return (options.client ?? client).post({
|
|
878
|
+
security: [
|
|
879
|
+
{
|
|
880
|
+
name: "x-api-token",
|
|
881
|
+
type: "apiKey"
|
|
882
|
+
}
|
|
883
|
+
],
|
|
884
|
+
url: "/quotes",
|
|
885
|
+
...options,
|
|
886
|
+
headers: {
|
|
887
|
+
"Content-Type": "application/json",
|
|
888
|
+
...options.headers
|
|
889
|
+
}
|
|
890
|
+
});
|
|
891
|
+
}, "quotesControllerCreateQuote");
|
|
892
|
+
var quotesControllerGetQuote = /* @__PURE__ */ __name((options) => {
|
|
899
893
|
return (options.client ?? client).get({
|
|
900
|
-
|
|
901
|
-
|
|
894
|
+
security: [
|
|
895
|
+
{
|
|
896
|
+
name: "x-api-token",
|
|
897
|
+
type: "apiKey"
|
|
898
|
+
}
|
|
899
|
+
],
|
|
900
|
+
url: "/quotes/{id}",
|
|
902
901
|
...options
|
|
903
902
|
});
|
|
904
|
-
}, "
|
|
903
|
+
}, "quotesControllerGetQuote");
|
|
905
904
|
var schemaControllerGetEventSchema = /* @__PURE__ */ __name((options) => {
|
|
906
905
|
return (options?.client ?? client).get({
|
|
907
906
|
url: "/schema/event",
|
|
@@ -1024,17 +1023,6 @@ var Event = z.union([
|
|
|
1024
1023
|
message: z.string()
|
|
1025
1024
|
}).strict()
|
|
1026
1025
|
}).strict(),
|
|
1027
|
-
z.object({
|
|
1028
|
-
id: z.any(),
|
|
1029
|
-
event_type: z.literal("protocol.flight.submitted"),
|
|
1030
|
-
timestamp: z.any(),
|
|
1031
|
-
data: z.object({
|
|
1032
|
-
flightId: z.number(),
|
|
1033
|
-
pilotAddress: z.string(),
|
|
1034
|
-
flightManifestUri: z.string(),
|
|
1035
|
-
missionId: z.number()
|
|
1036
|
-
}).strict()
|
|
1037
|
-
}).strict(),
|
|
1038
1026
|
z.object({
|
|
1039
1027
|
id: z.any(),
|
|
1040
1028
|
event_type: z.literal("protocol.mission.created"),
|
|
@@ -1060,7 +1048,6 @@ var Event = z.union([
|
|
|
1060
1048
|
captureEndTime: z.string().datetime({
|
|
1061
1049
|
offset: true
|
|
1062
1050
|
}),
|
|
1063
|
-
detailsHash: z.string(),
|
|
1064
1051
|
requestor: z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$"))
|
|
1065
1052
|
}).strict()
|
|
1066
1053
|
}).strict(),
|
|
@@ -1080,16 +1067,63 @@ var Event = z.union([
|
|
|
1080
1067
|
isOpen: z.boolean().optional()
|
|
1081
1068
|
}).strict()
|
|
1082
1069
|
}).strict(),
|
|
1070
|
+
z.object({
|
|
1071
|
+
id: z.any(),
|
|
1072
|
+
event_type: z.literal("protocol.mission.paid"),
|
|
1073
|
+
timestamp: z.any(),
|
|
1074
|
+
data: z.object({
|
|
1075
|
+
recipient: z.any(),
|
|
1076
|
+
flightId: z.object({
|
|
1077
|
+
__type: z.literal("bigint"),
|
|
1078
|
+
value: z.string()
|
|
1079
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1080
|
+
missionId: z.object({
|
|
1081
|
+
__type: z.literal("bigint"),
|
|
1082
|
+
value: z.string()
|
|
1083
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1084
|
+
vaultId: z.object({
|
|
1085
|
+
__type: z.literal("bigint"),
|
|
1086
|
+
value: z.string()
|
|
1087
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1088
|
+
amount: z.object({
|
|
1089
|
+
__type: z.literal("bigint"),
|
|
1090
|
+
value: z.string()
|
|
1091
|
+
}).transform((wire) => BigInt(wire.value))
|
|
1092
|
+
}).strict()
|
|
1093
|
+
}).strict(),
|
|
1094
|
+
z.object({
|
|
1095
|
+
id: z.any(),
|
|
1096
|
+
event_type: z.literal("protocol.flight.submitted"),
|
|
1097
|
+
timestamp: z.any(),
|
|
1098
|
+
data: z.object({
|
|
1099
|
+
storageKey: z.string(),
|
|
1100
|
+
pilotAddress: z.string(),
|
|
1101
|
+
flightManifestUri: z.string(),
|
|
1102
|
+
missionId: z.object({
|
|
1103
|
+
__type: z.literal("bigint"),
|
|
1104
|
+
value: z.string()
|
|
1105
|
+
}).transform((wire) => BigInt(wire.value))
|
|
1106
|
+
}).strict()
|
|
1107
|
+
}).strict(),
|
|
1083
1108
|
z.object({
|
|
1084
1109
|
id: z.any(),
|
|
1085
1110
|
event_type: z.literal("protocol.flight.reviewed"),
|
|
1086
1111
|
timestamp: z.any(),
|
|
1087
1112
|
data: z.object({
|
|
1088
|
-
flightId: z.
|
|
1113
|
+
flightId: z.object({
|
|
1114
|
+
__type: z.literal("bigint"),
|
|
1115
|
+
value: z.string()
|
|
1116
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1117
|
+
owner: z.any(),
|
|
1089
1118
|
isApproved: z.boolean(),
|
|
1090
1119
|
validationLogUri: z.string(),
|
|
1091
1120
|
validator: z.string(),
|
|
1092
|
-
filesHash: z.string()
|
|
1121
|
+
filesHash: z.string(),
|
|
1122
|
+
storageKey: z.string(),
|
|
1123
|
+
missionId: z.object({
|
|
1124
|
+
__type: z.literal("bigint"),
|
|
1125
|
+
value: z.string()
|
|
1126
|
+
}).transform((wire) => BigInt(wire.value))
|
|
1093
1127
|
}).strict()
|
|
1094
1128
|
}).strict()
|
|
1095
1129
|
]);
|
|
@@ -1120,24 +1154,23 @@ function getSecretHeader(headers) {
|
|
|
1120
1154
|
__name(getSecretHeader, "getSecretHeader");
|
|
1121
1155
|
export {
|
|
1122
1156
|
Event,
|
|
1157
|
+
apiControllerGetHello,
|
|
1123
1158
|
apiTokenControllerCreateToken,
|
|
1124
1159
|
apiTokenControllerDeleteToken,
|
|
1125
1160
|
apiTokenControllerGetToken,
|
|
1126
1161
|
apiTokenControllerUpdateToken,
|
|
1127
|
-
appControllerGetHello,
|
|
1128
1162
|
buildClientParams,
|
|
1129
1163
|
conditionsControllerGetSunAltitudeTimeLimits,
|
|
1130
1164
|
createClient,
|
|
1131
1165
|
createConfig,
|
|
1132
1166
|
flightsControllerCreatePresignedUrls,
|
|
1133
|
-
|
|
1167
|
+
flightsControllerGenerateStorageKey,
|
|
1134
1168
|
flightsControllerGetFlight,
|
|
1135
1169
|
flightsControllerValidateFlight,
|
|
1136
1170
|
formDataBodySerializer,
|
|
1137
1171
|
jsonBodySerializer,
|
|
1138
1172
|
keysControllerGetProvenanceCryptoKey,
|
|
1139
1173
|
mergeHeaders,
|
|
1140
|
-
missionsControllerClaimRewards,
|
|
1141
1174
|
missionsControllerCreateMissions,
|
|
1142
1175
|
missionsControllerUpdateMissions,
|
|
1143
1176
|
parseWebhookEvent,
|
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.18-alpha",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -18,9 +18,12 @@
|
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@hey-api/openapi-ts": "^0.74.0",
|
|
20
20
|
"@types/express": "^4",
|
|
21
|
+
"@types/jest": "^29.5.2",
|
|
21
22
|
"@types/node": "^20.3.1",
|
|
22
23
|
"express": "^4",
|
|
24
|
+
"jest": "^29.7.0",
|
|
23
25
|
"json-schema-to-zod": "^2.6.1",
|
|
26
|
+
"ts-jest": "^29.2.5",
|
|
24
27
|
"ts-loader": "^9.4.3",
|
|
25
28
|
"ts-node": "^10.9.2",
|
|
26
29
|
"tsup": "^8.5.0",
|
|
@@ -40,6 +43,8 @@
|
|
|
40
43
|
"generate-event": "ts-node ./scripts/generate-event-type.ts",
|
|
41
44
|
"generate": "pnpm generate-api && pnpm generate-event && pnpm lint --fix && pnpm build",
|
|
42
45
|
"type-check": "tsc --noEmit",
|
|
43
|
-
"
|
|
46
|
+
"test": "jest",
|
|
47
|
+
"test:watch": "jest --watch",
|
|
48
|
+
"coverage": "jest --coverage"
|
|
44
49
|
}
|
|
45
50
|
}
|