@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.mjs CHANGED
@@ -188,6 +188,7 @@ __export(api_definition_exports, {
188
188
  joiner: () => joiner,
189
189
  preprocessQueryParameters: () => preprocessQueryParameters,
190
190
  prune: () => prune,
191
+ pruneEndpointForExampleSnippet: () => pruneEndpointForExampleSnippet,
191
192
  pruneEndpointToSchemaSelector: () => pruneEndpointToSchemaSelector,
192
193
  replaceMultipartTemplateStrings: () => replaceMultipartTemplateStrings,
193
194
  replaceTemplateStrings: () => replaceTemplateStrings,
@@ -5404,6 +5405,34 @@ var ApiDefinitionV1ToLatest = class _ApiDefinitionV1ToLatest {
5404
5405
  );
5405
5406
  };
5406
5407
 
5408
+ // src/api-definition/prune-endpoint-example.ts
5409
+ function pruneEndpointForExampleSnippet(endpoint, exampleName) {
5410
+ const matching = exampleName != null ? endpoint.examples?.filter((example) => example.name === exampleName) : void 0;
5411
+ const examples = matching != null && matching.length > 0 ? matching : endpoint.examples;
5412
+ return {
5413
+ id: endpoint.id,
5414
+ namespace: endpoint.namespace,
5415
+ method: endpoint.method,
5416
+ path: endpoint.path,
5417
+ displayName: endpoint.displayName,
5418
+ operationId: endpoint.operationId,
5419
+ availability: endpoint.availability,
5420
+ auth: endpoint.auth,
5421
+ multiAuth: endpoint.multiAuth,
5422
+ defaultEnvironment: endpoint.defaultEnvironment,
5423
+ environments: endpoint.environments,
5424
+ errors: endpoint.errors?.map((error) => ({
5425
+ name: error.name,
5426
+ statusCode: error.statusCode,
5427
+ isWildcard: error.isWildcard,
5428
+ examples: error.examples
5429
+ })),
5430
+ examples,
5431
+ protocol: endpoint.protocol,
5432
+ includeInApiExplorer: endpoint.includeInApiExplorer
5433
+ };
5434
+ }
5435
+
5407
5436
  // src/api-definition/prune-endpoint-schema.ts
5408
5437
  var ALL_SECTIONS = ["request.path", "request.query", "request.body", "response.body"];
5409
5438
  function getSchemaSectionsForSelector(selector) {