@layer-drone/protocol 0.1.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -710,6 +710,19 @@ var conditionsControllerGetSunAltitudeTimeLimitsResponseTransformer = /* @__PURE
710
710
  data = getTimeLimitsForSunAltitudeResponseSchemaResponseTransformer(data);
711
711
  return data;
712
712
  }, "conditionsControllerGetSunAltitudeTimeLimitsResponseTransformer");
713
+ var getContractsResponseDtoSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
714
+ data.data = data.data.map((item) => {
715
+ if (item.deployedAt) {
716
+ item.deployedAt = new Date(item.deployedAt);
717
+ }
718
+ return item;
719
+ });
720
+ return data;
721
+ }, "getContractsResponseDtoSchemaResponseTransformer");
722
+ var contractsControllerGetAllContractsResponseTransformer = /* @__PURE__ */ __name(async (data) => {
723
+ data = getContractsResponseDtoSchemaResponseTransformer(data);
724
+ return data;
725
+ }, "contractsControllerGetAllContractsResponseTransformer");
713
726
  var validateFlightResponseDtoSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
714
727
  data.flightId = BigInt(data.flightId.toString());
715
728
  return data;
@@ -718,6 +731,36 @@ var flightsControllerValidateFlightResponseTransformer = /* @__PURE__ */ __name(
718
731
  data = validateFlightResponseDtoSchemaResponseTransformer(data);
719
732
  return data;
720
733
  }, "flightsControllerValidateFlightResponseTransformer");
734
+ var getFlightPlansResponseSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
735
+ data.data = data.data.map((item) => {
736
+ item.created_at = new Date(item.created_at);
737
+ item.updated_at = new Date(item.updated_at);
738
+ return item;
739
+ });
740
+ return data;
741
+ }, "getFlightPlansResponseSchemaResponseTransformer");
742
+ var flightPlansControllerGetManyResponseTransformer = /* @__PURE__ */ __name(async (data) => {
743
+ data = getFlightPlansResponseSchemaResponseTransformer(data);
744
+ return data;
745
+ }, "flightPlansControllerGetManyResponseTransformer");
746
+ var createFlightPlanResponseSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
747
+ data.created_at = new Date(data.created_at);
748
+ data.updated_at = new Date(data.updated_at);
749
+ return data;
750
+ }, "createFlightPlanResponseSchemaResponseTransformer");
751
+ var flightPlansControllerCreateResponseTransformer = /* @__PURE__ */ __name(async (data) => {
752
+ data = createFlightPlanResponseSchemaResponseTransformer(data);
753
+ return data;
754
+ }, "flightPlansControllerCreateResponseTransformer");
755
+ var getFlightPlanResponseSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
756
+ data.created_at = new Date(data.created_at);
757
+ data.updated_at = new Date(data.updated_at);
758
+ return data;
759
+ }, "getFlightPlanResponseSchemaResponseTransformer");
760
+ var flightPlansControllerGetResponseTransformer = /* @__PURE__ */ __name(async (data) => {
761
+ data = getFlightPlanResponseSchemaResponseTransformer(data);
762
+ return data;
763
+ }, "flightPlansControllerGetResponseTransformer");
721
764
  var createMissionResponseDtoSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
722
765
  data.data.missions = data.data.missions.map((item) => {
723
766
  item.captureStartTime = new Date(item.captureStartTime);
@@ -730,6 +773,45 @@ var missionsControllerCreateMissionsResponseTransformer = /* @__PURE__ */ __name
730
773
  data = createMissionResponseDtoSchemaResponseTransformer(data);
731
774
  return data;
732
775
  }, "missionsControllerCreateMissionsResponseTransformer");
