@fern-api/fern-api-dev 5.23.3-8-gbe2ec592eaa → 5.23.4

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 +134 -30
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -224990,9 +224990,9 @@ var require_path_key = __commonJS({
224990
224990
  }
224991
224991
  });
224992
224992
 
224993
- // ../../../node_modules/.pnpm/cross-spawn@7.0.5/node_modules/cross-spawn/lib/util/resolveCommand.js
224993
+ // ../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
224994
224994
  var require_resolveCommand = __commonJS({
224995
- "../../../node_modules/.pnpm/cross-spawn@7.0.5/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module4) {
224995
+ "../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module4) {
224996
224996
  "use strict";
224997
224997
  var path107 = require("path");
224998
224998
  var which = require_which();
@@ -225032,9 +225032,9 @@ var require_resolveCommand = __commonJS({
225032
225032
  }
225033
225033
  });
225034
225034
 
225035
- // ../../../node_modules/.pnpm/cross-spawn@7.0.5/node_modules/cross-spawn/lib/util/escape.js
225035
+ // ../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js
225036
225036
  var require_escape2 = __commonJS({
225037
- "../../../node_modules/.pnpm/cross-spawn@7.0.5/node_modules/cross-spawn/lib/util/escape.js"(exports2, module4) {
225037
+ "../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports2, module4) {
225038
225038
  "use strict";
225039
225039
  var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
225040
225040
  function escapeCommand(arg) {
@@ -225085,9 +225085,9 @@ var require_shebang_command = __commonJS({
225085
225085
  }
225086
225086
  });
225087
225087
 
225088
- // ../../../node_modules/.pnpm/cross-spawn@7.0.5/node_modules/cross-spawn/lib/util/readShebang.js
225088
+ // ../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
225089
225089
  var require_readShebang = __commonJS({
225090
- "../../../node_modules/.pnpm/cross-spawn@7.0.5/node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module4) {
225090
+ "../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module4) {
225091
225091
  "use strict";
225092
225092
  var fs28 = require("fs");
225093
225093
  var shebangCommand = require_shebang_command();
@@ -225107,9 +225107,9 @@ var require_readShebang = __commonJS({
225107
225107
  }
225108
225108
  });
225109
225109
 
225110
- // ../../../node_modules/.pnpm/cross-spawn@7.0.5/node_modules/cross-spawn/lib/parse.js
225110
+ // ../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
225111
225111
  var require_parse4 = __commonJS({
225112
- "../../../node_modules/.pnpm/cross-spawn@7.0.5/node_modules/cross-spawn/lib/parse.js"(exports2, module4) {
225112
+ "../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports2, module4) {
225113
225113
  "use strict";
225114
225114
  var path107 = require("path");
225115
225115
  var resolveCommand = require_resolveCommand();
@@ -225169,9 +225169,9 @@ var require_parse4 = __commonJS({
225169
225169
  }
225170
225170
  });
225171
225171
 
225172
- // ../../../node_modules/.pnpm/cross-spawn@7.0.5/node_modules/cross-spawn/lib/enoent.js
225172
+ // ../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js
225173
225173
  var require_enoent = __commonJS({
225174
- "../../../node_modules/.pnpm/cross-spawn@7.0.5/node_modules/cross-spawn/lib/enoent.js"(exports2, module4) {
225174
+ "../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"(exports2, module4) {
225175
225175
  "use strict";
225176
225176
  var isWin = process.platform === "win32";
225177
225177
  function notFoundError(original, syscall) {
@@ -225219,9 +225219,9 @@ var require_enoent = __commonJS({
225219
225219
  }
225220
225220
  });
225221
225221
 
225222
- // ../../../node_modules/.pnpm/cross-spawn@7.0.5/node_modules/cross-spawn/index.js
225222
+ // ../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
225223
225223
  var require_cross_spawn = __commonJS({
225224
- "../../../node_modules/.pnpm/cross-spawn@7.0.5/node_modules/cross-spawn/index.js"(exports2, module4) {
225224
+ "../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports2, module4) {
225225
225225
  "use strict";
225226
225226
  var cp11 = require("child_process");
225227
225227
  var parse19 = require_parse4();
@@ -578139,15 +578139,28 @@ function convertSchemaObject(schema2, wrapAsOptional, wrapAsNullable, context3,
578139
578139
  const convertedSchema = convertSchema2(filteredAllOfs[0], wrapAsOptional, wrapAsNullable, context3, breadcrumbs, source2, namespace, referencedAsRequest);
578140
578140
  return maybeInjectDescriptionOrGroupName(convertedSchema, description, namespace, groupName);
578141
578141
  }
578142
- const filteredAllOfObjects = filteredAllOfs.filter((allOf) => {
578143
- const valid2 = isValidAllOfObject(allOf);
578144
- if (!valid2) {
578142
+ const filteredAllOfObjects = [];
578143
+ const filteredOutPrimitiveElements = [];
578144
+ for (const allOf of filteredAllOfs) {
578145
+ if (isValidAllOfObject(allOf)) {
578146
+ filteredAllOfObjects.push(allOf);
578147
+ } else {
578145
578148
  context3.logger.debug(`Skipping non-object allOf element: ${JSON.stringify(allOf)}`);
578149
+ if (!isReferenceObject(allOf)) {
578150
+ filteredOutPrimitiveElements.push(allOf);
578151
+ }
578146
578152
  }
578147
- return valid2;
578148
- });
578153
+ }
578149
578154
  if ((schema2.properties == null || hasNoProperties(schema2)) && filteredAllOfObjects.length === 1 && filteredAllOfObjects[0] != null && (schema2.additionalProperties == null || schema2.additionalProperties === false)) {
578150
- const convertedSchema = convertSchema2(filteredAllOfObjects[0], wrapAsOptional, wrapAsNullable, context3, breadcrumbs, source2, namespace, referencedAsRequest);
578155
+ let elementToConvert = filteredAllOfObjects[0];
578156
+ if (filteredOutPrimitiveElements.length > 0) {
578157
+ const base4 = isReferenceObject(elementToConvert) ? { ...context3.resolveSchemaReference(elementToConvert) } : { ...elementToConvert };
578158
+ for (const primitiveElement of filteredOutPrimitiveElements) {
578159
+ Object.assign(base4, primitiveElement);
578160
+ }
578161
+ elementToConvert = base4;
578162
+ }
578163
+ const convertedSchema = convertSchema2(elementToConvert, wrapAsOptional, wrapAsNullable, context3, breadcrumbs, source2, namespace, referencedAsRequest);
578151
578164
  return maybeInjectDescriptionOrGroupName(convertedSchema, description, namespace, groupName);
578152
578165
  }
578153
578166
  return convertObject3({
@@ -647959,7 +647972,8 @@ var ExampleConverter = class _ExampleConverter extends AbstractConverter {
647959
647972
  };
647960
647973
  }
647961
647974
  const exampleObj = typeof this.example !== "object" || this.example == null ? {} : this.example;
647962
- const resultsByKey = Object.entries(resolvedSchema.properties ?? {}).map(([key2, property24]) => {
647975
+ const { mergedProperties, mergedRequired } = this.mergeAllOfProperties(resolvedSchema);
647976
+ const resultsByKey = Object.entries(mergedProperties).map(([key2, property24]) => {
647963
647977
  if (typeof property24 !== "object") {
647964
647978
  return {
647965
647979
  key: key2,
@@ -648025,7 +648039,7 @@ var ExampleConverter = class _ExampleConverter extends AbstractConverter {
648025
648039
  }
648026
648040
  const propertyAllowsNull = schemaAllowsNull(property24);
648027
648041
  const propertyIsOmittedFromExample = !(key2 in exampleObj) || !propertyAllowsNull && exampleObj[key2] == null || propertyAllowsNull && exampleObj[key2] === void 0;
648028
- const propertyIsOptional = !resolvedSchema.required?.includes(key2);
648042
+ const propertyIsOptional = !mergedRequired.includes(key2);
648029
648043
  if (propertyIsOmittedFromExample && propertyIsOptional) {
648030
648044
  if (this.example === void 0 && this.generateOptionalProperties) {
648031
648045
  const propertyExample = this.maybeResolveSchemaExample(property24);
@@ -648100,10 +648114,12 @@ var ExampleConverter = class _ExampleConverter extends AbstractConverter {
648100
648114
  for (const result of allOfResults) {
648101
648115
  if (typeof result.validExample === "object" && result.validExample !== null) {
648102
648116
  const validExampleObj = result.validExample;
648103
- example = {
648104
- ...example,
648105
- ...Object.fromEntries(Object.entries(validExampleObj).filter(([_7, value2]) => value2 !== void 0))
648106
- };
648117
+ const filteredAllOf = Object.fromEntries(Object.entries(validExampleObj).filter(([_7, value2]) => value2 !== void 0));
648118
+ for (const [key2, value2] of Object.entries(filteredAllOf)) {
648119
+ if (!(key2 in example) || example[key2] == null) {
648120
+ example[key2] = value2;
648121
+ }
648122
+ }
648107
648123
  }
648108
648124
  }
648109
648125
  const additionalPropertiesResults = [];
@@ -648415,6 +648431,81 @@ var ExampleConverter = class _ExampleConverter extends AbstractConverter {
648415
648431
  }
648416
648432
  return void 0;
648417
648433
  }
648434
+ /**
648435
+ * Handles allOf schemas where one element provides a base object and another
648436
+ * overrides specific properties. For example, given:
648437
+ *
648438
+ * allOf:
648439
+ * - $ref: GenericSearchResponse # base: { results: { type: array, items: {} } }
648440
+ * - properties: # override: just replaces items
648441
+ * results:
648442
+ * items:
648443
+ * $ref: SpecificModel
648444
+ *
648445
+ * The override's `results` only has `{ items: $ref }` — it's missing `type: array`
648446
+ * because the base already defined that. This function merges the two so the final
648447
+ * `results` property gets `{ type: array, items: $ref SpecificModel }`, letting the
648448
+ * example generator know it should produce an array, not a generic object.
648449
+ *
648450
+ * Precedence: the override's fields win; the base's fields fill in anything missing.
648451
+ */
648452
+ mergeAllOfProperties(resolvedSchema) {
648453
+ const directProps = resolvedSchema.properties ?? {};
648454
+ const directRequired = resolvedSchema.required ?? [];
648455
+ if (resolvedSchema.allOf == null || resolvedSchema.allOf.length === 0) {
648456
+ return { mergedProperties: directProps, mergedRequired: directRequired };
648457
+ }
648458
+ const baseProps = {};
648459
+ const baseRequired = new Set(directRequired);
648460
+ for (const subSchema of resolvedSchema.allOf) {
648461
+ const resolved = this.context.resolveMaybeReference({
648462
+ schemaOrReference: subSchema,
648463
+ breadcrumbs: this.breadcrumbs,
648464
+ skipErrorCollector: true
648465
+ });
648466
+ if (resolved == null) {
648467
+ continue;
648468
+ }
648469
+ if (resolved.required != null) {
648470
+ for (const req of resolved.required) {
648471
+ baseRequired.add(req);
648472
+ }
648473
+ }
648474
+ if (resolved.properties != null) {
648475
+ for (const [key2, value2] of Object.entries(resolved.properties)) {
648476
+ if (typeof value2 === "object" && value2 !== null) {
648477
+ const existing = baseProps[key2];
648478
+ if (existing != null && isInlineSchema(existing) && isInlineSchema(value2)) {
648479
+ baseProps[key2] = { ...existing, ...value2 };
648480
+ } else {
648481
+ baseProps[key2] = value2;
648482
+ }
648483
+ }
648484
+ }
648485
+ }
648486
+ }
648487
+ const merged = { ...directProps };
648488
+ for (const [key2, directProp] of Object.entries(merged)) {
648489
+ const baseProp = baseProps[key2];
648490
+ if (baseProp == null || !isInlineSchema(directProp)) {
648491
+ continue;
648492
+ }
648493
+ const resolvedBase = "$ref" in baseProp ? this.context.resolveMaybeReference({
648494
+ schemaOrReference: baseProp,
648495
+ breadcrumbs: this.breadcrumbs,
648496
+ skipErrorCollector: true
648497
+ }) : baseProp;
648498
+ if (resolvedBase != null) {
648499
+ merged[key2] = { ...resolvedBase, ...directProp };
648500
+ }
648501
+ }
648502
+ for (const [key2, baseProp] of Object.entries(baseProps)) {
648503
+ if (!(key2 in merged)) {
648504
+ merged[key2] = baseProp;
648505
+ }
648506
+ }
648507
+ return { mergedProperties: merged, mergedRequired: [...baseRequired] };
648508
+ }
648418
648509
  /**
648419
648510
  * Checks if a schema is a "constraint-only" schema that only has validation constraints
648420
648511
  * like 'required' but no actual structure (no type, properties, allOf, oneOf, anyOf, etc.).
@@ -650588,7 +650679,7 @@ var SchemaOrReferenceConverter = class extends AbstractConverter {
650588
650679
  const refElements = this.schemaOrReference.allOf.filter((s9) => this.context.isReferenceObject(s9));
650589
650680
  const inlineElements = this.schemaOrReference.allOf.filter((s9) => typeof s9 === "object" && s9 !== null && !this.context.isReferenceObject(s9));
650590
650681
  const singleRef = refElements.length === 1 ? refElements[0] : void 0;
650591
- if (singleRef != null && inlineElements.every((s9) => !s9.properties && !s9.enum && !s9.oneOf && !s9.anyOf && !s9.allOf && !s9.format && !("items" in s9)) && !inlineElements.some((s9) => s9.type === "null" || Array.isArray(s9.type) && s9.type.includes("null"))) {
650682
+ if (singleRef != null && inlineElements.every((s9) => isMetadataOnlySchema(s9))) {
650592
650683
  const resolved = this.context.resolveMaybeReference({
650593
650684
  schemaOrReference: singleRef,
650594
650685
  breadcrumbs: this.breadcrumbs
@@ -650663,6 +650754,19 @@ var SchemaOrReferenceConverter = class extends AbstractConverter {
650663
650754
  return TypeReference2.container(ContainerType.nullable(type8));
650664
650755
  }
650665
650756
  };
650757
+ var METADATA_ONLY_FIELDS = /* @__PURE__ */ new Set([
650758
+ "description",
650759
+ "title",
650760
+ "deprecated",
650761
+ "readOnly",
650762
+ "writeOnly",
650763
+ "xml",
650764
+ "externalDocs",
650765
+ "x-fern-type-name"
650766
+ ]);
650767
+ function isMetadataOnlySchema(schema2) {
650768
+ return Object.keys(schema2).every((key2) => METADATA_ONLY_FIELDS.has(key2));
650769
+ }
650666
650770
 
650667
650771
  // ../api-importers/v3-importer-commons/lib/converters/schema/ArraySchemaConverter.js
650668
650772
  var ArraySchemaConverter = class _ArraySchemaConverter extends AbstractConverter {
@@ -667458,7 +667562,7 @@ var AccessTokenPosthogManager = class {
667458
667562
  properties: {
667459
667563
  ...event,
667460
667564
  ...event.properties,
667461
- version: "5.23.3-8-gbe2ec592eaa",
667565
+ version: "5.23.4",
667462
667566
  usingAccessToken: true,
667463
667567
  ...getRunIdProperties()
667464
667568
  }
@@ -667513,7 +667617,7 @@ var UserPosthogManager = class {
667513
667617
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
667514
667618
  event: "CLI",
667515
667619
  properties: {
667516
- version: "5.23.3-8-gbe2ec592eaa",
667620
+ version: "5.23.4",
667517
667621
  ...event,
667518
667622
  ...event.properties,
667519
667623
  usingAccessToken: false,
@@ -858793,7 +858897,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
858793
858897
  var LOGS_FOLDER_NAME = "logs";
858794
858898
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
858795
858899
  function getCliSource() {
858796
- const version7 = "5.23.3-8-gbe2ec592eaa";
858900
+ const version7 = "5.23.4";
858797
858901
  return `cli@${version7}`;
858798
858902
  }
858799
858903
  var DebugLogger = class {
@@ -871617,7 +871721,7 @@ var LegacyDocsPublisher = class {
871617
871721
  previewId,
871618
871722
  disableTemplates: void 0,
871619
871723
  skipUpload,
871620
- cliVersion: "5.23.3-8-gbe2ec592eaa",
871724
+ cliVersion: "5.23.4",
871621
871725
  loginCommand: "fern auth login"
871622
871726
  });
871623
871727
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -946362,7 +946466,7 @@ var CliContext = class _CliContext {
946362
946466
  if (false) {
946363
946467
  this.logger.error("CLI_VERSION is not defined");
946364
946468
  }
946365
- return "5.23.3-8-gbe2ec592eaa";
946469
+ return "5.23.4";
946366
946470
  }
946367
946471
  getCliName() {
946368
946472
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.23.3-8-gbe2ec592eaa",
2
+ "version": "5.23.4",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",