@layer-drone/protocol 0.1.1 → 0.1.3

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.js CHANGED
@@ -22,6 +22,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
22
22
  var index_exports = {};
23
23
  __export(index_exports, {
24
24
  Event: () => Event,
25
+ apiControllerGetError: () => apiControllerGetError,
25
26
  apiControllerGetHello: () => apiControllerGetHello,
26
27
  apiTokenControllerCreateToken: () => apiTokenControllerCreateToken,
27
28
  apiTokenControllerDeleteToken: () => apiTokenControllerDeleteToken,
@@ -40,6 +41,7 @@ __export(index_exports, {
40
41
  keysControllerGetProvenanceCryptoKey: () => keysControllerGetProvenanceCryptoKey,
41
42
  mergeHeaders: () => mergeHeaders,
42
43
  missionsControllerCreateMissions: () => missionsControllerCreateMissions,
44
+ missionsControllerRepriceMissions: () => missionsControllerRepriceMissions,
43
45
  missionsControllerUpdateMissions: () => missionsControllerUpdateMissions,
44
46
  parseWebhookEvent: () => parseWebhookEvent,
45
47
  quotesControllerCreateQuote: () => quotesControllerCreateQuote,
@@ -627,11 +629,7 @@ var createClient = /* @__PURE__ */ __name((config = {}) => {
627
629
  if (opts.body === void 0 || opts.body === "") {
628
630
  opts.headers.delete("Content-Type");
629
631
  }
630
- const url = buildUrl({
631
- ...opts,
632
- baseUrl: opts.baseUrl ?? _config?.baseUrl ?? "https://api.layerdrone.org",
633
- url: opts.url ?? ""
634
- });
632
+ const url = buildUrl(opts);
635
633
  const requestInit = {
636
634
  redirect: "follow",
637
635
  ...opts
@@ -778,6 +776,18 @@ var flightsControllerValidateFlightResponseTransformer = /* @__PURE__ */ __name(
778
776
  data = validateFlightResponseDtoSchemaResponseTransformer(data);
779
777
  return data;
780
778
  }, "flightsControllerValidateFlightResponseTransformer");
779
+ var createMissionResponseDtoSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
780
+ data.data.missions = data.data.missions.map((item) => {
781
+ item.captureStartTime = new Date(item.captureStartTime);
782
+ item.captureEndTime = new Date(item.captureEndTime);
783
+ return item;
784
+ });
785
+ return data;
786
+ }, "createMissionResponseDtoSchemaResponseTransformer");
787
+ var missionsControllerCreateMissionsResponseTransformer = /* @__PURE__ */ __name(async (data) => {
788
+ data = createMissionResponseDtoSchemaResponseTransformer(data);
789
+ return data;
790
+ }, "missionsControllerCreateMissionsResponseTransformer");
781
791
 
782
792
  // src/client/sdk.gen.ts
783
793
  var apiControllerGetHello = /* @__PURE__ */ __name((options) => {
@@ -786,6 +796,12 @@ var apiControllerGetHello = /* @__PURE__ */ __name((options) => {
786
796
  ...options
787
797
  });
788
798
  }, "apiControllerGetHello");
799
+ var apiControllerGetError = /* @__PURE__ */ __name((options) => {
800
+ return (options?.client ?? client).get({
801
+ url: "/debug-sentry",
802
+ ...options
803
+ });
804
+ }, "apiControllerGetError");
789
805
  var apiTokenControllerCreateToken = /* @__PURE__ */ __name((options) => {
790
806
  return (options.client ?? client).post({
791
807
  security: [
@@ -915,6 +931,13 @@ var keysControllerGetProvenanceCryptoKey = /* @__PURE__ */ __name((options) => {
915
931
  }, "keysControllerGetProvenanceCryptoKey");
916
932
  var missionsControllerCreateMissions = /* @__PURE__ */ __name((options) => {
917
933
  return (options.client ?? client).post({
934
+ security: [
935
+ {
936
+ name: "x-api-token",
937
+ type: "apiKey"
938
+ }
939
+ ],
940
+ responseTransformer: missionsControllerCreateMissionsResponseTransformer,
918
941
  url: "/missions",
919
942
  ...options,
920
943
  headers: {
@@ -925,6 +948,12 @@ var missionsControllerCreateMissions = /* @__PURE__ */ __name((options) => {
925
948
  }, "missionsControllerCreateMissions");
926
949
  var missionsControllerUpdateMissions = /* @__PURE__ */ __name((options) => {
927
950
  return (options.client ?? client).put({
951
+ security: [
952
+ {
953
+ name: "x-api-token",
954
+ type: "apiKey"
955
+ }
956
+ ],
928
957
  url: "/missions",
929
958
  ...options,
930
959
  headers: {
@@ -933,6 +962,22 @@ var missionsControllerUpdateMissions = /* @__PURE__ */ __name((options) => {
933
962
  }
934
963
  });
935
964
  }, "missionsControllerUpdateMissions");
965
+ var missionsControllerRepriceMissions = /* @__PURE__ */ __name((options) => {
966
+ return (options.client ?? client).put({
967
+ security: [
968
+ {
969
+ name: "x-api-token",
970
+ type: "apiKey"
971
+ }
972
+ ],
973
+ url: "/missions/amounts",
974
+ ...options,
975
+ headers: {
976
+ "Content-Type": "application/json",
977
+ ...options.headers
978
+ }
979
+ });
980
+ }, "missionsControllerRepriceMissions");
936
981
  var quotesControllerCreateQuote = /* @__PURE__ */ __name((options) => {
937
982
  return (options.client ?? client).post({
938
983
  security: [
@@ -1081,8 +1126,8 @@ var Event = import_zod.z.union([
1081
1126
  timestamp: import_zod.z.string(),
1082
1127
  data: import_zod.z.object({
1083
1128
  message: import_zod.z.string()
1084
- }).strict()
1085
- }).strict(),
1129
+ }).catchall(import_zod.z.any())
1130
+ }).catchall(import_zod.z.any()),
1086
1131
  import_zod.z.object({
1087
1132
  id: import_zod.z.string(),
1088
1133
  event_type: import_zod.z.literal("protocol.mission.created"),
@@ -1102,6 +1147,7 @@ var Event = import_zod.z.union([
1102
1147
  }).transform((wire) => BigInt(wire.value)),
1103
1148
  zoneId: import_zod.z.string(),
1104
1149
  flightPlanId: import_zod.z.number(),
1150
+ campaigns: import_zod.z.array(import_zod.z.string()),
1105
1151
  captureStartTime: import_zod.z.string().datetime({
1106
1152
  offset: true
1107
1153
  }),
@@ -1109,8 +1155,8 @@ var Event = import_zod.z.union([
1109
1155
  offset: true
1110
1156
  }),
1111
1157
  requestor: import_zod.z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$"))
1112
- }).strict()
1113
- }).strict(),
1158
+ }).catchall(import_zod.z.any())
1159
+ }).catchall(import_zod.z.any()),
1114
1160
  import_zod.z.object({
1115
1161
  id: import_zod.z.string(),
1116
1162
  event_type: import_zod.z.literal("protocol.mission.updated"),
@@ -1124,9 +1170,10 @@ var Event = import_zod.z.union([
1124
1170
  __type: import_zod.z.literal("bigint"),
1125
1171
  value: import_zod.z.string()
1126
1172
  }).transform((wire) => BigInt(wire.value)).optional(),
1127
- isOpen: import_zod.z.boolean().optional()
1128
- }).strict()
1129
- }).strict(),
1173
+ isOpen: import_zod.z.boolean().optional(),
1174
+ campaigns: import_zod.z.array(import_zod.z.string()).optional()
1175
+ }).catchall(import_zod.z.any())
1176
+ }).catchall(import_zod.z.any()),
1130
1177
  import_zod.z.object({
1131
1178
  id: import_zod.z.string(),
1132
1179
  event_type: import_zod.z.literal("protocol.mission.paid"),
@@ -1150,8 +1197,8 @@ var Event = import_zod.z.union([
1150
1197
  value: import_zod.z.string()
1151
1198
  }).transform((wire) => BigInt(wire.value)),
1152
1199
  storageKey: import_zod.z.string()
1153
- }).strict()
1154
- }).strict(),
1200
+ }).catchall(import_zod.z.any())
1201
+ }).catchall(import_zod.z.any()),
1155
1202
  import_zod.z.object({
1156
1203
  id: import_zod.z.string(),
1157
1204
  event_type: import_zod.z.literal("protocol.flight.submitted"),
@@ -1164,8 +1211,8 @@ var Event = import_zod.z.union([
1164
1211
  __type: import_zod.z.literal("bigint"),
1165
1212
  value: import_zod.z.string()
1166
1213
  }).transform((wire) => BigInt(wire.value))
1167
- }).strict()
1168
- }).strict(),
1214
+ }).catchall(import_zod.z.any())
1215
+ }).catchall(import_zod.z.any()),
1169
1216
  import_zod.z.object({
1170
1217
  id: import_zod.z.string(),
1171
1218
  event_type: import_zod.z.literal("protocol.flight.reviewed"),
@@ -1185,8 +1232,8 @@ var Event = import_zod.z.union([
1185
1232
  __type: import_zod.z.literal("bigint"),
1186
1233
  value: import_zod.z.string()
1187
1234
  }).transform((wire) => BigInt(wire.value))
1188
- }).strict()
1189
- }).strict()
1235
+ }).catchall(import_zod.z.any())
1236
+ }).catchall(import_zod.z.any())
1190
1237
  ]);
