@fern-api/fern-api-dev 4.57.0 → 4.58.0-2-g7897b571c7b

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 +35 -13
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -507279,7 +507279,8 @@ var GlobalHeader = schemas_exports9.objectWithoutOptionalProperties({
507279
507279
  name: schemas_exports9.string().optional(),
507280
507280
  optional: schemas_exports9.boolean().optional(),
507281
507281
  env: schemas_exports9.string().optional(),
507282
- schema: schemas_exports9.lazy(() => Schema2).optional()
507282
+ schema: schemas_exports9.lazy(() => Schema2).optional(),
507283
+ clientDefault: schemas_exports9.unknown().optional()
507283
507284
  });
507284
507285
 
507285
507286
  // ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/finalIr/types/GlobalSecurity.js
@@ -511419,7 +511420,7 @@ function buildGlobalHeaders(context3) {
511419
511420
  const isOptional = header.optional === true;
511420
511421
  const defaultType = isOptional ? "optional<string>" : "string";
511421
511422
  let schema2 = defaultType;
511422
- if (header.name == null && header.env == null && typeof header.schema === "string") {
511423
+ if (header.name == null && header.env == null && header.clientDefault == null && typeof header.schema === "string") {
511423
511424
  schema2 = header.schema;
511424
511425
  } else if (header != null) {
511425
511426
  const groupName = header.schema ? getGroupNameForSchema(header.schema) : void 0;
@@ -511436,6 +511437,9 @@ function buildGlobalHeaders(context3) {
511436
511437
  declarationDepth: 0
511437
511438
  })) ?? defaultType : defaultType
511438
511439
  };
511440
+ if (typeof header.clientDefault === "string" || typeof header.clientDefault === "boolean") {
511441
+ schema2.default = header.clientDefault;
511442
+ }
511439
511443
  }
