(
featureId: string,
wptMetricView: FeatureWPTMetricViewType,
)
| 473 | return result.data!; |
| 474 | } |
| 475 | |
| 476 | public async getFeature( |
| 477 | featureId: string, |
| 478 | wptMetricView: FeatureWPTMetricViewType, |
| 479 | ): Promise<components['schemas']['Feature']> { |
| 480 | const qsParams: paths['/v1/features/{feature_id}']['get']['parameters']['query'] = |
| 481 | {}; |
| 482 | if (wptMetricView) qsParams.wpt_metric_view = wptMetricView; |
| 483 | return this.handleResponse( |
| 484 | this.client.GET('/v1/features/{feature_id}', { |
| 485 | params: { |
| 486 | path: {feature_id: featureId}, |
| 487 | query: qsParams, |
| 488 | }, |
| 489 | }), |
| 490 | '/v1/features/{feature_id}', |
| 491 | 'get', |
| 492 | { |
| 493 | statusHandlers: { |
| 494 | 200: (data, _d, response) => { |
| 495 | if (response.redirected && isFeature(data)) { |
| 496 | const newId = response.url.split('/').pop() || ''; |
| 497 | throw new FeatureMovedError('Redirected', newId, data); |
| 498 | } |
| 499 | }, |
| 500 | 410: error => { |
| 501 | if (isFeatureGoneError(error)) { |
| 502 | throw new FeatureGoneSplitError( |
| 503 | error.message, |
| 504 | error.new_features.map(f => f.id), |
| 505 | ); |
| 506 | } |
| 507 | }, |
| 508 | }, |
| 509 | }, |
| 510 | ); |
| 511 | } |
| 512 | |
| 513 | public getFeatureMetadata( |
no test coverage detected