@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.
@@ -2640,6 +2640,7 @@ __export(api_definition_exports, {
2640
2640
  joiner: () => joiner,
2641
2641
  preprocessQueryParameters: () => preprocessQueryParameters,
2642
2642
  prune: () => prune,
2643
+ pruneEndpointForExampleSnippet: () => pruneEndpointForExampleSnippet,
2643
2644
  pruneEndpointToSchemaSelector: () => pruneEndpointToSchemaSelector,
2644
2645
  replaceMultipartTemplateStrings: () => replaceMultipartTemplateStrings,
2645
2646
  replaceTemplateStrings: () => replaceTemplateStrings,
@@ -6468,6 +6469,34 @@ var ApiDefinitionV1ToLatest = class _ApiDefinitionV1ToLatest {
6468
6469
  );
6469
6470
  };
6470
6471
 
6472
+ // src/api-definition/prune-endpoint-example.ts
6473
+ function pruneEndpointForExampleSnippet(endpoint, exampleName) {
6474
+ const matching = exampleName != null ? endpoint.examples?.filter((example) => example.name === exampleName) : void 0;
6475
+ const examples = matching != null && matching.length > 0 ? matching : endpoint.examples;
6476
+ return {
6477
+ id: endpoint.id,
6478
+ namespace: endpoint.namespace,
6479
+ method: endpoint.method,
6480
+ path: endpoint.path,
6481
+ displayName: endpoint.displayName,
6482
+ operationId: endpoint.operationId,
6483
+ availability: endpoint.availability,
6484
+ auth: endpoint.auth,
6485
+ multiAuth: endpoint.multiAuth,
6486
+ defaultEnvironment: endpoint.defaultEnvironment,
6487
+ environments: endpoint.environments,
6488
+ errors: endpoint.errors?.map((error) => ({
6489
+ name: error.name,
6490
+ statusCode: error.statusCode,
6491
+ isWildcard: error.isWildcard,
6492
+ examples: error.examples
6493
+ })),
6494
+ examples,
6495
+ protocol: endpoint.protocol,
6496
+ includeInApiExplorer: endpoint.includeInApiExplorer
6497
+ };
6498
+ }
6499
+
6471
6500
  // src/api-definition/prune-endpoint-schema.ts
6472
6501
  var ALL_SECTIONS = ["request.path", "request.query", "request.body", "response.body"];
6473
6502
  function getSchemaSectionsForSelector(selector) {