@fern-api/fern-api-dev 5.23.3-933-g3f254c336f9 → 5.23.3-941-g239fc7b1855

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/cli.cjs +61 -8
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -153498,6 +153498,9 @@ function convertSchemaObject(schema, wrapAsOptional, wrapAsNullable, context3, b
153498
153498
  let groupName = (typeof mixedGroupName === "string" ? [mixedGroupName] : mixedGroupName) ?? [];
153499
153499
  groupName = context3.resolveGroupName(groupName);
153500
153500
  const generatedName = getGeneratedTypeName(breadcrumbs, context3.options.preserveSchemaIds);
153501
+ if (nameOverride != null) {
153502
+ breadcrumbs = [nameOverride];
153503
+ }
153501
153504
  const title2 = schema.title;
153502
153505
  const description = schema.description;
153503
153506
  const availability = convertAvailability2(schema);
@@ -686381,7 +686384,7 @@ var AccessTokenPosthogManager = class {
686381
686384
  properties: {
686382
686385
  ...event,
686383
686386
  ...event.properties,
686384
- version: "5.23.3-933-g3f254c336f9",
686387
+ version: "5.23.3-941-g239fc7b1855",
686385
686388
  usingAccessToken: true,
686386
686389
  ...getRunIdProperties()
686387
686390
  }
@@ -686447,7 +686450,7 @@ var UserPosthogManager = class {
686447
686450
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
686448
686451
  event: "CLI",
686449
686452
  properties: {
686450
- version: "5.23.3-933-g3f254c336f9",
686453
+ version: "5.23.3-941-g239fc7b1855",
686451
686454
  ...event,
686452
686455
  ...event.properties,
686453
686456
  usingAccessToken: false,
@@ -867509,7 +867512,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
867509
867512
  var LOGS_FOLDER_NAME = "logs";
867510
867513
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
867511
867514
  function getCliSource() {
867512
- const version7 = "5.23.3-933-g3f254c336f9";
867515
+ const version7 = "5.23.3-941-g239fc7b1855";
867513
867516
  return `cli@${version7}`;
867514
867517
  }
867515
867518
  var DebugLogger = class {
@@ -899697,7 +899700,7 @@ var LegacyDocsPublisher = class {
899697
899700
  previewId,
899698
899701
  disableTemplates: void 0,
899699
899702
  skipUpload,
899700
- cliVersion: "5.23.3-933-g3f254c336f9",
899703
+ cliVersion: "5.23.3-941-g239fc7b1855",
899701
899704
  loginCommand: "fern auth login"
899702
899705
  });
899703
899706
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -924461,9 +924464,9 @@ var DynamicTypeMapper2 = class {
924461
924464
  return this.convertNamed({ named });
924462
924465
  }
924463
924466
  case "optional":
924464
- return go_exports.Type.optional(this.convert({ typeReference: args.typeReference.value }));
924467
+ return this.convertOptionalOrNullable(args.typeReference.value);
924465
924468
  case "nullable":
924466
- return go_exports.Type.optional(this.convert({ typeReference: args.typeReference.value }));
924469
+ return this.convertOptionalOrNullable(args.typeReference.value);
924467
924470
  case "primitive":
924468
924471
  return this.convertPrimitive({ primitive: args.typeReference.value });
924469
924472
  case "set":
@@ -924474,6 +924477,56 @@ var DynamicTypeMapper2 = class {
924474
924477
  assertNever(args.typeReference);
924475
924478
  }
924476
924479
  }
924480
+ convertOptionalOrNullable(innerReference) {
924481
+ if (this.isPointerAliasReference(innerReference)) {
924482
+ return this.convert({ typeReference: innerReference });
924483
+ }
924484
+ return go_exports.Type.optional(this.convert({ typeReference: innerReference }));
924485
+ }
924486
+ /**
924487
+ * Returns true if the type reference resolves to a named alias that already
924488
+ * generates as a pointer type in Go. Also handles the collapse case where
924489
+ * optional(nullable(named(alias))) should not produce a double pointer.
924490
+ */
924491
+ isPointerAliasReference(reference4) {
924492
+ if (reference4.type === "named") {
924493
+ return this.isAliasToPointerType(reference4.value);
924494
+ }
924495
+ if (reference4.type === "optional" || reference4.type === "nullable") {
924496
+ const inner2 = reference4.value;
924497
+ if (inner2.type === "named") {
924498
+ return this.isAliasToPointerType(inner2.value);
924499
+ }
924500
+ }
924501
+ return false;
924502
+ }
924503
+ /**
924504
+ * Checks if a named type is an alias that already generates as a pointer in Go
924505
+ * (e.g. a nullable primitive like *time.Time). Traverses alias chains.
924506
+ */
924507
+ isAliasToPointerType(typeId) {
924508
+ const seen = /* @__PURE__ */ new Set();
924509
+ let currentTypeId = typeId;
924510
+ while (true) {
924511
+ if (seen.has(currentTypeId)) {
924512
+ return false;
924513
+ }
924514
+ seen.add(currentTypeId);
924515
+ const namedType = this.context.resolveNamedType({ typeId: currentTypeId });
924516
+ if (namedType == null || namedType.type !== "alias") {
924517
+ return false;
924518
+ }
924519
+ const aliasOf = namedType.typeReference;
924520
+ if (aliasOf.type === "optional" || aliasOf.type === "nullable") {
924521
+ return true;
924522
+ }
924523
+ if (aliasOf.type === "named") {
924524
+ currentTypeId = aliasOf.value;
924525
+ continue;
924526
+ }
924527
+ return false;
924528
+ }
924529
+ }
924477
924530
  convertLiteral({ literal: literal3 }) {
924478
924531
  switch (literal3.type) {
924479
924532
  case "boolean":
@@ -965838,7 +965891,7 @@ function getAutomationContextFromEnv() {
965838
965891
  config_branch: process.env.FERN_CONFIG_BRANCH,
965839
965892
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
965840
965893
  trigger: process.env.GITHUB_EVENT_NAME,
965841
- cli_version: "5.23.3-933-g3f254c336f9"
965894
+ cli_version: "5.23.3-941-g239fc7b1855"
965842
965895
  };
965843
965896
  }
965844
965897
  function isAutomationMode() {
@@ -966670,7 +966723,7 @@ var CliContext = class _CliContext {
966670
966723
  if (false) {
966671
966724
  this.logger.error("CLI_VERSION is not defined");
966672
966725
  }
966673
- return "5.23.3-933-g3f254c336f9";
966726
+ return "5.23.3-941-g239fc7b1855";
966674
966727
  }
966675
966728
  getCliName() {
966676
966729
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.23.3-933-g3f254c336f9",
2
+ "version": "5.23.3-941-g239fc7b1855",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",