fern-api 0.16.39 → 0.16.41

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.
Files changed (2) hide show
  1. package/bundle.cjs +39 -12
  2. package/package.json +1 -1
package/bundle.cjs CHANGED
@@ -735888,7 +735888,8 @@ var GeneratorInvocationSchema = z.strictObject({
735888
735888
  version: z.string(),
735889
735889
  output: z.optional(GeneratorOutputSchema),
735890
735890
  github: z.optional(GithubConfigurationSchema),
735891
- config: z.unknown()
735891
+ config: z.unknown(),
735892
+ "disable-examples": z.optional(z.boolean())
735892
735893
  });
735893
735894
 
735894
735895
  // pnp:/home/circleci/project/packages/cli/config-management/generators-configuration/lib/schemas/GeneratorGroupSchema.js
@@ -735943,6 +735944,7 @@ async function convertGenerator({ absolutePathToGeneratorsConfiguration, generat
735943
735944
  version: generator.version,
735944
735945
  config: generator.config,
735945
735946
  outputMode: await convertOutputMode({ absolutePathToGeneratorsConfiguration, generator }),
735947
+ disableExamples: generator["disable-examples"] ?? false,
735946
735948
  absolutePathToLocalOutput: ((_a2 = generator.output) == null ? void 0 : _a2.location) === "local-file-system" ? resolve(dirname(absolutePathToGeneratorsConfiguration), generator.output.path) : void 0,
735947
735949
  language: getLanguageFromGeneratorName(generator.name)
735948
735950
  };
@@ -739558,7 +739560,7 @@ var AccessTokenPosthogManager = class {
739558
739560
  properties: {
739559
739561
  ...event,
739560
739562
  ...event.properties,
739561
- version: "0.16.39",
739563
+ version: "0.16.41",
739562
739564
  usingAccessToken: true
739563
739565
  }
739564
739566
  });
@@ -739620,7 +739622,7 @@ var UserPosthogManager = class {
739620
739622
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
739621
739623
  event: "CLI",
739622
739624
  properties: {
739623
- version: "0.16.39",
739625
+ version: "0.16.41",
739624
739626
  ...event,
739625
739627
  ...event.properties
739626
739628
  }
@@ -753882,6 +753884,14 @@ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, prop
753882
753884
  description,
753883
753885
  groupName
753884
753886
  });
753887
+ } else if (schema2.format === "json-string") {
753888
+ return import_parseIr10.SchemaWithExample.unknown({
753889
+ nameOverride,
753890
+ generatedName,
753891
+ description,
753892
+ groupName,
753893
+ example: void 0
753894
+ });
753885
753895
  }
753886
753896
  const maybeConstValue = getProperty(schema2, "const");
