fern-api 0.16.20 → 0.16.22

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/bundle.cjs +67 -49
  2. package/package.json +1 -1
package/bundle.cjs CHANGED
@@ -736945,7 +736945,7 @@ var AccessTokenPosthogManager = class {
736945
736945
  properties: {
736946
736946
  ...event,
736947
736947
  ...event.properties,
736948
- version: "0.16.20",
736948
+ version: "0.16.22",
736949
736949
  usingAccessToken: true
736950
736950
  }
736951
736951
  });
@@ -737007,7 +737007,7 @@ var UserPosthogManager = class {
737007
737007
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
737008
737008
  event: "CLI",
737009
737009
  properties: {
737010
- version: "0.16.20",
737010
+ version: "0.16.22",
737011
737011
  ...event,
737012
737012
  ...event.properties
737013
737013
  }
@@ -752076,14 +752076,19 @@ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, prop
752076
752076
  groupName
752077
752077
  });
752078
752078
  }
752079
+ const hasNullValue = schema2.anyOf.filter((schema3) => {
752080
+ return !isReferenceObject(schema3) && schema3.type === "null";
752081
+ }).length > 0;
752079
752082
  return convertUndiscriminatedOneOf({
752080
752083
  nameOverride,
752081
752084
  generatedName,
752082
752085
  breadcrumbs,
752083
752086
  description,
752084
- wrapAsNullable,
752087
+ wrapAsNullable: wrapAsNullable || hasNullValue,
752085
752088
  context,
752086
- subtypes: schema2.anyOf,
752089
+ subtypes: schema2.anyOf.filter((schema3) => {
752090
+ return isReferenceObject(schema3) || schema3.type !== "null";
752091
+ }),
752087
752092
  groupName
752088
752093
  });
752089
752094
  }
@@ -753431,6 +753436,47 @@ function getScopes(oauthSecurityScheme) {
753431
753436
  return void 0;
753432
753437
  }
753433
753438
 
