@fern-api/fern-api-dev 5.113.3 → 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 +64 -34
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -131246,7 +131246,8 @@ var init_OpenApiSettingsSchema2 = __esm({
131246
131246
  "disambiguate-request-names": schemas_exports8.boolean().optional(),
131247
131247
  "ignore-tags": schemas_exports8.boolean().optional(),
131248
131248
  "respect-parameter-content": schemas_exports8.boolean().optional(),
131249
- "respect-per-spec-base-path": schemas_exports8.boolean().optional()
131249
+ "respect-per-spec-base-path": schemas_exports8.boolean().optional(),
131250
+ "namespaced-errors": schemas_exports8.boolean().optional()
131250
131251
  }).extend(BaseApiSettingsSchema);
131251
131252
  }
131252
131253
  });
@@ -139927,7 +139928,8 @@ var init_HttpError2 = __esm({
139927
139928
  init_ErrorExample2();
139928
139929
  HttpError = schemas_exports9.objectWithoutOptionalProperties({
139929
139930
  schema: schemas_exports9.lazy(() => Schema2).optional(),
139930
- examples: schemas_exports9.list(ErrorExample).optional()
139931
+ examples: schemas_exports9.list(ErrorExample).optional(),
139932
+ namespace: schemas_exports9.string().optional()
139931
139933
  }).extend(WithDescription).extend(WithName3).extend(WithSource);
139932
139934
  }
139933
139935
  });
@@ -141767,7 +141769,8 @@ var init_HttpErrorWithExample2 = __esm({
141767
141769
  HttpErrorWithExample = schemas_exports9.objectWithoutOptionalProperties({
141768
141770
  statusCode: StatusCode,
141769
141771
  schema: schemas_exports9.lazy(() => SchemaWithExample2),
141770
- fullExamples: schemas_exports9.list(NamedFullExample).optional()
141772
+ fullExamples: schemas_exports9.list(NamedFullExample).optional(),
141773
+ namespace: schemas_exports9.string().optional()
141771
141774
  }).extend(WithDescription).extend(WithName3).extend(WithSource);
141772
141775
  }
141773
141776
  });
@@ -143067,18 +143070,16 @@ function isOneOfEqual(a3, b5) {
143067
143070
  return false;
143068
143071
  }