753887
753897
  if (maybeConstValue != null) {
@@ -764974,10 +764984,10 @@ var CliContext = class {
764974
764984
  return "fern-api";
764975
764985
  }
764976
764986
  getPackageVersion() {
764977
- if ("0.16.39" == null) {
764987
+ if ("0.16.41" == null) {
764978
764988
  this.logger.error("CLI_VERSION is not defined");
764979
764989
  }
764980
- return "0.16.39";
764990
+ return "0.16.41";
764981
764991
  }
764982
764992
  getCliName() {
764983
764993
  if ("fern" == null) {
@@ -770070,7 +770080,7 @@ var VariableResolverImpl = _VariableResolverImpl;
770070
770080
  __publicField(VariableResolverImpl, "VARIABLE_PREFIX", "$");
770071
770081
 
770072
770082
  // pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/generateIntermediateRepresentation.js
770073
- async function generateIntermediateRepresentation({ workspace, generationLanguage, audiences }) {
770083
+ async function generateIntermediateRepresentation({ workspace, generationLanguage, disableExamples, audiences }) {
770074
770084
  const casingsGenerator = constructCasingsGenerator(generationLanguage);
770075
770085
  const irGraph = new IrGraph(audiences);
770076
770086
  const rootApiFileContext = constructRootApiFileContext({
@@ -770150,6 +770160,9 @@ async function generateIntermediateRepresentation({ workspace, generationLanguag
770150
770160
  workspace
770151
770161
  });
770152
770162
  const convertedTypeDeclaration = convertedTypeDeclarationWithFilepaths.typeDeclaration;
770163
+ if (disableExamples) {
770164
+ convertedTypeDeclaration.examples = [];
770165
+ }
770153
770166
  const subpackageFilepaths = convertedTypeDeclarationWithFilepaths.descendantFilepaths;
770154
770167
  const typeId = IdGenerator.generateTypeId(convertedTypeDeclaration.name);
770155
770168
  intermediateRepresentation.types[typeId] = convertedTypeDeclaration;
@@ -770204,6 +770217,9 @@ async function generateIntermediateRepresentation({ workspace, generationLanguag
770204
770217
  packageTreeGenerator.addService(serviceId, convertedHttpService);
770205
770218
  const convertedEndpoints = {};
770206
770219
  convertedHttpService.endpoints.forEach((httpEndpoint) => {
770220
+ if (disableExamples) {
770221
+ httpEndpoint.examples = [];
770222
+ }
770207
770223
  const rawEndpointSchema = service.endpoints[httpEndpoint.name.originalName];
770208
770224
  irGraph.addEndpoint(convertedHttpService, httpEndpoint, rawEndpointSchema);
770209
770225
  convertedEndpoints[httpEndpoint.name.originalName] = httpEndpoint;
@@ -770393,7 +770409,8 @@ async function registerApi({ organization, workspace, context, token, audiences,
770393
770409
  const ir = await generateIntermediateRepresentation({
770394
770410
  workspace,
770395
770411
  audiences,
770396
- generationLanguage: void 0
770412
+ generationLanguage: void 0,
770413
+ disableExamples: false
770397
770414
  });
770398
770415
  const fdrService = createFdrService({
770399
770416
  token: token.value
@@ -772987,12 +773004,14 @@ async function generateIrForFernWorkspace({
772987
773004
  workspace,
772988
773005
  context,
772989
773006
  generationLanguage,
773007
+ disableExamples,
772990
773008
  audiences
772991
773009
  }) {
772992
773010
  await validateAPIWorkspaceAndLogIssues({ workspace, context, logWarnings: false });
772993
773011
  return generateIntermediateRepresentation({
772994
773012
  workspace,
772995
773013
  generationLanguage,
773014
+ disableExamples,
772996
773015
  audiences
772997
773016
  });
772998
773017
  }
@@ -773012,7 +773031,8 @@ async function generateFdrApiDefinitionForWorkspaces({
773012
773031
  workspace: fernWorkspace,
773013
773032
  context,
773014
773033
  generationLanguage: void 0,
773015
- audiences
773034
+ audiences,
773035
+ disableExamples: false
773016
773036
  });
773017
773037
  const apiDefinition = convertIrToFdrApi(intermediateRepresentation, {});
773018
773038
  const resolvedOutputFilePath = import_path29.default.resolve(outputFilepath);
@@ -778804,6 +778824,7 @@ async function generateIrForWorkspaces({
778804
778824
  workspace: fernWorkspace,
778805
778825
  context,
778806
778826
  generationLanguage,
778827
+ disableExamples: false,
778807
778828
  audiences,
778808
778829
  version: version3
778809
778830
  });
@@ -778822,13 +778843,15 @@ async function getIntermediateRepresentation({
778822
778843
  context,
778823
778844
  generationLanguage,
778824
778845
  audiences,
778846
+ disableExamples,
778825
778847
  version: version3
778826
778848
  }) {
778827
778849
  const intermediateRepresentation = await generateIrForFernWorkspace({
778828
778850
  workspace,
778829
778851
  context,
778830
778852
  generationLanguage,
778831
- audiences
778853
+ audiences,
778854
+ disableExamples
778832
778855
  });
778833
778856
  if (version3 == null) {
778834
778857
  return IrSerialization2.IntermediateRepresentation.jsonOrThrow(intermediateRepresentation, {
@@ -779331,7 +779354,8 @@ async function writeIrToFile({ workspace, audiences, generatorInvocation, worksp
779331
779354
  const intermediateRepresentation = await generateIntermediateRepresentation({
779332
779355
  workspace,
779333
779356
  audiences,
779334
- generationLanguage: generatorInvocation.language
779357
+ generationLanguage: generatorInvocation.language,
779358
+ disableExamples: generatorInvocation.disableExamples
779335
779359
  });
779336
779360
  context.logger.debug("Generated IR");
779337
779361
  const migratedIntermediateRepresentation = irVersionOverride != null ? await migrateIntermediateRepresentationThroughVersion({
@@ -779668,6 +779692,7 @@ async function runRemoteGenerationForGenerator({ organization, workspace, intera
779668
779692
  const intermediateRepresentation = await generateIntermediateRepresentation({
779669
779693
  workspace,
779670
779694
  generationLanguage: generatorInvocation.language,
779695
+ disableExamples: generatorInvocation.disableExamples,
779671
779696
  audiences
779672
779697
  });
779673
779698
  const job = await createAndStartJob({
@@ -806517,7 +806542,8 @@ async function mockServer({
806517
806542
  const ir = await generateIntermediateRepresentation({
806518
806543
  workspace: fernWorkspace,
806519
806544
  audiences: { type: "all" },
806520
- generationLanguage: void 0
806545
+ generationLanguage: void 0,
806546
+ disableExamples: false
806521
806547
  });
806522
806548
  await runMockServer({
806523
806549
  context,
@@ -806592,7 +806618,8 @@ var ReferencedAPICollector = class {
806592
806618
  const ir = await generateIntermediateRepresentation({
806593
806619
  workspace: fernWorkspace,
806594
806620
  audiences: api.audiences,
806595
- generationLanguage: void 0
806621
+ generationLanguage: void 0,
806622
+ disableExamples: false
806596
806623
  });
806597
806624
  const apiDefinition = convertIrToFdrApi(ir, {});
806598
806625
  const dbApiDefinition = (0, import_fdr_sdk4.convertAPIDefinitionToDb)(apiDefinition, "", new import_fdr_sdk4.SDKSnippetHolder({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.16.39",
3
+ "version": "0.16.41",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",