@@ -176,7 +176,12 @@ function matchHaberdasherRoute<T extends TwirpContext = TwirpContext>(
176
176
) => {
177
177
ctx = { ...ctx , methodName : "MakeHat" } ;
178
178
await events . onMatch ( ctx ) ;
179
- return handleMakeHatRequest ( ctx , service , data , interceptors ) ;
179
+ return handleHaberdasherMakeHatRequest (
180
+ ctx ,
181
+ service ,
182
+ data ,
183
+ interceptors
184
+ ) ;
180
185
} ;
181
186
case "FindHat" :
182
187
return async (
@@ -187,7 +192,12 @@ function matchHaberdasherRoute<T extends TwirpContext = TwirpContext>(
187
192
) => {
188
193
ctx = { ...ctx , methodName : "FindHat" } ;
189
194
await events . onMatch ( ctx ) ;
190
- return handleFindHatRequest ( ctx , service , data , interceptors ) ;
195
+ return handleHaberdasherFindHatRequest (
196
+ ctx ,
197
+ service ,
198
+ data ,
199
+ interceptors
200
+ ) ;
191
201
} ;
192
202
case "ListHat" :
193
203
return async (
@@ -198,7 +208,12 @@ function matchHaberdasherRoute<T extends TwirpContext = TwirpContext>(
198
208
) => {
199
209
ctx = { ...ctx , methodName : "ListHat" } ;
200
210
await events . onMatch ( ctx ) ;
201
- return handleListHatRequest ( ctx , service , data , interceptors ) ;
211
+ return handleHaberdasherListHatRequest (
212
+ ctx ,
213
+ service ,
214
+ data ,
215
+ interceptors
216
+ ) ;
202
217
} ;
203
218
default :
204
219
events . onNotFound ( ) ;
@@ -207,57 +222,74 @@ function matchHaberdasherRoute<T extends TwirpContext = TwirpContext>(
207
222
}
208
223
}
209
224
210
- function handleMakeHatRequest < T extends TwirpContext = TwirpContext > (
225
+ function handleHaberdasherMakeHatRequest < T extends TwirpContext = TwirpContext > (
211
226
ctx : T ,
212
227
service : HaberdasherTwirp ,
213
228
data : Buffer ,
214
229
interceptors ?: Interceptor < T , Size , Hat > [ ]
215
230
) : Promise < string | Uint8Array > {
216
231
switch ( ctx . contentType ) {
217
232
case TwirpContentType . JSON :
218
- return handleMakeHatJSON < T > ( ctx , service , data , interceptors ) ;
233
+ return handleHaberdasherMakeHatJSON < T > ( ctx , service , data , interceptors ) ;
219
234
case TwirpContentType . Protobuf :
220
- return handleMakeHatProtobuf < T > ( ctx , service , data , interceptors ) ;
235
+ return handleHaberdasherMakeHatProtobuf < T > (
236
+ ctx ,
237
+ service ,
238
+ data ,
239
+ interceptors
240
+ ) ;
221
241
default :
222
242
const msg = "unexpected Content-Type" ;
223
243
throw new TwirpError ( TwirpErrorCode . BadRoute , msg ) ;
224
244
}
225
245
}
226
246
227
- function handleFindHatRequest < T extends TwirpContext = TwirpContext > (
247
+ function handleHaberdasherFindHatRequest < T extends TwirpContext = TwirpContext > (
228
248
ctx : T ,
229
249
service : HaberdasherTwirp ,
230
250
data : Buffer ,
231
251
interceptors ?: Interceptor < T , FindHatRPC , FindHatRPC > [ ]
232
252
) : Promise < string | Uint8Array > {
233
253
switch ( ctx . contentType ) {
234
254
case TwirpContentType . JSON :
235
- return handleFindHatJSON < T > ( ctx , service , data , interceptors ) ;
255
+ return handleHaberdasherFindHatJSON < T > ( ctx , service , data , interceptors ) ;
236
256
case TwirpContentType . Protobuf :
237
- return handleFindHatProtobuf < T > ( ctx , service , data , interceptors ) ;
257
+ return handleHaberdasherFindHatProtobuf < T > (
258
+ ctx ,
259
+ service ,
260
+ data ,
261
+ interceptors
262
+ ) ;
238
263
default :
239
264
const msg = "unexpected Content-Type" ;
240
265
throw new TwirpError ( TwirpErrorCode . BadRoute , msg ) ;
241
266
}
242
267
}
243
268
244
- function handleListHatRequest < T extends TwirpContext = TwirpContext > (
269
+ function handleHaberdasherListHatRequest < T extends TwirpContext = TwirpContext > (
245
270
ctx : T ,
246
271
service : HaberdasherTwirp ,
247
272
data : Buffer ,
248
273
interceptors ?: Interceptor < T , ListHatRPC , ListHatRPC > [ ]
249
274
) : Promise < string | Uint8Array > {
250
275
switch ( ctx . contentType ) {
251
276
case TwirpContentType . JSON :
252
- return handleListHatJSON < T > ( ctx , service , data , interceptors ) ;
277
+ return handleHaberdasherListHatJSON < T > ( ctx , service , data , interceptors ) ;
253
278
case TwirpContentType . Protobuf :
254
- return handleListHatProtobuf < T > ( ctx , service , data , interceptors ) ;
279
+ return handleHaberdasherListHatProtobuf < T > (
280
+ ctx ,
281
+ service ,
282
+ data ,
283
+ interceptors
284
+ ) ;
255
285
default :
256
286
const msg = "unexpected Content-Type" ;
257
287
throw new TwirpError ( TwirpErrorCode . BadRoute , msg ) ;
258
288
}
259
289
}
260
- async function handleMakeHatJSON < T extends TwirpContext = TwirpContext > (
290
+ async function handleHaberdasherMakeHatJSON <
291
+ T extends TwirpContext = TwirpContext
292
+ > (
261
293
ctx : T ,
262
294
service : HaberdasherTwirp ,
263
295
data : Buffer ,
@@ -297,7 +329,9 @@ async function handleMakeHatJSON<T extends TwirpContext = TwirpContext>(
297
329
) ;
298
330
}
299
331
300
- async function handleFindHatJSON < T extends TwirpContext = TwirpContext > (
332
+ async function handleHaberdasherFindHatJSON <
333
+ T extends TwirpContext = TwirpContext
334
+ > (
301
335
ctx : T ,
302
336
service : HaberdasherTwirp ,
303
337
data : Buffer ,
@@ -337,7 +371,9 @@ async function handleFindHatJSON<T extends TwirpContext = TwirpContext>(
337
371
) ;
338
372
}
339
373
340
- async function handleListHatJSON < T extends TwirpContext = TwirpContext > (
374
+ async function handleHaberdasherListHatJSON <
375
+ T extends TwirpContext = TwirpContext
376
+ > (
341
377
ctx : T ,
342
378
service : HaberdasherTwirp ,
343
379
data : Buffer ,
@@ -376,7 +412,9 @@ async function handleListHatJSON<T extends TwirpContext = TwirpContext>(
376
412
} ) as string
377
413
) ;
378
414
}
379
- async function handleMakeHatProtobuf < T extends TwirpContext = TwirpContext > (
415
+ async function handleHaberdasherMakeHatProtobuf <
416
+ T extends TwirpContext = TwirpContext
417
+ > (
380
418
ctx : T ,
381
419
service : HaberdasherTwirp ,
382
420
data : Buffer ,
@@ -410,7 +448,9 @@ async function handleMakeHatProtobuf<T extends TwirpContext = TwirpContext>(
410
448
return Buffer . from ( Hat . toBinary ( response ) ) ;
411
449
}
412
450
413
- async function handleFindHatProtobuf < T extends TwirpContext = TwirpContext > (
451
+ async function handleHaberdasherFindHatProtobuf <
452
+ T extends TwirpContext = TwirpContext
453
+ > (
414
454
ctx : T ,
415
455
service : HaberdasherTwirp ,
416
456
data : Buffer ,
@@ -444,7 +484,9 @@ async function handleFindHatProtobuf<T extends TwirpContext = TwirpContext>(
444
484
return Buffer . from ( FindHatRPC . toBinary ( response ) ) ;
445
485
}
446
486
447
- async function handleListHatProtobuf < T extends TwirpContext = TwirpContext > (
487
+ async function handleHaberdasherListHatProtobuf <
488
+ T extends TwirpContext = TwirpContext
489
+ > (
448
490
ctx : T ,
449
491
service : HaberdasherTwirp ,
450
492
data : Buffer ,
0 commit comments