@fern-api/fern-api-dev 5.112.0 → 5.112.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 +31 -15
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -147380,7 +147380,10 @@ function buildEndpoint({ endpoint: endpoint3, declarationFile, context: context3
147380
147380
  }
147381
147381
  context3.builder.addError(errorDeclarationFile, {
147382
147382
  name: errorName,
147383
- schema: context3.isErrorUnknownSchema(parseInt(statusCode)) ? { ...errorDeclaration, type: "unknown" } : errorDeclaration
147383
+ schema: context3.isErrorUnknownSchema({
147384
+ statusCode: parseInt(statusCode),
147385
+ namespace: maybeEndpointNamespace
147386
+ }) ? { ...errorDeclaration, type: "unknown" } : errorDeclaration
147384
147387
  });
147385
147388
  if (convertedEndpoint.errors == null) {
147386
147389
  convertedEndpoint.errors = [];
@@ -149305,6 +149308,9 @@ var init_lib14 = __esm({
149305
149308
  });
149306
149309
 
149307
149310
  // ../api-importers/openapi/openapi-ir-to-fern/lib/OpenApiIrConverterContext.js
149311
+ function getErrorKey({ statusCode, namespace }) {
149312
+ return namespace != null ? `${namespace}:${statusCode}` : `${statusCode}`;
149313
+ }
149308
149314
  var OpenApiIrConverterContext;
149309
149315
  var init_OpenApiIrConverterContext = __esm({
149310
149316
  "../api-importers/openapi/openapi-ir-to-fern/lib/OpenApiIrConverterContext.js"() {
@@ -149314,6 +149320,7 @@ var init_OpenApiIrConverterContext = __esm({
149314
149320
  init_lib13();
149315
149321
  init_ConvertOpenAPIOptions();
149316
149322
  init_State();
149323
+ init_getNamespaceFromGroup();
149317
149324
  OpenApiIrConverterContext = class {
149318
149325
  logger;
149319
149326
  taskContext;
@@ -149379,17 +149386,18 @@ var init_OpenApiIrConverterContext = __esm({
149379
149386
  if (ir3.title != null) {
149380
149387
  this.builder.setDisplayName({ displayName: ir3.title });
149381
149388
  }
149382
- const schemaByStatusCode = {};
149389
+ const schemaByErrorKey = {};
149383
149390
  if (!this.enableUniqueErrorsPerEndpoint) {
149384
149391
  for (const endpoint3 of ir3.endpoints) {
149392
+ const namespace = getEndpointNamespace(endpoint3.sdkName, endpoint3.namespace);
149385
149393
  for (const [statusCodeString, error50] of Object.entries(endpoint3.errors)) {
149386
- const statusCode = parseInt(statusCodeString);
149387
- const existingSchema = schemaByStatusCode[statusCode];
149394
+ const key2 = getErrorKey({ statusCode: parseInt(statusCodeString), namespace });
149395
+ const existingSchema = schemaByErrorKey[key2];
149388
149396
  if (existingSchema == null && error50.schema != null) {
149389
- schemaByStatusCode[statusCode] = error50.schema;
149397
+ schemaByErrorKey[key2] = error50.schema;
149390
149398
  } else if (existingSchema != null && error50.schema != null && isSchemaEqual(existingSchema, error50.schema)) {
149391
149399
  } else {
149392
- this.unknownSchema.add(statusCode);
149400
+ this.unknownSchema.add(key2);
149393
149401
  }
149394
149402
  }
149395
149403
  }
@@ -149432,10 +149440,11 @@ var init_OpenApiIrConverterContext = __esm({
149432
149440
  return this.urlIdMap.get(serverUrl);
149433
149441
  }
149434
149442
  /**
149435
- * Is error an unknown schema
149443
+ * Is error an unknown schema. Errors are shared per status code within a namespace,
149444
+ * so a schema mismatch in one namespace does not affect errors in another.
149436
149445
  */
149437
- isErrorUnknownSchema(statusCode) {
149438
- return this.unknownSchema.has(statusCode);
149446
+ isErrorUnknownSchema({ statusCode, namespace }) {
149447
+ return this.unknownSchema.has(getErrorKey({ statusCode, namespace }));
149439
149448
  }
149440
149449
  /**
149441
149450
  * Returns the current endpoint method being processed
@@ -705521,7 +705530,7 @@ var AccessTokenPosthogManager = class {
705521
705530
  properties: {
705522
705531
  ...event,
705523
705532
  ...event.properties,
705524
- version: "5.112.0",
705533
+ version: "5.112.1",
705525
705534
  usingAccessToken: true,
705526
705535
  ...getRunIdProperties()
705527
705536
  }
@@ -705587,7 +705596,7 @@ var UserPosthogManager = class {
705587
705596
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
705588
705597
  event: "CLI",
705589
705598
  properties: {
705590
- version: "5.112.0",
705599
+ version: "5.112.1",
705591
705600
  ...event,
705592
705601
  ...event.properties,
705593
705602
  usingAccessToken: false,
@@ -887263,7 +887272,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
887263
887272
  var LOGS_FOLDER_NAME = "logs";
887264
887273
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
887265
887274
  function getCliSource() {
887266
- const version7 = "5.112.0";
887275
+ const version7 = "5.112.1";
887267
887276
  return `cli@${version7}`;
887268
887277
  }
887269
887278
  var DebugLogger = class {
@@ -914576,7 +914585,7 @@ var LegacyDocsPublisher = class {
914576
914585
  previewId,
914577
914586
  disableTemplates: void 0,
914578
914587
  skipUpload,
914579
- cliVersion: "5.112.0",
914588
+ cliVersion: "5.112.1",
914580
914589
  loginCommand: "fern auth login"
914581
914590
  });
914582
914591
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -965462,6 +965471,7 @@ var TypescriptCustomConfigSchema = external_exports2.strictObject({
965462
965471
  noOptionalProperties: external_exports2.optional(external_exports2.boolean()),
965463
965472
  tolerateRepublish: external_exports2.optional(external_exports2.boolean()),
965464
965473
  packageJson: external_exports2.optional(external_exports2.record(external_exports2.any())),
965474
+ packageJsonMergeStrategy: external_exports2.optional(external_exports2.enum(["shallow", "deep"])),
965465
965475
  publishToJsr: external_exports2.optional(external_exports2.boolean()),
965466
965476
  omitUndefined: external_exports2.optional(external_exports2.boolean()),
965467
965477
  useLegacyExports: external_exports2.optional(external_exports2.boolean()),
@@ -965521,6 +965531,12 @@ var TypescriptCustomConfigSchema = external_exports2.strictObject({
965521
965531
  // get auth headers when credentials are supplied, and no endpoint gets them
965522
965532
  // when credentials are absent.
965523
965533
  "optional-auth": external_exports2.optional(external_exports2.boolean()),
965534
+ // When true, the generated auth providers read environment variables through a
965535
+ // `typeof process !== "undefined"` guard, so they fall back to the normal
965536
+ // missing-credential error instead of throwing `ReferenceError: process is not
965537
+ // defined` in runtimes without a Node `process` global (browsers, Cloudflare
965538
+ // Workers, Deno). Node behavior is unchanged.
965539
+ guardProcessEnvAccess: external_exports2.optional(external_exports2.boolean()),
965524
965540
  generateReactQueryHooks: external_exports2.optional(external_exports2.boolean()),
965525
965541
  // beta (not in docs)
965526
965542
  includeContentHeadersOnFileDownloadResponse: external_exports2.optional(external_exports2.boolean()),
@@ -981825,7 +981841,7 @@ function getAutomationContextFromEnv() {
981825
981841
  config_branch: process.env.FERN_CONFIG_BRANCH,
981826
981842
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
981827
981843
  trigger: process.env.GITHUB_EVENT_NAME,
981828
- cli_version: "5.112.0"
981844
+ cli_version: "5.112.1"
981829
981845
  };
981830
981846
  }
981831
981847
  function isAutomationMode() {
@@ -982657,7 +982673,7 @@ var CliContext = class _CliContext {
982657
982673
  if (false) {
982658
982674
  this.logger.error("CLI_VERSION is not defined");
982659
982675
  }
982660
- return "5.112.0";
982676
+ return "5.112.1";
982661
982677
  }
982662
982678
  getCliName() {
982663
982679
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.112.0",
2
+ "version": "5.112.1",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",