776
+ var getInboundWebhookConfigsResponseSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
777
+ data = data.map((item) => {
778
+ item.created_at = new Date(item.created_at);
779
+ item.updated_at = new Date(item.updated_at);
780
+ return item;
781
+ });
782
+ return data;
783
+ }, "getInboundWebhookConfigsResponseSchemaResponseTransformer");
784
+ var inboundWebhookConfigsControllerGetManyResponseTransformer = /* @__PURE__ */ __name(async (data) => {
785
+ data = getInboundWebhookConfigsResponseSchemaResponseTransformer(data);
786
+ return data;
787
+ }, "inboundWebhookConfigsControllerGetManyResponseTransformer");
788
+ var createInboundWebhookConfigResponseSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
789
+ data.created_at = new Date(data.created_at);
790
+ data.updated_at = new Date(data.updated_at);
791
+ return data;
792
+ }, "createInboundWebhookConfigResponseSchemaResponseTransformer");
793
+ var inboundWebhookConfigsControllerCreateResponseTransformer = /* @__PURE__ */ __name(async (data) => {
794
+ data = createInboundWebhookConfigResponseSchemaResponseTransformer(data);
795
+ return data;
796
+ }, "inboundWebhookConfigsControllerCreateResponseTransformer");
797
+ var getInboundWebhookConfigResponseSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
798
+ data.created_at = new Date(data.created_at);
799
+ data.updated_at = new Date(data.updated_at);
800
+ return data;
801
+ }, "getInboundWebhookConfigResponseSchemaResponseTransformer");
802
+ var inboundWebhookConfigsControllerGetResponseTransformer = /* @__PURE__ */ __name(async (data) => {
803
+ data = getInboundWebhookConfigResponseSchemaResponseTransformer(data);
804
+ return data;
805
+ }, "inboundWebhookConfigsControllerGetResponseTransformer");
806
+ var updateInboundWebhookConfigResponseSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
807
+ data.created_at = new Date(data.created_at);
808
+ data.updated_at = new Date(data.updated_at);
809
+ return data;
810
+ }, "updateInboundWebhookConfigResponseSchemaResponseTransformer");
811
+ var inboundWebhookConfigsControllerUpdateResponseTransformer = /* @__PURE__ */ __name(async (data) => {
812
+ data = updateInboundWebhookConfigResponseSchemaResponseTransformer(data);
813
+ return data;
814
+ }, "inboundWebhookConfigsControllerUpdateResponseTransformer");
733
815
 
734
816
  // src/client/sdk.gen.ts
735
817
  var apiControllerGetHello = /* @__PURE__ */ __name((options) => {
@@ -808,6 +890,91 @@ var conditionsControllerGetSunAltitudeTimeLimits = /* @__PURE__ */ __name((optio
808
890
  ...options
809
891
  });
810
892
  }, "conditionsControllerGetSunAltitudeTimeLimits");