753439
+ // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/converters/convertToHttpError.js
753440
+ var import_finalIr14 = __toESM(require_finalIr());
753441
+ var ERROR_NAMES_BY_STATUS_CODE = {
753442
+ 400: "BadRequestError",
753443
+ 401: "UnauthorizedError",
753444
+ 403: "ForbiddenError",
753445
+ 404: "NotFoundError",
753446
+ 408: "RequestTimeoutError",
753447
+ 409: "ConflictError",
753448
+ 413: "ContentTooLargeError",
753449
+ 422: "UnprocessableEntityError",
753450
+ 428: "PreconditionError",
753451
+ 429: "TooManyRequestsError",
753452
+ 500: "InternalServerError",
753453
+ 501: "NotImplementedError",
753454
+ 503: "ServiceUnavailableError"
753455
+ };
753456
+ var ERROR_NAMES = new Set(Object.values(ERROR_NAMES_BY_STATUS_CODE));
753457
+ function convertToError({ statusCode, errorBodyCollector, context }) {
753458
+ const errorName = ERROR_NAMES_BY_STATUS_CODE[statusCode];
753459
+ if (errorName == null) {
753460
+ return void 0;
753461
+ }
753462
+ const schemas = errorBodyCollector.getSchemas();
753463
+ if (schemas.length === 1 && schemas[0] != null) {
753464
+ const schema2 = convertSchema(schemas[0], false, context, [errorName, "Body"]);
753465
+ return {
753466
+ generatedName: errorName,
753467
+ nameOverride: null,
753468
+ schema: schema2,
753469
+ description: void 0
753470
+ };
753471
+ }
753472
+ return {
753473
+ generatedName: errorName,
753474
+ nameOverride: null,
753475
+ schema: import_finalIr14.Schema.unknown(),
753476
+ description: void 0
753477
+ };
753478
+ }
753479
+
753434
753480
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/utils/isSchemaRequired.js
753435
753481
  function isSchemaRequired(schema2) {
753436
753482
  return schema2.type !== "optional" && schema2.type !== "nullable";
@@ -753810,7 +753856,7 @@ function getResponseSchema(response) {
753810
753856
  }
753811
753857
 
753812
753858
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/extensions/getVariableDefinitions.js
753813
- var import_finalIr14 = __toESM(require_finalIr());
753859
+ var import_finalIr15 = __toESM(require_finalIr());
753814
753860
  function getVariableDefinitions(document4) {
753815
753861
  const variables = getExtension(document4, FernOpenAPIExtension.SDK_VARIABLES);
753816
753862
  if (variables == null) {
@@ -753821,7 +753867,7 @@ function getVariableDefinitions(document4) {
753821
753867
  return [
753822
753868
  variableName,
753823
753869
  {
753824
- schema: import_finalIr14.PrimitiveSchemaValue.string({
753870
+ schema: import_finalIr15.PrimitiveSchemaValue.string({
753825
753871
  minLength: void 0,
753826
753872
  maxLength: void 0
753827
753873
  }),
@@ -753835,46 +753881,6 @@ function getVariableDefinitions(document4) {
753835
753881
  }));
753836
753882
  }
753837
753883
 
753838
- // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/converters/convertToHttpError.js
753839
- var import_finalIr15 = __toESM(require_finalIr());
753840
- var ERROR_NAMES_BY_STATUS_CODE = {
753841
- 400: "BadRequestError",
753842
- 401: "UnauthorizedError",
753843
- 403: "ForbiddenError",
753844
- 404: "NotFoundError",
753845
- 408: "RequestTimeoutError",
753846
- 409: "ConflictError",
753847
- 413: "ContentTooLargeError",
753848
- 422: "UnprocessableEntityError",
753849
- 428: "PreconditionError",
753850
- 429: "TooManyRequestsError",
753851
- 500: "InternalServerError",
753852
- 501: "NotImplementedError",
753853
- 503: "ServiceUnavailableError"
753854
- };
753855
- function convertToError({ statusCode, errorBodyCollector, context }) {
753856
- const errorName = ERROR_NAMES_BY_STATUS_CODE[statusCode];
753857
- if (errorName == null) {
753858
- return void 0;
753859
- }
753860
- const schemas = errorBodyCollector.getSchemas();
753861
- if (schemas.length === 1 && schemas[0] != null) {
753862
- const schema2 = convertSchema(schemas[0], false, context, [errorName, "Body"]);
753863
- return {
753864
- generatedName: errorName,
753865
- nameOverride: null,
753866
- schema: schema2,
753867
- description: void 0
753868
- };
753869
- }
753870
- return {
753871
- generatedName: errorName,
753872
- nameOverride: null,
753873
- schema: import_finalIr15.Schema.unknown(),
753874
- description: void 0
753875
- };
753876
- }
753877
-
753878
753884
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/ErrorBodyCollector.js
753879
753885
  var ErrorBodyCollector = class {
753880
753886
  references = /* @__PURE__ */ new Set();
@@ -754034,6 +754040,17 @@ function generateIr(openApi, taskContext) {
754034
754040
  if (ignoreSchema != null && ignoreSchema) {
754035
754041
  return [];
754036
754042
  }
754043
+ if (ERROR_NAMES.has(key2)) {
754044
+ return [
754045
+ key2,
754046
+ convertSchema(
754047
+ { ...schema2, "x-fern-type-name": `${key2}Body` },
754048
+ false,
754049
+ context,
754050
+ [key2]
754051
+ )
754052
+ ];
754053
+ }
754037
754054
  }
754038
754055
  return [key2, convertSchema(schema2, false, context, [key2])];
754039
754056
  }).filter((entry) => entry.length > 0));
@@ -754081,7 +754098,8 @@ function generateIr(openApi, taskContext) {
754081
754098
  });
754082
754099
  const schemas = Object.fromEntries(Object.entries(schemasWithExample).map(([key2, schemaWithExample]) => {
754083
754100
  taskContext.logger.debug(`Converting schema ${key2}`);
754084
- return [key2, convertSchemaWithExampleToSchema(schemaWithExample)];
754101
+ const schema2 = convertSchemaWithExampleToSchema(schemaWithExample);
754102
+ return [key2, schema2];
754085
754103
  }));
754086
754104
  const ir = {
754087
754105
  title: openApi.info.title,
@@ -761548,10 +761566,10 @@ var CliContext = class {
761548
761566
  return "fern-api";
761549
761567
  }
761550
761568
  getPackageVersion() {
761551
- if ("0.16.20" == null) {
761569
+ if ("0.16.22" == null) {
761552
761570
  this.logger.error("CLI_VERSION is not defined");
761553
761571
  }
761554
- return "0.16.20";
761572
+ return "0.16.22";
761555
761573
  }
761556
761574
  getCliName() {
761557
761575
  if ("fern" == null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.16.20",
3
+ "version": "0.16.22",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",