@layer-drone/protocol 0.1.0 → 0.1.2
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 +2127 -353
- package/dist/index.d.ts +2127 -353
- package/dist/index.js +50 -31
- package/dist/index.mjs +49 -31
- package/package.json +3 -2
- package/src/client/client/client.ts +1 -5
- package/src/client/sdk.gen.ts +29 -1
- package/src/client/types.gen.ts +45 -4
- package/src/event/types.gen.ts +27 -24
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,
|
|
@@ -627,11 +628,7 @@ var createClient = /* @__PURE__ */ __name((config = {}) => {
|
|
|
627
628
|
if (opts.body === void 0 || opts.body === "") {
|
|
628
629
|
opts.headers.delete("Content-Type");
|
|
629
630
|
}
|
|
630
|
-
const url = buildUrl(
|
|
631
|
-
...opts,
|
|
632
|
-
baseUrl: opts.baseUrl ?? _config?.baseUrl ?? "https://api.layerdrone.org",
|
|
633
|
-
url: opts.url ?? ""
|
|
634
|
-
});
|
|
631
|
+
const url = buildUrl(opts);
|
|
635
632
|
const requestInit = {
|
|
636
633
|
redirect: "follow",
|
|
637
634
|
...opts
|
|
@@ -786,6 +783,12 @@ var apiControllerGetHello = /* @__PURE__ */ __name((options) => {
|
|
|
786
783
|
...options
|
|
787
784
|
});
|
|
788
785
|
}, "apiControllerGetHello");
|
|
786
|
+
var apiControllerGetError = /* @__PURE__ */ __name((options) => {
|
|
787
|
+
return (options?.client ?? client).get({
|
|
788
|
+
url: "/debug-sentry",
|
|
789
|
+
...options
|
|
790
|
+
});
|
|
791
|
+
}, "apiControllerGetError");
|
|
789
792
|
var apiTokenControllerCreateToken = /* @__PURE__ */ __name((options) => {
|
|
790
793
|
return (options.client ?? client).post({
|
|
791
794
|
security: [
|
|
@@ -915,6 +918,12 @@ var keysControllerGetProvenanceCryptoKey = /* @__PURE__ */ __name((options) => {
|
|
|
915
918
|
}, "keysControllerGetProvenanceCryptoKey");
|
|
916
919
|
var missionsControllerCreateMissions = /* @__PURE__ */ __name((options) => {
|
|
917
920
|
return (options.client ?? client).post({
|
|
921
|
+
security: [
|
|
922
|
+
{
|
|
923
|
+
name: "x-api-token",
|
|
924
|
+
type: "apiKey"
|
|
925
|
+
}
|
|
926
|
+
],
|
|
918
927
|
url: "/missions",
|
|
919
928
|
...options,
|
|
920
929
|
headers: {
|
|
@@ -925,6 +934,12 @@ var missionsControllerCreateMissions = /* @__PURE__ */ __name((options) => {
|
|
|
925
934
|
}, "missionsControllerCreateMissions");
|
|
926
935
|
var missionsControllerUpdateMissions = /* @__PURE__ */ __name((options) => {
|
|
927
936
|
return (options.client ?? client).put({
|
|
937
|
+
security: [
|
|
938
|
+
{
|
|
939
|
+
name: "x-api-token",
|
|
940
|
+
type: "apiKey"
|
|
941
|
+
}
|
|
942
|
+
],
|
|
928
943
|
url: "/missions",
|
|
929
944
|
...options,
|
|
930
945
|
headers: {
|
|
@@ -1081,12 +1096,12 @@ var Event = import_zod.z.union([
|
|
|
1081
1096
|
timestamp: import_zod.z.string(),
|
|
1082
1097
|
data: import_zod.z.object({
|
|
1083
1098
|
message: import_zod.z.string()
|
|
1084
|
-
}).
|
|
1085
|
-
}).
|
|
1099
|
+
}).catchall(import_zod.z.any())
|
|
1100
|
+
}).catchall(import_zod.z.any()),
|
|
1086
1101
|
import_zod.z.object({
|
|
1087
|
-
id: import_zod.z.
|
|
1102
|
+
id: import_zod.z.string(),
|
|
1088
1103
|
event_type: import_zod.z.literal("protocol.mission.created"),
|
|
1089
|
-
timestamp: import_zod.z.
|
|
1104
|
+
timestamp: import_zod.z.string(),
|
|
1090
1105
|
data: import_zod.z.object({
|
|
1091
1106
|
id: import_zod.z.object({
|
|
1092
1107
|
__type: import_zod.z.literal("bigint"),
|
|
@@ -1102,6 +1117,7 @@ var Event = import_zod.z.union([
|
|
|
1102
1117
|
}).transform((wire) => BigInt(wire.value)),
|
|
1103
1118
|
zoneId: import_zod.z.string(),
|
|
1104
1119
|
flightPlanId: import_zod.z.number(),
|
|
1120
|
+
campaigns: import_zod.z.array(import_zod.z.string()),
|
|
1105
1121
|
captureStartTime: import_zod.z.string().datetime({
|
|
1106
1122
|
offset: true
|
|
1107
1123
|
}),
|
|
@@ -1109,12 +1125,12 @@ var Event = import_zod.z.union([
|
|
|
1109
1125
|
offset: true
|
|
1110
1126
|
}),
|
|
1111
1127
|
requestor: import_zod.z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$"))
|
|
1112
|
-
}).
|
|
1113
|
-
}).
|
|
1128
|
+
}).catchall(import_zod.z.any())
|
|
1129
|
+
}).catchall(import_zod.z.any()),
|
|
1114
1130
|
import_zod.z.object({
|
|
1115
|
-
id: import_zod.z.
|
|
1131
|
+
id: import_zod.z.string(),
|
|
1116
1132
|
event_type: import_zod.z.literal("protocol.mission.updated"),
|
|
1117
|
-
timestamp: import_zod.z.
|
|
1133
|
+
timestamp: import_zod.z.string(),
|
|
1118
1134
|
data: import_zod.z.object({
|
|
1119
1135
|
id: import_zod.z.object({
|
|
1120
1136
|
__type: import_zod.z.literal("bigint"),
|
|
@@ -1124,15 +1140,16 @@ var Event = import_zod.z.union([
|
|
|
1124
1140
|
__type: import_zod.z.literal("bigint"),
|
|
1125
1141
|
value: import_zod.z.string()
|
|
1126
1142
|
}).transform((wire) => BigInt(wire.value)).optional(),
|
|
1127
|
-
isOpen: import_zod.z.boolean().optional()
|
|
1128
|
-
|
|
1129
|
-
|
|
1143
|
+
isOpen: import_zod.z.boolean().optional(),
|
|
1144
|
+
campaigns: import_zod.z.array(import_zod.z.string()).optional()
|
|
1145
|
+
}).catchall(import_zod.z.any())
|
|
1146
|
+
}).catchall(import_zod.z.any()),
|
|
1130
1147
|
import_zod.z.object({
|
|
1131
|
-
id: import_zod.z.
|
|
1148
|
+
id: import_zod.z.string(),
|
|
1132
1149
|
event_type: import_zod.z.literal("protocol.mission.paid"),
|
|
1133
|
-
timestamp: import_zod.z.
|
|
1150
|
+
timestamp: import_zod.z.string(),
|
|
1134
1151
|
data: import_zod.z.object({
|
|
1135
|
-
recipient: import_zod.z.
|
|
1152
|
+
recipient: import_zod.z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$")),
|
|
1136
1153
|
flightId: import_zod.z.object({
|
|
1137
1154
|
__type: import_zod.z.literal("bigint"),
|
|
1138
1155
|
value: import_zod.z.string()
|
|
@@ -1148,13 +1165,14 @@ var Event = import_zod.z.union([
|
|
|
1148
1165
|
amount: import_zod.z.object({
|
|
1149
1166
|
__type: import_zod.z.literal("bigint"),
|
|
1150
1167
|
value: import_zod.z.string()
|
|
1151
|
-
}).transform((wire) => BigInt(wire.value))
|
|
1152
|
-
|
|
1153
|
-
|
|
1168
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1169
|
+
storageKey: import_zod.z.string()
|
|
1170
|
+
}).catchall(import_zod.z.any())
|
|
1171
|
+
}).catchall(import_zod.z.any()),
|
|
1154
1172
|
import_zod.z.object({
|
|
1155
|
-
id: import_zod.z.
|
|
1173
|
+
id: import_zod.z.string(),
|
|
1156
1174
|
event_type: import_zod.z.literal("protocol.flight.submitted"),
|
|
1157
|
-
timestamp: import_zod.z.
|
|
1175
|
+
timestamp: import_zod.z.string(),
|
|
1158
1176
|
data: import_zod.z.object({
|
|
1159
1177
|
storageKey: import_zod.z.string(),
|
|
1160
1178
|
pilotAddress: import_zod.z.string(),
|
|
@@ -1163,18 +1181,18 @@ var Event = import_zod.z.union([
|
|
|
1163
1181
|
__type: import_zod.z.literal("bigint"),
|
|
1164
1182
|
value: import_zod.z.string()
|
|
1165
1183
|
}).transform((wire) => BigInt(wire.value))
|
|
1166
|
-
}).
|
|
1167
|
-
}).
|
|
1184
|
+
}).catchall(import_zod.z.any())
|
|
1185
|
+
}).catchall(import_zod.z.any()),
|
|
1168
1186
|
import_zod.z.object({
|
|
1169
|
-
id: import_zod.z.
|
|
1187
|
+
id: import_zod.z.string(),
|
|
1170
1188
|
event_type: import_zod.z.literal("protocol.flight.reviewed"),
|
|
1171
|
-
timestamp: import_zod.z.
|
|
1189
|
+
timestamp: import_zod.z.string(),
|
|
1172
1190
|
data: import_zod.z.object({
|
|
1173
1191
|
flightId: import_zod.z.object({
|
|
1174
1192
|
__type: import_zod.z.literal("bigint"),
|
|
1175
1193
|
value: import_zod.z.string()
|
|
1176
1194
|
}).transform((wire) => BigInt(wire.value)),
|
|
1177
|
-
owner: import_zod.z.
|
|
1195
|
+
owner: import_zod.z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$")),
|
|
1178
1196
|
isApproved: import_zod.z.boolean(),
|
|
1179
1197
|
validationLogUri: import_zod.z.string(),
|
|
1180
1198
|
validator: import_zod.z.string(),
|
|
@@ -1184,8 +1202,8 @@ var Event = import_zod.z.union([
|
|
|
1184
1202
|
__type: import_zod.z.literal("bigint"),
|
|
1185
1203
|
value: import_zod.z.string()
|
|
1186
1204
|
}).transform((wire) => BigInt(wire.value))
|
|
1187
|
-
}).
|
|
1188
|
-
}).
|
|
1205
|
+
}).catchall(import_zod.z.any())
|
|
1206
|
+
}).catchall(import_zod.z.any())
|
|
1189
1207
|
]);
|
|
1190
1208
|
|
|
1191
1209
|
// src/event/parser.ts
|
|
@@ -1215,6 +1233,7 @@ __name(getSecretHeader, "getSecretHeader");
|
|
|
1215
1233
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1216
1234
|
0 && (module.exports = {
|
|
1217
1235
|
Event,
|
|
1236
|
+
apiControllerGetError,
|
|
1218
1237
|
apiControllerGetHello,
|
|
1219
1238
|
apiTokenControllerCreateToken,
|
|
1220
1239
|
apiTokenControllerDeleteToken,
|
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
|
|
@@ -730,6 +726,12 @@ var apiControllerGetHello = /* @__PURE__ */ __name((options) => {
|
|
|
730
726
|
...options
|
|
731
727
|
});
|
|
732
728
|
}, "apiControllerGetHello");
|
|
729
|
+
var apiControllerGetError = /* @__PURE__ */ __name((options) => {
|
|
730
|
+
return (options?.client ?? client).get({
|
|
731
|
+
url: "/debug-sentry",
|
|
732
|
+
...options
|
|
733
|
+
});
|
|
734
|
+
}, "apiControllerGetError");
|
|
733
735
|
var apiTokenControllerCreateToken = /* @__PURE__ */ __name((options) => {
|
|
734
736
|
return (options.client ?? client).post({
|
|
735
737
|
security: [
|
|
@@ -859,6 +861,12 @@ var keysControllerGetProvenanceCryptoKey = /* @__PURE__ */ __name((options) => {
|
|
|
859
861
|
}, "keysControllerGetProvenanceCryptoKey");
|
|
860
862
|
var missionsControllerCreateMissions = /* @__PURE__ */ __name((options) => {
|
|
861
863
|
return (options.client ?? client).post({
|
|
864
|
+
security: [
|
|
865
|
+
{
|
|
866
|
+
name: "x-api-token",
|
|
867
|
+
type: "apiKey"
|
|
868
|
+
}
|
|
869
|
+
],
|
|
862
870
|
url: "/missions",
|
|
863
871
|
...options,
|
|
864
872
|
headers: {
|
|
@@ -869,6 +877,12 @@ var missionsControllerCreateMissions = /* @__PURE__ */ __name((options) => {
|
|
|
869
877
|
}, "missionsControllerCreateMissions");
|
|
870
878
|
var missionsControllerUpdateMissions = /* @__PURE__ */ __name((options) => {
|
|
871
879
|
return (options.client ?? client).put({
|
|
880
|
+
security: [
|
|
881
|
+
{
|
|
882
|
+
name: "x-api-token",
|
|
883
|
+
type: "apiKey"
|
|
884
|
+
}
|
|
885
|
+
],
|
|
872
886
|
url: "/missions",
|
|
873
887
|
...options,
|
|
874
888
|
headers: {
|
|
@@ -1025,12 +1039,12 @@ var Event = z.union([
|
|
|
1025
1039
|
timestamp: z.string(),
|
|
1026
1040
|
data: z.object({
|
|
1027
1041
|
message: z.string()
|
|
1028
|
-
}).
|
|
1029
|
-
}).
|
|
1042
|
+
}).catchall(z.any())
|
|
1043
|
+
}).catchall(z.any()),
|
|
1030
1044
|
z.object({
|
|
1031
|
-
id: z.
|
|
1045
|
+
id: z.string(),
|
|
1032
1046
|
event_type: z.literal("protocol.mission.created"),
|
|
1033
|
-
timestamp: z.
|
|
1047
|
+
timestamp: z.string(),
|
|
1034
1048
|
data: z.object({
|
|
1035
1049
|
id: z.object({
|
|
1036
1050
|
__type: z.literal("bigint"),
|
|
@@ -1046,6 +1060,7 @@ var Event = z.union([
|
|
|
1046
1060
|
}).transform((wire) => BigInt(wire.value)),
|
|
1047
1061
|
zoneId: z.string(),
|
|
1048
1062
|
flightPlanId: z.number(),
|
|
1063
|
+
campaigns: z.array(z.string()),
|
|
1049
1064
|
captureStartTime: z.string().datetime({
|
|
1050
1065
|
offset: true
|
|
1051
1066
|
}),
|
|
@@ -1053,12 +1068,12 @@ var Event = z.union([
|
|
|
1053
1068
|
offset: true
|
|
1054
1069
|
}),
|
|
1055
1070
|
requestor: z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$"))
|
|
1056
|
-
}).
|
|
1057
|
-
}).
|
|
1071
|
+
}).catchall(z.any())
|
|
1072
|
+
}).catchall(z.any()),
|
|
1058
1073
|
z.object({
|
|
1059
|
-
id: z.
|
|
1074
|
+
id: z.string(),
|
|
1060
1075
|
event_type: z.literal("protocol.mission.updated"),
|
|
1061
|
-
timestamp: z.
|
|
1076
|
+
timestamp: z.string(),
|
|
1062
1077
|
data: z.object({
|
|
1063
1078
|
id: z.object({
|
|
1064
1079
|
__type: z.literal("bigint"),
|
|
@@ -1068,15 +1083,16 @@ var Event = z.union([
|
|
|
1068
1083
|
__type: z.literal("bigint"),
|
|
1069
1084
|
value: z.string()
|
|
1070
1085
|
}).transform((wire) => BigInt(wire.value)).optional(),
|
|
1071
|
-
isOpen: z.boolean().optional()
|
|
1072
|
-
|
|
1073
|
-
|
|
1086
|
+
isOpen: z.boolean().optional(),
|
|
1087
|
+
campaigns: z.array(z.string()).optional()
|
|
1088
|
+
}).catchall(z.any())
|
|
1089
|
+
}).catchall(z.any()),
|
|
1074
1090
|
z.object({
|
|
1075
|
-
id: z.
|
|
1091
|
+
id: z.string(),
|
|
1076
1092
|
event_type: z.literal("protocol.mission.paid"),
|
|
1077
|
-
timestamp: z.
|
|
1093
|
+
timestamp: z.string(),
|
|
1078
1094
|
data: z.object({
|
|
1079
|
-
recipient: z.
|
|
1095
|
+
recipient: z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$")),
|
|
1080
1096
|
flightId: z.object({
|
|
1081
1097
|
__type: z.literal("bigint"),
|
|
1082
1098
|
value: z.string()
|
|
@@ -1092,13 +1108,14 @@ var Event = z.union([
|
|
|
1092
1108
|
amount: z.object({
|
|
1093
1109
|
__type: z.literal("bigint"),
|
|
1094
1110
|
value: z.string()
|
|
1095
|
-
}).transform((wire) => BigInt(wire.value))
|
|
1096
|
-
|
|
1097
|
-
|
|
1111
|
+
}).transform((wire) => BigInt(wire.value)),
|
|
1112
|
+
storageKey: z.string()
|
|
1113
|
+
}).catchall(z.any())
|
|
1114
|
+
}).catchall(z.any()),
|
|
1098
1115
|
z.object({
|
|
1099
|
-
id: z.
|
|
1116
|
+
id: z.string(),
|
|
1100
1117
|
event_type: z.literal("protocol.flight.submitted"),
|
|
1101
|
-
timestamp: z.
|
|
1118
|
+
timestamp: z.string(),
|
|
1102
1119
|
data: z.object({
|
|
1103
1120
|
storageKey: z.string(),
|
|
1104
1121
|
pilotAddress: z.string(),
|
|
@@ -1107,18 +1124,18 @@ var Event = z.union([
|
|
|
1107
1124
|
__type: z.literal("bigint"),
|
|
1108
1125
|
value: z.string()
|
|
1109
1126
|
}).transform((wire) => BigInt(wire.value))
|
|
1110
|
-
}).
|
|
1111
|
-
}).
|
|
1127
|
+
}).catchall(z.any())
|
|
1128
|
+
}).catchall(z.any()),
|
|
1112
1129
|
z.object({
|
|
1113
|
-
id: z.
|
|
1130
|
+
id: z.string(),
|
|
1114
1131
|
event_type: z.literal("protocol.flight.reviewed"),
|
|
1115
|
-
timestamp: z.
|
|
1132
|
+
timestamp: z.string(),
|
|
1116
1133
|
data: z.object({
|
|
1117
1134
|
flightId: z.object({
|
|
1118
1135
|
__type: z.literal("bigint"),
|
|
1119
1136
|
value: z.string()
|
|
1120
1137
|
}).transform((wire) => BigInt(wire.value)),
|
|
1121
|
-
owner: z.
|
|
1138
|
+
owner: z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$")),
|
|
1122
1139
|
isApproved: z.boolean(),
|
|
1123
1140
|
validationLogUri: z.string(),
|
|
1124
1141
|
validator: z.string(),
|
|
@@ -1128,8 +1145,8 @@ var Event = z.union([
|
|
|
1128
1145
|
__type: z.literal("bigint"),
|
|
1129
1146
|
value: z.string()
|
|
1130
1147
|
}).transform((wire) => BigInt(wire.value))
|
|
1131
|
-
}).
|
|
1132
|
-
}).
|
|
1148
|
+
}).catchall(z.any())
|
|
1149
|
+
}).catchall(z.any())
|
|
1133
1150
|
]);
|
|
1134
1151
|
|
|
1135
1152
|
// src/event/parser.ts
|
|
@@ -1158,6 +1175,7 @@ function getSecretHeader(headers) {
|
|
|
1158
1175
|
__name(getSecretHeader, "getSecretHeader");
|
|
1159
1176
|
export {
|
|
1160
1177
|
Event,
|
|
1178
|
+
apiControllerGetError,
|
|
1161
1179
|
apiControllerGetHello,
|
|
1162
1180
|
apiTokenControllerCreateToken,
|
|
1163
1181
|
apiTokenControllerDeleteToken,
|
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.
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -17,11 +17,12 @@
|
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@hey-api/openapi-ts": "^0.74.0",
|
|
20
|
-
"@types/express": "^4",
|
|
20
|
+
"@types/express": "^4.17.17",
|
|
21
21
|
"@types/jest": "^29.5.2",
|
|
22
22
|
"@types/node": "^20.3.1",
|
|
23
23
|
"express": "^4",
|
|
24
24
|
"jest": "^29.7.0",
|
|
25
|
+
"json-refs": "^3.0.15",
|
|
25
26
|
"json-schema-to-zod": "^2.6.1",
|
|
26
27
|
"ts-jest": "^29.2.5",
|
|
27
28
|
"ts-loader": "^9.4.3",
|
|
@@ -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,
|
package/src/client/sdk.gen.ts
CHANGED
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
flightsControllerValidateFlightResponseTransformer,
|
|
12
12
|
} from "./transformers.gen.js";
|
|
13
13
|
import type {
|
|
14
|
+
ApiControllerGetErrorData,
|
|
15
|
+
ApiControllerGetErrorResponses,
|
|
14
16
|
ApiControllerGetHelloData,
|
|
15
17
|
ApiControllerGetHelloResponses,
|
|
16
18
|
ApiTokenControllerCreateTokenData,
|
|
@@ -45,6 +47,7 @@ import type {
|
|
|
45
47
|
MissionsControllerCreateMissionsErrors,
|
|
46
48
|
MissionsControllerCreateMissionsResponses,
|
|
47
49
|
MissionsControllerUpdateMissionsData,
|
|
50
|
+
MissionsControllerUpdateMissionsErrors,
|
|
48
51
|
MissionsControllerUpdateMissionsResponses,
|
|
49
52
|
QuotesControllerCreateQuoteData,
|
|
50
53
|
QuotesControllerCreateQuoteErrors,
|
|
@@ -110,6 +113,19 @@ export const apiControllerGetHello = <ThrowOnError extends boolean = false>(
|
|
|
110
113
|
});
|
|
111
114
|
};
|
|
112
115
|
|
|
116
|
+
export const apiControllerGetError = <ThrowOnError extends boolean = false>(
|
|
117
|
+
options?: Options<ApiControllerGetErrorData, ThrowOnError>,
|
|
118
|
+
) => {
|
|
119
|
+
return (options?.client ?? _heyApiClient).get<
|
|
120
|
+
ApiControllerGetErrorResponses,
|
|
121
|
+
unknown,
|
|
122
|
+
ThrowOnError
|
|
123
|
+
>({
|
|
124
|
+
url: "/debug-sentry",
|
|
125
|
+
...options,
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
|
|
113
129
|
export const apiTokenControllerCreateToken = <
|
|
114
130
|
ThrowOnError extends boolean = false,
|
|
115
131
|
>(
|
|
@@ -345,6 +361,12 @@ export const missionsControllerCreateMissions = <
|
|
|
345
361
|
MissionsControllerCreateMissionsErrors,
|
|
346
362
|
ThrowOnError
|
|
347
363
|
>({
|
|
364
|
+
security: [
|
|
365
|
+
{
|
|
366
|
+
name: "x-api-token",
|
|
367
|
+
type: "apiKey",
|
|
368
|
+
},
|
|
369
|
+
],
|
|
348
370
|
url: "/missions",
|
|
349
371
|
...options,
|
|
350
372
|
headers: {
|
|
@@ -365,9 +387,15 @@ export const missionsControllerUpdateMissions = <
|
|
|
365
387
|
) => {
|
|
366
388
|
return (options.client ?? _heyApiClient).put<
|
|
367
389
|
MissionsControllerUpdateMissionsResponses,
|
|
368
|
-
|
|
390
|
+
MissionsControllerUpdateMissionsErrors,
|
|
369
391
|
ThrowOnError
|
|
370
392
|
>({
|
|
393
|
+
security: [
|
|
394
|
+
{
|
|
395
|
+
name: "x-api-token",
|
|
396
|
+
type: "apiKey",
|
|
397
|
+
},
|
|
398
|
+
],
|
|
371
399
|
url: "/missions",
|
|
372
400
|
...options,
|
|
373
401
|
headers: {
|
package/src/client/types.gen.ts
CHANGED
|
@@ -6,18 +6,36 @@ export type CreateApiTokenResponseDto = {
|
|
|
6
6
|
deleted_at: Date;
|
|
7
7
|
last_used: Date;
|
|
8
8
|
org: number;
|
|
9
|
-
scopes: Array<
|
|
9
|
+
scopes: Array<
|
|
10
|
+
| "manageTokens"
|
|
11
|
+
| "manageFlights"
|
|
12
|
+
| "manageMissions"
|
|
13
|
+
| "manageWebhooks"
|
|
14
|
+
| "all"
|
|
15
|
+
>;
|
|
10
16
|
};
|
|
11
17
|
|
|
12
18
|
export type CreateApiTokenRequestDto = {
|
|
13
19
|
name: string;
|
|
14
|
-
scopes: Array<
|
|
20
|
+
scopes: Array<
|
|
21
|
+
| "manageTokens"
|
|
22
|
+
| "manageFlights"
|
|
23
|
+
| "manageMissions"
|
|
24
|
+
| "manageWebhooks"
|
|
25
|
+
| "all"
|
|
26
|
+
>;
|
|
15
27
|
orgId: number;
|
|
16
28
|
};
|
|
17
29
|
|
|
18
30
|
export type UpdateApiTokenRequestDto = {
|
|
19
31
|
name?: string;
|
|
20
|
-
scopes?: Array<
|
|
32
|
+
scopes?: Array<
|
|
33
|
+
| "manageTokens"
|
|
34
|
+
| "manageFlights"
|
|
35
|
+
| "manageMissions"
|
|
36
|
+
| "manageWebhooks"
|
|
37
|
+
| "all"
|
|
38
|
+
>;
|
|
21
39
|
};
|
|
22
40
|
|
|
23
41
|
export type UpdateApiTokenResponseDto = {
|
|
@@ -26,7 +44,13 @@ export type UpdateApiTokenResponseDto = {
|
|
|
26
44
|
deleted_at: Date;
|
|
27
45
|
last_used: Date;
|
|
28
46
|
org: number;
|
|
29
|
-
scopes: Array<
|
|
47
|
+
scopes: Array<
|
|
48
|
+
| "manageTokens"
|
|
49
|
+
| "manageFlights"
|
|
50
|
+
| "manageMissions"
|
|
51
|
+
| "manageWebhooks"
|
|
52
|
+
| "all"
|
|
53
|
+
>;
|
|
30
54
|
};
|
|
31
55
|
|
|
32
56
|
export type GetTimeLimitsForSunAltitudeResponse = {
|
|
@@ -298,6 +322,17 @@ export type ApiControllerGetHelloResponses = {
|
|
|
298
322
|
200: unknown;
|
|
299
323
|
};
|
|
300
324
|
|
|
325
|
+
export type ApiControllerGetErrorData = {
|
|
326
|
+
body?: never;
|
|
327
|
+
path?: never;
|
|
328
|
+
query?: never;
|
|
329
|
+
url: "/debug-sentry";
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
export type ApiControllerGetErrorResponses = {
|
|
333
|
+
200: unknown;
|
|
334
|
+
};
|
|
335
|
+
|
|
301
336
|
export type ApiTokenControllerCreateTokenData = {
|
|
302
337
|
body: CreateApiTokenRequestDto;
|
|
303
338
|
path?: never;
|
|
@@ -525,6 +560,7 @@ export type MissionsControllerCreateMissionsErrors = {
|
|
|
525
560
|
* Validation failed - invalid Zones, mission types, or times
|
|
526
561
|
*/
|
|
527
562
|
400: unknown;
|
|
563
|
+
401: unknown;
|
|
528
564
|
/**
|
|
529
565
|
* Insufficient treasury spending limit
|
|
530
566
|
*/
|
|
@@ -552,6 +588,11 @@ export type MissionsControllerUpdateMissionsData = {
|
|
|
552
588
|
url: "/missions";
|
|
553
589
|
};
|
|
554
590
|
|
|
591
|
+
export type MissionsControllerUpdateMissionsErrors = {
|
|
592
|
+
401: unknown;
|
|
593
|
+
403: unknown;
|
|
594
|
+
};
|
|
595
|
+
|
|
555
596
|
export type MissionsControllerUpdateMissionsResponses = {
|
|
556
597
|
/**
|
|
557
598
|
* Missions update transaction queued successfully
|
package/src/event/types.gen.ts
CHANGED
|
@@ -7,14 +7,14 @@ export const Event = z.union([
|
|
|
7
7
|
id: z.string(),
|
|
8
8
|
event_type: z.literal("test"),
|
|
9
9
|
timestamp: z.string(),
|
|
10
|
-
data: z.object({ message: z.string() }).
|
|
10
|
+
data: z.object({ message: z.string() }).catchall(z.any()),
|
|
11
11
|
})
|
|
12
|
-
.
|
|
12
|
+
.catchall(z.any()),
|
|
13
13
|
z
|
|
14
14
|
.object({
|
|
15
|
-
id: z.
|
|
15
|
+
id: z.string(),
|
|
16
16
|
event_type: z.literal("protocol.mission.created"),
|
|
17
|
-
timestamp: z.
|
|
17
|
+
timestamp: z.string(),
|
|
18
18
|
data: z
|
|
19
19
|
.object({
|
|
20
20
|
id: z
|
|
@@ -28,18 +28,19 @@ export const Event = z.union([
|
|
|
28
28
|
.transform((wire) => BigInt(wire.value)),
|
|
29
29
|
zoneId: z.string(),
|
|
30
30
|
flightPlanId: z.number(),
|
|
31
|
+
campaigns: z.array(z.string()),
|
|
31
32
|
captureStartTime: z.string().datetime({ offset: true }),
|
|
32
33
|
captureEndTime: z.string().datetime({ offset: true }),
|
|
33
34
|
requestor: z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$")),
|
|
34
35
|
})
|
|
35
|
-
.
|
|
36
|
+
.catchall(z.any()),
|
|
36
37
|
})
|
|
37
|
-
.
|
|
38
|
+
.catchall(z.any()),
|
|
38
39
|
z
|
|
39
40
|
.object({
|
|
40
|
-
id: z.
|
|
41
|
+
id: z.string(),
|
|
41
42
|
event_type: z.literal("protocol.mission.updated"),
|
|
42
|
-
timestamp: z.
|
|
43
|
+
timestamp: z.string(),
|
|
43
44
|
data: z
|
|
44
45
|
.object({
|
|
45
46
|
id: z
|
|
@@ -50,18 +51,19 @@ export const Event = z.union([
|
|
|
50
51
|
.transform((wire) => BigInt(wire.value))
|
|
51
52
|
.optional(),
|
|
52
53
|
isOpen: z.boolean().optional(),
|
|
54
|
+
campaigns: z.array(z.string()).optional(),
|
|
53
55
|
})
|
|
54
|
-
.
|
|
56
|
+
.catchall(z.any()),
|
|
55
57
|
})
|
|
56
|
-
.
|
|
58
|
+
.catchall(z.any()),
|
|
57
59
|
z
|
|
58
60
|
.object({
|
|
59
|
-
id: z.
|
|
61
|
+
id: z.string(),
|
|
60
62
|
event_type: z.literal("protocol.mission.paid"),
|
|
61
|
-
timestamp: z.
|
|
63
|
+
timestamp: z.string(),
|
|
62
64
|
data: z
|
|
63
65
|
.object({
|
|
64
|
-
recipient: z.
|
|
66
|
+
recipient: z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$")),
|
|
65
67
|
flightId: z
|
|
66
68
|
.object({ __type: z.literal("bigint"), value: z.string() })
|
|
67
69
|
.transform((wire) => BigInt(wire.value)),
|
|
@@ -74,15 +76,16 @@ export const Event = z.union([
|
|
|
74
76
|
amount: z
|
|
75
77
|
.object({ __type: z.literal("bigint"), value: z.string() })
|
|
76
78
|
.transform((wire) => BigInt(wire.value)),
|
|
79
|
+
storageKey: z.string(),
|
|
77
80
|
})
|
|
78
|
-
.
|
|
81
|
+
.catchall(z.any()),
|
|
79
82
|
})
|
|
80
|
-
.
|
|
83
|
+
.catchall(z.any()),
|
|
81
84
|
z
|
|
82
85
|
.object({
|
|
83
|
-
id: z.
|
|
86
|
+
id: z.string(),
|
|
84
87
|
event_type: z.literal("protocol.flight.submitted"),
|
|
85
|
-
timestamp: z.
|
|
88
|
+
timestamp: z.string(),
|
|
86
89
|
data: z
|
|
87
90
|
.object({
|
|
88
91
|
storageKey: z.string(),
|
|
@@ -92,20 +95,20 @@ export const Event = z.union([
|
|
|
92
95
|
.object({ __type: z.literal("bigint"), value: z.string() })
|
|
93
96
|
.transform((wire) => BigInt(wire.value)),
|
|
94
97
|
})
|
|
95
|
-
.
|
|
98
|
+
.catchall(z.any()),
|
|
96
99
|
})
|
|
97
|
-
.
|
|
100
|
+
.catchall(z.any()),
|
|
98
101
|
z
|
|
99
102
|
.object({
|
|
100
|
-
id: z.
|
|
103
|
+
id: z.string(),
|
|
101
104
|
event_type: z.literal("protocol.flight.reviewed"),
|
|
102
|
-
timestamp: z.
|
|
105
|
+
timestamp: z.string(),
|
|
103
106
|
data: z
|
|
104
107
|
.object({
|
|
105
108
|
flightId: z
|
|
106
109
|
.object({ __type: z.literal("bigint"), value: z.string() })
|
|
107
110
|
.transform((wire) => BigInt(wire.value)),
|
|
108
|
-
owner: z.
|
|
111
|
+
owner: z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$")),
|
|
109
112
|
isApproved: z.boolean(),
|
|
110
113
|
validationLogUri: z.string(),
|
|
111
114
|
validator: z.string(),
|
|
@@ -115,9 +118,9 @@ export const Event = z.union([
|
|
|
115
118
|
.object({ __type: z.literal("bigint"), value: z.string() })
|
|
116
119
|
.transform((wire) => BigInt(wire.value)),
|
|
117
120
|
})
|
|
118
|
-
.
|
|
121
|
+
.catchall(z.any()),
|
|
119
122
|
})
|
|
120
|
-
.
|
|
123
|
+
.catchall(z.any()),
|
|
121
124
|
]);
|
|
122
125
|
export type Event = z.infer<typeof Event>;
|
|
123
126
|
|