@layer-drone/protocol 0.0.11 → 0.0.13
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 +293 -11
- package/dist/index.d.ts +293 -11
- package/dist/index.js +73 -0
- package/dist/index.mjs +70 -0
- package/package.json +2 -1
- package/src/client/sdk.gen.ts +77 -0
- package/src/client/types.gen.ts +189 -10
- package/src/event/types.gen.ts +67 -0
package/dist/index.d.ts
CHANGED
|
@@ -56,6 +56,59 @@ type CreateQuoteRequestDto = {
|
|
|
56
56
|
buyer: string;
|
|
57
57
|
mintOnChain: boolean;
|
|
58
58
|
};
|
|
59
|
+
type CreateMissionRequestDto = {
|
|
60
|
+
missions: Array<{
|
|
61
|
+
zoneId: string;
|
|
62
|
+
flightPlanId: number;
|
|
63
|
+
amount: number;
|
|
64
|
+
startTime: Date;
|
|
65
|
+
endTime: Date;
|
|
66
|
+
}>;
|
|
67
|
+
campaignId: number;
|
|
68
|
+
requestor: string;
|
|
69
|
+
mintOnChain?: boolean;
|
|
70
|
+
};
|
|
71
|
+
type CreateMissionResponseDto = {
|
|
72
|
+
success: boolean;
|
|
73
|
+
data: {
|
|
74
|
+
missions: Array<{
|
|
75
|
+
missionId: string;
|
|
76
|
+
vaultId: string;
|
|
77
|
+
amount: number;
|
|
78
|
+
zoneId: string;
|
|
79
|
+
flightPlanId: number;
|
|
80
|
+
captureStartTime: Date;
|
|
81
|
+
captureEndTime: Date;
|
|
82
|
+
requestor: string;
|
|
83
|
+
}>;
|
|
84
|
+
totalAmount: number;
|
|
85
|
+
} | string;
|
|
86
|
+
};
|
|
87
|
+
type UpdateMissionsRequestDto = {
|
|
88
|
+
missions: Array<{
|
|
89
|
+
id: string;
|
|
90
|
+
amount: number;
|
|
91
|
+
} | {
|
|
92
|
+
id: string;
|
|
93
|
+
isOpen: false;
|
|
94
|
+
}>;
|
|
95
|
+
};
|
|
96
|
+
type UpdateMissionsResponseDto = {
|
|
97
|
+
success: boolean;
|
|
98
|
+
data: {
|
|
99
|
+
rewardUpdatesQueued: Array<string>;
|
|
100
|
+
cancelUpdatesQueued: Array<string>;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
type ClaimRewardsRequestDto = {
|
|
104
|
+
flightIds: Array<number>;
|
|
105
|
+
};
|
|
106
|
+
type ClaimRewardsResponseDto = {
|
|
107
|
+
success: boolean;
|
|
108
|
+
data: {
|
|
109
|
+
cancelUpdatesQueued: Array<string>;
|
|
110
|
+
} | string;
|
|
111
|
+
};
|
|
59
112
|
type FlightDto = {
|
|
60
113
|
token_id: number;
|
|
61
114
|
owner: string;
|
|
@@ -80,11 +133,6 @@ type ValidateFlightDto = {
|
|
|
80
133
|
pilotAddress: string;
|
|
81
134
|
missionId: number;
|
|
82
135
|
flightTimestamp: string;
|
|
83
|
-
externalBucketInfo?: {
|
|
84
|
-
prefix: string;
|
|
85
|
-
bucketName: string;
|
|
86
|
-
region: string;
|
|
87
|
-
};
|
|
88
136
|
flightRequestInfo: {
|
|
89
137
|
filePaths: Array<string>;
|
|
90
138
|
flightPlanId: number;
|
|
@@ -112,7 +160,7 @@ type GetTimeLimitsForSunAltitudeResponse = {
|
|
|
112
160
|
type CreateWebhookBody = {
|
|
113
161
|
name: string;
|
|
114
162
|
url: string;
|
|
115
|
-
event_types: Array<"test" | "protocol.flight.submitted" | "*">;
|
|
163
|
+
event_types: Array<"test" | "protocol.flight.submitted" | "protocol.mission.created" | "protocol.mission.updated" | "protocol.flight.reviewed" | "*">;
|
|
116
164
|
active: boolean;
|
|
117
165
|
};
|
|
118
166
|
type CreateWebhookResponse = {
|
|
@@ -123,7 +171,7 @@ type GetWebhooksResponse = Array<{
|
|
|
123
171
|
id: number;
|
|
124
172
|
name: string;
|
|
125
173
|
url: string;
|
|
126
|
-
event_types: Array<"test" | "protocol.flight.submitted" | "*">;
|
|
174
|
+
event_types: Array<"test" | "protocol.flight.submitted" | "protocol.mission.created" | "protocol.mission.updated" | "protocol.flight.reviewed" | "*">;
|
|
127
175
|
active: boolean;
|
|
128
176
|
failure_count: number;
|
|
129
177
|
last_failure_reason: string;
|
|
@@ -134,7 +182,7 @@ type GetWebhookResponse = {
|
|
|
134
182
|
id: number;
|
|
135
183
|
name: string;
|
|
136
184
|
url: string;
|
|
137
|
-
event_types: Array<"test" | "protocol.flight.submitted" | "*">;
|
|
185
|
+
event_types: Array<"test" | "protocol.flight.submitted" | "protocol.mission.created" | "protocol.mission.updated" | "protocol.flight.reviewed" | "*">;
|
|
138
186
|
active: boolean;
|
|
139
187
|
failure_count: number;
|
|
140
188
|
last_failure_reason: string;
|
|
@@ -144,14 +192,14 @@ type GetWebhookResponse = {
|
|
|
144
192
|
type UpdateWebhookBody = {
|
|
145
193
|
name?: string;
|
|
146
194
|
url?: string;
|
|
147
|
-
event_types?: Array<"test" | "protocol.flight.submitted" | "*">;
|
|
195
|
+
event_types?: Array<"test" | "protocol.flight.submitted" | "protocol.mission.created" | "protocol.mission.updated" | "protocol.flight.reviewed" | "*">;
|
|
148
196
|
active?: boolean;
|
|
149
197
|
};
|
|
150
198
|
type UpdateWebhookResponse = {
|
|
151
199
|
id: number;
|
|
152
200
|
name: string;
|
|
153
201
|
url: string;
|
|
154
|
-
event_types: Array<"test" | "protocol.flight.submitted" | "*">;
|
|
202
|
+
event_types: Array<"test" | "protocol.flight.submitted" | "protocol.mission.created" | "protocol.mission.updated" | "protocol.flight.reviewed" | "*">;
|
|
155
203
|
active: boolean;
|
|
156
204
|
failure_count: number;
|
|
157
205
|
last_failure_reason: string;
|
|
@@ -307,6 +355,48 @@ type QuotesControllerGetQuoteErrors = {
|
|
|
307
355
|
type QuotesControllerGetQuoteResponses = {
|
|
308
356
|
200: unknown;
|
|
309
357
|
};
|
|
358
|
+
type MissionsControllerCreateMissionsData = {
|
|
359
|
+
body: CreateMissionRequestDto;
|
|
360
|
+
path?: never;
|
|
361
|
+
query?: never;
|
|
362
|
+
url: "/missions";
|
|
363
|
+
};
|
|
364
|
+
type MissionsControllerCreateMissionsErrors = {
|
|
365
|
+
400: unknown;
|
|
366
|
+
403: unknown;
|
|
367
|
+
500: unknown;
|
|
368
|
+
};
|
|
369
|
+
type MissionsControllerCreateMissionsResponses = {
|
|
370
|
+
201: CreateMissionResponseDto;
|
|
371
|
+
};
|
|
372
|
+
type MissionsControllerCreateMissionsResponse = MissionsControllerCreateMissionsResponses[keyof MissionsControllerCreateMissionsResponses];
|
|
373
|
+
type MissionsControllerUpdateMissionsData = {
|
|
374
|
+
body: UpdateMissionsRequestDto;
|
|
375
|
+
path?: never;
|
|
376
|
+
query?: never;
|
|
377
|
+
url: "/missions";
|
|
378
|
+
};
|
|
379
|
+
type MissionsControllerUpdateMissionsResponses = {
|
|
380
|
+
200: UpdateMissionsResponseDto;
|
|
381
|
+
};
|
|
382
|
+
type MissionsControllerUpdateMissionsResponse = MissionsControllerUpdateMissionsResponses[keyof MissionsControllerUpdateMissionsResponses];
|
|
383
|
+
type MissionsControllerClaimRewardsData = {
|
|
384
|
+
body: ClaimRewardsRequestDto;
|
|
385
|
+
path: {
|
|
386
|
+
id: bigint;
|
|
387
|
+
};
|
|
388
|
+
query?: never;
|
|
389
|
+
url: "/missions/{id}/rewards";
|
|
390
|
+
};
|
|
391
|
+
type MissionsControllerClaimRewardsErrors = {
|
|
392
|
+
400: unknown;
|
|
393
|
+
404: unknown;
|
|
394
|
+
500: unknown;
|
|
395
|
+
};
|
|
396
|
+
type MissionsControllerClaimRewardsResponses = {
|
|
397
|
+
200: ClaimRewardsResponseDto;
|
|
398
|
+
};
|
|
399
|
+
type MissionsControllerClaimRewardsResponse = MissionsControllerClaimRewardsResponses[keyof MissionsControllerClaimRewardsResponses];
|
|
310
400
|
type FlightsControllerGenerateFlightIdData = {
|
|
311
401
|
body?: never;
|
|
312
402
|
path?: never;
|
|
@@ -716,6 +806,9 @@ declare const apiTokenControllerGetToken: <ThrowOnError extends boolean = false>
|
|
|
716
806
|
declare const apiTokenControllerUpdateToken: <ThrowOnError extends boolean = false>(options: Options<ApiTokenControllerUpdateTokenData, ThrowOnError>) => RequestResult<ApiTokenControllerUpdateTokenResponses, ApiTokenControllerUpdateTokenErrors, ThrowOnError, "fields">;
|
|
717
807
|
declare const quotesControllerCreateQuote: <ThrowOnError extends boolean = false>(options: Options<QuotesControllerCreateQuoteData, ThrowOnError>) => RequestResult<QuotesControllerCreateQuoteResponses, QuotesControllerCreateQuoteErrors, ThrowOnError, "fields">;
|
|
718
808
|
declare const quotesControllerGetQuote: <ThrowOnError extends boolean = false>(options: Options<QuotesControllerGetQuoteData, ThrowOnError>) => RequestResult<QuotesControllerGetQuoteResponses, QuotesControllerGetQuoteErrors, ThrowOnError, "fields">;
|
|
809
|
+
declare const missionsControllerCreateMissions: <ThrowOnError extends boolean = false>(options: Options<MissionsControllerCreateMissionsData, ThrowOnError>) => RequestResult<MissionsControllerCreateMissionsResponses, MissionsControllerCreateMissionsErrors, ThrowOnError, "fields">;
|
|
810
|
+
declare const missionsControllerUpdateMissions: <ThrowOnError extends boolean = false>(options: Options<MissionsControllerUpdateMissionsData, ThrowOnError>) => RequestResult<MissionsControllerUpdateMissionsResponses, unknown, ThrowOnError, "fields">;
|
|
811
|
+
declare const missionsControllerClaimRewards: <ThrowOnError extends boolean = false>(options: Options<MissionsControllerClaimRewardsData, ThrowOnError>) => RequestResult<MissionsControllerClaimRewardsResponses, MissionsControllerClaimRewardsErrors, ThrowOnError, "fields">;
|
|
719
812
|
declare const flightsControllerGenerateFlightId: <ThrowOnError extends boolean = false>(options: Options<FlightsControllerGenerateFlightIdData, ThrowOnError>) => RequestResult<FlightsControllerGenerateFlightIdResponses, FlightsControllerGenerateFlightIdErrors, ThrowOnError, "fields">;
|
|
720
813
|
declare const flightsControllerGetFlight: <ThrowOnError extends boolean = false>(options: Options<FlightsControllerGetFlightData, ThrowOnError>) => RequestResult<FlightsControllerGetFlightResponses, FlightsControllerGetFlightErrors, ThrowOnError, "fields">;
|
|
721
814
|
declare const flightsControllerCreatePresignedUrls: <ThrowOnError extends boolean = false>(options: Options<FlightsControllerCreatePresignedUrlsData, ThrowOnError>) => RequestResult<FlightsControllerCreatePresignedUrlsResponses, FlightsControllerCreatePresignedUrlsErrors, ThrowOnError, "fields">;
|
|
@@ -791,8 +884,163 @@ declare const Event: z.ZodUnion<[z.ZodObject<{
|
|
|
791
884
|
event_type: "protocol.flight.submitted";
|
|
792
885
|
id?: any;
|
|
793
886
|
timestamp?: any;
|
|
887
|
+
}>, z.ZodObject<{
|
|
888
|
+
id: z.ZodAny;
|
|
889
|
+
event_type: z.ZodLiteral<"protocol.mission.created">;
|
|
890
|
+
timestamp: z.ZodAny;
|
|
891
|
+
data: z.ZodObject<{
|
|
892
|
+
missionId: z.ZodString;
|
|
893
|
+
vaultId: z.ZodString;
|
|
894
|
+
amount: z.ZodString;
|
|
895
|
+
zoneId: z.ZodString;
|
|
896
|
+
flightPlanId: z.ZodNumber;
|
|
897
|
+
captureStartTime: z.ZodString;
|
|
898
|
+
captureEndTime: z.ZodString;
|
|
899
|
+
detailsHash: z.ZodString;
|
|
900
|
+
}, "strict", z.ZodTypeAny, {
|
|
901
|
+
missionId: string;
|
|
902
|
+
vaultId: string;
|
|
903
|
+
amount: string;
|
|
904
|
+
zoneId: string;
|
|
905
|
+
flightPlanId: number;
|
|
906
|
+
captureStartTime: string;
|
|
907
|
+
captureEndTime: string;
|
|
908
|
+
detailsHash: string;
|
|
909
|
+
}, {
|
|
910
|
+
missionId: string;
|
|
911
|
+
vaultId: string;
|
|
912
|
+
amount: string;
|
|
913
|
+
zoneId: string;
|
|
914
|
+
flightPlanId: number;
|
|
915
|
+
captureStartTime: string;
|
|
916
|
+
captureEndTime: string;
|
|
917
|
+
detailsHash: string;
|
|
918
|
+
}>;
|
|
919
|
+
}, "strict", z.ZodTypeAny, {
|
|
920
|
+
data: {
|
|
921
|
+
missionId: string;
|
|
922
|
+
vaultId: string;
|
|
923
|
+
amount: string;
|
|
924
|
+
zoneId: string;
|
|
925
|
+
flightPlanId: number;
|
|
926
|
+
captureStartTime: string;
|
|
927
|
+
captureEndTime: string;
|
|
928
|
+
detailsHash: string;
|
|
929
|
+
};
|
|
930
|
+
event_type: "protocol.mission.created";
|
|
931
|
+
id?: any;
|
|
932
|
+
timestamp?: any;
|
|
933
|
+
}, {
|
|
934
|
+
data: {
|
|
935
|
+
missionId: string;
|
|
936
|
+
vaultId: string;
|
|
937
|
+
amount: string;
|
|
938
|
+
zoneId: string;
|
|
939
|
+
flightPlanId: number;
|
|
940
|
+
captureStartTime: string;
|
|
941
|
+
captureEndTime: string;
|
|
942
|
+
detailsHash: string;
|
|
943
|
+
};
|
|
944
|
+
event_type: "protocol.mission.created";
|
|
945
|
+
id?: any;
|
|
946
|
+
timestamp?: any;
|
|
947
|
+
}>, z.ZodObject<{
|
|
948
|
+
id: z.ZodAny;
|
|
949
|
+
event_type: z.ZodLiteral<"protocol.mission.updated">;
|
|
950
|
+
timestamp: z.ZodAny;
|
|
951
|
+
data: z.ZodObject<{
|
|
952
|
+
id: z.ZodString;
|
|
953
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
954
|
+
isOpen: z.ZodOptional<z.ZodBoolean>;
|
|
955
|
+
}, "strict", z.ZodTypeAny, {
|
|
956
|
+
id: string;
|
|
957
|
+
amount?: number | undefined;
|
|
958
|
+
isOpen?: boolean | undefined;
|
|
959
|
+
}, {
|
|
960
|
+
id: string;
|
|
961
|
+
amount?: number | undefined;
|
|
962
|
+
isOpen?: boolean | undefined;
|
|
963
|
+
}>;
|
|
964
|
+
}, "strict", z.ZodTypeAny, {
|
|
965
|
+
data: {
|
|
966
|
+
id: string;
|
|
967
|
+
amount?: number | undefined;
|
|
968
|
+
isOpen?: boolean | undefined;
|
|
969
|
+
};
|
|
970
|
+
event_type: "protocol.mission.updated";
|
|
971
|
+
id?: any;
|
|
972
|
+
timestamp?: any;
|
|
973
|
+
}, {
|
|
974
|
+
data: {
|
|
975
|
+
id: string;
|
|
976
|
+
amount?: number | undefined;
|
|
977
|
+
isOpen?: boolean | undefined;
|
|
978
|
+
};
|
|
979
|
+
event_type: "protocol.mission.updated";
|
|
980
|
+
id?: any;
|
|
981
|
+
timestamp?: any;
|
|
982
|
+
}>, z.ZodObject<{
|
|
983
|
+
id: z.ZodAny;
|
|
984
|
+
event_type: z.ZodLiteral<"protocol.flight.reviewed">;
|
|
985
|
+
timestamp: z.ZodAny;
|
|
986
|
+
data: z.ZodObject<{
|
|
987
|
+
flightId: z.ZodNumber;
|
|
988
|
+
isApproved: z.ZodBoolean;
|
|
989
|
+
validationLogUri: z.ZodString;
|
|
990
|
+
validator: z.ZodString;
|
|
991
|
+
filesHash: z.ZodString;
|
|
992
|
+
}, "strict", z.ZodTypeAny, {
|
|
993
|
+
flightId: number;
|
|
994
|
+
isApproved: boolean;
|
|
995
|
+
validationLogUri: string;
|
|
996
|
+
validator: string;
|
|
997
|
+
filesHash: string;
|
|
998
|
+
}, {
|
|
999
|
+
flightId: number;
|
|
1000
|
+
isApproved: boolean;
|
|
1001
|
+
validationLogUri: string;
|
|
1002
|
+
validator: string;
|
|
1003
|
+
filesHash: string;
|
|
1004
|
+
}>;
|
|
1005
|
+
}, "strict", z.ZodTypeAny, {
|
|
1006
|
+
data: {
|
|
1007
|
+
flightId: number;
|
|
1008
|
+
isApproved: boolean;
|
|
1009
|
+
validationLogUri: string;
|
|
1010
|
+
validator: string;
|
|
1011
|
+
filesHash: string;
|
|
1012
|
+
};
|
|
1013
|
+
event_type: "protocol.flight.reviewed";
|
|
1014
|
+
id?: any;
|
|
1015
|
+
timestamp?: any;
|
|
1016
|
+
}, {
|
|
1017
|
+
data: {
|
|
1018
|
+
flightId: number;
|
|
1019
|
+
isApproved: boolean;
|
|
1020
|
+
validationLogUri: string;
|
|
1021
|
+
validator: string;
|
|
1022
|
+
filesHash: string;
|
|
1023
|
+
};
|
|
1024
|
+
event_type: "protocol.flight.reviewed";
|
|
1025
|
+
id?: any;
|
|
1026
|
+
timestamp?: any;
|
|
794
1027
|
}>]>;
|
|
795
1028
|
type Event = z.infer<typeof Event>;
|
|
1029
|
+
type TestEvent = Extract<Event, {
|
|
1030
|
+
event_type: "test";
|
|
1031
|
+
}>;
|
|
1032
|
+
type FlightSubmittedEvent = Extract<Event, {
|
|
1033
|
+
event_type: "protocol.flight.submitted";
|
|
1034
|
+
}>;
|
|
1035
|
+
type MissionCreatedEvent = Extract<Event, {
|
|
1036
|
+
event_type: "protocol.mission.created";
|
|
1037
|
+
}>;
|
|
1038
|
+
type MissionUpdatedEvent = Extract<Event, {
|
|
1039
|
+
event_type: "protocol.mission.updated";
|
|
1040
|
+
}>;
|
|
1041
|
+
type FlightReviewedEvent = Extract<Event, {
|
|
1042
|
+
event_type: "protocol.flight.reviewed";
|
|
1043
|
+
}>;
|
|
796
1044
|
|
|
797
1045
|
declare function parseWebhookEvent(req: Request$1, webhookSecret: string): {
|
|
798
1046
|
data: {
|
|
@@ -810,6 +1058,40 @@ declare function parseWebhookEvent(req: Request$1, webhookSecret: string): {
|
|
|
810
1058
|
event_type: "protocol.flight.submitted";
|
|
811
1059
|
id?: any;
|
|
812
1060
|
timestamp?: any;
|
|
1061
|
+
} | {
|
|
1062
|
+
data: {
|
|
1063
|
+
missionId: string;
|
|
1064
|
+
vaultId: string;
|
|
1065
|
+
amount: string;
|
|
1066
|
+
zoneId: string;
|
|
1067
|
+
flightPlanId: number;
|
|
1068
|
+
captureStartTime: string;
|
|
1069
|
+
captureEndTime: string;
|
|
1070
|
+
detailsHash: string;
|
|
1071
|
+
};
|
|
1072
|
+
event_type: "protocol.mission.created";
|
|
1073
|
+
id?: any;
|
|
1074
|
+
timestamp?: any;
|
|
1075
|
+
} | {
|
|
1076
|
+
data: {
|
|
1077
|
+
id: string;
|
|
1078
|
+
amount?: number | undefined;
|
|
1079
|
+
isOpen?: boolean | undefined;
|
|
1080
|
+
};
|
|
1081
|
+
event_type: "protocol.mission.updated";
|
|
1082
|
+
id?: any;
|
|
1083
|
+
timestamp?: any;
|
|
1084
|
+
} | {
|
|
1085
|
+
data: {
|
|
1086
|
+
flightId: number;
|
|
1087
|
+
isApproved: boolean;
|
|
1088
|
+
validationLogUri: string;
|
|
1089
|
+
validator: string;
|
|
1090
|
+
filesHash: string;
|
|
1091
|
+
};
|
|
1092
|
+
event_type: "protocol.flight.reviewed";
|
|
1093
|
+
id?: any;
|
|
1094
|
+
timestamp?: any;
|
|
813
1095
|
};
|
|
814
1096
|
|
|
815
|
-
export { type ApiTokenControllerCreateTokenData, type ApiTokenControllerCreateTokenErrors, type ApiTokenControllerCreateTokenResponse, type ApiTokenControllerCreateTokenResponses, type ApiTokenControllerDeleteTokenData, type ApiTokenControllerDeleteTokenErrors, type ApiTokenControllerDeleteTokenResponses, type ApiTokenControllerGetTokenData, type ApiTokenControllerGetTokenErrors, type ApiTokenControllerGetTokenResponses, type ApiTokenControllerUpdateTokenData, type ApiTokenControllerUpdateTokenErrors, type ApiTokenControllerUpdateTokenResponse, type ApiTokenControllerUpdateTokenResponses, type AppControllerGetHelloData, type AppControllerGetHelloResponses, type Auth, type Client, type ClientOptions$1 as ClientOptions, type ConditionsControllerGetSunAltitudeTimeLimitsData, type ConditionsControllerGetSunAltitudeTimeLimitsResponse, type ConditionsControllerGetSunAltitudeTimeLimitsResponses, type Config, type CreateApiTokenRequestDto, type CreateApiTokenResponseDto, type CreateClientConfig, type CreateFileRequestDto, type CreateFileResponseDto, type CreateQuoteRequestDto, type CreateWebhookBody, type CreateWebhookResponse, type DeleteWebhookResponse, type DepositRewardsRequestDto, type DepositRewardsResponseDto, type DistributeRewardsRequestDto, type DistributeRewardsResponseDto, Event, type FlightDto, type FlightsControllerCreatePresignedUrlsData, type FlightsControllerCreatePresignedUrlsErrors, type FlightsControllerCreatePresignedUrlsResponse, type FlightsControllerCreatePresignedUrlsResponses, type FlightsControllerGenerateFlightIdData, type FlightsControllerGenerateFlightIdErrors, type FlightsControllerGenerateFlightIdResponse, type FlightsControllerGenerateFlightIdResponses, type FlightsControllerGetFlightData, type FlightsControllerGetFlightErrors, type FlightsControllerGetFlightResponse, type FlightsControllerGetFlightResponses, type FlightsControllerValidateFlightData, type FlightsControllerValidateFlightErrors, type FlightsControllerValidateFlightResponse, type FlightsControllerValidateFlightResponses, type GetProvenanceCryptoKeyResponse, type GetTimeLimitsForSunAltitudeResponse, type GetWebhookResponse, type GetWebhookStatusResponse, type GetWebhooksResponse, type KeysControllerGetProvenanceCryptoKeyData, type KeysControllerGetProvenanceCryptoKeyResponse, type KeysControllerGetProvenanceCryptoKeyResponses, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type QuotesControllerCreateQuoteData, type QuotesControllerCreateQuoteErrors, type QuotesControllerCreateQuoteResponses, type QuotesControllerGetQuoteData, type QuotesControllerGetQuoteErrors, type QuotesControllerGetQuoteResponses, type RegenerateWebhookSecretResponseDto, type RequestOptions, type RequestResult, type ResponseStyle, type RewardsControllerDepositRewardsData, type RewardsControllerDepositRewardsErrors, type RewardsControllerDepositRewardsResponse, type RewardsControllerDepositRewardsResponses, type RewardsControllerDistributeRewardsData, type RewardsControllerDistributeRewardsErrors, type RewardsControllerDistributeRewardsResponse, type RewardsControllerDistributeRewardsResponses, type SchemaControllerGetEventSchemaData, type SchemaControllerGetEventSchemaResponses, type TDataShape, type TestWebhookResponse, type UpdateApiTokenRequestDto, type UpdateApiTokenResponseDto, type UpdateWebhookBody, type UpdateWebhookResponse, type ValidateFlightDto, type ValidateFlightResponseDto, type WebhooksControllerCreateData, type WebhooksControllerCreateErrors, type WebhooksControllerCreateResponse, type WebhooksControllerCreateResponses, type WebhooksControllerDeleteData, type WebhooksControllerDeleteErrors, type WebhooksControllerDeleteResponse, type WebhooksControllerDeleteResponses, type WebhooksControllerGetData, type WebhooksControllerGetErrors, type WebhooksControllerGetManyData, type WebhooksControllerGetManyErrors, type WebhooksControllerGetManyResponse, type WebhooksControllerGetManyResponses, type WebhooksControllerGetResponse, type WebhooksControllerGetResponses, type WebhooksControllerGetStatusData, type WebhooksControllerGetStatusErrors, type WebhooksControllerGetStatusResponse, type WebhooksControllerGetStatusResponses, type WebhooksControllerRegenerateSecretData, type WebhooksControllerRegenerateSecretErrors, type WebhooksControllerRegenerateSecretResponse, type WebhooksControllerRegenerateSecretResponses, type WebhooksControllerTestData, type WebhooksControllerTestErrors, type WebhooksControllerTestResponse, type WebhooksControllerTestResponses, type WebhooksControllerUpdateData, type WebhooksControllerUpdateErrors, type WebhooksControllerUpdateResponse, type WebhooksControllerUpdateResponses, apiTokenControllerCreateToken, apiTokenControllerDeleteToken, apiTokenControllerGetToken, apiTokenControllerUpdateToken, appControllerGetHello, buildClientParams, conditionsControllerGetSunAltitudeTimeLimits, createClient, createConfig, flightsControllerCreatePresignedUrls, flightsControllerGenerateFlightId, flightsControllerGetFlight, flightsControllerValidateFlight, formDataBodySerializer, jsonBodySerializer, keysControllerGetProvenanceCryptoKey, mergeHeaders, parseWebhookEvent, quotesControllerCreateQuote, quotesControllerGetQuote, rewardsControllerDepositRewards, rewardsControllerDistributeRewards, schemaControllerGetEventSchema, urlSearchParamsBodySerializer, webhooksControllerCreate, webhooksControllerDelete, webhooksControllerGet, webhooksControllerGetMany, webhooksControllerGetStatus, webhooksControllerRegenerateSecret, webhooksControllerTest, webhooksControllerUpdate };
|
|
1097
|
+
export { type ApiTokenControllerCreateTokenData, type ApiTokenControllerCreateTokenErrors, type ApiTokenControllerCreateTokenResponse, type ApiTokenControllerCreateTokenResponses, type ApiTokenControllerDeleteTokenData, type ApiTokenControllerDeleteTokenErrors, type ApiTokenControllerDeleteTokenResponses, type ApiTokenControllerGetTokenData, type ApiTokenControllerGetTokenErrors, type ApiTokenControllerGetTokenResponses, type ApiTokenControllerUpdateTokenData, type ApiTokenControllerUpdateTokenErrors, type ApiTokenControllerUpdateTokenResponse, type ApiTokenControllerUpdateTokenResponses, type AppControllerGetHelloData, type AppControllerGetHelloResponses, type Auth, type ClaimRewardsRequestDto, type ClaimRewardsResponseDto, type Client, type ClientOptions$1 as ClientOptions, type ConditionsControllerGetSunAltitudeTimeLimitsData, type ConditionsControllerGetSunAltitudeTimeLimitsResponse, type ConditionsControllerGetSunAltitudeTimeLimitsResponses, type Config, type CreateApiTokenRequestDto, type CreateApiTokenResponseDto, type CreateClientConfig, type CreateFileRequestDto, type CreateFileResponseDto, type CreateMissionRequestDto, type CreateMissionResponseDto, type CreateQuoteRequestDto, type CreateWebhookBody, type CreateWebhookResponse, type DeleteWebhookResponse, type DepositRewardsRequestDto, type DepositRewardsResponseDto, type DistributeRewardsRequestDto, type DistributeRewardsResponseDto, Event, type FlightDto, type FlightReviewedEvent, type FlightSubmittedEvent, type FlightsControllerCreatePresignedUrlsData, type FlightsControllerCreatePresignedUrlsErrors, type FlightsControllerCreatePresignedUrlsResponse, type FlightsControllerCreatePresignedUrlsResponses, type FlightsControllerGenerateFlightIdData, type FlightsControllerGenerateFlightIdErrors, type FlightsControllerGenerateFlightIdResponse, type FlightsControllerGenerateFlightIdResponses, type FlightsControllerGetFlightData, type FlightsControllerGetFlightErrors, type FlightsControllerGetFlightResponse, type FlightsControllerGetFlightResponses, type FlightsControllerValidateFlightData, type FlightsControllerValidateFlightErrors, type FlightsControllerValidateFlightResponse, type FlightsControllerValidateFlightResponses, type GetProvenanceCryptoKeyResponse, type GetTimeLimitsForSunAltitudeResponse, type GetWebhookResponse, type GetWebhookStatusResponse, type GetWebhooksResponse, type KeysControllerGetProvenanceCryptoKeyData, type KeysControllerGetProvenanceCryptoKeyResponse, type KeysControllerGetProvenanceCryptoKeyResponses, type MissionCreatedEvent, type MissionUpdatedEvent, type MissionsControllerClaimRewardsData, type MissionsControllerClaimRewardsErrors, type MissionsControllerClaimRewardsResponse, type MissionsControllerClaimRewardsResponses, type MissionsControllerCreateMissionsData, type MissionsControllerCreateMissionsErrors, type MissionsControllerCreateMissionsResponse, type MissionsControllerCreateMissionsResponses, type MissionsControllerUpdateMissionsData, type MissionsControllerUpdateMissionsResponse, type MissionsControllerUpdateMissionsResponses, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type QuotesControllerCreateQuoteData, type QuotesControllerCreateQuoteErrors, type QuotesControllerCreateQuoteResponses, type QuotesControllerGetQuoteData, type QuotesControllerGetQuoteErrors, type QuotesControllerGetQuoteResponses, type RegenerateWebhookSecretResponseDto, type RequestOptions, type RequestResult, type ResponseStyle, type RewardsControllerDepositRewardsData, type RewardsControllerDepositRewardsErrors, type RewardsControllerDepositRewardsResponse, type RewardsControllerDepositRewardsResponses, type RewardsControllerDistributeRewardsData, type RewardsControllerDistributeRewardsErrors, type RewardsControllerDistributeRewardsResponse, type RewardsControllerDistributeRewardsResponses, type SchemaControllerGetEventSchemaData, type SchemaControllerGetEventSchemaResponses, type TDataShape, type TestEvent, type TestWebhookResponse, type UpdateApiTokenRequestDto, type UpdateApiTokenResponseDto, type UpdateMissionsRequestDto, type UpdateMissionsResponseDto, type UpdateWebhookBody, type UpdateWebhookResponse, type ValidateFlightDto, type ValidateFlightResponseDto, type WebhooksControllerCreateData, type WebhooksControllerCreateErrors, type WebhooksControllerCreateResponse, type WebhooksControllerCreateResponses, type WebhooksControllerDeleteData, type WebhooksControllerDeleteErrors, type WebhooksControllerDeleteResponse, type WebhooksControllerDeleteResponses, type WebhooksControllerGetData, type WebhooksControllerGetErrors, type WebhooksControllerGetManyData, type WebhooksControllerGetManyErrors, type WebhooksControllerGetManyResponse, type WebhooksControllerGetManyResponses, type WebhooksControllerGetResponse, type WebhooksControllerGetResponses, type WebhooksControllerGetStatusData, type WebhooksControllerGetStatusErrors, type WebhooksControllerGetStatusResponse, type WebhooksControllerGetStatusResponses, type WebhooksControllerRegenerateSecretData, type WebhooksControllerRegenerateSecretErrors, type WebhooksControllerRegenerateSecretResponse, type WebhooksControllerRegenerateSecretResponses, type WebhooksControllerTestData, type WebhooksControllerTestErrors, type WebhooksControllerTestResponse, type WebhooksControllerTestResponses, type WebhooksControllerUpdateData, type WebhooksControllerUpdateErrors, type WebhooksControllerUpdateResponse, type WebhooksControllerUpdateResponses, apiTokenControllerCreateToken, apiTokenControllerDeleteToken, apiTokenControllerGetToken, apiTokenControllerUpdateToken, appControllerGetHello, buildClientParams, conditionsControllerGetSunAltitudeTimeLimits, createClient, createConfig, flightsControllerCreatePresignedUrls, flightsControllerGenerateFlightId, flightsControllerGetFlight, flightsControllerValidateFlight, formDataBodySerializer, jsonBodySerializer, keysControllerGetProvenanceCryptoKey, mergeHeaders, missionsControllerClaimRewards, missionsControllerCreateMissions, missionsControllerUpdateMissions, parseWebhookEvent, quotesControllerCreateQuote, quotesControllerGetQuote, rewardsControllerDepositRewards, rewardsControllerDistributeRewards, schemaControllerGetEventSchema, urlSearchParamsBodySerializer, webhooksControllerCreate, webhooksControllerDelete, webhooksControllerGet, webhooksControllerGetMany, webhooksControllerGetStatus, webhooksControllerRegenerateSecret, webhooksControllerTest, webhooksControllerUpdate };
|
package/dist/index.js
CHANGED
|
@@ -39,6 +39,9 @@ __export(index_exports, {
|
|
|
39
39
|
jsonBodySerializer: () => jsonBodySerializer,
|
|
40
40
|
keysControllerGetProvenanceCryptoKey: () => keysControllerGetProvenanceCryptoKey,
|
|
41
41
|
mergeHeaders: () => mergeHeaders,
|
|
42
|
+
missionsControllerClaimRewards: () => missionsControllerClaimRewards,
|
|
43
|
+
missionsControllerCreateMissions: () => missionsControllerCreateMissions,
|
|
44
|
+
missionsControllerUpdateMissions: () => missionsControllerUpdateMissions,
|
|
42
45
|
parseWebhookEvent: () => parseWebhookEvent,
|
|
43
46
|
quotesControllerCreateQuote: () => quotesControllerCreateQuote,
|
|
44
47
|
quotesControllerGetQuote: () => quotesControllerGetQuote,
|
|
@@ -897,6 +900,36 @@ var quotesControllerGetQuote = /* @__PURE__ */ __name((options) => {
|
|
|
897
900
|
...options
|
|
898
901
|
});
|
|
899
902
|
}, "quotesControllerGetQuote");
|
|
903
|
+
var missionsControllerCreateMissions = /* @__PURE__ */ __name((options) => {
|
|
904
|
+
return (options.client ?? client).post({
|
|
905
|
+
url: "/missions",
|
|
906
|
+
...options,
|
|
907
|
+
headers: {
|
|
908
|
+
"Content-Type": "application/json",
|
|
909
|
+
...options.headers
|
|
910
|
+
}
|
|
911
|
+
});
|
|
912
|
+
}, "missionsControllerCreateMissions");
|
|
913
|
+
var missionsControllerUpdateMissions = /* @__PURE__ */ __name((options) => {
|
|
914
|
+
return (options.client ?? client).put({
|
|
915
|
+
url: "/missions",
|
|
916
|
+
...options,
|
|
917
|
+
headers: {
|
|
918
|
+
"Content-Type": "application/json",
|
|
919
|
+
...options.headers
|
|
920
|
+
}
|
|
921
|
+
});
|
|
922
|
+
}, "missionsControllerUpdateMissions");
|
|
923
|
+
var missionsControllerClaimRewards = /* @__PURE__ */ __name((options) => {
|
|
924
|
+
return (options.client ?? client).post({
|
|
925
|
+
url: "/missions/{id}/rewards",
|
|
926
|
+
...options,
|
|
927
|
+
headers: {
|
|
928
|
+
"Content-Type": "application/json",
|
|
929
|
+
...options.headers
|
|
930
|
+
}
|
|
931
|
+
});
|
|
932
|
+
}, "missionsControllerClaimRewards");
|
|
900
933
|
var flightsControllerGenerateFlightId = /* @__PURE__ */ __name((options) => {
|
|
901
934
|
return (options.client ?? client).get({
|
|
902
935
|
security: [
|
|
@@ -1091,6 +1124,43 @@ var Event = import_zod.z.union([
|
|
|
1091
1124
|
pilotAddress: import_zod.z.string(),
|
|
1092
1125
|
flightManifestUri: import_zod.z.string()
|
|
1093
1126
|
}).strict()
|
|
1127
|
+
}).strict(),
|
|
1128
|
+
import_zod.z.object({
|
|
1129
|
+
id: import_zod.z.any(),
|
|
1130
|
+
event_type: import_zod.z.literal("protocol.mission.created"),
|
|
1131
|
+
timestamp: import_zod.z.any(),
|
|
1132
|
+
data: import_zod.z.object({
|
|
1133
|
+
missionId: import_zod.z.string(),
|
|
1134
|
+
vaultId: import_zod.z.string(),
|
|
1135
|
+
amount: import_zod.z.string(),
|
|
1136
|
+
zoneId: import_zod.z.string(),
|
|
1137
|
+
flightPlanId: import_zod.z.number(),
|
|
1138
|
+
captureStartTime: import_zod.z.string(),
|
|
1139
|
+
captureEndTime: import_zod.z.string(),
|
|
1140
|
+
detailsHash: import_zod.z.string()
|
|
1141
|
+
}).strict()
|
|
1142
|
+
}).strict(),
|
|
1143
|
+
import_zod.z.object({
|
|
1144
|
+
id: import_zod.z.any(),
|
|
1145
|
+
event_type: import_zod.z.literal("protocol.mission.updated"),
|
|
1146
|
+
timestamp: import_zod.z.any(),
|
|
1147
|
+
data: import_zod.z.object({
|
|
1148
|
+
id: import_zod.z.string(),
|
|
1149
|
+
amount: import_zod.z.number().optional(),
|
|
1150
|
+
isOpen: import_zod.z.boolean().optional()
|
|
1151
|
+
}).strict()
|
|
1152
|
+
}).strict(),
|
|
1153
|
+
import_zod.z.object({
|
|
1154
|
+
id: import_zod.z.any(),
|
|
1155
|
+
event_type: import_zod.z.literal("protocol.flight.reviewed"),
|
|
1156
|
+
timestamp: import_zod.z.any(),
|
|
1157
|
+
data: import_zod.z.object({
|
|
1158
|
+
flightId: import_zod.z.number(),
|
|
1159
|
+
isApproved: import_zod.z.boolean(),
|
|
1160
|
+
validationLogUri: import_zod.z.string(),
|
|
1161
|
+
validator: import_zod.z.string(),
|
|
1162
|
+
filesHash: import_zod.z.string()
|
|
1163
|
+
}).strict()
|
|
1094
1164
|
}).strict()
|
|
1095
1165
|
]);
|
|
1096
1166
|
|
|
@@ -1138,6 +1208,9 @@ __name(getSecretHeader, "getSecretHeader");
|
|
|
1138
1208
|
jsonBodySerializer,
|
|
1139
1209
|
keysControllerGetProvenanceCryptoKey,
|
|
1140
1210
|
mergeHeaders,
|
|
1211
|
+
missionsControllerClaimRewards,
|
|
1212
|
+
missionsControllerCreateMissions,
|
|
1213
|
+
missionsControllerUpdateMissions,
|
|
1141
1214
|
parseWebhookEvent,
|
|
1142
1215
|
quotesControllerCreateQuote,
|
|
1143
1216
|
quotesControllerGetQuote,
|
package/dist/index.mjs
CHANGED
|
@@ -841,6 +841,36 @@ var quotesControllerGetQuote = /* @__PURE__ */ __name((options) => {
|
|
|
841
841
|
...options
|
|
842
842
|
});
|
|
843
843
|
}, "quotesControllerGetQuote");
|
|
844
|
+
var missionsControllerCreateMissions = /* @__PURE__ */ __name((options) => {
|
|
845
|
+
return (options.client ?? client).post({
|
|
846
|
+
url: "/missions",
|
|
847
|
+
...options,
|
|
848
|
+
headers: {
|
|
849
|
+
"Content-Type": "application/json",
|
|
850
|
+
...options.headers
|
|
851
|
+
}
|
|
852
|
+
});
|
|
853
|
+
}, "missionsControllerCreateMissions");
|
|
854
|
+
var missionsControllerUpdateMissions = /* @__PURE__ */ __name((options) => {
|
|
855
|
+
return (options.client ?? client).put({
|
|
856
|
+
url: "/missions",
|
|
857
|
+
...options,
|
|
858
|
+
headers: {
|
|
859
|
+
"Content-Type": "application/json",
|
|
860
|
+
...options.headers
|
|
861
|
+
}
|
|
862
|
+
});
|
|
863
|
+
}, "missionsControllerUpdateMissions");
|
|
864
|
+
var missionsControllerClaimRewards = /* @__PURE__ */ __name((options) => {
|
|
865
|
+
return (options.client ?? client).post({
|
|
866
|
+
url: "/missions/{id}/rewards",
|
|
867
|
+
...options,
|
|
868
|
+
headers: {
|
|
869
|
+
"Content-Type": "application/json",
|
|
870
|
+
...options.headers
|
|
871
|
+
}
|
|
872
|
+
});
|
|
873
|
+
}, "missionsControllerClaimRewards");
|
|
844
874
|
var flightsControllerGenerateFlightId = /* @__PURE__ */ __name((options) => {
|
|
845
875
|
return (options.client ?? client).get({
|
|
846
876
|
security: [
|
|
@@ -1035,6 +1065,43 @@ var Event = z.union([
|
|
|
1035
1065
|
pilotAddress: z.string(),
|
|
1036
1066
|
flightManifestUri: z.string()
|
|
1037
1067
|
}).strict()
|
|
1068
|
+
}).strict(),
|
|
1069
|
+
z.object({
|
|
1070
|
+
id: z.any(),
|
|
1071
|
+
event_type: z.literal("protocol.mission.created"),
|
|
1072
|
+
timestamp: z.any(),
|
|
1073
|
+
data: z.object({
|
|
1074
|
+
missionId: z.string(),
|
|
1075
|
+
vaultId: z.string(),
|
|
1076
|
+
amount: z.string(),
|
|
1077
|
+
zoneId: z.string(),
|
|
1078
|
+
flightPlanId: z.number(),
|
|
1079
|
+
captureStartTime: z.string(),
|
|
1080
|
+
captureEndTime: z.string(),
|
|
1081
|
+
detailsHash: z.string()
|
|
1082
|
+
}).strict()
|
|
1083
|
+
}).strict(),
|
|
1084
|
+
z.object({
|
|
1085
|
+
id: z.any(),
|
|
1086
|
+
event_type: z.literal("protocol.mission.updated"),
|
|
1087
|
+
timestamp: z.any(),
|
|
1088
|
+
data: z.object({
|
|
1089
|
+
id: z.string(),
|
|
1090
|
+
amount: z.number().optional(),
|
|
1091
|
+
isOpen: z.boolean().optional()
|
|
1092
|
+
}).strict()
|
|
1093
|
+
}).strict(),
|
|
1094
|
+
z.object({
|
|
1095
|
+
id: z.any(),
|
|
1096
|
+
event_type: z.literal("protocol.flight.reviewed"),
|
|
1097
|
+
timestamp: z.any(),
|
|
1098
|
+
data: z.object({
|
|
1099
|
+
flightId: z.number(),
|
|
1100
|
+
isApproved: z.boolean(),
|
|
1101
|
+
validationLogUri: z.string(),
|
|
1102
|
+
validator: z.string(),
|
|
1103
|
+
filesHash: z.string()
|
|
1104
|
+
}).strict()
|
|
1038
1105
|
}).strict()
|
|
1039
1106
|
]);
|
|
1040
1107
|
|
|
@@ -1081,6 +1148,9 @@ export {
|
|
|
1081
1148
|
jsonBodySerializer,
|
|
1082
1149
|
keysControllerGetProvenanceCryptoKey,
|
|
1083
1150
|
mergeHeaders,
|
|
1151
|
+
missionsControllerClaimRewards,
|
|
1152
|
+
missionsControllerCreateMissions,
|
|
1153
|
+
missionsControllerUpdateMissions,
|
|
1084
1154
|
parseWebhookEvent,
|
|
1085
1155
|
quotesControllerCreateQuote,
|
|
1086
1156
|
quotesControllerGetQuote,
|
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.0.
|
|
4
|
+
"version": "0.0.13",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"generate-api": "openapi-ts",
|
|
40
40
|
"generate-event": "ts-node ./scripts/generate-event-type.ts",
|
|
41
41
|
"generate": "pnpm generate-api && pnpm generate-event && pnpm lint --fix && pnpm build",
|
|
42
|
+
"type-check": "tsc --noEmit",
|
|
42
43
|
"sonar": "sonar"
|
|
43
44
|
}
|
|
44
45
|
}
|