511440
511444
  context3.builder.addGlobalHeader({
511441
511445
  name: headerName,
@@ -531568,7 +531572,11 @@ function getGlobalHeaders(document4) {
531568
531572
  const result = [];
531569
531573
  for (const header of globalHeaders ?? []) {
531570
531574
  result.push({
531571
- ...header,
531575
+ header: header.header,
531576
+ name: header.name,
531577
+ optional: header.optional,
531578
+ env: header.env,
531579
+ clientDefault: header["x-fern-default"],
531572
531580
  schema: header.type != null ? getSchemaFromFernType({
531573
531581
  fernType: header.type,
531574
531582
  description: void 0,
@@ -588314,6 +588322,18 @@ var FernGlobalHeadersExtension = class extends AbstractExtension {
588314
588322
  };
588315
588323
 
588316
588324
  // ../api-importers/openapi-to-ir/lib/utils/convertGlobalHeadersExtension.js
588325
+ function convertDefaultToLiteral2(defaultValue) {
588326
+ if (defaultValue == null) {
588327
+ return void 0;
588328
+ }
588329
+ if (typeof defaultValue === "string") {
588330
+ return api_exports.Literal.string(defaultValue);
588331
+ }
588332
+ if (typeof defaultValue === "boolean") {
588333
+ return api_exports.Literal.boolean(defaultValue);
588334
+ }
588335
+ return void 0;
588336
+ }
588317
588337
  function convertGlobalHeadersExtension({ globalHeaders, context: context3 }) {
588318
588338
  return globalHeaders.map((header) => ({
588319
588339
  name: context3.casingsGenerator.generateNameAndWireValue({
@@ -588325,7 +588345,7 @@ function convertGlobalHeadersExtension({ globalHeaders, context: context3 }) {
588325
588345
  v2Examples: header.optional ? void 0 : constructGlobalHeaderExample({ header, context: context3 }),
588326
588346
  availability: void 0,
588327
588347
  docs: void 0,
588328
- clientDefault: void 0
588348
+ clientDefault: convertDefaultToLiteral2(header["x-fern-default"])
588329
588349
  }));
588330
588350
  }
588331
588351
  function constructGlobalHeaderExample({ header, context: context3 }) {
@@ -602661,7 +602681,7 @@ var AccessTokenPosthogManager = class {
602661
602681
  properties: {
602662
602682
  ...event,
602663
602683
  ...event.properties,
602664
- version: "4.57.0",
602684
+ version: "4.58.0-2-g7897b571c7b",
602665
602685
  usingAccessToken: true
602666
602686
  }
602667
602687
  });
@@ -602712,7 +602732,7 @@ var UserPosthogManager = class {
602712
602732
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
602713
602733
  event: "CLI",
602714
602734
  properties: {
602715
- version: "4.57.0",
602735
+ version: "4.58.0-2-g7897b571c7b",
602716
602736
  ...event,
602717
602737
  ...event.properties,
602718
602738
  usingAccessToken: false,
@@ -839942,7 +839962,7 @@ var import_path54 = __toESM(require("path"), 1);
839942
839962
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
839943
839963
  var LOGS_FOLDER_NAME = "logs";
839944
839964
  function getCliSource() {
839945
- const version7 = "4.57.0";
839965
+ const version7 = "4.58.0-2-g7897b571c7b";
839946
839966
  return `cli@${version7}`;
839947
839967
  }
839948
839968
  var DebugLogger = class {
@@ -851043,7 +851063,7 @@ var LegacyDocsPublisher = class {
851043
851063
  previewId: void 0,
851044
851064
  disableTemplates: void 0,
851045
851065
  skipUpload,
851046
- cliVersion: "4.57.0"
851066
+ cliVersion: "4.58.0-2-g7897b571c7b"
851047
851067
  });
851048
851068
  if (taskContext.getResult() === TaskResult.Failure) {
851049
851069
  return { success: false };
@@ -903089,7 +903109,7 @@ var GenerationRunner = class {
903089
903109
  constructor(executionEnvironment) {
903090
903110
  this.executionEnvironment = executionEnvironment;
903091
903111
  }
903092
- async run({ organization, absolutePathToFernConfig, workspace, generatorGroup, context: context3, irVersionOverride, outputVersionOverride, shouldGenerateDynamicSnippetTests, skipUnstableDynamicSnippetTests, inspect: inspect6, skipFernignore }) {
903112
+ async run({ organization, absolutePathToFernConfig, workspace, generatorGroup, context: context3, irVersionOverride, outputVersionOverride, shouldGenerateDynamicSnippetTests, skipUnstableDynamicSnippetTests, inspect: inspect6, skipFernignore, skipAutogenerationIfManualExamplesExist }) {
903093
903113
  const results = await Promise.all(generatorGroup.generators.map(async (generatorInvocation) => {
903094
903114
  return context3.runInteractiveTask({ name: generatorInvocation.name }, async (interactiveTaskContext) => {
903095
903115
  if (generatorInvocation.absolutePathToLocalOutput == null) {
@@ -903107,7 +903127,8 @@ var GenerationRunner = class {
903107
903127
  outputVersionOverride,
903108
903128
  absolutePathToFernConfig,
903109
903129
  inspect: inspect6,
903110
- skipFernignore
903130
+ skipFernignore,
903131
+ skipAutogenerationIfManualExamplesExist
903111
903132
  });
903112
903133
  interactiveTaskContext.logger.info(source_default.green("Wrote files to " + generatorInvocation.absolutePathToLocalOutput));
903113
903134
  if (shouldGenerateDynamicSnippetTests && generatorInvocation.language != null) {
@@ -903134,7 +903155,7 @@ var GenerationRunner = class {
903134
903155
  });
903135
903156
  }));
903136
903157
  }
903137
- async executeGenerator({ generatorGroup, generatorInvocation, context: context3, workspace, organization, irVersionOverride, outputVersionOverride, absolutePathToFernConfig, inspect: inspect6, skipFernignore }) {
903158
+ async executeGenerator({ generatorGroup, generatorInvocation, context: context3, workspace, organization, irVersionOverride, outputVersionOverride, absolutePathToFernConfig, inspect: inspect6, skipFernignore, skipAutogenerationIfManualExamplesExist }) {
903138
903159
  context3.logger.info(`Starting generation for ${generatorInvocation.name}`);
903139
903160
  if (generatorInvocation.absolutePathToLocalOutput == null) {
903140
903161
  throw new Error("Output path is required for generation");
@@ -903147,7 +903168,8 @@ var GenerationRunner = class {
903147
903168
  smartCasing: generatorInvocation.smartCasing,
903148
903169
  exampleGeneration: {
903149
903170
  includeOptionalRequestPropertyExamples: true,
903150
- disabled: generatorInvocation.disableExamples
903171
+ disabled: generatorInvocation.disableExamples,
903172
+ skipAutogenerationIfManualExamplesExist: skipAutogenerationIfManualExamplesExist ?? false
903151
903173
  },
903152
903174
  readme: generatorInvocation.readme,
903153
903175
  version: outputVersionOverride,
@@ -924197,7 +924219,7 @@ var CliContext = class {
924197
924219
  if (false) {
924198
924220
  this.logger.error("CLI_VERSION is not defined");
924199
924221
  }
924200
- return "4.57.0";
924222
+ return "4.58.0-2-g7897b571c7b";
924201
924223
  }
924202
924224
  getCliName() {
924203
924225
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.57.0",
2
+ "version": "4.58.0-2-g7897b571c7b",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",