@layer-drone/protocol 2.3.0 → 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/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.3.0",
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/typescript-config": "0.0.0",
39
- "@layer-drone/event-schema": "0.0.0"
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"
@@ -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;
@@ -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
+ >;