143069
143072
  function isObjectEqual(a3, b5) {
143070
- if (Object.keys(a3.properties).length !== Object.keys(b5.properties).length) {
143073
+ if (a3.properties.length !== b5.properties.length) {
143071
143074
  return false;
143072
143075
  }
143073
- const aPropertyMap = Object.fromEntries(a3.properties.map((property24) => {
143074
- return [property24.key, property24.schema];
143075
- }));
143076
- return Object.entries(b5.properties).every(([bPropertyName, bPropertySchema]) => {
143077
- const aProperty = aPropertyMap[bPropertyName];
143078
- if (aProperty == null) {
143076
+ const aPropertyMap = new Map(a3.properties.map((property24) => [property24.key, property24.schema]));
143077
+ return b5.properties.every((bProperty) => {
143078
+ const aPropertySchema = aPropertyMap.get(bProperty.key);
143079
+ if (aPropertySchema == null) {
143079
143080
  return false;
143080
143081
  }
143081
- return isSchemaEqual(aProperty, bPropertySchema.schema);
143082
+ return isSchemaEqual(aPropertySchema, bProperty.schema);
143082
143083
  });
143083
143084
  }
143084
143085
  var init_isSchemaEqual = __esm({
@@ -145655,6 +145656,9 @@ function getNamespaceFromGroup(groupName) {
145655
145656
  function getEndpointNamespace(sdkName, namespaceOverride) {
145656
145657
  return namespaceOverride != null ? namespaceOverride : sdkName?.groupName != null ? getNamespaceFromGroup(sdkName.groupName) : void 0;
145657
145658
  }
145659
+ function getErrorNamespace({ endpointNamespace, error: error50 }) {
145660
+ return error50.namespace ?? endpointNamespace;
145661
+ }
145658
145662
  var init_getNamespaceFromGroup = __esm({
145659
145663
  "../api-importers/openapi/openapi-ir-to-fern/lib/utils/getNamespaceFromGroup.js"() {
145660
145664
  "use strict";
@@ -147362,9 +147366,13 @@ function buildEndpoint({ endpoint: endpoint3, declarationFile, context: context3
147362
147366
  const errorDeclaration = {
147363
147367
  "status-code": parseInt(statusCode)
147364
147368
  };
147369
+ const errorNamespace = getErrorNamespace({
147370
+ endpointNamespace: maybeEndpointNamespace,
147371
+ error: httpError
147372
+ });
147365
147373
  const errorDeclarationFile = resolveLocationWithNamespace({
147366
147374
  location: ERROR_DECLARATIONS_FILENAME,
147367
- namespaceOverride: maybeEndpointNamespace
147375
+ namespaceOverride: errorNamespace
147368
147376
  });
147369
147377
  if (httpError.schema != null) {
147370
147378
  const typeReference2 = buildTypeReference({
@@ -147372,7 +147380,7 @@ function buildEndpoint({ endpoint: endpoint3, declarationFile, context: context3
147372
147380
  context: context3,
147373
147381
  fileContainingReference: errorDeclarationFile,
147374
147382
  declarationFile: errorDeclarationFile,
147375
- namespace: maybeEndpointNamespace,
147383
+ namespace: errorNamespace,
147376
147384
  declarationDepth: 0
147377
147385
  });
147378
147386
  errorDeclaration.type = getTypeFromTypeReference(typeReference2);
@@ -147380,7 +147388,10 @@ function buildEndpoint({ endpoint: endpoint3, declarationFile, context: context3
147380
147388
  }
147381
147389
  context3.builder.addError(errorDeclarationFile, {
147382
147390
  name: errorName,
147383
- schema: context3.isErrorUnknownSchema(parseInt(statusCode)) ? { ...errorDeclaration, type: "unknown" } : errorDeclaration
147391
+ schema: context3.isErrorUnknownSchema({
147392
+ statusCode: parseInt(statusCode),
147393
+ namespace: httpError.namespace
147394
+ }) ? { ...errorDeclaration, type: "unknown" } : errorDeclaration
147384
147395
  });
147385
147396
  if (convertedEndpoint.errors == null) {
147386
147397
  convertedEndpoint.errors = [];
@@ -149305,6 +149316,9 @@ var init_lib14 = __esm({
149305
149316
  });
149306
149317
 
149307
149318
  // ../api-importers/openapi/openapi-ir-to-fern/lib/OpenApiIrConverterContext.js
149319
+ function getErrorKey({ statusCode, namespace }) {
149320
+ return namespace != null ? `${namespace}:${statusCode}` : `${statusCode}`;
149321
+ }
149308
149322
  var OpenApiIrConverterContext;
149309
149323
  var init_OpenApiIrConverterContext = __esm({
149310
149324
  "../api-importers/openapi/openapi-ir-to-fern/lib/OpenApiIrConverterContext.js"() {
@@ -149379,17 +149393,18 @@ var init_OpenApiIrConverterContext = __esm({
149379
149393
  if (ir3.title != null) {
149380
149394
  this.builder.setDisplayName({ displayName: ir3.title });
149381
149395
  }
149382
- const schemaByStatusCode = {};
149396
+ const schemaByErrorKey = {};
149383
149397
  if (!this.enableUniqueErrorsPerEndpoint) {
149384
149398
  for (const endpoint3 of ir3.endpoints) {
149385
149399
  for (const [statusCodeString, error50] of Object.entries(endpoint3.errors)) {
149386
149400
  const statusCode = parseInt(statusCodeString);
149387
- const existingSchema = schemaByStatusCode[statusCode];
149401
+ const key2 = getErrorKey({ statusCode, namespace: error50.namespace });
149402
+ const existingSchema = schemaByErrorKey[key2];
149388
149403
  if (existingSchema == null && error50.schema != null) {
149389
- schemaByStatusCode[statusCode] = error50.schema;
149404
+ schemaByErrorKey[key2] = error50.schema;
149390
149405
  } else if (existingSchema != null && error50.schema != null && isSchemaEqual(existingSchema, error50.schema)) {
149391
149406
  } else {
149392
- this.unknownSchema.add(statusCode);
149407
+ this.unknownSchema.add(key2);
149393
149408
  }
149394
149409
  }
149395
149410
  }
@@ -149434,8 +149449,8 @@ var init_OpenApiIrConverterContext = __esm({
149434
149449
  /**
149435
149450
  * Is error an unknown schema
149436
149451
  */
149437
- isErrorUnknownSchema(statusCode) {
149438
- return this.unknownSchema.has(statusCode);
149452
+ isErrorUnknownSchema({ statusCode, namespace }) {
149453
+ return this.unknownSchema.has(getErrorKey({ statusCode, namespace }));
149439
149454
  }
149440
149455
  /**
149441
149456
  * Returns the current endpoint method being processed
@@ -153114,7 +153129,8 @@ var init_options2 = __esm({
153114
153129
  disambiguateRequestNames: true,
153115
153130
  ignoreTags: false,
153116
153131
  respectParameterContent: false,
153117
- respectPerSpecBasePath: false
153132
+ respectPerSpecBasePath: false,
153133
+ namespacedErrors: false
153118
153134
  };
153119
153135
  }
153120
153136
  });
@@ -167060,13 +167076,15 @@ function markErrorSchemas({ responses, context: context3, source: source2, names
167060
167076
  context3.logger.warn(`No error name found for status code ${statusCode}`);
167061
167077
  continue;
167062
167078
  }
167079
+ const responseNamespace = context3.options.namespacedErrors ? getExtension(resolvedResponse, FernOpenAPIExtension.SDK_NAMESPACE) : void 0;
167063
167080
  errors4[parsedStatusCode] = {
167064
167081
  statusCode: parsedStatusCode,
167065
167082
  nameOverride: void 0,
167066
167083
  generatedName: errorName,
167067
167084
  description: resolvedResponse.description,
167068
- schema: convertSchema2(mediaObject?.schema ?? {}, false, false, context3, [errorName, "Body"], source2, namespace),
167085
+ schema: convertSchema2(mediaObject?.schema ?? {}, false, false, context3, [errorName, "Body"], source2, responseNamespace ?? namespace),
167069
167086
  fullExamples: mediaObject?.examples,
167087
+ namespace: responseNamespace,
167070
167088
  source: source2
167071
167089
  };
167072
167090
  }
@@ -169148,7 +169166,8 @@ function generateIr({ openApi, taskContext, options: options2, source: source2,
169148
169166
  schema: convertSchemaWithExampleToSchema(error50.schema),
169149
169167
  description: error50.description,
169150
169168
  source: error50.source,
169151
- examples: examples2
169169
+ examples: examples2,
169170
+ namespace: error50.namespace
169152
169171
  };
169153
169172
  }),
169154
169173
  retries: endpointWithExample.retries,
@@ -200343,7 +200362,8 @@ var init_getAPIDefinitionSettings = __esm({
200343
200362
  disambiguateRequestNames: "disambiguateRequestNames",
200344
200363
  ignoreTags: "ignoreTags",
200345
200364
  respectParameterContent: "respectParameterContent",
200346
- respectPerSpecBasePath: "respectPerSpecBasePath"
200365
+ respectPerSpecBasePath: "respectPerSpecBasePath",
200366
+ namespacedErrors: "namespacedErrors"
200347
200367
  };
200348
200368
  }
200349
200369
  });
@@ -264966,7 +264986,8 @@ function parseOpenApiDefinitionSettingsSchema(settings) {
264966
264986
  disambiguateRequestNames: settings?.["disambiguate-request-names"],
264967
264987
  ignoreTags: settings?.["ignore-tags"],
264968
264988
  respectParameterContent: settings?.["respect-parameter-content"],
264969
- respectPerSpecBasePath: settings?.["respect-per-spec-base-path"]
264989
+ respectPerSpecBasePath: settings?.["respect-per-spec-base-path"],
264990
+ namespacedErrors: settings?.["namespaced-errors"]
264970
264991
  };
264971
264992
  }
264972
264993
  function parseAsyncApiDefinitionSettingsSchema(settings) {
@@ -265836,7 +265857,8 @@ var init_convertGeneratorsConfiguration = __esm({
265836
265857
  disambiguateRequestNames: void 0,
265837
265858
  ignoreTags: void 0,
265838
265859
  respectParameterContent: void 0,
265839
- respectPerSpecBasePath: void 0
265860
+ respectPerSpecBasePath: void 0,
265861
+ namespacedErrors: void 0
265840
265862
  };
265841
265863
  }
265842
265864
  });
@@ -696945,7 +696967,13 @@ var OpenApiSettingsSchema2 = BaseApiSettingsSchema2.extend({
696945
696967
  * If true, apply each OpenAPI document's plain `x-fern-base-path` to that document's endpoints.
696946
696968
  * Defaults to false.
696947
696969
  */
696948
- "respect-per-spec-base-path": external_exports.boolean().optional()
696970
+ "respect-per-spec-base-path": external_exports.boolean().optional(),
696971
+ /**
696972
+ * If true, an error whose body schema carries `x-fern-sdk-namespace` is declared in, and shared
696973
+ * within, that namespace instead of the endpoint's namespace.
696974
+ * Defaults to false.
696975
+ */
696976
+ "namespaced-errors": external_exports.boolean().optional()
696949
696977
  });
696950
696978
 
696951
696979
  // ../config/lib/schemas/specs/OpenApiSpecSchema.js
@@ -705536,7 +705564,7 @@ var AccessTokenPosthogManager = class {
705536
705564
  properties: {
705537
705565
  ...event,
705538
705566
  ...event.properties,
705539
- version: "5.113.3",
705567
+ version: "5.114.1",
705540
705568
  usingAccessToken: true,
705541
705569
  ...getRunIdProperties()
705542
705570
  }
@@ -705602,7 +705630,7 @@ var UserPosthogManager = class {
705602
705630
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
705603
705631
  event: "CLI",
705604
705632
  properties: {
705605
- version: "5.113.3",
705633
+ version: "5.114.1",
705606
705634
  ...event,
705607
705635
  ...event.properties,
705608
705636
  usingAccessToken: false,
@@ -712421,7 +712449,8 @@ var LegacyApiSpecAdapter = class {
712421
712449
  disambiguateRequestNames: settings["disambiguate-request-names"],
712422
712450
  ignoreTags: settings["ignore-tags"],
712423
712451
  respectParameterContent: settings["respect-parameter-content"],
712424
- respectPerSpecBasePath: settings["respect-per-spec-base-path"]
712452
+ respectPerSpecBasePath: settings["respect-per-spec-base-path"],
712453
+ namespacedErrors: settings["namespaced-errors"]
712425
712454
  };
712426
712455
  const hasSettings = Object.values(result).some((v3) => v3 != null);
712427
712456
  return hasSettings ? result : void 0;
@@ -885358,6 +885387,7 @@ var SETTINGS_KEY_MAP = {
885358
885387
  "prefer-undiscriminated-unions-with-literals": "preferUndiscriminatedUnionsWithLiterals",
885359
885388
  "object-query-parameters": "objectQueryParameters",
885360
885389
  "respect-readonly-schemas": "respectReadonlySchemas",
885390
+ "namespaced-errors": "namespacedErrors",
885361
885391
  "use-read-variant-for-responses": "useReadVariantForResponses",
885362
885392
  "respect-forward-compatible-enums": "respectForwardCompatibleEnums",
885363
885393
  "respect-optional-request-body": "respectOptionalRequestBody",
@@ -887278,7 +887308,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
887278
887308
  var LOGS_FOLDER_NAME = "logs";
887279
887309
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
887280
887310
  function getCliSource() {
887281
- const version7 = "5.113.3";
887311
+ const version7 = "5.114.1";
887282
887312
  return `cli@${version7}`;
887283
887313
  }
887284
887314
  var DebugLogger = class {
@@ -914591,7 +914621,7 @@ var LegacyDocsPublisher = class {
914591
914621
  previewId,
914592
914622
  disableTemplates: void 0,
914593
914623
  skipUpload,
914594
- cliVersion: "5.113.3",
914624
+ cliVersion: "5.114.1",
914595
914625
  loginCommand: "fern auth login"
914596
914626
  });
914597
914627
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -981847,7 +981877,7 @@ function getAutomationContextFromEnv() {
981847
981877
  config_branch: process.env.FERN_CONFIG_BRANCH,
981848
981878
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
981849
981879
  trigger: process.env.GITHUB_EVENT_NAME,
981850
- cli_version: "5.113.3"
981880
+ cli_version: "5.114.1"
981851
981881
  };
981852
981882
  }
981853
981883
  function isAutomationMode() {
@@ -982679,7 +982709,7 @@ var CliContext = class _CliContext {
982679
982709
  if (false) {
982680
982710
  this.logger.error("CLI_VERSION is not defined");
982681
982711
  }
982682
- return "5.113.3";
982712
+ return "5.114.1";
982683
982713
  }
982684
982714
  getCliName() {
982685
982715
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.113.3",
2
+ "version": "5.114.1",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",