@fern-api/fern-api-dev 5.23.3-370-g83c45012af2 → 5.23.3-372-g237c4d96421

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 +117 -8
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -576868,6 +576868,14 @@ function inferCommonPropertiesFromVariants({ variants, discriminant: discriminan
576868
576868
  if (firstVariantProps == null) {
576869
576869
  return [];
576870
576870
  }
576871
+ const inheritedFromSharedParent = getPropertyNamesInheritedFromSharedAllOfRefParents({
576872
+ variants,
576873
+ context: context3,
576874
+ breadcrumbs,
576875
+ source: source2,
576876
+ namespace
576877
+ });
576878
+ const variantRequiredSets = variants.map((variant) => getAllRequiredPropertyNames({ schema: variant, context: context3, visited: /* @__PURE__ */ new Set() }));
576871
576879
  const result = [];
576872
576880
  for (const [propertyName, firstSchema] of Object.entries(firstVariantProps)) {
576873
576881
  if (propertyName === discriminant22) {
@@ -576876,6 +576884,9 @@ function inferCommonPropertiesFromVariants({ variants, discriminant: discriminan
576876
576884
  if (existingPropertyNames.has(propertyName)) {
576877
576885
  continue;
576878
576886
  }
576887
+ if (inheritedFromSharedParent.has(propertyName)) {
576888
+ continue;
576889
+ }
576879
576890
  let presentInAll = true;
576880
576891
  for (let i9 = 1; i9 < variantPropertyMaps.length; i9++) {
576881
576892
  const map16 = variantPropertyMaps[i9];
@@ -576885,8 +576896,106 @@ function inferCommonPropertiesFromVariants({ variants, discriminant: discriminan
576885
576896
  break;
576886
576897
  }
576887
576898
  }
576888
- if (presentInAll) {
576889
- result.push({ key: propertyName, schema: firstSchema });
576899
+ if (!presentInAll) {
576900
+ continue;
576901
+ }
576902
+ const requiredInEveryVariant = variantRequiredSets.every((set27) => set27.has(propertyName));
576903
+ const schemaToLift = requiredInEveryVariant || firstSchema.type === "optional" || firstSchema.type === "nullable" ? firstSchema : SchemaWithExample.optional({
576904
+ nameOverride: void 0,
576905
+ generatedName: "",
576906
+ title: void 0,
576907
+ value: firstSchema,
576908
+ description: void 0,
576909
+ availability: void 0,
576910
+ namespace: void 0,
576911
+ groupName: void 0,
576912
+ inline: void 0
576913
+ });
576914
+ result.push({ key: propertyName, schema: schemaToLift });
576915
+ }
576916
+ return result;
576917
+ }
576918
+ function getAllRequiredPropertyNames({ schema: schema2, context: context3, visited }) {
576919
+ const result = /* @__PURE__ */ new Set();
576920
+ let resolved;
576921
+ if (isReferenceObject(schema2)) {
576922
+ if (visited.has(schema2.$ref)) {
576923
+ return result;
576924
+ }
576925
+ visited.add(schema2.$ref);
576926
+ resolved = context3.resolveSchemaReference(schema2);
576927
+ } else {
576928
+ resolved = schema2;
576929
+ }
576930
+ for (const name2 of resolved.required ?? []) {
576931
+ result.add(name2);
576932
+ }
576933
+ for (const allOfElement of resolved.allOf ?? []) {
576934
+ const childRequired = getAllRequiredPropertyNames({ schema: allOfElement, context: context3, visited });
576935
+ for (const name2 of childRequired) {
576936
+ result.add(name2);
576937
+ }
576938
+ }
576939
+ return result;
576940
+ }
576941
+ function getPropertyNamesInheritedFromSharedAllOfRefParents({ variants, context: context3, breadcrumbs, source: source2, namespace }) {
576942
+ if (variants.length === 0) {
576943
+ return /* @__PURE__ */ new Set();
576944
+ }
576945
+ const refsPerVariant = variants.map((variant) => collectTransitiveAllOfRefs({ schema: variant, context: context3, visited: /* @__PURE__ */ new Set() }));
576946
+ const firstSet = refsPerVariant[0];
576947
+ if (firstSet == null || firstSet.size === 0) {
576948
+ return /* @__PURE__ */ new Set();
576949
+ }
576950
+ const inherited = /* @__PURE__ */ new Set();
576951
+ for (const [refKey, refObject] of firstSet) {
576952
+ const sharedAcrossAllVariants = refsPerVariant.every((s9) => s9.has(refKey));
576953
+ if (!sharedAcrossAllVariants) {
576954
+ continue;
576955
+ }
576956
+ const parentProperties = getAllProperties({
576957
+ schema: refObject,
576958
+ context: context3,
576959
+ breadcrumbs,
576960
+ source: source2,
576961
+ namespace
576962
+ });
576963
+ for (const propertyName of Object.keys(parentProperties)) {
576964
+ inherited.add(propertyName);
576965
+ }
576966
+ }
576967
+ return inherited;
576968
+ }
576969
+ function collectTransitiveAllOfRefs({ schema: schema2, context: context3, visited }) {
576970
+ const result = /* @__PURE__ */ new Map();
576971
+ let resolved;
576972
+ if (isReferenceObject(schema2)) {
576973
+ if (visited.has(schema2.$ref)) {
576974
+ return result;
576975
+ }
576976
+ visited.add(schema2.$ref);
576977
+ resolved = context3.resolveSchemaReference(schema2);
576978
+ } else {
576979
+ resolved = schema2;
576980
+ }
576981
+ for (const allOfElement of resolved.allOf ?? []) {
576982
+ if (isReferenceObject(allOfElement)) {
576983
+ if (!result.has(allOfElement.$ref)) {
576984
+ result.set(allOfElement.$ref, allOfElement);
576985
+ }
576986
+ const nested = collectTransitiveAllOfRefs({ schema: allOfElement, context: context3, visited });
576987
+ for (const [k5, v9] of nested) {
576988
+ if (!result.has(k5)) {
576989
+ result.set(k5, v9);
576990
+ }
576991
+ }
576992
+ } else {
576993
+ const nested = collectTransitiveAllOfRefs({ schema: allOfElement, context: context3, visited });
576994
+ for (const [k5, v9] of nested) {
576995
+ if (!result.has(k5)) {
576996
+ result.set(k5, v9);
576997
+ }
576998
+ }
576890
576999
  }
576891
577000
  }
576892
577001
  return result;
@@ -669396,7 +669505,7 @@ var AccessTokenPosthogManager = class {
669396
669505
  properties: {
669397
669506
  ...event,
669398
669507
  ...event.properties,
669399
- version: "5.23.3-370-g83c45012af2",
669508
+ version: "5.23.3-372-g237c4d96421",
669400
669509
  usingAccessToken: true,
669401
669510
  ...getRunIdProperties()
669402
669511
  }
@@ -669460,7 +669569,7 @@ var UserPosthogManager = class {
669460
669569
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
669461
669570
  event: "CLI",
669462
669571
  properties: {
669463
- version: "5.23.3-370-g83c45012af2",
669572
+ version: "5.23.3-372-g237c4d96421",
669464
669573
  ...event,
669465
669574
  ...event.properties,
669466
669575
  usingAccessToken: false,
@@ -860901,7 +861010,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
860901
861010
  var LOGS_FOLDER_NAME = "logs";
860902
861011
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
860903
861012
  function getCliSource() {
860904
- const version7 = "5.23.3-370-g83c45012af2";
861013
+ const version7 = "5.23.3-372-g237c4d96421";
860905
861014
  return `cli@${version7}`;
860906
861015
  }
860907
861016
  var DebugLogger = class {
@@ -891876,7 +891985,7 @@ var LegacyDocsPublisher = class {
891876
891985
  previewId,
891877
891986
  disableTemplates: void 0,
891878
891987
  skipUpload,
891879
- cliVersion: "5.23.3-370-g83c45012af2",
891988
+ cliVersion: "5.23.3-372-g237c4d96421",
891880
891989
  loginCommand: "fern auth login"
891881
891990
  });
891882
891991
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -956963,7 +957072,7 @@ function getAutomationContextFromEnv() {
956963
957072
  config_branch: process.env.FERN_CONFIG_BRANCH,
956964
957073
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
956965
957074
  trigger: process.env.GITHUB_EVENT_NAME,
956966
- cli_version: "5.23.3-370-g83c45012af2"
957075
+ cli_version: "5.23.3-372-g237c4d96421"
956967
957076
  };
956968
957077
  }
956969
957078
  function isAutomationMode() {
@@ -957789,7 +957898,7 @@ var CliContext = class _CliContext {
957789
957898
  if (false) {
957790
957899
  this.logger.error("CLI_VERSION is not defined");
957791
957900
  }
957792
- return "5.23.3-370-g83c45012af2";
957901
+ return "5.23.3-372-g237c4d96421";
957793
957902
  }
957794
957903
  getCliName() {
957795
957904
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.23.3-370-g83c45012af2",
2
+ "version": "5.23.3-372-g237c4d96421",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",