@layer-drone/protocol 0.0.16 → 0.0.18-alpha
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/README.md +43 -0
- package/dist/index.d.mts +427 -255
- package/dist/index.d.ts +427 -255
- package/dist/index.js +125 -93
- package/dist/index.mjs +123 -90
- package/package.json +7 -2
- package/src/client/client/client.ts +5 -1
- package/src/client/sdk.gen.ts +119 -143
- package/src/client/transformers.gen.ts +13 -0
- package/src/client/types.gen.ts +231 -269
- package/src/event/types.gen.ts +57 -21
package/src/event/types.gen.ts
CHANGED
|
@@ -10,21 +10,6 @@ export const Event = z.union([
|
|
|
10
10
|
data: z.object({ message: z.string() }).strict(),
|
|
11
11
|
})
|
|
12
12
|
.strict(),
|
|
13
|
-
z
|
|
14
|
-
.object({
|
|
15
|
-
id: z.any(),
|
|
16
|
-
event_type: z.literal("protocol.flight.submitted"),
|
|
17
|
-
timestamp: z.any(),
|
|
18
|
-
data: z
|
|
19
|
-
.object({
|
|
20
|
-
flightId: z.number(),
|
|
21
|
-
pilotAddress: z.string(),
|
|
22
|
-
flightManifestUri: z.string(),
|
|
23
|
-
missionId: z.number(),
|
|
24
|
-
})
|
|
25
|
-
.strict(),
|
|
26
|
-
})
|
|
27
|
-
.strict(),
|
|
28
13
|
z
|
|
29
14
|
.object({
|
|
30
15
|
id: z.any(),
|
|
@@ -45,7 +30,6 @@ export const Event = z.union([
|
|
|
45
30
|
flightPlanId: z.number(),
|
|
46
31
|
captureStartTime: z.string().datetime({ offset: true }),
|
|
47
32
|
captureEndTime: z.string().datetime({ offset: true }),
|
|
48
|
-
detailsHash: z.string(),
|
|
49
33
|
requestor: z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$")),
|
|
50
34
|
})
|
|
51
35
|
.strict(),
|
|
@@ -70,6 +54,47 @@ export const Event = z.union([
|
|
|
70
54
|
.strict(),
|
|
71
55
|
})
|
|
72
56
|
.strict(),
|
|
57
|
+
z
|
|
58
|
+
.object({
|
|
59
|
+
id: z.any(),
|
|
60
|
+
event_type: z.literal("protocol.mission.paid"),
|
|
61
|
+
timestamp: z.any(),
|
|
62
|
+
data: z
|
|
63
|
+
.object({
|
|
64
|
+
recipient: z.any(),
|
|
65
|
+
flightId: z
|
|
66
|
+
.object({ __type: z.literal("bigint"), value: z.string() })
|
|
67
|
+
.transform((wire) => BigInt(wire.value)),
|
|
68
|
+
missionId: z
|
|
69
|
+
.object({ __type: z.literal("bigint"), value: z.string() })
|
|
70
|
+
.transform((wire) => BigInt(wire.value)),
|
|
71
|
+
vaultId: z
|
|
72
|
+
.object({ __type: z.literal("bigint"), value: z.string() })
|
|
73
|
+
.transform((wire) => BigInt(wire.value)),
|
|
74
|
+
amount: z
|
|
75
|
+
.object({ __type: z.literal("bigint"), value: z.string() })
|
|
76
|
+
.transform((wire) => BigInt(wire.value)),
|
|
77
|
+
})
|
|
78
|
+
.strict(),
|
|
79
|
+
})
|
|
80
|
+
.strict(),
|
|
81
|
+
z
|
|
82
|
+
.object({
|
|
83
|
+
id: z.any(),
|
|
84
|
+
event_type: z.literal("protocol.flight.submitted"),
|
|
85
|
+
timestamp: z.any(),
|
|
86
|
+
data: z
|
|
87
|
+
.object({
|
|
88
|
+
storageKey: z.string(),
|
|
89
|
+
pilotAddress: z.string(),
|
|
90
|
+
flightManifestUri: z.string(),
|
|
91
|
+
missionId: z
|
|
92
|
+
.object({ __type: z.literal("bigint"), value: z.string() })
|
|
93
|
+
.transform((wire) => BigInt(wire.value)),
|
|
94
|
+
})
|
|
95
|
+
.strict(),
|
|
96
|
+
})
|
|
97
|
+
.strict(),
|
|
73
98
|
z
|
|
74
99
|
.object({
|
|
75
100
|
id: z.any(),
|
|
@@ -77,11 +102,18 @@ export const Event = z.union([
|
|
|
77
102
|
timestamp: z.any(),
|
|
78
103
|
data: z
|
|
79
104
|
.object({
|
|
80
|
-
flightId: z
|
|
105
|
+
flightId: z
|
|
106
|
+
.object({ __type: z.literal("bigint"), value: z.string() })
|
|
107
|
+
.transform((wire) => BigInt(wire.value)),
|
|
108
|
+
owner: z.any(),
|
|
81
109
|
isApproved: z.boolean(),
|
|
82
110
|
validationLogUri: z.string(),
|
|
83
111
|
validator: z.string(),
|
|
84
112
|
filesHash: z.string(),
|
|
113
|
+
storageKey: z.string(),
|
|
114
|
+
missionId: z
|
|
115
|
+
.object({ __type: z.literal("bigint"), value: z.string() })
|
|
116
|
+
.transform((wire) => BigInt(wire.value)),
|
|
85
117
|
})
|
|
86
118
|
.strict(),
|
|
87
119
|
})
|
|
@@ -90,10 +122,6 @@ export const Event = z.union([
|
|
|
90
122
|
export type Event = z.infer<typeof Event>;
|
|
91
123
|
|
|
92
124
|
export type TestEvent = Extract<Event, { event_type: "test" }>;
|
|
93
|
-
export type FlightSubmittedEvent = Extract<
|
|
94
|
-
Event,
|
|
95
|
-
{ event_type: "protocol.flight.submitted" }
|
|
96
|
-
>;
|
|
97
125
|
export type MissionCreatedEvent = Extract<
|
|
98
126
|
Event,
|
|
99
127
|
{ event_type: "protocol.mission.created" }
|
|
@@ -102,6 +130,14 @@ export type MissionUpdatedEvent = Extract<
|
|
|
102
130
|
Event,
|
|
103
131
|
{ event_type: "protocol.mission.updated" }
|
|
104
132
|
>;
|
|
133
|
+
export type MissionPaidEvent = Extract<
|
|
134
|
+
Event,
|
|
135
|
+
{ event_type: "protocol.mission.paid" }
|
|
136
|
+
>;
|
|
137
|
+
export type FlightSubmittedEvent = Extract<
|
|
138
|
+
Event,
|
|
139
|
+
{ event_type: "protocol.flight.submitted" }
|
|
140
|
+
>;
|
|
105
141
|
export type FlightReviewedEvent = Extract<
|
|
106
142
|
Event,
|
|
107
143
|
{ event_type: "protocol.flight.reviewed" }
|