@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.
@@ -211,6 +211,7 @@ __export(api_definition_exports, {
211
211
  joiner: () => joiner,
212
212
  preprocessQueryParameters: () => preprocessQueryParameters,
213
213
  prune: () => prune,
214
+ pruneEndpointForExampleSnippet: () => pruneEndpointForExampleSnippet,
214
215
  pruneEndpointToSchemaSelector: () => pruneEndpointToSchemaSelector,
215
216
  replaceMultipartTemplateStrings: () => replaceMultipartTemplateStrings,
216
217
  replaceTemplateStrings: () => replaceTemplateStrings,
@@ -5392,6 +5393,34 @@ var ApiDefinitionV1ToLatest = class _ApiDefinitionV1ToLatest {
5392
5393
  );
5393
5394
  };
5394
5395
 
5396
+ // src/api-definition/prune-endpoint-example.ts
5397
+ function pruneEndpointForExampleSnippet(endpoint, exampleName) {
5398
+ const matching = exampleName != null ? endpoint.examples?.filter((example) => example.name === exampleName) : void 0;
5399
+ const examples = matching != null && matching.length > 0 ? matching : endpoint.examples;
5400
+ return {
5401
+ id: endpoint.id,
5402
+ namespace: endpoint.namespace,
5403
+ method: endpoint.method,
5404
+ path: endpoint.path,
5405
+ displayName: endpoint.displayName,
5406
+ operationId: endpoint.operationId,
5407
+ availability: endpoint.availability,
5408
+ auth: endpoint.auth,
5409
+ multiAuth: endpoint.multiAuth,
5410
+ defaultEnvironment: endpoint.defaultEnvironment,
5411
+ environments: endpoint.environments,
5412
+ errors: endpoint.errors?.map((error) => ({
5413
+ name: error.name,
5414
+ statusCode: error.statusCode,
5415
+ isWildcard: error.isWildcard,
5416
+ examples: error.examples
5417
+ })),
5418
+ examples,
5419
+ protocol: endpoint.protocol,
5420
+ includeInApiExplorer: endpoint.includeInApiExplorer
5421
+ };
5422
+ }
5423
+
5395
5424
  // src/api-definition/prune-endpoint-schema.ts
5396
5425
  var ALL_SECTIONS = ["request.path", "request.query", "request.body", "response.body"];
5397
5426
  function getSchemaSectionsForSelector(selector) {
@@ -7252,6 +7281,7 @@ var Transformer = class _Transformer {
7252
7281
  joiner,
7253
7282
  preprocessQueryParameters,
7254
7283
  prune,
7284
+ pruneEndpointForExampleSnippet,
7255
7285
  pruneEndpointToSchemaSelector,
7256
7286
  replaceMultipartTemplateStrings,
7257
7287
  replaceTemplateStrings,