@fern-api/fdr-sdk 1.2.158-2a3de2b6ef → 1.2.158-3ca6ed3799

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/js/index.js CHANGED
@@ -252,6 +252,7 @@ __export(api_definition_exports, {
252
252
  joiner: () => joiner,
253
253
  preprocessQueryParameters: () => preprocessQueryParameters,
254
254
  prune: () => prune,
255
+ pruneEndpointForExampleSnippet: () => pruneEndpointForExampleSnippet,
255
256
  pruneEndpointToSchemaSelector: () => pruneEndpointToSchemaSelector,
256
257
  replaceMultipartTemplateStrings: () => replaceMultipartTemplateStrings,
257
258
  replaceTemplateStrings: () => replaceTemplateStrings,
@@ -5468,6 +5469,34 @@ var ApiDefinitionV1ToLatest = class _ApiDefinitionV1ToLatest {
5468
5469
  );
5469
5470
  };
5470
5471
 
5472
+ // src/api-definition/prune-endpoint-example.ts
5473
+ function pruneEndpointForExampleSnippet(endpoint, exampleName) {
5474
+ const matching = exampleName != null ? endpoint.examples?.filter((example) => example.name === exampleName) : void 0;
5475
+ const examples = matching != null && matching.length > 0 ? matching : endpoint.examples;
5476
+ return {
5477
+ id: endpoint.id,
5478
+ namespace: endpoint.namespace,
5479
+ method: endpoint.method,
5480
+ path: endpoint.path,
5481
+ displayName: endpoint.displayName,
5482
+ operationId: endpoint.operationId,
5483
+ availability: endpoint.availability,
5484
+ auth: endpoint.auth,
5485
+ multiAuth: endpoint.multiAuth,
5486
+ defaultEnvironment: endpoint.defaultEnvironment,
5487
+ environments: endpoint.environments,
5488
+ errors: endpoint.errors?.map((error) => ({
5489
+ name: error.name,
5490
+ statusCode: error.statusCode,
5491
+ isWildcard: error.isWildcard,
5492
+ examples: error.examples
5493
+ })),
5494
+ examples,
5495
+ protocol: endpoint.protocol,
5496
+ includeInApiExplorer: endpoint.includeInApiExplorer
5497
+ };
5498
+ }
5499
+
5471
5500
  // src/api-definition/prune-endpoint-schema.ts
5472
5501
  var ALL_SECTIONS = ["request.path", "request.query", "request.body", "response.body"];
5473
5502
  function getSchemaSectionsForSelector(selector) {