@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.
@@ -2616,6 +2616,7 @@ __export(api_definition_exports, {
2616
2616
  joiner: () => joiner,
2617
2617
  preprocessQueryParameters: () => preprocessQueryParameters,
2618
2618
  prune: () => prune,
2619
+ pruneEndpointForExampleSnippet: () => pruneEndpointForExampleSnippet,
2619
2620
  pruneEndpointToSchemaSelector: () => pruneEndpointToSchemaSelector,
2620
2621
  replaceMultipartTemplateStrings: () => replaceMultipartTemplateStrings,
2621
2622
  replaceTemplateStrings: () => replaceTemplateStrings,
@@ -6444,6 +6445,34 @@ var ApiDefinitionV1ToLatest = class _ApiDefinitionV1ToLatest {
6444
6445
  );
6445
6446
  };
6446
6447
 
6448
+ // src/api-definition/prune-endpoint-example.ts
6449
+ function pruneEndpointForExampleSnippet(endpoint, exampleName) {
6450
+ const matching = exampleName != null ? endpoint.examples?.filter((example) => example.name === exampleName) : void 0;
6451
+ const examples = matching != null && matching.length > 0 ? matching : endpoint.examples;
6452
+ return {
6453
+ id: endpoint.id,
6454
+ namespace: endpoint.namespace,
6455
+ method: endpoint.method,
6456
+ path: endpoint.path,
6457
+ displayName: endpoint.displayName,
6458
+ operationId: endpoint.operationId,
6459
+ availability: endpoint.availability,
6460
+ auth: endpoint.auth,
6461
+ multiAuth: endpoint.multiAuth,
6462
+ defaultEnvironment: endpoint.defaultEnvironment,
6463
+ environments: endpoint.environments,
6464
+ errors: endpoint.errors?.map((error) => ({
6465
+ name: error.name,
6466
+ statusCode: error.statusCode,
6467
+ isWildcard: error.isWildcard,
6468
+ examples: error.examples
6469
+ })),
6470
+ examples,
6471
+ protocol: endpoint.protocol,
6472
+ includeInApiExplorer: endpoint.includeInApiExplorer
6473
+ };
6474
+ }
6475
+
6447
6476
  // src/api-definition/prune-endpoint-schema.ts
6448
6477
  var ALL_SECTIONS = ["request.path", "request.query", "request.body", "response.body"];
6449
6478
  function getSchemaSectionsForSelector(selector) {