1191
1238
 
1192
1239
  // src/event/parser.ts
@@ -1216,6 +1263,7 @@ __name(getSecretHeader, "getSecretHeader");
1216
1263
  // Annotate the CommonJS export names for ESM import in node:
1217
1264
  0 && (module.exports = {
1218
1265
  Event,
1266
+ apiControllerGetError,
1219
1267
  apiControllerGetHello,
1220
1268
  apiTokenControllerCreateToken,
1221
1269
  apiTokenControllerDeleteToken,
@@ -1234,6 +1282,7 @@ __name(getSecretHeader, "getSecretHeader");
1234
1282
  keysControllerGetProvenanceCryptoKey,
1235
1283
  mergeHeaders,
1236
1284
  missionsControllerCreateMissions,
1285
+ missionsControllerRepriceMissions,
1237
1286
  missionsControllerUpdateMissions,
1238
1287
  parseWebhookEvent,
1239
1288
  quotesControllerCreateQuote,
package/dist/index.mjs CHANGED
@@ -571,11 +571,7 @@ var createClient = /* @__PURE__ */ __name((config = {}) => {
571
571
  if (opts.body === void 0 || opts.body === "") {
572
572
  opts.headers.delete("Content-Type");
573
573
  }
574
- const url = buildUrl({
575
- ...opts,
576
- baseUrl: opts.baseUrl ?? _config?.baseUrl ?? "https://api.layerdrone.org",
577
- url: opts.url ?? ""
578
- });
574
+ const url = buildUrl(opts);
579
575
  const requestInit = {
580
576
  redirect: "follow",
581
577
  ...opts
@@ -722,6 +718,18 @@ var flightsControllerValidateFlightResponseTransformer = /* @__PURE__ */ __name(
722
718
  data = validateFlightResponseDtoSchemaResponseTransformer(data);
723
719
  return data;
724
720
  }, "flightsControllerValidateFlightResponseTransformer");
721
+ var createMissionResponseDtoSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
722
+ data.data.missions = data.data.missions.map((item) => {
723
+ item.captureStartTime = new Date(item.captureStartTime);
724
+ item.captureEndTime = new Date(item.captureEndTime);
725
+ return item;
726
+ });
727
+ return data;
728
+ }, "createMissionResponseDtoSchemaResponseTransformer");
729
+ var missionsControllerCreateMissionsResponseTransformer = /* @__PURE__ */ __name(async (data) => {
730
+ data = createMissionResponseDtoSchemaResponseTransformer(data);
731
+ return data;
732
+ }, "missionsControllerCreateMissionsResponseTransformer");
725
733
 
726
734
  // src/client/sdk.gen.ts
727
735
  var apiControllerGetHello = /* @__PURE__ */ __name((options) => {
@@ -730,6 +738,12 @@ var apiControllerGetHello = /* @__PURE__ */ __name((options) => {
730
738
  ...options
731
739
  });
732
740
  }, "apiControllerGetHello");
741
+ var apiControllerGetError = /* @__PURE__ */ __name((options) => {
742
+ return (options?.client ?? client).get({
743
+ url: "/debug-sentry",
744
+ ...options
745
+ });
746
+ }, "apiControllerGetError");
733
747
  var apiTokenControllerCreateToken = /* @__PURE__ */ __name((options) => {
734
748
  return (options.client ?? client).post({
735
749
  security: [
@@ -859,6 +873,13 @@ var keysControllerGetProvenanceCryptoKey = /* @__PURE__ */ __name((options) => {
859
873
  }, "keysControllerGetProvenanceCryptoKey");
860
874
  var missionsControllerCreateMissions = /* @__PURE__ */ __name((options) => {
861
875
  return (options.client ?? client).post({
876
+ security: [
877
+ {
878
+ name: "x-api-token",
879
+ type: "apiKey"
880
+ }
881
+ ],
882
+ responseTransformer: missionsControllerCreateMissionsResponseTransformer,
862
883
  url: "/missions",
863
884
  ...options,
864
885
  headers: {
@@ -869,6 +890,12 @@ var missionsControllerCreateMissions = /* @__PURE__ */ __name((options) => {
869
890
  }, "missionsControllerCreateMissions");
870
891
  var missionsControllerUpdateMissions = /* @__PURE__ */ __name((options) => {
871
892
  return (options.client ?? client).put({
893
+ security: [
894
+ {
895
+ name: "x-api-token",
896
+ type: "apiKey"
897
+ }
898
+ ],
872
899
  url: "/missions",
873
900
  ...options,
874
901
  headers: {
@@ -877,6 +904,22 @@ var missionsControllerUpdateMissions = /* @__PURE__ */ __name((options) => {
877
904
  }
878
905
  });
879
906
  }, "missionsControllerUpdateMissions");
907
+ var missionsControllerRepriceMissions = /* @__PURE__ */ __name((options) => {
908
+ return (options.client ?? client).put({
909
+ security: [
910
+ {
911
+ name: "x-api-token",
912
+ type: "apiKey"
913
+ }
914
+ ],
915
+ url: "/missions/amounts",
916
+ ...options,
917
+ headers: {
918
+ "Content-Type": "application/json",
919
+ ...options.headers
920
+ }
921
+ });
922
+ }, "missionsControllerRepriceMissions");
880
923
  var quotesControllerCreateQuote = /* @__PURE__ */ __name((options) => {
881
924
  return (options.client ?? client).post({
882
925
  security: [
@@ -1025,8 +1068,8 @@ var Event = z.union([
1025
1068
  timestamp: z.string(),
1026
1069
  data: z.object({
1027
1070
  message: z.string()
1028
- }).strict()
1029
- }).strict(),
1071
+ }).catchall(z.any())
1072
+ }).catchall(z.any()),
1030
1073
  z.object({
1031
1074
  id: z.string(),
1032
1075
  event_type: z.literal("protocol.mission.created"),
@@ -1046,6 +1089,7 @@ var Event = z.union([
1046
1089
  }).transform((wire) => BigInt(wire.value)),
1047
1090
  zoneId: z.string(),
1048
1091
  flightPlanId: z.number(),
1092
+ campaigns: z.array(z.string()),
1049
1093
  captureStartTime: z.string().datetime({
1050
1094
  offset: true
1051
1095
  }),
@@ -1053,8 +1097,8 @@ var Event = z.union([
1053
1097
  offset: true
1054
1098
  }),
1055
1099
  requestor: z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$"))
1056
- }).strict()
1057
- }).strict(),
1100
+ }).catchall(z.any())
1101
+ }).catchall(z.any()),
1058
1102
  z.object({
1059
1103
  id: z.string(),
1060
1104
  event_type: z.literal("protocol.mission.updated"),
@@ -1068,9 +1112,10 @@ var Event = z.union([
1068
1112
  __type: z.literal("bigint"),
1069
1113
  value: z.string()
1070
1114
  }).transform((wire) => BigInt(wire.value)).optional(),
1071
- isOpen: z.boolean().optional()
1072
- }).strict()
1073
- }).strict(),
1115
+ isOpen: z.boolean().optional(),
1116
+ campaigns: z.array(z.string()).optional()
1117
+ }).catchall(z.any())
1118
+ }).catchall(z.any()),
1074
1119
  z.object({
1075
1120
  id: z.string(),
1076
1121
  event_type: z.literal("protocol.mission.paid"),
@@ -1094,8 +1139,8 @@ var Event = z.union([
1094
1139
  value: z.string()
1095
1140
  }).transform((wire) => BigInt(wire.value)),
1096
1141
  storageKey: z.string()
1097
- }).strict()
1098
- }).strict(),
1142
+ }).catchall(z.any())
1143
+ }).catchall(z.any()),
1099
1144
  z.object({
1100
1145
  id: z.string(),
1101
1146
  event_type: z.literal("protocol.flight.submitted"),
@@ -1108,8 +1153,8 @@ var Event = z.union([
1108
1153
  __type: z.literal("bigint"),
1109
1154
  value: z.string()
1110
1155
  }).transform((wire) => BigInt(wire.value))
1111
- }).strict()
1112
- }).strict(),
1156
+ }).catchall(z.any())
1157
+ }).catchall(z.any()),
1113
1158
  z.object({
1114
1159
  id: z.string(),
1115
1160
  event_type: z.literal("protocol.flight.reviewed"),
@@ -1129,8 +1174,8 @@ var Event = z.union([
1129
1174
  __type: z.literal("bigint"),
1130
1175
  value: z.string()
1131
1176
  }).transform((wire) => BigInt(wire.value))
1132
- }).strict()
1133
- }).strict()
1177
+ }).catchall(z.any())
1178
+ }).catchall(z.any())
1134
1179
  ]);
