fern-api 0.18.0-rc0 → 0.18.1-rc1

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 -29
  2. package/package.json +1 -1
package/bundle.cjs CHANGED
@@ -739640,7 +739640,7 @@ var AccessTokenPosthogManager = class {
739640
739640
  properties: {
739641
739641
  ...event,
739642
739642
  ...event.properties,
739643
- version: "0.18.0-rc0",
739643
+ version: "0.18.1-rc1",
739644
739644
  usingAccessToken: true
739645
739645
  }
739646
739646
  });
@@ -739702,7 +739702,7 @@ var UserPosthogManager = class {
739702
739702
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
739703
739703
  event: "CLI",
739704
739704
  properties: {
739705
- version: "0.18.0-rc0",
739705
+ version: "0.18.1-rc1",
739706
739706
  ...event,
739707
739707
  ...event.properties
739708
739708
  }
@@ -752107,37 +752107,47 @@ function buildPrimitiveTypeDeclaration(schema2) {
752107
752107
  schema: buildPrimitiveTypeReference(schema2)
752108
752108
  };
752109
752109
  }
752110
+ function isCasingEmpty(casing) {
752111
+ return casing.camel == null && casing.pascal == null && casing.screamingSnake == null && casing.snake == null;
752112
+ }
752110
752113
  function buildEnumTypeDeclaration(schema2) {
752111
752114
  const enumSchema = {
752112
752115
  enum: schema2.values.map((enumValue) => {
752113
752116
  const name2 = enumValue.nameOverride ?? enumValue.generatedName;
752114
752117
  const value = enumValue.value;
752115
- const setName = name2 !== value;
752116
- if (name2 === value && enumValue.description == null && enumValue.casing == null) {
752118
+ if (name2 === value && enumValue.description == null && (enumValue.casing == null || isCasingEmpty(enumValue.casing))) {
752117
752119
  return name2;
752118
752120
  }
752119
752121
  const enumValueDeclaration = {
752120
752122
  value: enumValue.value
752121
752123
  };
752122
- if (setName) {
752124
+ if (name2 !== value) {
752123
752125
  enumValueDeclaration.name = name2;
752124
752126
  }
752125
752127
  if (enumValue.description != null) {
752126
752128
  enumValueDeclaration.docs = enumValue.description;
752127
752129
  }
752128
- if (enumValue.casing != null) {
752129
- enumValueDeclaration.casing = {};
752130
+ if (enumValue.casing != null && !isCasingEmpty(enumValue.casing)) {
752131
+ const casing = {};
752132
+ let setCasing = false;
752130
752133
  if (enumValue.casing.camel != null) {
752131
- enumValueDeclaration.casing.camel = enumValue.casing.camel;
752134
+ casing.camel = enumValue.casing.camel;
752135
+ setCasing = true;
752132
752136
  }
752133
752137
  if (enumValue.casing.screamingSnake != null) {
752134
- enumValueDeclaration.casing["screaming-snake"] = enumValue.casing.screamingSnake;
752138
+ casing["screaming-snake"] = enumValue.casing.screamingSnake;
752139
+ setCasing = true;
752135
752140
  }
752136
752141
  if (enumValue.casing.snake != null) {
752137
- enumValueDeclaration.casing.snake = enumValue.casing.snake;
752142
+ casing.snake = enumValue.casing.snake;
752143
+ setCasing = true;
752138
752144
  }
752139
752145
  if (enumValue.casing.pascal != null) {
752140
- enumValueDeclaration.casing.pascal = enumValue.casing.pascal;
752146
+ casing.pascal = enumValue.casing.pascal;
752147
+ setCasing = true;
752148
+ }
752149
+ if (setCasing) {
752150
+ enumValueDeclaration.casing = casing;
752141
752151
  }
752142
752152
  }
752143
752153
  return enumValueDeclaration;
@@ -765634,10 +765644,10 @@ var CliContext = class {
765634
765644
  return "fern-api";
765635
765645
  }
765636
765646
  getPackageVersion() {
765637
- if ("0.18.0-rc0" == null) {
765647
+ if ("0.18.1-rc1" == null) {
765638
765648
  this.logger.error("CLI_VERSION is not defined");
765639
765649
  }
765640
- return "0.18.0-rc0";
765650
+ return "0.18.1-rc1";
765641
765651
  }
765642
765652
  getCliName() {
765643
765653
  if ("fern" == null) {
@@ -767012,9 +767022,10 @@ var RESERVED_KEYWORDS = {
767012
767022
 
767013
767023
  // pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/casings/CasingsGenerator.js
767014
767024
  var CAPITALIZE_INITIALISM = ["go", "ruby"];
767015
- function constructCasingsGenerator({ generationLanguage, smartCasing, casingOverrides = {} }) {
767025
+ function constructCasingsGenerator({ generationLanguage, smartCasing }) {
767016
767026
  const casingsGenerator = {
767017
- generateName: (name2) => {
767027
+ generateName: (name2, opts) => {
767028
+ var _a2, _b2, _c2, _d;
767018
767029
  const generateSafeAndUnsafeString = (unsafeString) => ({
767019
767030
  unsafeName: unsafeString,
767020
767031
  safeName: sanitizeNameForLanguage(unsafeString, generationLanguage)
@@ -767055,14 +767066,14 @@ function constructCasingsGenerator({ generationLanguage, smartCasing, casingOver
767055
767066
  }
767056
767067
  return {
767057
767068
  originalName: name2,
767058
- camelCase: generateSafeAndUnsafeString(casingOverrides.camel ?? camelCaseName),
767059
- snakeCase: generateSafeAndUnsafeString(casingOverrides.snake ?? snakeCaseName),
767060
- screamingSnakeCase: generateSafeAndUnsafeString(casingOverrides["screaming-snake"] ?? snakeCaseName.toUpperCase()),
767061
- pascalCase: generateSafeAndUnsafeString(casingOverrides.pascal ?? pascalCaseName)
767069
+ camelCase: generateSafeAndUnsafeString(((_a2 = opts == null ? void 0 : opts.casingOverrides) == null ? void 0 : _a2.camel) ?? camelCaseName),
767070
+ snakeCase: generateSafeAndUnsafeString(((_b2 = opts == null ? void 0 : opts.casingOverrides) == null ? void 0 : _b2.snake) ?? snakeCaseName),
767071
+ screamingSnakeCase: generateSafeAndUnsafeString(((_c2 = opts == null ? void 0 : opts.casingOverrides) == null ? void 0 : _c2["screaming-snake"]) ?? snakeCaseName.toUpperCase()),
767072
+ pascalCase: generateSafeAndUnsafeString(((_d = opts == null ? void 0 : opts.casingOverrides) == null ? void 0 : _d.pascal) ?? pascalCaseName)
767062
767073
  };
767063
767074
  },
767064
- generateNameAndWireValue: ({ name: name2, wireValue }) => ({
767065
- name: casingsGenerator.generateName(name2),
767075
+ generateNameAndWireValue: ({ name: name2, wireValue, opts }) => ({
767076
+ name: casingsGenerator.generateName(name2, opts),
767066
767077
  wireValue
767067
767078
  })
767068
767079
  };
@@ -767721,8 +767732,7 @@ function constructFernFileContext({ relativeFilepath, definitionFile, casingsGen
767721
767732
  // pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/utils/getAllPropertiesForObject.js
767722
767733
  var CASINGS_GENERATOR = constructCasingsGenerator({
767723
767734
  generationLanguage: void 0,
767724
- smartCasing: false,
767725
- casingOverrides: {}
767735
+ smartCasing: false
767726
767736
  });
767727
767737
  function getAllPropertiesForObject({
767728
767738
  typeName,
@@ -767747,8 +767757,7 @@ function getAllPropertiesForObject({
767747
767757
  if (smartCasing) {
767748
767758
  casingsGenerator = constructCasingsGenerator({
767749
767759
  generationLanguage: void 0,
767750
- smartCasing,
767751
- casingOverrides: {}
767760
+ smartCasing
767752
767761
  });
767753
767762
  }
767754
767763
  const file = constructFernFileContext({
@@ -768401,7 +768410,9 @@ async function convertEnumTypeDeclaration({ _enum, file }) {
768401
768410
  name: file.casingsGenerator.generateNameAndWireValue({
768402
768411
  wireValue: typeof value === "string" ? value : value.value,
768403
768412
  name: getEnumName(value).name,
768404
- casingOverrides: typeof value !== "string" ? value.casing : void 0
768413
+ opts: {
768414
+ casingOverrides: typeof value !== "string" ? value.casing : void 0
768415
+ }
768405
768416
  })
768406
768417
  };
768407
768418
  }))
@@ -771037,7 +771048,7 @@ __publicField(VariableResolverImpl, "VARIABLE_PREFIX", "$");
771037
771048
 
771038
771049
  // pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/generateIntermediateRepresentation.js
771039
771050
  async function generateIntermediateRepresentation({ workspace, generationLanguage, smartCasing, disableExamples, audiences }) {
771040
- const casingsGenerator = constructCasingsGenerator({ generationLanguage, smartCasing, casingOverrides: {} });
771051
+ const casingsGenerator = constructCasingsGenerator({ generationLanguage, smartCasing });
771041
771052
  const irGraph = new IrGraph(audiences);
771042
771053
  const rootApiFileContext = constructRootApiFileContext({
771043
771054
  casingsGenerator,
@@ -771676,8 +771687,7 @@ function minimumString(strings) {
771676
771687
  // pnp:/home/circleci/project/packages/cli/yaml/validator/lib/utils/casingsGenerator.js
771677
771688
  var CASINGS_GENERATOR2 = constructCasingsGenerator({
771678
771689
  generationLanguage: void 0,
771679
- smartCasing: false,
771680
- casingOverrides: {}
771690
+ smartCasing: false
771681
771691
  });
771682
771692
 
771683
771693
  // pnp:/home/circleci/project/packages/cli/yaml/validator/lib/ComplexQueryParamTypeDetector.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.18.0-rc0",
3
+ "version": "0.18.1-rc1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",