fern-api 0.31.11 → 0.31.12

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 +88 -13
  2. package/package.json +1 -1
package/bundle.cjs CHANGED
@@ -1115837,7 +1115837,7 @@ var AccessTokenPosthogManager = class {
1115837
1115837
  properties: {
1115838
1115838
  ...event,
1115839
1115839
  ...event.properties,
1115840
- version: "0.31.11",
1115840
+ version: "0.31.12",
1115841
1115841
  usingAccessToken: true
1115842
1115842
  }
1115843
1115843
  });
@@ -1115899,7 +1115899,7 @@ var UserPosthogManager = class {
1115899
1115899
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
1115900
1115900
  event: "CLI",
1115901
1115901
  properties: {
1115902
- version: "0.31.11",
1115902
+ version: "0.31.12",
1115903
1115903
  ...event,
1115904
1115904
  ...event.properties
1115905
1115905
  }
@@ -1138175,16 +1138175,35 @@ function maybeStringValidation(schema2) {
1138175
1138175
  return void 0;
1138176
1138176
  }
1138177
1138177
  const { format: format5, pattern, minLength, maxLength } = schema2;
1138178
- if (format5 == null && pattern == null && minLength == null && maxLength == null) {
1138178
+ const validFormat = maybeValidFormat(format5);
1138179
+ if (validFormat == null && pattern == null && minLength == null && maxLength == null) {
1138179
1138180
  return void 0;
1138180
1138181
  }
1138181
1138182
  return {
1138182
- format: format5,
1138183
+ format: validFormat,
1138183
1138184
  pattern,
1138184
1138185
  minLength,
1138185
1138186
  maxLength
1138186
1138187
  };
1138187
1138188
  }
1138189
+ function maybeValidFormat(format5) {
1138190
+ switch (format5) {
1138191
+ case "date":
1138192
+ case "date-time":
1138193
+ case "password":
1138194
+ case "byte":
1138195
+ case "binary":
1138196
+ case "email":
1138197
+ case "uuid":
1138198
+ case "uri":
1138199
+ case "hostname":
1138200
+ case "ipv4":
1138201
+ case "ipv6":
1138202
+ return format5;
1138203
+ default:
1138204
+ return void 0;
1138205
+ }
1138206
+ }
1138188
1138207
  function maybeNumberValidation(schema2, type2) {
1138189
1138208
  if (schema2 == null) {
1138190
1138209
  return void 0;
@@ -1151448,10 +1151467,10 @@ var CliContext = class {
1151448
1151467
  return "fern-api";
1151449
1151468
  }
1151450
1151469
  getPackageVersion() {
1151451
- if ("0.31.11" == null) {
1151470
+ if ("0.31.12" == null) {
1151452
1151471
  this.logger.error("CLI_VERSION is not defined");
1151453
1151472
  }
1151454
- return "0.31.11";
1151473
+ return "0.31.12";
1151455
1151474
  }
1151456
1151475
  getCliName() {
1151457
1151476
  if ("fern" == null) {
@@ -1192374,11 +1192393,11 @@ function validateResolvedType({ resolvedType, _default: _default3, validation })
1192374
1192393
  case "INTEGER":
1192375
1192394
  return validateIntegerDefaultAndValidation({ _default: _default3, validation });
1192376
1192395
  case "BOOLEAN":
1192377
- typeName = "boolean";
1192378
- break;
1192396
+ return validateBooleanDefaultAndValidation({ _default: _default3, validation });
1192379
1192397
  case "LONG":
1192380
- typeName = "long";
1192381
- break;
1192398
+ return validateLongDefaultAndValidation({ _default: _default3, validation });
1192399
+ case "BIG_INTEGER":
1192400
+ return validateBigIntegerDefaultAndValidation({ _default: _default3, validation });
1192382
1192401
  case "DATE_TIME":
1192383
1192402
  typeName = "datetime";
1192384
1192403
  break;
@@ -1192388,9 +1192407,6 @@ function validateResolvedType({ resolvedType, _default: _default3, validation })
1192388
1192407
  case "BASE_64":
1192389
1192408
  typeName = "base64";
1192390
1192409
  break;
1192391
- case "BIG_INTEGER":
1192392
- typeName = "bigint";
1192393
- break;
1192394
1192410
  }
1192395
1192411
  }
1192396
1192412
  if (_default3 != null) {
@@ -1192459,6 +1192475,65 @@ function validateIntegerDefaultAndValidation({ _default: _default3, validation }
1192459
1192475
  }
1192460
1192476
  return violations;
1192461
1192477
  }
1192478
+ function validateBooleanDefaultAndValidation({ _default: _default3, validation }) {
1192479
+ const violations = [];
1192480
+ if (_default3 != null && typeof _default3 !== "boolean") {
1192481
+ violations.push({
1192482
+ message: `Default value '${_default3}' is not a valid boolean`,
1192483
+ severity: "error"
1192484
+ });
1192485
+ }
1192486
+ if (validation != null) {
1192487
+ violations.push({
1192488
+ message: `Validation rules '${JSON.stringify(validation)}' are not compatible with the boolean type`,
1192489
+ severity: "error"
1192490
+ });
1192491
+ }
1192492
+ return violations;
1192493
+ }
1192494
+ function validateLongDefaultAndValidation({ _default: _default3, validation }) {
1192495
+ const violations = [];
1192496
+ if (_default3 != null && typeof _default3 !== "number") {
1192497
+ violations.push({
1192498
+ message: `Default value '${_default3}' is not a valid long`,
1192499
+ severity: "error"
1192500
+ });
1192501
+ }
1192502
+ if (validation != null) {
1192503
+ violations.push({
1192504
+ message: `Validation rules '${JSON.stringify(validation)}' are not compatible with the long type`,
1192505
+ severity: "error"
1192506
+ });
1192507
+ }
1192508
+ return violations;
1192509
+ }
1192510
+ function validateBigIntegerDefaultAndValidation({ _default: _default3, validation }) {
1192511
+ const violations = [];
1192512
+ if (_default3 != null) {
1192513
+ if (typeof _default3 !== "string") {
1192514
+ violations.push({
1192515
+ message: `Default value '${_default3}' is not a valid bigint`,
1192516
+ severity: "error"
1192517
+ });
1192518
+ } else {
1192519
+ try {
1192520
+ BigInt(_default3);
1192521
+ } catch (error) {
1192522
+ violations.push({
1192523
+ message: `Default value '${_default3}' is not a valid bigint`,
1192524
+ severity: "error"
1192525
+ });
1192526
+ }
1192527
+ }
1192528
+ }
1192529
+ if (validation != null) {
1192530
+ violations.push({
1192531
+ message: `Validation rules '${JSON.stringify(validation)}' are not compatible with the bigint type`,
1192532
+ severity: "error"
1192533
+ });
1192534
+ }
1192535
+ return violations;
1192536
+ }
1192462
1192537
  function validateIntegerValidation({ name: name3, value }) {
1192463
1192538
  if (value != null && !Number.isInteger(value)) {
1192464
1192539
  return [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.31.11",
3
+ "version": "0.31.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",