1135
1180
 
1136
1181
  // src/event/parser.ts
@@ -1159,6 +1204,7 @@ function getSecretHeader(headers) {
1159
1204
  __name(getSecretHeader, "getSecretHeader");
1160
1205
  export {
1161
1206
  Event,
1207
+ apiControllerGetError,
1162
1208
  apiControllerGetHello,
1163
1209
  apiTokenControllerCreateToken,
1164
1210
  apiTokenControllerDeleteToken,
@@ -1177,6 +1223,7 @@ export {
1177
1223
  keysControllerGetProvenanceCryptoKey,
1178
1224
  mergeHeaders,
1179
1225
  missionsControllerCreateMissions,
1226
+ missionsControllerRepriceMissions,
1180
1227
  missionsControllerUpdateMissions,
1181
1228
  parseWebhookEvent,
1182
1229
  quotesControllerCreateQuote,
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.1.1",
4
+ "version": "0.1.3",
5
5
  "license": "MIT",
6
6
  "files": [
7
7
  "dist",
@@ -20,6 +20,7 @@
20
20
  "@types/express": "^4.17.17",
21
21
  "@types/jest": "^29.5.2",
22
22
  "@types/node": "^20.3.1",
23
+ "csv-parse": "^6.1.0",
23
24
  "express": "^4",
24
25
  "jest": "^29.7.0",
25
26
  "json-refs": "^3.0.15",
@@ -37,8 +38,8 @@
37
38
  "zod": "^3.x.x"
38
39
  },
39
40
  "scripts": {
40
- "build": "tsup src/index.ts --format cjs,esm --dts",
41
- "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
41
+ "build": "tsup src/index.ts --tsconfig tsconfig.build.json --format cjs,esm --dts",
42
+ "dev": "tsup src/index.ts --tsconfig tsconfig.build.json --format cjs,esm --dts --watch",
42
43
  "lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
43
44
  "generate-api": "openapi-ts",
44
45
  "generate-event": "ts-node ./scripts/generate-event-type.ts",
@@ -55,11 +55,7 @@ export const createClient = (config: Config = {}): Client => {
55
55
  opts.headers.delete("Content-Type");
56
56
  }
57
57
 
58
- const url = buildUrl({
59
- ...opts,
60
- baseUrl: opts.baseUrl ?? _config?.baseUrl ?? "https://api.layerdrone.org",
61
- url: opts.url ?? "",
62
- });
58
+ const url = buildUrl(opts);
63
59
  const requestInit: ReqInit = {
64
60
  redirect: "follow",
65
61
  ...opts,
@@ -9,8 +9,11 @@ import {
9
9
  apiTokenControllerUpdateTokenResponseTransformer,
10
10
  conditionsControllerGetSunAltitudeTimeLimitsResponseTransformer,
11
11
  flightsControllerValidateFlightResponseTransformer,
12
+ missionsControllerCreateMissionsResponseTransformer,
12
13
  } from "./transformers.gen.js";
13
14
  import type {
15
+ ApiControllerGetErrorData,
16
+ ApiControllerGetErrorResponses,
14
17
  ApiControllerGetHelloData,
15
18
  ApiControllerGetHelloResponses,
16
19
  ApiTokenControllerCreateTokenData,
@@ -44,7 +47,11 @@ import type {
44
47
  MissionsControllerCreateMissionsData,
45
48
  MissionsControllerCreateMissionsErrors,
46
49
  MissionsControllerCreateMissionsResponses,
50
+ MissionsControllerRepriceMissionsData,
51
+ MissionsControllerRepriceMissionsErrors,
52
+ MissionsControllerRepriceMissionsResponses,
47
53
  MissionsControllerUpdateMissionsData,
54
+ MissionsControllerUpdateMissionsErrors,
48
55
  MissionsControllerUpdateMissionsResponses,
49
56
  QuotesControllerCreateQuoteData,
50
57
  QuotesControllerCreateQuoteErrors,
@@ -110,6 +117,19 @@ export const apiControllerGetHello = <ThrowOnError extends boolean = false>(
110
117
  });
111
118
  };
112
119
 
120
+ export const apiControllerGetError = <ThrowOnError extends boolean = false>(
121
+ options?: Options<ApiControllerGetErrorData, ThrowOnError>,
122
+ ) => {
123
+ return (options?.client ?? _heyApiClient).get<
124
+ ApiControllerGetErrorResponses,
125
+ unknown,
126
+ ThrowOnError
127
+ >({
128
+ url: "/debug-sentry",
129
+ ...options,
130
+ });
131
+ };
132
+
113
133
  export const apiTokenControllerCreateToken = <
114
134
  ThrowOnError extends boolean = false,
115
135
  >(
@@ -345,6 +365,13 @@ export const missionsControllerCreateMissions = <
345
365
  MissionsControllerCreateMissionsErrors,
346
366
  ThrowOnError
347
367
  >({
368
+ security: [
369
+ {
370
+ name: "x-api-token",
371
+ type: "apiKey",
372
+ },
373
+ ],
374
+ responseTransformer: missionsControllerCreateMissionsResponseTransformer,
348
375
  url: "/missions",
349
376
  ...options,
350
377
  headers: {
@@ -365,9 +392,15 @@ export const missionsControllerUpdateMissions = <
365
392
  ) => {
366
393
  return (options.client ?? _heyApiClient).put<
367
394
  MissionsControllerUpdateMissionsResponses,
368
- unknown,
395
+ MissionsControllerUpdateMissionsErrors,
369
396
  ThrowOnError
370
397
  >({
398
+ security: [
399
+ {
400
+ name: "x-api-token",
401
+ type: "apiKey",
402
+ },
403
+ ],
371
404
  url: "/missions",
372
405
  ...options,
373
406
  headers: {
@@ -377,6 +410,35 @@ export const missionsControllerUpdateMissions = <
377
410
  });
378
411
  };
379
412
 
413
+ /**
414
+ * Reprice missions
415
+ * Apply a scale factor to all open missions' vault amounts
416
+ */
417
+ export const missionsControllerRepriceMissions = <
418
+ ThrowOnError extends boolean = false,
419
+ >(
420
+ options: Options<MissionsControllerRepriceMissionsData, ThrowOnError>,
421
+ ) => {
422
+ return (options.client ?? _heyApiClient).put<
423
+ MissionsControllerRepriceMissionsResponses,
424
+ MissionsControllerRepriceMissionsErrors,
425
+ ThrowOnError
426
+ >({
427
+ security: [
428
+ {
429
+ name: "x-api-token",
430
+ type: "apiKey",
431
+ },
432
+ ],
433
+ url: "/missions/amounts",
434
+ ...options,
435
+ headers: {
436
+ "Content-Type": "application/json",
437
+ ...options.headers,
438
+ },
439
+ });
440
+ };
441
+
380
442
  export const quotesControllerCreateQuote = <
381
443
  ThrowOnError extends boolean = false,
382
444
  >(
@@ -3,6 +3,7 @@ import type {
3
3
  ApiTokenControllerUpdateTokenResponse,
4
4
  ConditionsControllerGetSunAltitudeTimeLimitsResponse,
5
5
  FlightsControllerValidateFlightResponse,
6
+ MissionsControllerCreateMissionsResponse,
6
7
  } from "./types.gen.js";
7
8
 
8
9
  const updateApiTokenResponseDtoSchemaResponseTransformer = (data: any) => {
@@ -51,3 +52,19 @@ export const flightsControllerValidateFlightResponseTransformer = async (
51
52
  data = validateFlightResponseDtoSchemaResponseTransformer(data);
52
53
  return data;
53
54
  };
55
+
56
+ const createMissionResponseDtoSchemaResponseTransformer = (data: any) => {
57
+ data.data.missions = data.data.missions.map((item: any) => {
58
+ item.captureStartTime = new Date(item.captureStartTime);
59
+ item.captureEndTime = new Date(item.captureEndTime);
60
+ return item;
61
+ });
62
+ return data;
63
+ };
64
+
65
+ export const missionsControllerCreateMissionsResponseTransformer = async (
66
+ data: any,
67
+ ): Promise<MissionsControllerCreateMissionsResponse> => {
68
+ data = createMissionResponseDtoSchemaResponseTransformer(data);
69
+ return data;
70
+ };