@fern-api/fern-api-dev 5.114.0 → 5.114.1

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 +16 -60
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -132774,8 +132774,7 @@ var init_ConvertOpenAPIOptions = __esm({
132774
132774
  groupEnvironmentsByHost: false,
132775
132775
  multiServerStrategy: generators_yml_exports.MultiServerStrategy.EnvironmentPerServer,
132776
132776
  removeDiscriminantsFromSchemas: generators_yml_exports.RemoveDiscriminantsFromSchemas.Always,
132777
- inferDefaultEnvironment: true,
132778
- namespacedErrors: false
132777
+ inferDefaultEnvironment: true
132779
132778
  };
132780
132779
  }
132781
132780
  });
@@ -145657,37 +145656,8 @@ function getNamespaceFromGroup(groupName) {
145657
145656
  function getEndpointNamespace(sdkName, namespaceOverride) {
145658
145657
  return namespaceOverride != null ? namespaceOverride : sdkName?.groupName != null ? getNamespaceFromGroup(sdkName.groupName) : void 0;
145659
145658
  }
145660
- function getErrorNamespace({ endpointNamespace, error: error50, namespacedErrors }) {
145661
- if (namespacedErrors) {
145662
- if (error50.namespace != null) {
145663
- return error50.namespace;
145664
- }
145665
- const referenced = unwrapReferencedSchema(error50.schema);
145666
- if (referenced?.namespace != null) {
145667
- return referenced.namespace;
145668
- }
145669
- }
145670
- return endpointNamespace;
145671
- }
145672
- function getErrorConflictNamespace({ endpointNamespace, error: error50, namespacedErrors }) {
145673
- if (!namespacedErrors) {
145674
- return void 0;
145675
- }
145676
- return getErrorNamespace({ endpointNamespace, error: error50, namespacedErrors });
145677
- }
145678
- function unwrapReferencedSchema(schema) {
145679
- if (schema == null) {
145680
- return void 0;
145681
- }
145682
- switch (schema.type) {
145683
- case "reference":
145684
- return schema;
145685
- case "nullable":
145686
- case "optional":
145687
- return unwrapReferencedSchema(schema.value);
145688
- default:
145689
- return void 0;
145690
- }
145659
+ function getErrorNamespace({ endpointNamespace, error: error50 }) {
145660
+ return error50.namespace ?? endpointNamespace;
145691
145661
  }
145692
145662
  var init_getNamespaceFromGroup = __esm({
145693
145663
  "../api-importers/openapi/openapi-ir-to-fern/lib/utils/getNamespaceFromGroup.js"() {
@@ -147398,8 +147368,7 @@ function buildEndpoint({ endpoint: endpoint3, declarationFile, context: context3
147398
147368
  };
147399
147369
  const errorNamespace = getErrorNamespace({
147400
147370
  endpointNamespace: maybeEndpointNamespace,
147401
- error: httpError,
147402
- namespacedErrors: context3.options.namespacedErrors
147371
+ error: httpError
147403
147372
  });
147404
147373
  const errorDeclarationFile = resolveLocationWithNamespace({
147405
147374
  location: ERROR_DECLARATIONS_FILENAME,
@@ -147421,11 +147390,7 @@ function buildEndpoint({ endpoint: endpoint3, declarationFile, context: context3
147421
147390
  name: errorName,
147422
147391
  schema: context3.isErrorUnknownSchema({
147423
147392
  statusCode: parseInt(statusCode),
147424
- namespace: getErrorConflictNamespace({
147425
- endpointNamespace: maybeEndpointNamespace,
147426
- error: httpError,
147427
- namespacedErrors: context3.options.namespacedErrors
147428
- })
147393
+ namespace: httpError.namespace
147429
147394
  }) ? { ...errorDeclaration, type: "unknown" } : errorDeclaration
147430
147395
  });
147431
147396
  if (convertedEndpoint.errors == null) {
@@ -149363,7 +149328,6 @@ var init_OpenApiIrConverterContext = __esm({
149363
149328
  init_lib13();
149364
149329
  init_ConvertOpenAPIOptions();
149365
149330
  init_State();
149366
- init_getNamespaceFromGroup();
149367
149331
  OpenApiIrConverterContext = class {
149368
149332
  logger;
149369
149333
  taskContext;
@@ -149432,15 +149396,9 @@ var init_OpenApiIrConverterContext = __esm({
149432
149396
  const schemaByErrorKey = {};
149433
149397
  if (!this.enableUniqueErrorsPerEndpoint) {
149434
149398
  for (const endpoint3 of ir3.endpoints) {
149435
- const endpointNamespace = getEndpointNamespace(endpoint3.sdkName, endpoint3.namespace);
149436
149399
  for (const [statusCodeString, error50] of Object.entries(endpoint3.errors)) {
149437
149400
  const statusCode = parseInt(statusCodeString);
149438
- const namespace = getErrorConflictNamespace({
149439
- endpointNamespace,
149440
- error: error50,
149441
- namespacedErrors: this.options.namespacedErrors
149442
- });
149443
- const key2 = getErrorKey({ statusCode, namespace });
149401
+ const key2 = getErrorKey({ statusCode, namespace: error50.namespace });
149444
149402
  const existingSchema = schemaByErrorKey[key2];
149445
149403
  if (existingSchema == null && error50.schema != null) {
149446
149404
  schemaByErrorKey[key2] = error50.schema;
@@ -152226,7 +152184,6 @@ var init_BaseOpenAPIWorkspace = __esm({
152226
152184
  defaultIntegerFormat;
152227
152185
  pathParameterOrder;
152228
152186
  coerceConstsTo;
152229
- namespacedErrors;
152230
152187
  converter;
152231
152188
  constructor(args) {
152232
152189
  super(args);
@@ -152252,7 +152209,6 @@ var init_BaseOpenAPIWorkspace = __esm({
152252
152209
  this.defaultIntegerFormat = args.defaultIntegerFormat;
152253
152210
  this.pathParameterOrder = args.pathParameterOrder;
152254
152211
  this.coerceConstsTo = args.coerceConstsTo;
152255
- this.namespacedErrors = args.namespacedErrors;
152256
152212
  this.converter = new FernDefinitionConverter(args);
152257
152213
  }
152258
152214
  async getDefinition({ context: context3, absoluteFilePath, relativePathToDependency }, settings) {
@@ -153173,7 +153129,8 @@ var init_options2 = __esm({
153173
153129
  disambiguateRequestNames: true,
153174
153130
  ignoreTags: false,
153175
153131
  respectParameterContent: false,
153176
- respectPerSpecBasePath: false
153132
+ respectPerSpecBasePath: false,
153133
+ namespacedErrors: false
153177
153134
  };
153178
153135
  }
153179
153136
  });
@@ -167119,7 +167076,7 @@ function markErrorSchemas({ responses, context: context3, source: source2, names
167119
167076
  context3.logger.warn(`No error name found for status code ${statusCode}`);
167120
167077
  continue;
167121
167078
  }
167122
- const responseNamespace = getExtension(resolvedResponse, FernOpenAPIExtension.SDK_NAMESPACE);
167079
+ const responseNamespace = context3.options.namespacedErrors ? getExtension(resolvedResponse, FernOpenAPIExtension.SDK_NAMESPACE) : void 0;
167123
167080
  errors4[parsedStatusCode] = {
167124
167081
  statusCode: parsedStatusCode,
167125
167082
  nameOverride: void 0,
@@ -374422,8 +374379,7 @@ var init_OSSWorkspace = __esm({
374422
374379
  inferDefaultEnvironment: collapseSpecBooleanSetting(specs, (s5) => s5?.inferDefaultEnvironment),
374423
374380
  defaultIntegerFormat: specs[0]?.settings?.defaultIntegerFormat,
374424
374381
  pathParameterOrder: specs[0]?.settings?.pathParameterOrder,
374425
- coerceConstsTo: specs[0]?.settings?.coerceConstsTo,
374426
- namespacedErrors: specs.some((spec) => spec.settings?.namespacedErrors)
374382
+ coerceConstsTo: specs[0]?.settings?.coerceConstsTo
374427
374383
  });
374428
374384
  this.specs = specs;
374429
374385
  this.allSpecs = allSpecs;
@@ -705608,7 +705564,7 @@ var AccessTokenPosthogManager = class {
705608
705564
  properties: {
705609
705565
  ...event,
705610
705566
  ...event.properties,
705611
- version: "5.114.0",
705567
+ version: "5.114.1",
705612
705568
  usingAccessToken: true,
705613
705569
  ...getRunIdProperties()
705614
705570
  }
@@ -705674,7 +705630,7 @@ var UserPosthogManager = class {
705674
705630
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
705675
705631
  event: "CLI",
705676
705632
  properties: {
705677
- version: "5.114.0",
705633
+ version: "5.114.1",
705678
705634
  ...event,
705679
705635
  ...event.properties,
705680
705636
  usingAccessToken: false,
@@ -887352,7 +887308,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
887352
887308
  var LOGS_FOLDER_NAME = "logs";
887353
887309
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
887354
887310
  function getCliSource() {
887355
- const version7 = "5.114.0";
887311
+ const version7 = "5.114.1";
887356
887312
  return `cli@${version7}`;
887357
887313
  }
887358
887314
  var DebugLogger = class {
@@ -914665,7 +914621,7 @@ var LegacyDocsPublisher = class {
914665
914621
  previewId,
914666
914622
  disableTemplates: void 0,
914667
914623
  skipUpload,
914668
- cliVersion: "5.114.0",
914624
+ cliVersion: "5.114.1",
914669
914625
  loginCommand: "fern auth login"
914670
914626
  });
914671
914627
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -981921,7 +981877,7 @@ function getAutomationContextFromEnv() {
981921
981877
  config_branch: process.env.FERN_CONFIG_BRANCH,
981922
981878
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
981923
981879
  trigger: process.env.GITHUB_EVENT_NAME,
981924
- cli_version: "5.114.0"
981880
+ cli_version: "5.114.1"
981925
981881
  };
981926
981882
  }
981927
981883
  function isAutomationMode() {
@@ -982753,7 +982709,7 @@ var CliContext = class _CliContext {
982753
982709
  if (false) {
982754
982710
  this.logger.error("CLI_VERSION is not defined");
982755
982711
  }
982756
- return "5.114.0";
982712
+ return "5.114.1";
982757
982713
  }
982758
982714
  getCliName() {
982759
982715
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.114.0",
2
+ "version": "5.114.1",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",