@layer-drone/protocol 0.0.5 → 0.0.6
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 +43 -10
- package/dist/index.d.ts +43 -10
- package/dist/index.js +19 -1
- package/dist/index.mjs +18 -1
- package/package.json +1 -1
- package/src/client/sdk.gen.ts +64 -29
- package/src/client/types.gen.ts +59 -6
- package/dist/client/client.gen.d.ts +0 -4
- package/dist/client/client.gen.js +0 -6
- package/dist/client/client.gen.js.map +0 -1
- package/dist/client/index.d.ts +0 -2
- package/dist/client/index.js +0 -19
- package/dist/client/index.js.map +0 -1
- package/dist/client/sdk.gen.d.ts +0 -26
- package/dist/client/sdk.gen.js +0 -279
- package/dist/client/sdk.gen.js.map +0 -1
- package/dist/client/types.gen.d.ts +0 -416
- package/dist/client/types.gen.js +0 -3
- package/dist/client/types.gen.js.map +0 -1
- package/dist/event/index.d.ts +0 -2
- package/dist/event/index.js +0 -19
- package/dist/event/index.js.map +0 -1
- package/dist/event/parser.d.ts +0 -17
- package/dist/event/parser.js +0 -20
- package/dist/event/parser.js.map +0 -1
- package/dist/event/types.gen.d.ts +0 -63
- package/dist/event/types.gen.js +0 -29
- package/dist/event/types.gen.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,416 +0,0 @@
|
|
|
1
|
-
export type GetProvenanceCryptoKeyResponse = {
|
|
2
|
-
KeyId: string;
|
|
3
|
-
PublicKey: string;
|
|
4
|
-
KeySpec?: "ECC_NIST_P256" | "ECC_NIST_P384" | "ECC_NIST_P521" | "ECC_SECG_P256K1" | "HMAC_224" | "HMAC_256" | "HMAC_384" | "HMAC_512" | "RSA_2048" | "RSA_3072" | "RSA_4096" | "SM2" | "SYMMETRIC_DEFAULT";
|
|
5
|
-
KeyUsage?: "ENCRYPT_DECRYPT" | "GENERATE_VERIFY_MAC" | "KEY_AGREEMENT" | "SIGN_VERIFY";
|
|
6
|
-
EncryptionAlgorithms?: Array<"RSAES_OAEP_SHA_1" | "RSAES_OAEP_SHA_256" | "SM2PKE" | "SYMMETRIC_DEFAULT">;
|
|
7
|
-
};
|
|
8
|
-
export type DepositRewardsRequestDto = {
|
|
9
|
-
caller: string;
|
|
10
|
-
amount: number;
|
|
11
|
-
vaultId: number;
|
|
12
|
-
vaultManagerAddress?: string;
|
|
13
|
-
};
|
|
14
|
-
export type DepositRewardsResponseDto = {
|
|
15
|
-
MessageId: string;
|
|
16
|
-
};
|
|
17
|
-
export type DistributeRewardsRequestDto = {
|
|
18
|
-
amounts: {
|
|
19
|
-
[key: string]: number;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export type DistributeRewardsResponseDto = {
|
|
23
|
-
MessageId: string;
|
|
24
|
-
};
|
|
25
|
-
export type CreateApiTokenResponseDto = {
|
|
26
|
-
id: string;
|
|
27
|
-
name: string;
|
|
28
|
-
deleted_at: string | null;
|
|
29
|
-
last_used: string | null;
|
|
30
|
-
org: number;
|
|
31
|
-
scopes: Array<"manageTokens" | "manageFlights" | "manageWebhooks" | "all"> | null;
|
|
32
|
-
};
|
|
33
|
-
export type CreateApiTokenRequestDto = {
|
|
34
|
-
name: string;
|
|
35
|
-
scopes: Array<"manageTokens" | "manageFlights" | "manageWebhooks" | "all">;
|
|
36
|
-
orgId: number;
|
|
37
|
-
};
|
|
38
|
-
export type UpdateApiTokenRequestDto = {
|
|
39
|
-
name?: string;
|
|
40
|
-
scopes?: Array<"manageTokens" | "manageFlights" | "manageWebhooks" | "all">;
|
|
41
|
-
};
|
|
42
|
-
export type UpdateApiTokenResponseDto = {
|
|
43
|
-
id: string;
|
|
44
|
-
name: string;
|
|
45
|
-
deleted_at: string | null;
|
|
46
|
-
last_used: string | null;
|
|
47
|
-
org: number;
|
|
48
|
-
scopes: Array<"manageTokens" | "manageFlights" | "manageWebhooks" | "all"> | null;
|
|
49
|
-
};
|
|
50
|
-
export type CreateFileRequestDto = {
|
|
51
|
-
filenames: Array<string>;
|
|
52
|
-
flightId: number;
|
|
53
|
-
};
|
|
54
|
-
export type ValidateFlightDto = {
|
|
55
|
-
pilotAddress: string;
|
|
56
|
-
flightId: number;
|
|
57
|
-
flightManifestUri?: string;
|
|
58
|
-
};
|
|
59
|
-
export type CreateWebhookBody = {
|
|
60
|
-
name: string;
|
|
61
|
-
url: string;
|
|
62
|
-
event_types: Array<"test" | "protocol.flight.submitted" | "*">;
|
|
63
|
-
active: boolean;
|
|
64
|
-
};
|
|
65
|
-
export type CreateWebhookResponse = {
|
|
66
|
-
id: number;
|
|
67
|
-
secret: string;
|
|
68
|
-
};
|
|
69
|
-
export type GetWebhooksResponse = Array<{
|
|
70
|
-
id: number;
|
|
71
|
-
name: string;
|
|
72
|
-
url: string;
|
|
73
|
-
event_types: Array<"test" | "protocol.flight.submitted" | "*">;
|
|
74
|
-
active: boolean;
|
|
75
|
-
failure_count: number;
|
|
76
|
-
last_failure_reason: string | null;
|
|
77
|
-
created_at: string;
|
|
78
|
-
updated_at: string;
|
|
79
|
-
}>;
|
|
80
|
-
export type GetWebhookResponse = {
|
|
81
|
-
id: number;
|
|
82
|
-
name: string;
|
|
83
|
-
url: string;
|
|
84
|
-
event_types: Array<"test" | "protocol.flight.submitted" | "*">;
|
|
85
|
-
active: boolean;
|
|
86
|
-
failure_count: number;
|
|
87
|
-
last_failure_reason: string | null;
|
|
88
|
-
created_at: string;
|
|
89
|
-
updated_at: string;
|
|
90
|
-
};
|
|
91
|
-
export type UpdateWebhookBody = {
|
|
92
|
-
name?: string;
|
|
93
|
-
url?: string;
|
|
94
|
-
event_types?: Array<"test" | "protocol.flight.submitted" | "*">;
|
|
95
|
-
active?: boolean;
|
|
96
|
-
};
|
|
97
|
-
export type UpdateWebhookResponse = {
|
|
98
|
-
id: number;
|
|
99
|
-
name: string;
|
|
100
|
-
url: string;
|
|
101
|
-
event_types: Array<"test" | "protocol.flight.submitted" | "*">;
|
|
102
|
-
active: boolean;
|
|
103
|
-
failure_count: number;
|
|
104
|
-
last_failure_reason: string | null;
|
|
105
|
-
created_at: string;
|
|
106
|
-
updated_at: string;
|
|
107
|
-
};
|
|
108
|
-
export type DeleteWebhookResponse = {
|
|
109
|
-
message: string;
|
|
110
|
-
};
|
|
111
|
-
export type RegenerateWebhookSecretResponseDto = {
|
|
112
|
-
secret: string;
|
|
113
|
-
};
|
|
114
|
-
export type TestWebhookResponse = {
|
|
115
|
-
success: boolean;
|
|
116
|
-
};
|
|
117
|
-
export type GetWebhookStatusResponse = {
|
|
118
|
-
status: "inactive" | "error" | "connected" | "connecting";
|
|
119
|
-
error?: string | null;
|
|
120
|
-
};
|
|
121
|
-
export type AppControllerGetHelloData = {
|
|
122
|
-
body?: never;
|
|
123
|
-
path?: never;
|
|
124
|
-
query?: never;
|
|
125
|
-
url: "/";
|
|
126
|
-
};
|
|
127
|
-
export type AppControllerGetHelloResponses = {
|
|
128
|
-
200: unknown;
|
|
129
|
-
};
|
|
130
|
-
export type KeysControllerGetProvenanceCryptoKeyData = {
|
|
131
|
-
body?: never;
|
|
132
|
-
path?: never;
|
|
133
|
-
query?: never;
|
|
134
|
-
url: "/keys";
|
|
135
|
-
};
|
|
136
|
-
export type KeysControllerGetProvenanceCryptoKeyResponses = {
|
|
137
|
-
200: GetProvenanceCryptoKeyResponse;
|
|
138
|
-
};
|
|
139
|
-
export type KeysControllerGetProvenanceCryptoKeyResponse = KeysControllerGetProvenanceCryptoKeyResponses[keyof KeysControllerGetProvenanceCryptoKeyResponses];
|
|
140
|
-
export type RewardsControllerDepositRewardsData = {
|
|
141
|
-
body: DepositRewardsRequestDto;
|
|
142
|
-
path?: never;
|
|
143
|
-
query?: never;
|
|
144
|
-
url: "/rewards/deposit";
|
|
145
|
-
};
|
|
146
|
-
export type RewardsControllerDepositRewardsErrors = {
|
|
147
|
-
401: unknown;
|
|
148
|
-
403: unknown;
|
|
149
|
-
};
|
|
150
|
-
export type RewardsControllerDepositRewardsResponses = {
|
|
151
|
-
200: DepositRewardsResponseDto;
|
|
152
|
-
};
|
|
153
|
-
export type RewardsControllerDepositRewardsResponse = RewardsControllerDepositRewardsResponses[keyof RewardsControllerDepositRewardsResponses];
|
|
154
|
-
export type RewardsControllerDistributeRewardsData = {
|
|
155
|
-
body: DistributeRewardsRequestDto;
|
|
156
|
-
path?: never;
|
|
157
|
-
query?: never;
|
|
158
|
-
url: "/rewards/distribute";
|
|
159
|
-
};
|
|
160
|
-
export type RewardsControllerDistributeRewardsErrors = {
|
|
161
|
-
401: unknown;
|
|
162
|
-
403: unknown;
|
|
163
|
-
};
|
|
164
|
-
export type RewardsControllerDistributeRewardsResponses = {
|
|
165
|
-
200: DistributeRewardsResponseDto;
|
|
166
|
-
};
|
|
167
|
-
export type RewardsControllerDistributeRewardsResponse = RewardsControllerDistributeRewardsResponses[keyof RewardsControllerDistributeRewardsResponses];
|
|
168
|
-
export type ApiTokenControllerCreateTokenData = {
|
|
169
|
-
body: CreateApiTokenRequestDto;
|
|
170
|
-
path?: never;
|
|
171
|
-
query?: never;
|
|
172
|
-
url: "/tokens";
|
|
173
|
-
};
|
|
174
|
-
export type ApiTokenControllerCreateTokenErrors = {
|
|
175
|
-
401: unknown;
|
|
176
|
-
403: unknown;
|
|
177
|
-
};
|
|
178
|
-
export type ApiTokenControllerCreateTokenResponses = {
|
|
179
|
-
200: CreateApiTokenResponseDto;
|
|
180
|
-
201: unknown;
|
|
181
|
-
};
|
|
182
|
-
export type ApiTokenControllerCreateTokenResponse = ApiTokenControllerCreateTokenResponses[keyof ApiTokenControllerCreateTokenResponses];
|
|
183
|
-
export type ApiTokenControllerDeleteTokenData = {
|
|
184
|
-
body?: never;
|
|
185
|
-
path: {
|
|
186
|
-
id: string;
|
|
187
|
-
};
|
|
188
|
-
query?: never;
|
|
189
|
-
url: "/tokens/{id}";
|
|
190
|
-
};
|
|
191
|
-
export type ApiTokenControllerDeleteTokenErrors = {
|
|
192
|
-
401: unknown;
|
|
193
|
-
403: unknown;
|
|
194
|
-
};
|
|
195
|
-
export type ApiTokenControllerDeleteTokenResponses = {
|
|
196
|
-
200: unknown;
|
|
197
|
-
};
|
|
198
|
-
export type ApiTokenControllerGetTokenData = {
|
|
199
|
-
body?: never;
|
|
200
|
-
path: {
|
|
201
|
-
id: string;
|
|
202
|
-
};
|
|
203
|
-
query?: never;
|
|
204
|
-
url: "/tokens/{id}";
|
|
205
|
-
};
|
|
206
|
-
export type ApiTokenControllerGetTokenErrors = {
|
|
207
|
-
401: unknown;
|
|
208
|
-
403: unknown;
|
|
209
|
-
};
|
|
210
|
-
export type ApiTokenControllerGetTokenResponses = {
|
|
211
|
-
200: unknown;
|
|
212
|
-
};
|
|
213
|
-
export type ApiTokenControllerUpdateTokenData = {
|
|
214
|
-
body: UpdateApiTokenRequestDto;
|
|
215
|
-
path: {
|
|
216
|
-
id: string;
|
|
217
|
-
};
|
|
218
|
-
query?: never;
|
|
219
|
-
url: "/tokens/{id}";
|
|
220
|
-
};
|
|
221
|
-
export type ApiTokenControllerUpdateTokenErrors = {
|
|
222
|
-
401: unknown;
|
|
223
|
-
403: unknown;
|
|
224
|
-
};
|
|
225
|
-
export type ApiTokenControllerUpdateTokenResponses = {
|
|
226
|
-
200: UpdateApiTokenResponseDto;
|
|
227
|
-
};
|
|
228
|
-
export type ApiTokenControllerUpdateTokenResponse = ApiTokenControllerUpdateTokenResponses[keyof ApiTokenControllerUpdateTokenResponses];
|
|
229
|
-
export type FlightsControllerGenerateFlightIdData = {
|
|
230
|
-
body?: never;
|
|
231
|
-
path?: never;
|
|
232
|
-
query: {
|
|
233
|
-
missionId: number;
|
|
234
|
-
pilotAddress: string;
|
|
235
|
-
};
|
|
236
|
-
url: "/flights/id";
|
|
237
|
-
};
|
|
238
|
-
export type FlightsControllerGenerateFlightIdErrors = {
|
|
239
|
-
401: unknown;
|
|
240
|
-
403: unknown;
|
|
241
|
-
};
|
|
242
|
-
export type FlightsControllerGenerateFlightIdResponses = {
|
|
243
|
-
200: unknown;
|
|
244
|
-
};
|
|
245
|
-
export type FlightsControllerCreatePresignedUrlsData = {
|
|
246
|
-
body: CreateFileRequestDto;
|
|
247
|
-
path?: never;
|
|
248
|
-
query?: never;
|
|
249
|
-
url: "/flights/files";
|
|
250
|
-
};
|
|
251
|
-
export type FlightsControllerCreatePresignedUrlsErrors = {
|
|
252
|
-
401: unknown;
|
|
253
|
-
403: unknown;
|
|
254
|
-
};
|
|
255
|
-
export type FlightsControllerCreatePresignedUrlsResponses = {
|
|
256
|
-
201: unknown;
|
|
257
|
-
};
|
|
258
|
-
export type FlightsControllerValidateFlightData = {
|
|
259
|
-
body: ValidateFlightDto;
|
|
260
|
-
path?: never;
|
|
261
|
-
query?: never;
|
|
262
|
-
url: "/flights";
|
|
263
|
-
};
|
|
264
|
-
export type FlightsControllerValidateFlightErrors = {
|
|
265
|
-
401: unknown;
|
|
266
|
-
403: unknown;
|
|
267
|
-
};
|
|
268
|
-
export type FlightsControllerValidateFlightResponses = {
|
|
269
|
-
201: unknown;
|
|
270
|
-
};
|
|
271
|
-
export type SchemaControllerGetEventSchemaData = {
|
|
272
|
-
body?: never;
|
|
273
|
-
path?: never;
|
|
274
|
-
query?: never;
|
|
275
|
-
url: "/schema/event";
|
|
276
|
-
};
|
|
277
|
-
export type SchemaControllerGetEventSchemaResponses = {
|
|
278
|
-
200: unknown;
|
|
279
|
-
};
|
|
280
|
-
export type WebhooksControllerGetManyData = {
|
|
281
|
-
body?: never;
|
|
282
|
-
path: {
|
|
283
|
-
org_id: number;
|
|
284
|
-
};
|
|
285
|
-
query?: never;
|
|
286
|
-
url: "/org/{org_id}/webhooks";
|
|
287
|
-
};
|
|
288
|
-
export type WebhooksControllerGetManyErrors = {
|
|
289
|
-
401: unknown;
|
|
290
|
-
403: unknown;
|
|
291
|
-
};
|
|
292
|
-
export type WebhooksControllerGetManyResponses = {
|
|
293
|
-
200: GetWebhooksResponse;
|
|
294
|
-
};
|
|
295
|
-
export type WebhooksControllerGetManyResponse = WebhooksControllerGetManyResponses[keyof WebhooksControllerGetManyResponses];
|
|
296
|
-
export type WebhooksControllerCreateData = {
|
|
297
|
-
body: CreateWebhookBody;
|
|
298
|
-
path: {
|
|
299
|
-
org_id: number;
|
|
300
|
-
};
|
|
301
|
-
query?: never;
|
|
302
|
-
url: "/org/{org_id}/webhooks";
|
|
303
|
-
};
|
|
304
|
-
export type WebhooksControllerCreateErrors = {
|
|
305
|
-
401: unknown;
|
|
306
|
-
403: unknown;
|
|
307
|
-
};
|
|
308
|
-
export type WebhooksControllerCreateResponses = {
|
|
309
|
-
201: CreateWebhookResponse;
|
|
310
|
-
};
|
|
311
|
-
export type WebhooksControllerCreateResponse = WebhooksControllerCreateResponses[keyof WebhooksControllerCreateResponses];
|
|
312
|
-
export type WebhooksControllerDeleteData = {
|
|
313
|
-
body?: never;
|
|
314
|
-
path: {
|
|
315
|
-
org_id: number;
|
|
316
|
-
id: number;
|
|
317
|
-
};
|
|
318
|
-
query?: never;
|
|
319
|
-
url: "/org/{org_id}/webhooks/{id}";
|
|
320
|
-
};
|
|
321
|
-
export type WebhooksControllerDeleteErrors = {
|
|
322
|
-
401: unknown;
|
|
323
|
-
403: unknown;
|
|
324
|
-
};
|
|
325
|
-
export type WebhooksControllerDeleteResponses = {
|
|
326
|
-
200: DeleteWebhookResponse;
|
|
327
|
-
};
|
|
328
|
-
export type WebhooksControllerDeleteResponse = WebhooksControllerDeleteResponses[keyof WebhooksControllerDeleteResponses];
|
|
329
|
-
export type WebhooksControllerGetData = {
|
|
330
|
-
body?: never;
|
|
331
|
-
path: {
|
|
332
|
-
org_id: number;
|
|
333
|
-
id: number;
|
|
334
|
-
};
|
|
335
|
-
query?: never;
|
|
336
|
-
url: "/org/{org_id}/webhooks/{id}";
|
|
337
|
-
};
|
|
338
|
-
export type WebhooksControllerGetErrors = {
|
|
339
|
-
401: unknown;
|
|
340
|
-
403: unknown;
|
|
341
|
-
};
|
|
342
|
-
export type WebhooksControllerGetResponses = {
|
|
343
|
-
200: GetWebhookResponse;
|
|
344
|
-
};
|
|
345
|
-
export type WebhooksControllerGetResponse = WebhooksControllerGetResponses[keyof WebhooksControllerGetResponses];
|
|
346
|
-
export type WebhooksControllerUpdateData = {
|
|
347
|
-
body: UpdateWebhookBody;
|
|
348
|
-
path: {
|
|
349
|
-
org_id: number;
|
|
350
|
-
id: number;
|
|
351
|
-
};
|
|
352
|
-
query?: never;
|
|
353
|
-
url: "/org/{org_id}/webhooks/{id}";
|
|
354
|
-
};
|
|
355
|
-
export type WebhooksControllerUpdateErrors = {
|
|
356
|
-
401: unknown;
|
|
357
|
-
403: unknown;
|
|
358
|
-
};
|
|
359
|
-
export type WebhooksControllerUpdateResponses = {
|
|
360
|
-
200: UpdateWebhookResponse;
|
|
361
|
-
};
|
|
362
|
-
export type WebhooksControllerUpdateResponse = WebhooksControllerUpdateResponses[keyof WebhooksControllerUpdateResponses];
|
|
363
|
-
export type WebhooksControllerRegenerateSecretData = {
|
|
364
|
-
body?: never;
|
|
365
|
-
path: {
|
|
366
|
-
org_id: number;
|
|
367
|
-
id: number;
|
|
368
|
-
};
|
|
369
|
-
query?: never;
|
|
370
|
-
url: "/org/{org_id}/webhooks/{id}/regenerate-secret";
|
|
371
|
-
};
|
|
372
|
-
export type WebhooksControllerRegenerateSecretErrors = {
|
|
373
|
-
401: unknown;
|
|
374
|
-
403: unknown;
|
|
375
|
-
};
|
|
376
|
-
export type WebhooksControllerRegenerateSecretResponses = {
|
|
377
|
-
200: RegenerateWebhookSecretResponseDto;
|
|
378
|
-
};
|
|
379
|
-
export type WebhooksControllerRegenerateSecretResponse = WebhooksControllerRegenerateSecretResponses[keyof WebhooksControllerRegenerateSecretResponses];
|
|
380
|
-
export type WebhooksControllerTestData = {
|
|
381
|
-
body?: never;
|
|
382
|
-
path: {
|
|
383
|
-
org_id: number;
|
|
384
|
-
id: number;
|
|
385
|
-
};
|
|
386
|
-
query?: never;
|
|
387
|
-
url: "/org/{org_id}/webhooks/{id}/test";
|
|
388
|
-
};
|
|
389
|
-
export type WebhooksControllerTestErrors = {
|
|
390
|
-
401: unknown;
|
|
391
|
-
403: unknown;
|
|
392
|
-
};
|
|
393
|
-
export type WebhooksControllerTestResponses = {
|
|
394
|
-
200: TestWebhookResponse;
|
|
395
|
-
};
|
|
396
|
-
export type WebhooksControllerTestResponse = WebhooksControllerTestResponses[keyof WebhooksControllerTestResponses];
|
|
397
|
-
export type WebhooksControllerGetStatusData = {
|
|
398
|
-
body?: never;
|
|
399
|
-
path: {
|
|
400
|
-
org_id: number;
|
|
401
|
-
id: number;
|
|
402
|
-
};
|
|
403
|
-
query?: never;
|
|
404
|
-
url: "/org/{org_id}/webhooks/{id}/status";
|
|
405
|
-
};
|
|
406
|
-
export type WebhooksControllerGetStatusErrors = {
|
|
407
|
-
401: unknown;
|
|
408
|
-
403: unknown;
|
|
409
|
-
};
|
|
410
|
-
export type WebhooksControllerGetStatusResponses = {
|
|
411
|
-
200: GetWebhookStatusResponse;
|
|
412
|
-
};
|
|
413
|
-
export type WebhooksControllerGetStatusResponse = WebhooksControllerGetStatusResponses[keyof WebhooksControllerGetStatusResponses];
|
|
414
|
-
export type ClientOptions = {
|
|
415
|
-
baseUrl: string;
|
|
416
|
-
};
|
package/dist/client/types.gen.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.gen.js","sourceRoot":"","sources":["../../src/client/types.gen.ts"],"names":[],"mappings":""}
|
package/dist/event/index.d.ts
DELETED
package/dist/event/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./types.gen"), exports);
|
|
18
|
-
__exportStar(require("./parser"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
package/dist/event/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/event/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,2CAAyB"}
|
package/dist/event/parser.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare function parseWebhookEvent(req: Request, webhookSecret: string): {
|
|
2
|
-
id: string;
|
|
3
|
-
event_type: "test";
|
|
4
|
-
timestamp: string;
|
|
5
|
-
data: {
|
|
6
|
-
message: string;
|
|
7
|
-
};
|
|
8
|
-
} | {
|
|
9
|
-
event_type: "protocol.flight.submitted";
|
|
10
|
-
data: {
|
|
11
|
-
pilotAddress: string;
|
|
12
|
-
flightId: number;
|
|
13
|
-
flightManifestUri: string;
|
|
14
|
-
};
|
|
15
|
-
id?: any;
|
|
16
|
-
timestamp?: any;
|
|
17
|
-
};
|
package/dist/event/parser.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseWebhookEvent = parseWebhookEvent;
|
|
4
|
-
const types_gen_1 = require("./types.gen");
|
|
5
|
-
const WEBHOOK_SECRET_HEADER = "X-Webhook-Secret";
|
|
6
|
-
function parseWebhookEvent(req, webhookSecret) {
|
|
7
|
-
const secret = req.headers[WEBHOOK_SECRET_HEADER] ||
|
|
8
|
-
req.headers[WEBHOOK_SECRET_HEADER.toLowerCase()];
|
|
9
|
-
if (typeof secret !== "string") {
|
|
10
|
-
throw new Error("Webhook request signature is not a string");
|
|
11
|
-
}
|
|
12
|
-
if (!Buffer.isBuffer(req.body)) {
|
|
13
|
-
throw new Error("Webhook request body is not a Buffer");
|
|
14
|
-
}
|
|
15
|
-
if (secret !== webhookSecret) {
|
|
16
|
-
throw new Error("Invalid webhook secret");
|
|
17
|
-
}
|
|
18
|
-
return types_gen_1.Event.parse(JSON.parse(req.body.toString("utf-8")));
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=parser.js.map
|
package/dist/event/parser.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/event/parser.ts"],"names":[],"mappings":";;AAIA,8CAcC;AAlBD,2CAAoC;AAEpC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAEjD,SAAgB,iBAAiB,CAAC,GAAY,EAAE,aAAqB;IACnE,MAAM,MAAM,GACV,GAAG,CAAC,OAAO,CAAC,qBAAqB,CAAC;QAClC,GAAG,CAAC,OAAO,CAAC,qBAAqB,CAAC,WAAW,EAAE,CAAC,CAAC;IACnD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/D,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC;IACD,IAAI,MAAM,KAAK,aAAa,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,iBAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const Event: z.ZodUnion<[z.ZodObject<{
|
|
3
|
-
id: z.ZodString;
|
|
4
|
-
event_type: z.ZodLiteral<"test">;
|
|
5
|
-
timestamp: z.ZodString;
|
|
6
|
-
data: z.ZodObject<{
|
|
7
|
-
message: z.ZodString;
|
|
8
|
-
}, "strict", z.ZodTypeAny, {
|
|
9
|
-
message: string;
|
|
10
|
-
}, {
|
|
11
|
-
message: string;
|
|
12
|
-
}>;
|
|
13
|
-
}, "strict", z.ZodTypeAny, {
|
|
14
|
-
id: string;
|
|
15
|
-
event_type: "test";
|
|
16
|
-
timestamp: string;
|
|
17
|
-
data: {
|
|
18
|
-
message: string;
|
|
19
|
-
};
|
|
20
|
-
}, {
|
|
21
|
-
id: string;
|
|
22
|
-
event_type: "test";
|
|
23
|
-
timestamp: string;
|
|
24
|
-
data: {
|
|
25
|
-
message: string;
|
|
26
|
-
};
|
|
27
|
-
}>, z.ZodObject<{
|
|
28
|
-
id: z.ZodAny;
|
|
29
|
-
event_type: z.ZodLiteral<"protocol.flight.submitted">;
|
|
30
|
-
timestamp: z.ZodAny;
|
|
31
|
-
data: z.ZodObject<{
|
|
32
|
-
flightId: z.ZodNumber;
|
|
33
|
-
pilotAddress: z.ZodString;
|
|
34
|
-
flightManifestUri: z.ZodString;
|
|
35
|
-
}, "strict", z.ZodTypeAny, {
|
|
36
|
-
pilotAddress: string;
|
|
37
|
-
flightId: number;
|
|
38
|
-
flightManifestUri: string;
|
|
39
|
-
}, {
|
|
40
|
-
pilotAddress: string;
|
|
41
|
-
flightId: number;
|
|
42
|
-
flightManifestUri: string;
|
|
43
|
-
}>;
|
|
44
|
-
}, "strict", z.ZodTypeAny, {
|
|
45
|
-
event_type: "protocol.flight.submitted";
|
|
46
|
-
data: {
|
|
47
|
-
pilotAddress: string;
|
|
48
|
-
flightId: number;
|
|
49
|
-
flightManifestUri: string;
|
|
50
|
-
};
|
|
51
|
-
id?: any;
|
|
52
|
-
timestamp?: any;
|
|
53
|
-
}, {
|
|
54
|
-
event_type: "protocol.flight.submitted";
|
|
55
|
-
data: {
|
|
56
|
-
pilotAddress: string;
|
|
57
|
-
flightId: number;
|
|
58
|
-
flightManifestUri: string;
|
|
59
|
-
};
|
|
60
|
-
id?: any;
|
|
61
|
-
timestamp?: any;
|
|
62
|
-
}>]>;
|
|
63
|
-
export type Event = z.infer<typeof Event>;
|
package/dist/event/types.gen.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Event = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.Event = zod_1.z.union([
|
|
6
|
-
zod_1.z
|
|
7
|
-
.object({
|
|
8
|
-
id: zod_1.z.string(),
|
|
9
|
-
event_type: zod_1.z.literal("test"),
|
|
10
|
-
timestamp: zod_1.z.string(),
|
|
11
|
-
data: zod_1.z.object({ message: zod_1.z.string() }).strict(),
|
|
12
|
-
})
|
|
13
|
-
.strict(),
|
|
14
|
-
zod_1.z
|
|
15
|
-
.object({
|
|
16
|
-
id: zod_1.z.any(),
|
|
17
|
-
event_type: zod_1.z.literal("protocol.flight.submitted"),
|
|
18
|
-
timestamp: zod_1.z.any(),
|
|
19
|
-
data: zod_1.z
|
|
20
|
-
.object({
|
|
21
|
-
flightId: zod_1.z.number(),
|
|
22
|
-
pilotAddress: zod_1.z.string(),
|
|
23
|
-
flightManifestUri: zod_1.z.string(),
|
|
24
|
-
})
|
|
25
|
-
.strict(),
|
|
26
|
-
})
|
|
27
|
-
.strict(),
|
|
28
|
-
]);
|
|
29
|
-
//# sourceMappingURL=types.gen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.gen.js","sourceRoot":"","sources":["../../src/event/types.gen.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AAEX,QAAA,KAAK,GAAG,OAAC,CAAC,KAAK,CAAC;IAC3B,OAAC;SACE,MAAM,CAAC;QACN,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;QACd,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QAC7B,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;QACrB,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;KACjD,CAAC;SACD,MAAM,EAAE;IACX,OAAC;SACE,MAAM,CAAC;QACN,EAAE,EAAE,OAAC,CAAC,GAAG,EAAE;QACX,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,2BAA2B,CAAC;QAClD,SAAS,EAAE,OAAC,CAAC,GAAG,EAAE;QAClB,IAAI,EAAE,OAAC;aACJ,MAAM,CAAC;YACN,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;YACpB,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;YACxB,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE;SAC9B,CAAC;aACD,MAAM,EAAE;KACZ,CAAC;SACD,MAAM,EAAE;CACZ,CAAC,CAAC"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,0CAAwB"}
|