@fern-api/fern-api-dev 4.77.0-2-gb4a5cdbb61e → 4.77.0-4-g23ada903e77

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 +173 -13
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -477592,6 +477592,7 @@ __export(api_exports, {
477592
477592
  HttpMethod: () => HttpMethod2,
477593
477593
  HttpRequestBody: () => HttpRequestBody,
477594
477594
  HttpResponseBody: () => HttpResponseBody,
477595
+ InvocationSource: () => InvocationSource,
477595
477596
  JsonResponse: () => JsonResponse,
477596
477597
  Literal: () => Literal,
477597
477598
  NamedTypeDefault: () => NamedTypeDefault,
@@ -480204,7 +480205,8 @@ __export(ir_exports2, {
480204
480205
  ApiDefinitionSource: () => ApiDefinitionSource,
480205
480206
  ApiVersionScheme: () => ApiVersionScheme,
480206
480207
  ErrorDiscriminationStrategy: () => ErrorDiscriminationStrategy,
480207
- ExampleStyle: () => ExampleStyle
480208
+ ExampleStyle: () => ExampleStyle,
480209
+ InvocationSource: () => InvocationSource
480208
480210
  });
480209
480211
 
480210
480212
  // ../../ir-sdk/lib/sdk/api/resources/ir/types/ApiDefinitionSource.js
@@ -480309,6 +480311,31 @@ var ExampleStyle = {
480309
480311
  }
480310
480312
  };
480311
480313
 
480314
+ // ../../ir-sdk/lib/sdk/api/resources/ir/types/InvocationSource.js
480315
+ var InvocationSourceValues = {
480316
+ Autopilot: "autopilot",
480317
+ Autorelease: "autorelease",
480318
+ Ci: "ci",
480319
+ Manual: "manual"
480320
+ };
480321
+ var InvocationSource = {
480322
+ ...InvocationSourceValues,
480323
+ _visit: (value, visitor) => {
480324
+ switch (value) {
480325
+ case InvocationSource.Autopilot:
480326
+ return visitor.autopilot();
480327
+ case InvocationSource.Autorelease:
480328
+ return visitor.autorelease();
480329
+ case InvocationSource.Ci:
480330
+ return visitor.ci();
480331
+ case InvocationSource.Manual:
480332
+ return visitor.manual();
480333
+ default:
480334
+ return visitor._other();
480335
+ }
480336
+ }
480337
+ };
480338
+
480312
480339
  // ../../ir-sdk/lib/sdk/api/resources/proto/index.js
480313
480340
  var proto_exports = {};
480314
480341
  __export(proto_exports, {
@@ -482409,6 +482436,7 @@ __export(serialization_exports2, {
482409
482436
  IntegerType: () => IntegerType,
482410
482437
  IntegerValidationRules: () => IntegerValidationRules,
482411
482438
  IntermediateRepresentation: () => IntermediateRepresentation,
482439
+ InvocationSource: () => InvocationSource2,
482412
482440
  JsonEncoding: () => JsonEncoding,
482413
482441
  JsonResponse: () => JsonResponse2,
482414
482442
  JsonResponseBody: () => JsonResponseBody,
@@ -487174,6 +487202,7 @@ __export(ir_exports4, {
487174
487202
  GenerationMetadata: () => GenerationMetadata,
487175
487203
  HeaderApiVersionScheme: () => HeaderApiVersionScheme,
487176
487204
  IntermediateRepresentation: () => IntermediateRepresentation,
487205
+ InvocationSource: () => InvocationSource2,
487177
487206
  Package: () => Package,
487178
487207
  PackageNavigationConfig: () => PackageNavigationConfig,
487179
487208
  PlatformHeaders: () => PlatformHeaders,
@@ -487281,13 +487310,20 @@ var ErrorDiscriminationStrategy2 = schemas_exports3.union("type", {
487281
487310
  // ../../ir-sdk/lib/sdk/serialization/resources/ir/types/ExampleStyle.js
487282
487311
  var ExampleStyle2 = schemas_exports3.enum_(["minimal", "comprehensive"]);
487283
487312
 
487313
+ // ../../ir-sdk/lib/sdk/serialization/resources/ir/types/InvocationSource.js
487314
+ var InvocationSource2 = schemas_exports3.enum_(["autopilot", "autorelease", "ci", "manual"]);
487315
+
487284
487316
  // ../../ir-sdk/lib/sdk/serialization/resources/ir/types/GenerationMetadata.js
487285
487317
  var GenerationMetadata = schemas_exports3.objectWithoutOptionalProperties({
487286
487318
  cliVersion: schemas_exports3.string(),
487287
487319
  generatorName: schemas_exports3.string(),
487288
487320
  generatorVersion: schemas_exports3.string(),
487289
487321
  generatorConfig: schemas_exports3.unknown().optional(),
487290
- originGitCommit: schemas_exports3.string().optional()
487322
+ originGitCommit: schemas_exports3.string().optional(),
487323
+ originGitCommitIsDirty: schemas_exports3.boolean().optional(),
487324
+ invokedBy: InvocationSource2.optional(),
487325
+ requestedVersion: schemas_exports3.string().optional(),
487326
+ ciProvider: schemas_exports3.string().optional()
487291
487327
  });
487292
487328
 
487293
487329
  // ../../ir-sdk/lib/sdk/serialization/resources/publish/types/CratesPublishTarget.js
@@ -492120,6 +492156,81 @@ function getGithubRepository(generatorInvocation) {
492120
492156
  return void 0;
492121
492157
  }
492122
492158
 
492159
+ // ../../commons/api-workspace-commons/lib/detectInvocationSource.js
492160
+ function detectInvocationSource() {
492161
+ const fromEnv = normalizeInvoker(process.env.FERN_INVOKER);
492162
+ if (fromEnv != null) {
492163
+ return fromEnv;
492164
+ }
492165
+ if (isCIEnvironment()) {
492166
+ return "ci";
492167
+ }
492168
+ return "manual";
492169
+ }
492170
+ function detectCiProvider() {
492171
+ if (process.env.GITHUB_ACTIONS === "true") {
492172
+ return "github";
492173
+ }
492174
+ if (process.env.GITLAB_CI === "true") {
492175
+ return "gitlab";
492176
+ }
492177
+ if (process.env.BITBUCKET_BUILD_NUMBER != null) {
492178
+ return "bitbucket";
492179
+ }
492180
+ if (process.env.CIRCLECI === "true") {
492181
+ return "circleci";
492182
+ }
492183
+ if (process.env.TRAVIS === "true") {
492184
+ return "travis";
492185
+ }
492186
+ if (process.env.JENKINS_URL != null || process.env.JENKINS_HOME != null) {
492187
+ return "jenkins";
492188
+ }
492189
+ if (process.env.TF_BUILD != null) {
492190
+ return "azure-pipelines";
492191
+ }
492192
+ if (process.env.BUILDKITE === "true") {
492193
+ return "buildkite";
492194
+ }
492195
+ if (process.env.CODEBUILD_BUILD_ID != null) {
492196
+ return "codebuild";
492197
+ }
492198
+ if (process.env.TEAMCITY_VERSION != null) {
492199
+ return "teamcity";
492200
+ }
492201
+ if (process.env.DRONE === "true") {
492202
+ return "drone";
492203
+ }
492204
+ if (process.env.SEMAPHORE === "true") {
492205
+ return "semaphore";
492206
+ }
492207
+ if (process.env.APPVEYOR === "true" || process.env.APPVEYOR === "True") {
492208
+ return "appveyor";
492209
+ }
492210
+ if (isCIEnvironment()) {
492211
+ return "unknown";
492212
+ }
492213
+ return void 0;
492214
+ }
492215
+ function normalizeInvoker(raw) {
492216
+ if (raw == null) {
492217
+ return void 0;
492218
+ }
492219
+ const normalized = raw.trim().toLowerCase();
492220
+ switch (normalized) {
492221
+ case "autopilot":
492222
+ case "autorelease":
492223
+ case "ci":
492224
+ case "manual":
492225
+ return normalized;
492226
+ default:
492227
+ return void 0;
492228
+ }
492229
+ }
492230
+ function isCIEnvironment() {
492231
+ return !!(process.env.CI || process.env.CONTINUOUS_INTEGRATION || process.env.GITHUB_ACTIONS || process.env.GITLAB_CI || process.env.CIRCLECI || process.env.TRAVIS || process.env.JENKINS_URL || process.env.JENKINS_HOME || process.env.TF_BUILD || process.env.BUILDKITE || process.env.CODEBUILD_BUILD_ID || process.env.TEAMCITY_VERSION || process.env.BITBUCKET_BUILD_NUMBER || process.env.DRONE || process.env.SEMAPHORE || process.env.APPVEYOR || process.env.BUDDY_WORKSPACE_ID || process.env.WERCKER_RUN_ID);
492232
+ }
492233
+
492123
492234
  // ../../commons/api-workspace-commons/lib/FernWorkspace.js
492124
492235
  var FernWorkspace = class extends AbstractAPIWorkspace {
492125
492236
  definition;
@@ -492163,6 +492274,20 @@ function getOriginGitCommit() {
492163
492274
  return void 0;
492164
492275
  }
492165
492276
  }
492277
+ function getOriginGitCommitIsDirty() {
492278
+ if (process.env.IGNORE_GIT_IN_METADATA === "true") {
492279
+ return void 0;
492280
+ }
492281
+ try {
492282
+ const status = (0, import_child_process3.execSync)("git status --porcelain", {
492283
+ encoding: "utf-8",
492284
+ stdio: ["pipe", "pipe", "pipe"]
492285
+ });
492286
+ return status.trim().length > 0;
492287
+ } catch {
492288
+ return void 0;
492289
+ }
492290
+ }
492166
492291
 
492167
492292
  // ../configuration/lib/constants.js
492168
492293
  var FERN_DIRECTORY = "fern";
@@ -622064,7 +622189,7 @@ var AccessTokenPosthogManager = class {
622064
622189
  properties: {
622065
622190
  ...event,
622066
622191
  ...event.properties,
622067
- version: "4.77.0-2-gb4a5cdbb61e",
622192
+ version: "4.77.0-4-g23ada903e77",
622068
622193
  usingAccessToken: true
622069
622194
  }
622070
622195
  });
@@ -622118,7 +622243,7 @@ var UserPosthogManager = class {
622118
622243
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
622119
622244
  event: "CLI",
622120
622245
  properties: {
622121
- version: "4.77.0-2-gb4a5cdbb61e",
622246
+ version: "4.77.0-4-g23ada903e77",
622122
622247
  ...event,
622123
622248
  ...event.properties,
622124
622249
  usingAccessToken: false,
@@ -754057,7 +754182,16 @@ function inflateIr(ir15, casingsGenerator) {
754057
754182
  dynamic: ir15.dynamic != null ? inflateDynamicIr(ir15.dynamic) : void 0,
754058
754183
  selfHosted: ir15.selfHosted,
754059
754184
  audiences: ir15.audiences,
754060
- generationMetadata: ir15.generationMetadata,
754185
+ // V65 only knows about cliVersion/generatorName/generatorVersion/generatorConfig/originGitCommit.
754186
+ // Strip the V66-only fields (originGitCommitIsDirty, invokedBy, requestedVersion, ciProvider)
754187
+ // to preserve the V65 contract for older generators.
754188
+ generationMetadata: ir15.generationMetadata != null ? {
754189
+ cliVersion: ir15.generationMetadata.cliVersion,
754190
+ generatorName: ir15.generationMetadata.generatorName,
754191
+ generatorVersion: ir15.generationMetadata.generatorVersion,
754192
+ generatorConfig: ir15.generationMetadata.generatorConfig,
754193
+ originGitCommit: ir15.generationMetadata.originGitCommit
754194
+ } : void 0,
754061
754195
  apiPlayground: ir15.apiPlayground
754062
754196
  };
754063
754197
  }
@@ -839336,7 +839470,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
839336
839470
  var LOGS_FOLDER_NAME = "logs";
839337
839471
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
839338
839472
  function getCliSource() {
839339
- const version7 = "4.77.0-2-gb4a5cdbb61e";
839473
+ const version7 = "4.77.0-4-g23ada903e77";
839340
839474
  return `cli@${version7}`;
839341
839475
  }
839342
839476
  var DebugLogger = class {
@@ -849247,7 +849381,11 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
849247
849381
  generatorName: generatorInvocation.name,
849248
849382
  generatorVersion: generatorInvocation.version,
849249
849383
  generatorConfig: generatorInvocation.config,
849250
- originGitCommit: getOriginGitCommit()
849384
+ originGitCommit: getOriginGitCommit(),
849385
+ originGitCommitIsDirty: getOriginGitCommitIsDirty(),
849386
+ invokedBy: detectInvocationSource(),
849387
+ requestedVersion: version7,
849388
+ ciProvider: detectCiProvider()
849251
849389
  }
849252
849390
  });
849253
849391
  const venus = createVenusService({ token: token.value });
@@ -850651,7 +850789,7 @@ var LegacyDocsPublisher = class {
850651
850789
  previewId,
850652
850790
  disableTemplates: void 0,
850653
850791
  skipUpload,
850654
- cliVersion: "4.77.0-2-gb4a5cdbb61e"
850792
+ cliVersion: "4.77.0-4-g23ada903e77"
850655
850793
  });
850656
850794
  if (taskContext.getResult() === TaskResult.Failure) {
850657
850795
  return { success: false };
@@ -902634,7 +902772,11 @@ async function getIntermediateRepresentation({ workspace, audiences, generatorIn
902634
902772
  generatorName: generatorInvocation.name,
902635
902773
  generatorVersion: generatorInvocation.version,
902636
902774
  generatorConfig: generatorInvocation.config,
902637
- originGitCommit: getOriginGitCommit()
902775
+ originGitCommit: getOriginGitCommit(),
902776
+ originGitCommitIsDirty: getOriginGitCommitIsDirty(),
902777
+ invokedBy: detectInvocationSource(),
902778
+ requestedVersion: version7,
902779
+ ciProvider: detectCiProvider()
902638
902780
  }
902639
902781
  });
902640
902782
  if (sourceConfig != null) {
@@ -902645,7 +902787,17 @@ async function getIntermediateRepresentation({ workspace, audiences, generatorIn
902645
902787
  generatorName: generatorInvocation.name,
902646
902788
  generatorVersion: generatorInvocation.version,
902647
902789
  generatorConfig: generatorInvocation.config,
902648
- originGitCommit: getOriginGitCommit()
902790
+ originGitCommit: getOriginGitCommit(),
902791
+ originGitCommitIsDirty: getOriginGitCommitIsDirty(),
902792
+ invokedBy: detectInvocationSource(),
902793
+ // `requestedVersion` must reflect the raw `--version` flag passed by the user. The
902794
+ // `version` parameter here may have been resolved (e.g. via `computeSemanticVersion`)
902795
+ // so we never fall back to it. When the IR is freshly generated above, this field is
902796
+ // populated with the raw flag value. When the IR is pre-generated, the caller is
902797
+ // responsible for having set this correctly; a pre-existing `undefined` means the
902798
+ // user did not pass `--version`.
902799
+ requestedVersion: intermediateRepresentation.generationMetadata?.requestedVersion,
902800
+ ciProvider: detectCiProvider()
902649
902801
  };
902650
902802
  context3.logger.debug("Generated IR");
902651
902803
  const irVersionFromFdr = await getIrVersionForGenerator(generatorInvocation).then((version8) => version8 == null ? void 0 : "v" + version8.toString());
@@ -904056,7 +904208,11 @@ async function runLocalGenerationForWorkspace({ token, projectConfig, workspace,
904056
904208
  generatorName: generatorInvocation.name,
904057
904209
  generatorVersion: generatorInvocation.version,
904058
904210
  generatorConfig: generatorInvocation.config,
904059
- originGitCommit: getOriginGitCommit()
904211
+ originGitCommit: getOriginGitCommit(),
904212
+ originGitCommitIsDirty: getOriginGitCommitIsDirty(),
904213
+ invokedBy: detectInvocationSource(),
904214
+ requestedVersion: userProvidedVersion,
904215
+ ciProvider: detectCiProvider()
904060
904216
  }
904061
904217
  });
904062
904218
  const venus = createVenusService({ token: token?.value });
@@ -904487,7 +904643,11 @@ var GenerationRunner = class {
904487
904643
  generatorName: generatorInvocation.name,
904488
904644
  generatorVersion: generatorInvocation.version,
904489
904645
  generatorConfig: generatorInvocation.config,
904490
- originGitCommit: getOriginGitCommit()
904646
+ originGitCommit: getOriginGitCommit(),
904647
+ originGitCommitIsDirty: getOriginGitCommitIsDirty(),
904648
+ invokedBy: detectInvocationSource(),
904649
+ requestedVersion: outputVersionOverride,
904650
+ ciProvider: detectCiProvider()
904491
904651
  }
904492
904652
  });
904493
904653
  const workspaceTempDir = await getWorkspaceTempDir();
@@ -925701,7 +925861,7 @@ var CliContext = class _CliContext {
925701
925861
  if (false) {
925702
925862
  this.logger.error("CLI_VERSION is not defined");
925703
925863
  }
925704
- return "4.77.0-2-gb4a5cdbb61e";
925864
+ return "4.77.0-4-g23ada903e77";
925705
925865
  }
925706
925866
  getCliName() {
925707
925867
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.77.0-2-gb4a5cdbb61e",
2
+ "version": "4.77.0-4-g23ada903e77",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",