@fern-api/fern-api-dev 5.72.1 → 5.73.0

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 +84 -12
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -564079,6 +564079,12 @@ async function tryRunContainer({ logger: logger4, imageName, args, binds, envVar
564079
564079
  if (process.env["FERN_STACK_TRACK"]) {
564080
564080
  envVars["FERN_STACK_TRACK"] = process.env["FERN_STACK_TRACK"];
564081
564081
  }
564082
+ const oidcEnvArgs = ["ACTIONS_ID_TOKEN_REQUEST_URL", "ACTIONS_ID_TOKEN_REQUEST_TOKEN"].flatMap((name2) => {
564083
+ const value2 = process.env[name2];
564084
+ return value2 != null ? ["-e", `${name2}=${value2}`] : [];
564085
+ });
564086
+ const oidcSecret = process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"];
564087
+ const secrets = oidcSecret != null ? [oidcSecret] : [];
564082
564088
  const containerArgs = [
564083
564089
  "run",
564084
564090
  "--user",
@@ -564086,6 +564092,7 @@ async function tryRunContainer({ logger: logger4, imageName, args, binds, envVar
564086
564092
  ...pull ? ["--pull", "always"] : [],
564087
564093
  ...platform4 != null ? ["--platform", platform4] : [],
564088
564094
  ...binds.flatMap((bind5) => ["-v", bind5]),
564095
+ ...oidcEnvArgs,
564089
564096
  ...Object.entries(envVars).flatMap(([key2, value2]) => ["-e", `${key2}="${value2}"`]),
564090
564097
  ...Object.entries(ports).flatMap(([hostPort, containerPort]) => ["-p", `${hostPort}:${containerPort}`]),
564091
564098
  removeAfterCompletion ? "--rm" : "",
@@ -564097,6 +564104,7 @@ async function tryRunContainer({ logger: logger4, imageName, args, binds, envVar
564097
564104
  reject: false,
564098
564105
  all: true,
564099
564106
  doNotPipeOutput: true,
564107
+ secrets,
564100
564108
  signal
564101
564109
  });
564102
564110
  const logs4 = stdout + stderr;
@@ -582534,11 +582542,23 @@ var require_pushSignedCommit = __commonJS({
582534
582542
  "../../generator-cli/lib/pipeline/github/pushSignedCommit.js"(exports2) {
582535
582543
  "use strict";
582536
582544
  Object.defineProperty(exports2, "__esModule", { value: true });
582545
+ exports2.resolveCommitAuthor = resolveCommitAuthor;
582537
582546
  exports2.pushSignedCommit = pushSignedCommit;
582538
582547
  exports2.isNonFastForwardError = isNonFastForwardError;
582539
582548
  var core_utils_1 = (init_lib4(), __toCommonJS(lib_exports));
582549
+ var constants_1 = require_constants8();
582540
582550
  var MAX_CONCURRENT_PUSH_RETRIES = 3;
582541
582551
  var MAX_SIGNED_CHAIN_LENGTH = 20;
582552
+ var PAT_TOKEN_PREFIXES = ["ghp_", "github_pat_"];
582553
+ function resolveCommitAuthor(token, author) {
582554
+ if (author != null) {
582555
+ return author;
582556
+ }
582557
+ if (PAT_TOKEN_PREFIXES.some((prefix2) => token.startsWith(prefix2))) {
582558
+ return { name: constants_1.FERN_BOT_NAME, email: constants_1.FERN_BOT_EMAIL };
582559
+ }
582560
+ return void 0;
582561
+ }
582542
582562
  async function pushSignedCommit({ repository, octokit, owner, repo, branch, force, rebaseOnConflict = false, author, logger: logger4 }) {
582543
582563
  const tempRef = `refs/temp/fern-${Date.now()}`;
582544
582564
  let tempRefPushed = false;
@@ -582966,7 +582986,7 @@ var require_GithubStep = __commonJS({
582966
582986
  repo,
582967
582987
  branch: prBranch,
582968
582988
  force: isUpdatingExistingPR,
582969
- author: this.config.author,
582989
+ author: (0, pushSignedCommit_1.resolveCommitAuthor)(this.config.token, this.config.author),
582970
582990
  logger: this.logger
582971
582991
  });
582972
582992
  const pushedBranch = await repository.getCurrentBranch();
@@ -583089,7 +583109,7 @@ var require_GithubStep = __commonJS({
583089
583109
  branch: baseBranch,
583090
583110
  force: false,
583091
583111
  rebaseOnConflict: true,
583092
- author: this.config.author,
583112
+ author: (0, pushSignedCommit_1.resolveCommitAuthor)(this.config.token, this.config.author),
583093
583113
  logger: this.logger
583094
583114
  });
583095
583115
  const pushedBranch = await repository.getCurrentBranch();
@@ -583131,7 +583151,7 @@ var require_GithubStep = __commonJS({
583131
583151
  branch: baseBranch,
583132
583152
  force: false,
583133
583153
  rebaseOnConflict: true,
583134
- author: this.config.author,
583154
+ author: (0, pushSignedCommit_1.resolveCommitAuthor)(this.config.token, this.config.author),
583135
583155
  logger: this.logger
583136
583156
  });
583137
583157
  const pushedBranch = await repository.getCurrentBranch();
@@ -678867,7 +678887,8 @@ function validateResponseProperty({ endpointId, typeResolver, file: file4, resol
678867
678887
  return violations;
678868
678888
  }
678869
678889
  function isIntegerType({ resolvedType }) {
678870
- return maybePrimitiveType(resolvedType) === "INTEGER";
678890
+ const primitiveType2 = maybePrimitiveType(resolvedType);
678891
+ return primitiveType2 === "INTEGER" || primitiveType2 === "LONG";
678871
678892
  }
678872
678893
  function isStringType({ resolvedType }) {
678873
678894
  return maybePrimitiveType(resolvedType) === "STRING";
@@ -690066,7 +690087,7 @@ var AccessTokenPosthogManager = class {
690066
690087
  properties: {
690067
690088
  ...event,
690068
690089
  ...event.properties,
690069
- version: "5.72.1",
690090
+ version: "5.73.0",
690070
690091
  usingAccessToken: true,
690071
690092
  ...getRunIdProperties()
690072
690093
  }
@@ -690132,7 +690153,7 @@ var UserPosthogManager = class {
690132
690153
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
690133
690154
  event: "CLI",
690134
690155
  properties: {
690135
- version: "5.72.1",
690156
+ version: "5.73.0",
690136
690157
  ...event,
690137
690158
  ...event.properties,
690138
690159
  usingAccessToken: false,
@@ -871233,7 +871254,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
871233
871254
  var LOGS_FOLDER_NAME = "logs";
871234
871255
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
871235
871256
  function getCliSource() {
871236
- const version7 = "5.72.1";
871257
+ const version7 = "5.73.0";
871237
871258
  return `cli@${version7}`;
871238
871259
  }
871239
871260
  var DebugLogger = class {
@@ -903816,7 +903837,7 @@ var LegacyDocsPublisher = class {
903816
903837
  previewId,
903817
903838
  disableTemplates: void 0,
903818
903839
  skipUpload,
903819
- cliVersion: "5.72.1",
903840
+ cliVersion: "5.73.0",
903820
903841
  loginCommand: "fern auth login"
903821
903842
  });
903822
903843
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -929393,13 +929414,13 @@ var EndpointSnippetGenerator2 = class {
929393
929414
  }
929394
929415
  const args = [];
929395
929416
  for (const param of parameters2) {
929396
- if (param.typeReference.type === "optional" || param.typeReference.type === "literal") {
929417
+ if (this.isInferredAuthConstructorParamSkipped(param.typeReference)) {
929397
929418
  continue;
929398
929419
  }
929399
929420
  const wireValue = param.name.wireValue;
929400
929421
  const value2 = values2.values?.[wireValue] ?? param.name.name.originalName;
929401
929422
  const typeInstantiation = this.context.dynamicTypeInstantiationMapper.convert({
929402
- typeReference: param.typeReference,
929423
+ typeReference: this.getInferredAuthConstructorTypeReference(param.typeReference),
929403
929424
  value: value2
929404
929425
  });
929405
929426
  if (go_exports.TypeInstantiation.isNop(typeInstantiation)) {
@@ -929417,6 +929438,57 @@ var EndpointSnippetGenerator2 = class {
929417
929438
  }
929418
929439
  return args;
929419
929440
  }
929441
+ isInferredAuthConstructorParamSkipped(typeReference2, seen = /* @__PURE__ */ new Set()) {
929442
+ switch (typeReference2.type) {
929443
+ case "optional":
929444
+ case "literal":
929445
+ return true;
929446
+ case "named": {
929447
+ if (seen.has(typeReference2.value)) {
929448
+ return false;
929449
+ }
929450
+ seen.add(typeReference2.value);
929451
+ const named = this.context.resolveNamedType({ typeId: typeReference2.value });
929452
+ return named?.type === "alias" && this.isInferredAuthConstructorParamSkipped(named.typeReference, seen);
929453
+ }
929454
+ case "list":
929455
+ case "map":
929456
+ case "nullable":
929457
+ case "primitive":
929458
+ case "set":
929459
+ case "unknown":
929460
+ return false;
929461
+ default:
929462
+ assertNever(typeReference2);
929463
+ }
929464
+ }
929465
+ getInferredAuthConstructorTypeReference(typeReference2, seen = /* @__PURE__ */ new Set()) {
929466
+ switch (typeReference2.type) {
929467
+ case "nullable":
929468
+ return this.getInferredAuthConstructorTypeReference(typeReference2.value, seen);
929469
+ case "named": {
929470
+ if (seen.has(typeReference2.value)) {
929471
+ return typeReference2;
929472
+ }
929473
+ seen.add(typeReference2.value);
929474
+ const named = this.context.resolveNamedType({ typeId: typeReference2.value });
929475
+ if (named?.type === "alias" && named.typeReference.type === "nullable") {
929476
+ return this.getInferredAuthConstructorTypeReference(named.typeReference, seen);
929477
+ }
929478
+ return typeReference2;
929479
+ }
929480
+ case "list":
929481
+ case "literal":
929482
+ case "map":
929483
+ case "optional":
929484
+ case "primitive":
929485
+ case "set":
929486
+ case "unknown":
929487
+ return typeReference2;
929488
+ default:
929489
+ assertNever(typeReference2);
929490
+ }
929491
+ }
929420
929492
  getConstructorHeaderArgs({ headers: headers2, values: values2 }) {
929421
929493
  const args = [];
929422
929494
  for (const header of headers2) {
@@ -970291,7 +970363,7 @@ function getAutomationContextFromEnv() {
970291
970363
  config_branch: process.env.FERN_CONFIG_BRANCH,
970292
970364
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
970293
970365
  trigger: process.env.GITHUB_EVENT_NAME,
970294
- cli_version: "5.72.1"
970366
+ cli_version: "5.73.0"
970295
970367
  };
970296
970368
  }
970297
970369
  function isAutomationMode() {
@@ -971123,7 +971195,7 @@ var CliContext = class _CliContext {
971123
971195
  if (false) {
971124
971196
  this.logger.error("CLI_VERSION is not defined");
971125
971197
  }
971126
- return "5.72.1";
971198
+ return "5.73.0";
971127
971199
  }
971128
971200
  getCliName() {
971129
971201
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.72.1",
2
+ "version": "5.73.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",