893
+ var contractsControllerGetAllContracts = /* @__PURE__ */ __name((options) => {
894
+ return (options?.client ?? client).get({
895
+ security: [
896
+ {
897
+ name: "x-api-token",
898
+ type: "apiKey"
899
+ }
900
+ ],
901
+ responseTransformer: contractsControllerGetAllContractsResponseTransformer,
902
+ url: "/contracts",
903
+ ...options
904
+ });
905
+ }, "contractsControllerGetAllContracts");
906
+ var contractsControllerCreateContract = /* @__PURE__ */ __name((options) => {
907
+ return (options.client ?? client).post({
908
+ security: [
909
+ {
910
+ name: "x-api-token",
911
+ type: "apiKey"
912
+ }
913
+ ],
914
+ url: "/contracts",
915
+ ...options,
916
+ headers: {
917
+ "Content-Type": "application/json",
918
+ ...options.headers
919
+ }
920
+ });
921
+ }, "contractsControllerCreateContract");
922
+ var contractsControllerDeleteContract = /* @__PURE__ */ __name((options) => {
923
+ return (options.client ?? client).delete({
924
+ security: [
925
+ {
926
+ name: "x-api-token",
927
+ type: "apiKey"
928
+ }
929
+ ],
930
+ url: "/contracts/{id}",
931
+ ...options
932
+ });
933
+ }, "contractsControllerDeleteContract");
934
+ var contractsControllerGetContract = /* @__PURE__ */ __name((options) => {
935
+ return (options.client ?? client).get({
936
+ security: [
937
+ {
938
+ name: "x-api-token",
939
+ type: "apiKey"
940
+ }
941
+ ],
942
+ url: "/contracts/{id}",
943
+ ...options
944
+ });
945
+ }, "contractsControllerGetContract");
946
+ var contractsControllerUpdateContract = /* @__PURE__ */ __name((options) => {
947
+ return (options.client ?? client).patch({
948
+ security: [
949
+ {
950
+ name: "x-api-token",
951
+ type: "apiKey"
952
+ }
953
+ ],
954
+ url: "/contracts/{id}",
955
+ ...options,
956
+ headers: {
957
+ "Content-Type": "application/json",
958
+ ...options.headers
959
+ }
960
+ });
961
+ }, "contractsControllerUpdateContract");
962
+ var dlqRedriverControllerRedriveDlq = /* @__PURE__ */ __name((options) => {
963
+ return (options.client ?? client).post({
964
+ security: [
965
+ {
966
+ name: "x-api-token",
967
+ type: "apiKey"
968
+ }
969
+ ],
970
+ url: "/dlq-redriver/redrive",
971
+ ...options,
972
+ headers: {
973
+ "Content-Type": "application/json",
974
+ ...options.headers
975
+ }
976
+ });
977
+ }, "dlqRedriverControllerRedriveDlq");
811
978
  var flightsControllerGenerateStorageKey = /* @__PURE__ */ __name((options) => {
812
979
  return (options.client ?? client).get({
813
980
  security: [
@@ -865,6 +1032,49 @@ var flightsControllerValidateFlight = /* @__PURE__ */ __name((options) => {
865
1032
  }
866
1033
  });
867
1034
  }, "flightsControllerValidateFlight");
1035
+ var flightPlansControllerGetMany = /* @__PURE__ */ __name((options) => {
1036
+ return (options?.client ?? client).get({
1037
+ security: [
1038
+ {
1039
+ name: "x-api-token",
1040
+ type: "apiKey"
1041
+ }
1042
+ ],
1043
+ responseTransformer: flightPlansControllerGetManyResponseTransformer,
1044
+ url: "/flight-plans",
1045
+ ...options
1046
+ });
1047
+ }, "flightPlansControllerGetMany");
1048
+ var flightPlansControllerCreate = /* @__PURE__ */ __name((options) => {
1049
+ return (options.client ?? client).post({
1050
+ security: [
1051
+ {
1052
+ name: "x-api-token",
1053
+ type: "apiKey"
1054
+ }
1055
+ ],
1056
+ responseTransformer: flightPlansControllerCreateResponseTransformer,
1057
+ url: "/flight-plans",
1058
+ ...options,
1059
+ headers: {
1060
+ "Content-Type": "application/json",
1061
+ ...options.headers
1062
+ }
1063
+ });
1064
+ }, "flightPlansControllerCreate");
1065
+ var flightPlansControllerGet = /* @__PURE__ */ __name((options) => {
1066
+ return (options.client ?? client).get({
1067
+ security: [
1068
+ {
1069
+ name: "x-api-token",
1070
+ type: "apiKey"
1071
+ }
1072
+ ],
1073
+ responseTransformer: flightPlansControllerGetResponseTransformer,
1074
+ url: "/flight-plans/{id}",
1075
+ ...options
1076
+ });
1077
+ }, "flightPlansControllerGet");
868
1078
  var keysControllerGetProvenanceCryptoKey = /* @__PURE__ */ __name((options) => {
869
1079
  return (options?.client ?? client).get({
870
1080
  url: "/keys",
@@ -920,6 +1130,22 @@ var missionsControllerRepriceMissions = /* @__PURE__ */ __name((options) => {
920
1130
  }
921
1131
  });
922
1132
  }, "missionsControllerRepriceMissions");
1133
+ var missionsControllerCloseMission = /* @__PURE__ */ __name((options) => {
1134
+ return (options.client ?? client).post({
1135
+ security: [
1136
+ {
1137
+ name: "x-api-token",
1138
+ type: "apiKey"
1139
+ }
1140
+ ],
1141
+ url: "/missions/{id}/close",
1142
+ ...options,
1143
+ headers: {
1144
+ "Content-Type": "application/json",
1145
+ ...options.headers
1146
+ }
1147
+ });
1148
+ }, "missionsControllerCloseMission");
923
1149
  var quotesControllerCreateQuote = /* @__PURE__ */ __name((options) => {
924
1150
  return (options.client ?? client).post({
925
1151
  security: [
@@ -954,6 +1180,32 @@ var schemaControllerGetEventSchema = /* @__PURE__ */ __name((options) => {
954
1180
  ...options
955
1181
  });
956
1182
  }, "schemaControllerGetEventSchema");
1183
+ var schemaControllerGetFlightPlanSchema = /* @__PURE__ */ __name((options) => {
1184
+ return (options?.client ?? client).get({
1185
+ url: "/schema/flight-plan",
1186
+ ...options
1187
+ });
1188
+ }, "schemaControllerGetFlightPlanSchema");
1189
+ var vaultsControllerCreateVaults = /* @__PURE__ */ __name((options) => {
1190
+ return (options.client ?? client).post({
1191
+ security: [
1192
+ {
1193
+ name: "x-api-token",
1194
+ type: "apiKey"
1195
+ },
1196
+ {
1197
+ name: "x-api-token",
1198
+ type: "apiKey"
1199
+ }
1200
+ ],
1201
+ url: "/vaults",
1202
+ ...options,
1203
+ headers: {
1204
+ "Content-Type": "application/json",
1205
+ ...options.headers
1206
+ }
1207
+ });
1208
+ }, "vaultsControllerCreateVaults");
957
1209
  var webhooksControllerGetMany = /* @__PURE__ */ __name((options) => {
958
1210
  return (options.client ?? client).get({
959
1211
  security: [
@@ -1058,6 +1310,88 @@ var webhooksControllerGetStatus = /* @__PURE__ */ __name((options) => {
1058
1310
  ...options
1059
1311
  });
1060
1312
  }, "webhooksControllerGetStatus");
1313
+ var alchemyControllerHandleWebhook = /* @__PURE__ */ __name((options) => {
1314
+ return (options.client ?? client).post({
1315
+ url: "/webhooks/inbound/alchemy",
1316
+ ...options,
1317
+ headers: {
1318
+ "Content-Type": "application/json",
1319
+ ...options.headers
1320
+ }
1321
+ });
1322
+ }, "alchemyControllerHandleWebhook");
1323
+ var inboundWebhookConfigsControllerGetMany = /* @__PURE__ */ __name((options) => {
1324
+ return (options?.client ?? client).get({
1325
+ security: [
1326
+ {
1327
+ name: "x-api-token",
1328
+ type: "apiKey"
1329
+ }
1330
+ ],
1331
+ responseTransformer: inboundWebhookConfigsControllerGetManyResponseTransformer,
1332
+ url: "/webhooks/inbound/configs",
1333
+ ...options
1334
+ });
1335
+ }, "inboundWebhookConfigsControllerGetMany");
1336
+ var inboundWebhookConfigsControllerCreate = /* @__PURE__ */ __name((options) => {
1337
+ return (options.client ?? client).post({
1338
+ security: [
1339
+ {
1340
+ name: "x-api-token",
1341
+ type: "apiKey"
1342
+ }
1343
+ ],
1344
+ responseTransformer: inboundWebhookConfigsControllerCreateResponseTransformer,
1345
+ url: "/webhooks/inbound/configs",
1346
+ ...options,
1347
+ headers: {
1348
+ "Content-Type": "application/json",
1349
+ ...options.headers
1350
+ }
1351
+ });
1352
+ }, "inboundWebhookConfigsControllerCreate");
1353
+ var inboundWebhookConfigsControllerDelete = /* @__PURE__ */ __name((options) => {
1354
+ return (options.client ?? client).delete({
1355
+ security: [
1356
+ {
1357
+ name: "x-api-token",
1358
+ type: "apiKey"
1359
+ }
1360
+ ],
1361
+ url: "/webhooks/inbound/configs/{id}",
1362
+ ...options
1363
+ });
1364
+ }, "inboundWebhookConfigsControllerDelete");
1365
+ var inboundWebhookConfigsControllerGet = /* @__PURE__ */ __name((options) => {
1366
+ return (options.client ?? client).get({
1367
+ security: [
1368
+ {
1369
+ name: "x-api-token",
1370
+ type: "apiKey"
1371
+ }
1372
+ ],
1373
+ responseTransformer: inboundWebhookConfigsControllerGetResponseTransformer,
1374
+ url: "/webhooks/inbound/configs/{id}",
1375
+ ...options
1376
+ });
1377
+ }, "inboundWebhookConfigsControllerGet");
1378
+ var inboundWebhookConfigsControllerUpdate = /* @__PURE__ */ __name((options) => {
1379
+ return (options.client ?? client).put({
1380
+ security: [
1381
+ {
1382
+ name: "x-api-token",
1383
+ type: "apiKey"
1384
+ }
1385
+ ],
1386
+ responseTransformer: inboundWebhookConfigsControllerUpdateResponseTransformer,
1387
+ url: "/webhooks/inbound/configs/{id}",
1388
+ ...options,
1389
+ headers: {
1390
+ "Content-Type": "application/json",
1391
+ ...options.headers
1392
+ }
1393
+ });
1394
+ }, "inboundWebhookConfigsControllerUpdate");
1061
1395
 
1062
1396
  // src/event/types.gen.ts
1063
1397
  import { z } from "zod";
@@ -1075,6 +1409,7 @@ var Event = z.union([
1075
1409
  event_type: z.literal("protocol.mission.created"),
1076
1410
  timestamp: z.string(),
1077
1411
  data: z.object({
1412
+ version: z.literal(1),
1078
1413
  id: z.object({
1079
1414
  __type: z.literal("bigint"),
1080
1415
  value: z.string()
@@ -1096,7 +1431,11 @@ var Event = z.union([
1096
1431
  captureEndTime: z.string().datetime({
1097
1432
  offset: true
1098
1433
  }),
1099
- requestor: z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$"))
1434
+ isReservable: z.boolean(),
1435
+ requestor: z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$")),
1436
+ collateralTokenAddress: z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$")),
1437
+ chainId: z.number(),
1438
+ tags: z.record(z.string())
1100
1439
  }).catchall(z.any())
1101
1440
  }).catchall(z.any()),
1102
1441
  z.object({
@@ -1104,6 +1443,7 @@ var Event = z.union([
1104
1443
  event_type: z.literal("protocol.mission.updated"),
1105
1444
  timestamp: z.string(),
1106
1445
  data: z.object({
1446
+ version: z.literal(1),
1107
1447
  id: z.object({
1108
1448
  __type: z.literal("bigint"),
1109
1449
  value: z.string()
@@ -1121,6 +1461,7 @@ var Event = z.union([
1121
1461
  event_type: z.literal("protocol.mission.paid"),
1122
1462
  timestamp: z.string(),
1123
1463
  data: z.object({
1464
+ version: z.literal(1),
1124
1465
  recipient: z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$")),
1125
1466
  flightId: z.object({
1126
1467
  __type: z.literal("bigint"),
@@ -1146,6 +1487,7 @@ var Event = z.union([
1146
1487
  event_type: z.literal("protocol.flight.submitted"),
1147
1488
  timestamp: z.string(),
1148
1489
  data: z.object({
1490
+ version: z.literal(1),
1149
1491
  storageKey: z.string(),
1150
1492
  pilotAddress: z.string(),
1151
1493
  flightManifestUri: z.string(),
@@ -1160,6 +1502,7 @@ var Event = z.union([
1160
1502
  event_type: z.literal("protocol.flight.reviewed"),
1161
1503
  timestamp: z.string(),
1162
1504
  data: z.object({
1505
+ version: z.literal(1),
1163
1506
  flightId: z.object({
1164
1507
  __type: z.literal("bigint"),
1165
1508
  value: z.string()
@@ -1204,6 +1547,7 @@ function getSecretHeader(headers) {
1204
1547
  __name(getSecretHeader, "getSecretHeader");
1205
1548
  export {
1206
1549
  Event,
1550
+ alchemyControllerHandleWebhook,
1207
1551
  apiControllerGetError,
1208
1552
  apiControllerGetHello,
1209
1553
  apiTokenControllerCreateToken,
@@ -1212,16 +1556,31 @@ export {
1212
1556
  apiTokenControllerUpdateToken,
1213
1557
  buildClientParams,
1214
1558
  conditionsControllerGetSunAltitudeTimeLimits,
1559
+ contractsControllerCreateContract,
1560
+ contractsControllerDeleteContract,
1561
+ contractsControllerGetAllContracts,
1562
+ contractsControllerGetContract,
1563
+ contractsControllerUpdateContract,
1215
1564
  createClient,
1216
1565
  createConfig,
1566
+ dlqRedriverControllerRedriveDlq,
1567
+ flightPlansControllerCreate,
1568
+ flightPlansControllerGet,
1569
+ flightPlansControllerGetMany,
1217
1570
  flightsControllerCreatePresignedUrls,
1218
1571
  flightsControllerGenerateStorageKey,
1219
1572
  flightsControllerGetFlight,
1220
1573
  flightsControllerValidateFlight,
1221
1574
  formDataBodySerializer,
1575
+ inboundWebhookConfigsControllerCreate,
1576
+ inboundWebhookConfigsControllerDelete,
1577
+ inboundWebhookConfigsControllerGet,
1578
+ inboundWebhookConfigsControllerGetMany,
1579
+ inboundWebhookConfigsControllerUpdate,
1222
1580
  jsonBodySerializer,
1223
1581
  keysControllerGetProvenanceCryptoKey,
1224
1582
  mergeHeaders,
1583
+ missionsControllerCloseMission,
1225
1584
  missionsControllerCreateMissions,
1226
1585
  missionsControllerRepriceMissions,
1227
1586
  missionsControllerUpdateMissions,
@@ -1229,7 +1588,9 @@ export {
1229
1588
  quotesControllerCreateQuote,
1230
1589
  quotesControllerGetQuote,
1231
1590
  schemaControllerGetEventSchema,
1591
+ schemaControllerGetFlightPlanSchema,
1232
1592
  urlSearchParamsBodySerializer,
1593
+ vaultsControllerCreateVaults,
1233
1594
  webhooksControllerCreate,
1234
1595
  webhooksControllerDelete,
1235
1596
  webhooksControllerGet,
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.3",
4
+ "version": "0.3.0",
5
5
  "license": "MIT",
6
6
  "files": [
7
7
  "dist",
@@ -21,7 +21,7 @@
21
21
  "@types/jest": "^29.5.2",
22
22
  "@types/node": "^20.3.1",
23
23
  "csv-parse": "^6.1.0",
24
- "express": "^4",
24
+ "express": "^4.17.7",
25
25
  "jest": "^29.7.0",
26
26
  "json-refs": "^3.0.15",
27
27
  "json-schema-to-zod": "^2.6.1",