@layer-drone/protocol 2.3.1 → 2.4.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.d.mts +797 -6
- package/dist/index.d.ts +797 -6
- package/dist/index.js +88 -0
- package/dist/index.mjs +88 -0
- package/package.json +3 -3
- package/src/client/types.gen.ts +26 -0
- package/src/event/types.gen.ts +105 -0
package/dist/index.js
CHANGED
|
@@ -4031,6 +4031,94 @@ var Event = import_zod.z.union([
|
|
|
4031
4031
|
}).optional()
|
|
4032
4032
|
}).catchall(import_zod.z.any()).optional()
|
|
4033
4033
|
}).catchall(import_zod.z.any())
|
|
4034
|
+
}).catchall(import_zod.z.any()),
|
|
4035
|
+
import_zod.z.object({
|
|
4036
|
+
id: import_zod.z.string(),
|
|
4037
|
+
event_type: import_zod.z.literal("fulfillment.reservation"),
|
|
4038
|
+
timestamp: import_zod.z.string(),
|
|
4039
|
+
data: import_zod.z.object({
|
|
4040
|
+
version: import_zod.z.literal(1),
|
|
4041
|
+
data: import_zod.z.object({
|
|
4042
|
+
id: import_zod.z.string().uuid(),
|
|
4043
|
+
missionId: import_zod.z.string().uuid(),
|
|
4044
|
+
missionHoldId: import_zod.z.string().uuid(),
|
|
4045
|
+
pilotAddress: import_zod.z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$")),
|
|
4046
|
+
status: import_zod.z.enum([
|
|
4047
|
+
"active",
|
|
4048
|
+
"completed",
|
|
4049
|
+
"cancelled",
|
|
4050
|
+
"expired"
|
|
4051
|
+
]),
|
|
4052
|
+
endedAt: import_zod.z.union([
|
|
4053
|
+
import_zod.z.string().datetime({
|
|
4054
|
+
offset: true
|
|
4055
|
+
}),
|
|
4056
|
+
import_zod.z.null()
|
|
4057
|
+
]),
|
|
4058
|
+
createdAt: import_zod.z.string().datetime({
|
|
4059
|
+
offset: true
|
|
4060
|
+
}),
|
|
4061
|
+
updatedAt: import_zod.z.string().datetime({
|
|
4062
|
+
offset: true
|
|
4063
|
+
})
|
|
4064
|
+
}).catchall(import_zod.z.any()),
|
|
4065
|
+
changes: import_zod.z.array(import_zod.z.enum([
|
|
4066
|
+
"id",
|
|
4067
|
+
"missionId",
|
|
4068
|
+
"missionHoldId",
|
|
4069
|
+
"pilotAddress",
|
|
4070
|
+
"status",
|
|
4071
|
+
"endedAt",
|
|
4072
|
+
"createdAt",
|
|
4073
|
+
"updatedAt"
|
|
4074
|
+
])).optional()
|
|
4075
|
+
}).catchall(import_zod.z.any())
|
|
4076
|
+
}).catchall(import_zod.z.any()),
|
|
4077
|
+
import_zod.z.object({
|
|
4078
|
+
id: import_zod.z.string(),
|
|
4079
|
+
event_type: import_zod.z.literal("fulfillment.mission-hold"),
|
|
4080
|
+
timestamp: import_zod.z.string(),
|
|
4081
|
+
data: import_zod.z.object({
|
|
4082
|
+
version: import_zod.z.literal(1),
|
|
4083
|
+
data: import_zod.z.object({
|
|
4084
|
+
id: import_zod.z.string().uuid(),
|
|
4085
|
+
missionId: import_zod.z.string().uuid(),
|
|
4086
|
+
pilotAddress: import_zod.z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$")),
|
|
4087
|
+
expiresAt: import_zod.z.string().datetime({
|
|
4088
|
+
offset: true
|
|
4089
|
+
}),
|
|
4090
|
+
releasedAt: import_zod.z.union([
|
|
4091
|
+
import_zod.z.string().datetime({
|
|
4092
|
+
offset: true
|
|
4093
|
+
}),
|
|
4094
|
+
import_zod.z.null()
|
|
4095
|
+
]),
|
|
4096
|
+
releasedReason: import_zod.z.union([
|
|
4097
|
+
import_zod.z.enum([
|
|
4098
|
+
"expired",
|
|
4099
|
+
"completed",
|
|
4100
|
+
"cancelled"
|
|
4101
|
+
]),
|
|
4102
|
+
import_zod.z.null()
|
|
4103
|
+
]),
|
|
4104
|
+
createdAt: import_zod.z.string().datetime({
|
|
4105
|
+
offset: true
|
|
4106
|
+
}),
|
|
4107
|
+
updatedAt: import_zod.z.string().datetime({
|
|
4108
|
+
offset: true
|
|
4109
|
+
})
|
|
4110
|
+
}).catchall(import_zod.z.any()),
|
|
4111
|
+
changes: import_zod.z.array(import_zod.z.enum([
|
|
4112
|
+
"id",
|
|
4113
|
+
"missionId",
|
|
4114
|
+
"pilotAddress",
|
|
4115
|
+
"expiresAt",
|
|
4116
|
+
"releasedAt",
|
|
4117
|
+
"releasedReason",
|
|
4118
|
+
"createdAt",
|
|
4119
|
+
"updatedAt"
|
|
4120
|
+
])).optional()
|
|
4121
|
+
}).catchall(import_zod.z.any())
|
|
4034
4122
|
}).catchall(import_zod.z.any())
|
|
4035
4123
|
]);
|
|
4036
4124
|
|
package/dist/index.mjs
CHANGED
|
@@ -3838,6 +3838,94 @@ var Event = z.union([
|
|
|
3838
3838
|
}).optional()
|
|
3839
3839
|
}).catchall(z.any()).optional()
|
|
3840
3840
|
}).catchall(z.any())
|
|
3841
|
+
}).catchall(z.any()),
|
|
3842
|
+
z.object({
|
|
3843
|
+
id: z.string(),
|
|
3844
|
+
event_type: z.literal("fulfillment.reservation"),
|
|
3845
|
+
timestamp: z.string(),
|
|
3846
|
+
data: z.object({
|
|
3847
|
+
version: z.literal(1),
|
|
3848
|
+
data: z.object({
|
|
3849
|
+
id: z.string().uuid(),
|
|
3850
|
+
missionId: z.string().uuid(),
|
|
3851
|
+
missionHoldId: z.string().uuid(),
|
|
3852
|
+
pilotAddress: z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$")),
|
|
3853
|
+
status: z.enum([
|
|
3854
|
+
"active",
|
|
3855
|
+
"completed",
|
|
3856
|
+
"cancelled",
|
|
3857
|
+
"expired"
|
|
3858
|
+
]),
|
|
3859
|
+
endedAt: z.union([
|
|
3860
|
+
z.string().datetime({
|
|
3861
|
+
offset: true
|
|
3862
|
+
}),
|
|
3863
|
+
z.null()
|
|
3864
|
+
]),
|
|
3865
|
+
createdAt: z.string().datetime({
|
|
3866
|
+
offset: true
|
|
3867
|
+
}),
|
|
3868
|
+
updatedAt: z.string().datetime({
|
|
3869
|
+
offset: true
|
|
3870
|
+
})
|
|
3871
|
+
}).catchall(z.any()),
|
|
3872
|
+
changes: z.array(z.enum([
|
|
3873
|
+
"id",
|
|
3874
|
+
"missionId",
|
|
3875
|
+
"missionHoldId",
|
|
3876
|
+
"pilotAddress",
|
|
3877
|
+
"status",
|
|
3878
|
+
"endedAt",
|
|
3879
|
+
"createdAt",
|
|
3880
|
+
"updatedAt"
|
|
3881
|
+
])).optional()
|
|
3882
|
+
}).catchall(z.any())
|
|
3883
|
+
}).catchall(z.any()),
|
|
3884
|
+
z.object({
|
|
3885
|
+
id: z.string(),
|
|
3886
|
+
event_type: z.literal("fulfillment.mission-hold"),
|
|
3887
|
+
timestamp: z.string(),
|
|
3888
|
+
data: z.object({
|
|
3889
|
+
version: z.literal(1),
|
|
3890
|
+
data: z.object({
|
|
3891
|
+
id: z.string().uuid(),
|
|
3892
|
+
missionId: z.string().uuid(),
|
|
3893
|
+
pilotAddress: z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$")),
|
|
3894
|
+
expiresAt: z.string().datetime({
|
|
3895
|
+
offset: true
|
|
3896
|
+
}),
|
|
3897
|
+
releasedAt: z.union([
|
|
3898
|
+
z.string().datetime({
|
|
3899
|
+
offset: true
|
|
3900
|
+
}),
|
|
3901
|
+
z.null()
|
|
3902
|
+
]),
|
|
3903
|
+
releasedReason: z.union([
|
|
3904
|
+
z.enum([
|
|
3905
|
+
"expired",
|
|
3906
|
+
"completed",
|
|
3907
|
+
"cancelled"
|
|
3908
|
+
]),
|
|
3909
|
+
z.null()
|
|
3910
|
+
]),
|
|
3911
|
+
createdAt: z.string().datetime({
|
|
3912
|
+
offset: true
|
|
3913
|
+
}),
|
|
3914
|
+
updatedAt: z.string().datetime({
|
|
3915
|
+
offset: true
|
|
3916
|
+
})
|
|
3917
|
+
}).catchall(z.any()),
|
|
3918
|
+
changes: z.array(z.enum([
|
|
3919
|
+
"id",
|
|
3920
|
+
"missionId",
|
|
3921
|
+
"pilotAddress",
|
|
3922
|
+
"expiresAt",
|
|
3923
|
+
"releasedAt",
|
|
3924
|
+
"releasedReason",
|
|
3925
|
+
"createdAt",
|
|
3926
|
+
"updatedAt"
|
|
3927
|
+
])).optional()
|
|
3928
|
+
}).catchall(z.any())
|
|
3841
3929
|
}).catchall(z.any())
|
|
3842
3930
|
]);
|
|
3843
3931
|
|
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": "2.
|
|
4
|
+
"version": "2.4.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"zod": "^3.24.2",
|
|
36
36
|
"zod-to-json-schema": "^3.24.5",
|
|
37
37
|
"@layer-drone/eslint-config": "0.0.0",
|
|
38
|
-
"@layer-drone/
|
|
39
|
-
"@layer-drone/
|
|
38
|
+
"@layer-drone/event-schema": "0.0.0",
|
|
39
|
+
"@layer-drone/typescript-config": "0.0.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"zod": "^3.x.x"
|
package/src/client/types.gen.ts
CHANGED
|
@@ -1005,6 +1005,9 @@ export type CreateVaultsResponseDto = {
|
|
|
1005
1005
|
export type CreateWebhookBody = {
|
|
1006
1006
|
name: string;
|
|
1007
1007
|
url: string;
|
|
1008
|
+
/**
|
|
1009
|
+
* "*" subscribes to every event type except the transitional fulfillment.reservation and fulfillment.mission-hold, which are delivered only when named and will be removed once Pilot API MVT indexing moves to LayerDrone.
|
|
1010
|
+
*/
|
|
1008
1011
|
event_types: Array<
|
|
1009
1012
|
| "test"
|
|
1010
1013
|
| "protocol.mission.created"
|
|
@@ -1013,6 +1016,8 @@ export type CreateWebhookBody = {
|
|
|
1013
1016
|
| "protocol.flight.submitted"
|
|
1014
1017
|
| "protocol.flight.reviewed"
|
|
1015
1018
|
| "protocol.zone"
|
|
1019
|
+
| "fulfillment.reservation"
|
|
1020
|
+
| "fulfillment.mission-hold"
|
|
1016
1021
|
| "*"
|
|
1017
1022
|
>;
|
|
1018
1023
|
active: boolean;
|
|
@@ -1027,6 +1032,9 @@ export type GetWebhooksResponse = Array<{
|
|
|
1027
1032
|
id: number;
|
|
1028
1033
|
name: string;
|
|
1029
1034
|
url: string;
|
|
1035
|
+
/**
|
|
1036
|
+
* "*" subscribes to every event type except the transitional fulfillment.reservation and fulfillment.mission-hold, which are delivered only when named and will be removed once Pilot API MVT indexing moves to LayerDrone.
|
|
1037
|
+
*/
|
|
1030
1038
|
event_types: Array<
|
|
1031
1039
|
| "test"
|
|
1032
1040
|
| "protocol.mission.created"
|
|
@@ -1035,6 +1043,8 @@ export type GetWebhooksResponse = Array<{
|
|
|
1035
1043
|
| "protocol.flight.submitted"
|
|
1036
1044
|
| "protocol.flight.reviewed"
|
|
1037
1045
|
| "protocol.zone"
|
|
1046
|
+
| "fulfillment.reservation"
|
|
1047
|
+
| "fulfillment.mission-hold"
|
|
1038
1048
|
| "*"
|
|
1039
1049
|
>;
|
|
1040
1050
|
active: boolean;
|
|
@@ -1049,6 +1059,9 @@ export type GetWebhookResponse = {
|
|
|
1049
1059
|
id: number;
|
|
1050
1060
|
name: string;
|
|
1051
1061
|
url: string;
|
|
1062
|
+
/**
|
|
1063
|
+
* "*" subscribes to every event type except the transitional fulfillment.reservation and fulfillment.mission-hold, which are delivered only when named and will be removed once Pilot API MVT indexing moves to LayerDrone.
|
|
1064
|
+
*/
|
|
1052
1065
|
event_types: Array<
|
|
1053
1066
|
| "test"
|
|
1054
1067
|
| "protocol.mission.created"
|
|
@@ -1057,6 +1070,8 @@ export type GetWebhookResponse = {
|
|
|
1057
1070
|
| "protocol.flight.submitted"
|
|
1058
1071
|
| "protocol.flight.reviewed"
|
|
1059
1072
|
| "protocol.zone"
|
|
1073
|
+
| "fulfillment.reservation"
|
|
1074
|
+
| "fulfillment.mission-hold"
|
|
1060
1075
|
| "*"
|
|
1061
1076
|
>;
|
|
1062
1077
|
active: boolean;
|
|
@@ -1070,6 +1085,9 @@ export type GetWebhookResponse = {
|
|
|
1070
1085
|
export type UpdateWebhookBody = {
|
|
1071
1086
|
name?: string;
|
|
1072
1087
|
url?: string;
|
|
1088
|
+
/**
|
|
1089
|
+
* "*" subscribes to every event type except the transitional fulfillment.reservation and fulfillment.mission-hold, which are delivered only when named and will be removed once Pilot API MVT indexing moves to LayerDrone.
|
|
1090
|
+
*/
|
|
1073
1091
|
event_types?: Array<
|
|
1074
1092
|
| "test"
|
|
1075
1093
|
| "protocol.mission.created"
|
|
@@ -1078,6 +1096,8 @@ export type UpdateWebhookBody = {
|
|
|
1078
1096
|
| "protocol.flight.submitted"
|
|
1079
1097
|
| "protocol.flight.reviewed"
|
|
1080
1098
|
| "protocol.zone"
|
|
1099
|
+
| "fulfillment.reservation"
|
|
1100
|
+
| "fulfillment.mission-hold"
|
|
1081
1101
|
| "*"
|
|
1082
1102
|
>;
|
|
1083
1103
|
active?: boolean;
|
|
@@ -1087,6 +1107,9 @@ export type UpdateWebhookResponse = {
|
|
|
1087
1107
|
id: number;
|
|
1088
1108
|
name: string;
|
|
1089
1109
|
url: string;
|
|
1110
|
+
/**
|
|
1111
|
+
* "*" subscribes to every event type except the transitional fulfillment.reservation and fulfillment.mission-hold, which are delivered only when named and will be removed once Pilot API MVT indexing moves to LayerDrone.
|
|
1112
|
+
*/
|
|
1090
1113
|
event_types: Array<
|
|
1091
1114
|
| "test"
|
|
1092
1115
|
| "protocol.mission.created"
|
|
@@ -1095,6 +1118,8 @@ export type UpdateWebhookResponse = {
|
|
|
1095
1118
|
| "protocol.flight.submitted"
|
|
1096
1119
|
| "protocol.flight.reviewed"
|
|
1097
1120
|
| "protocol.zone"
|
|
1121
|
+
| "fulfillment.reservation"
|
|
1122
|
+
| "fulfillment.mission-hold"
|
|
1098
1123
|
| "*"
|
|
1099
1124
|
>;
|
|
1100
1125
|
active: boolean;
|
|
@@ -1450,6 +1475,7 @@ export type FlightPathIntendedResponse = {
|
|
|
1450
1475
|
id: string;
|
|
1451
1476
|
slug?: string | null;
|
|
1452
1477
|
name?: string;
|
|
1478
|
+
family?: "Map" | "Multi Panorama" | "Panorama" | "Grid Map" | "Hybrid";
|
|
1453
1479
|
};
|
|
1454
1480
|
zoneHash: string;
|
|
1455
1481
|
imageCount: number;
|
package/src/event/types.gen.ts
CHANGED
|
@@ -169,6 +169,91 @@ export const Event = z.union([
|
|
|
169
169
|
.catchall(z.any()),
|
|
170
170
|
})
|
|
171
171
|
.catchall(z.any()),
|
|
172
|
+
z
|
|
173
|
+
.object({
|
|
174
|
+
id: z.string(),
|
|
175
|
+
event_type: z.literal("fulfillment.reservation"),
|
|
176
|
+
timestamp: z.string(),
|
|
177
|
+
data: z
|
|
178
|
+
.object({
|
|
179
|
+
version: z.literal(1),
|
|
180
|
+
data: z
|
|
181
|
+
.object({
|
|
182
|
+
id: z.string().uuid(),
|
|
183
|
+
missionId: z.string().uuid(),
|
|
184
|
+
missionHoldId: z.string().uuid(),
|
|
185
|
+
pilotAddress: z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$")),
|
|
186
|
+
status: z.enum(["active", "completed", "cancelled", "expired"]),
|
|
187
|
+
endedAt: z.union([
|
|
188
|
+
z.string().datetime({ offset: true }),
|
|
189
|
+
z.null(),
|
|
190
|
+
]),
|
|
191
|
+
createdAt: z.string().datetime({ offset: true }),
|
|
192
|
+
updatedAt: z.string().datetime({ offset: true }),
|
|
193
|
+
})
|
|
194
|
+
.catchall(z.any()),
|
|
195
|
+
changes: z
|
|
196
|
+
.array(
|
|
197
|
+
z.enum([
|
|
198
|
+
"id",
|
|
199
|
+
"missionId",
|
|
200
|
+
"missionHoldId",
|
|
201
|
+
"pilotAddress",
|
|
202
|
+
"status",
|
|
203
|
+
"endedAt",
|
|
204
|
+
"createdAt",
|
|
205
|
+
"updatedAt",
|
|
206
|
+
]),
|
|
207
|
+
)
|
|
208
|
+
.optional(),
|
|
209
|
+
})
|
|
210
|
+
.catchall(z.any()),
|
|
211
|
+
})
|
|
212
|
+
.catchall(z.any()),
|
|
213
|
+
z
|
|
214
|
+
.object({
|
|
215
|
+
id: z.string(),
|
|
216
|
+
event_type: z.literal("fulfillment.mission-hold"),
|
|
217
|
+
timestamp: z.string(),
|
|
218
|
+
data: z
|
|
219
|
+
.object({
|
|
220
|
+
version: z.literal(1),
|
|
221
|
+
data: z
|
|
222
|
+
.object({
|
|
223
|
+
id: z.string().uuid(),
|
|
224
|
+
missionId: z.string().uuid(),
|
|
225
|
+
pilotAddress: z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$")),
|
|
226
|
+
expiresAt: z.string().datetime({ offset: true }),
|
|
227
|
+
releasedAt: z.union([
|
|
228
|
+
z.string().datetime({ offset: true }),
|
|
229
|
+
z.null(),
|
|
230
|
+
]),
|
|
231
|
+
releasedReason: z.union([
|
|
232
|
+
z.enum(["expired", "completed", "cancelled"]),
|
|
233
|
+
z.null(),
|
|
234
|
+
]),
|
|
235
|
+
createdAt: z.string().datetime({ offset: true }),
|
|
236
|
+
updatedAt: z.string().datetime({ offset: true }),
|
|
237
|
+
})
|
|
238
|
+
.catchall(z.any()),
|
|
239
|
+
changes: z
|
|
240
|
+
.array(
|
|
241
|
+
z.enum([
|
|
242
|
+
"id",
|
|
243
|
+
"missionId",
|
|
244
|
+
"pilotAddress",
|
|
245
|
+
"expiresAt",
|
|
246
|
+
"releasedAt",
|
|
247
|
+
"releasedReason",
|
|
248
|
+
"createdAt",
|
|
249
|
+
"updatedAt",
|
|
250
|
+
]),
|
|
251
|
+
)
|
|
252
|
+
.optional(),
|
|
253
|
+
})
|
|
254
|
+
.catchall(z.any()),
|
|
255
|
+
})
|
|
256
|
+
.catchall(z.any()),
|
|
172
257
|
]);
|
|
173
258
|
export type Event = z.infer<typeof Event>;
|
|
174
259
|
|
|
@@ -194,3 +279,23 @@ export type FlightReviewedEvent = Extract<
|
|
|
194
279
|
{ event_type: "protocol.flight.reviewed" }
|
|
195
280
|
>;
|
|
196
281
|
export type ZoneEvent = Extract<Event, { event_type: "protocol.zone" }>;
|
|
282
|
+
/**
|
|
283
|
+
* @deprecated Transitional - for Pilot API MVT indexing only, and removed once
|
|
284
|
+
* MVT generation moves to LayerDrone. Not delivered through "*": a webhook
|
|
285
|
+
* must subscribe to it by name. Delivery is at most once, so do not treat it
|
|
286
|
+
* as a source of truth.
|
|
287
|
+
*/
|
|
288
|
+
export type FulfillmentReservationEvent = Extract<
|
|
289
|
+
Event,
|
|
290
|
+
{ event_type: "fulfillment.reservation" }
|
|
291
|
+
>;
|
|
292
|
+
/**
|
|
293
|
+
* @deprecated Transitional - for Pilot API MVT indexing only, and removed once
|
|
294
|
+
* MVT generation moves to LayerDrone. Not delivered through "*": a webhook
|
|
295
|
+
* must subscribe to it by name. Delivery is at most once, so do not treat it
|
|
296
|
+
* as a source of truth.
|
|
297
|
+
*/
|
|
298
|
+
export type FulfillmentMissionHoldEvent = Extract<
|
|
299
|
+
Event,
|
|
300
|
+
{ event_type: "fulfillment.mission-hold" }
|
|
301
|
+
>;
|