@fern-api/fern-api-dev 5.47.4 → 5.47.6

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 +186 -169
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -319185,6 +319185,20 @@ var init_walk_estree_jsx_attributes = __esm({
319185
319185
  });
319186
319186
 
319187
319187
  // ../docs-markdown-utils/lib/parseImagePaths.js
319188
+ function requoteLeadingZeroValues(doc) {
319189
+ const openIdx = doc.indexOf("---\n");
319190
+ if (openIdx !== 0) {
319191
+ return doc;
319192
+ }
319193
+ const closeIdx = doc.indexOf("\n---\n", 4);
319194
+ if (closeIdx === -1) {
319195
+ return doc;
319196
+ }
319197
+ const frontmatter = doc.slice(0, closeIdx);
319198
+ const rest = doc.slice(closeIdx);
319199
+ const fixed = frontmatter.replace(/^(\s*[\w][\w-]*:\s+)(0\d+)\s*$/gm, '$1"$2"');
319200
+ return fixed + rest;
319201
+ }
319188
319202
  function getLargeFileBytes() {
319189
319203
  return parseInt(process.env.FERN_DOCS_LARGE_FILE_BYTES ?? "5000000", 10);
319190
319204
  }
@@ -319560,7 +319574,10 @@ function parseImagePaths(markdown, metadata, context3) {
319560
319574
  });
319561
319575
  replacedContent = applyEdits(content5, edits);
319562
319576
  }
319563
- return { filepaths: [...filepaths], markdown: import_gray_matter3.default.stringify(replacedContent, data2) };
319577
+ return {
319578
+ filepaths: [...filepaths],
319579
+ markdown: requoteLeadingZeroValues(import_gray_matter3.default.stringify(replacedContent, data2))
319580
+ };
319564
319581
  }
319565
319582
  function resolvePath5(pathToImage, { absolutePathToFernFolder, absolutePathToMarkdownFile }) {
319566
319583
  if (pathToImage == null || isExternalUrl(pathToImage) || isDataUrl(pathToImage)) {
@@ -319858,7 +319875,7 @@ function replaceImagePathsAndUrls(markdown, fileIdsMap, markdownFilesToPathName,
319858
319875
  });
319859
319876
  replacedContent = applyEdits(content5, edits);
319860
319877
  }
319861
- return import_gray_matter3.default.stringify(replacedContent, data2);
319878
+ return requoteLeadingZeroValues(import_gray_matter3.default.stringify(replacedContent, data2));
319862
319879
  }
319863
319880
  function trimAnchor(text9) {
319864
319881
  if (typeof text9 !== "string") {
@@ -650690,6 +650707,7 @@ var MapSchemaConverter = class extends AbstractConverter {
650690
650707
  for (const typeId of Object.keys(convertedAdditionalProperties.inlinedTypes)) {
650691
650708
  referencedTypes.add(typeId);
650692
650709
  }
650710
+ collectNamedTypeIdsFromTypeReference(convertedAdditionalProperties.type, referencedTypes);
650693
650711
  return {
650694
650712
  type: Type.alias({
650695
650713
  aliasOf: additionalPropertiesType,
@@ -650874,167 +650892,6 @@ function isPlainObject18(value2) {
650874
650892
 
650875
650893
  // ../api-importers/v3-importer-commons/lib/converters/schema/ObjectSchemaConverter.js
650876
650894
  init_lib4();
650877
-
650878
- // ../api-importers/v3-importer-commons/lib/utils/ConvertProperties.js
650879
- function convertProperties({ properties: properties7, required: required6, breadcrumbs, context: context3, errorCollector }) {
650880
- const convertedProperties = [];
650881
- let inlinedTypesFromProperties = {};
650882
- const propertiesByAudience = {};
650883
- const referencedTypes = /* @__PURE__ */ new Set();
650884
- for (const [propertyName, propertySchema] of Object.entries(properties7 ?? {})) {
650885
- const propertyBreadcrumbs = [...breadcrumbs, "properties", propertyName];
650886
- if (typeof propertySchema !== "object") {
650887
- errorCollector.collect({
650888
- message: `Schema property ${propertyName} should be an object`,
650889
- path: propertyBreadcrumbs
650890
- });
650891
- continue;
650892
- }
650893
- const propertyId = maybeGetFernTypeNameExtension(breadcrumbs, propertySchema, context3) ?? context3.convertBreadcrumbsToName(propertyBreadcrumbs);
650894
- const isNullable = "nullable" in propertySchema ? propertySchema.nullable : false;
650895
- const propertySchemaConverter = new SchemaOrReferenceConverter({
650896
- context: context3,
650897
- breadcrumbs: propertyBreadcrumbs,
650898
- schemaOrReference: propertySchema,
650899
- schemaIdOverride: propertyId,
650900
- wrapAsOptional: !required6.includes(propertyName),
650901
- wrapAsNullable: isNullable
650902
- });
650903
- const convertedProperty = propertySchemaConverter.convert();
650904
- if (convertedProperty != null) {
650905
- const resolvedPropertySchema = context3.resolveMaybeReference({
650906
- schemaOrReference: propertySchema,
650907
- breadcrumbs: propertyBreadcrumbs,
650908
- skipErrorCollector: true
650909
- });
650910
- convertedProperties.push({
650911
- name: context3.casingsGenerator.generateNameAndWireValue({
650912
- name: propertyName,
650913
- wireValue: propertyName
650914
- }),
650915
- valueType: convertedProperty.type,
650916
- docs: propertySchema.description,
650917
- availability: convertedProperty.availability,
650918
- propertyAccess: context3.getPropertyAccess(propertySchema),
650919
- defaultValue: resolvedPropertySchema?.default,
650920
- v2Examples: convertedProperty.schema?.typeDeclaration?.v2Examples ?? generatePropertyV2Examples({
650921
- propertySchema,
650922
- breadcrumbs: propertyBreadcrumbs,
650923
- context: context3,
650924
- propertyId
650925
- })
650926
- });
650927
- inlinedTypesFromProperties = {
650928
- ...inlinedTypesFromProperties,
650929
- ...convertedProperty.inlinedTypes
650930
- };
650931
- if (convertedProperty.schema?.typeDeclaration.referencedTypes != null) {
650932
- convertedProperty.schema.typeDeclaration.referencedTypes.forEach((type8) => {
650933
- referencedTypes.add(type8);
650934
- });
650935
- }
650936
- collectNamedTypeIdsFromTypeReference(convertedProperty.type, referencedTypes);
650937
- for (const audience of convertedProperty.schema?.audiences ?? []) {
650938
- if (propertiesByAudience[audience] == null) {
650939
- propertiesByAudience[audience] = /* @__PURE__ */ new Set();
650940
- }
650941
- propertiesByAudience[audience].add(propertyName);
650942
- }
650943
- }
650944
- }
650945
- for (const typeId of Object.keys(inlinedTypesFromProperties)) {
650946
- referencedTypes.add(typeId);
650947
- }
650948
- return { convertedProperties, propertiesByAudience, inlinedTypesFromProperties, referencedTypes };
650949
- }
650950
- function generatePropertyV2Examples({ propertySchema, breadcrumbs, context: context3, propertyId }) {
650951
- const resolvedSchema = context3.resolveMaybeReference({
650952
- schemaOrReference: propertySchema,
650953
- breadcrumbs,
650954
- skipErrorCollector: true
650955
- });
650956
- const examples = context3.getExamplesFromSchema({
650957
- schema: resolvedSchema ?? void 0,
650958
- breadcrumbs
650959
- });
650960
- if (examples.length > 0) {
650961
- const userSpecifiedExamples = {};
650962
- for (const [index3, example] of examples.entries()) {
650963
- const resolvedExample = context3.resolveExample(example);
650964
- const exampleName2 = `${propertyId}_example_${index3}`;
650965
- const exampleConverter2 = new ExampleConverter({
650966
- breadcrumbs,
650967
- context: context3,
650968
- schema: propertySchema,
650969
- example: resolvedExample
650970
- });
650971
- const { validExample: validExample2 } = exampleConverter2.convert();
650972
- userSpecifiedExamples[exampleName2] = validExample2;
650973
- }
650974
- return { userSpecifiedExamples, autogeneratedExamples: {} };
650975
- }
650976
- const exampleName = `${propertyId}_example_autogenerated`;
650977
- const exampleConverter = new ExampleConverter({
650978
- breadcrumbs,
650979
- context: context3,
650980
- schema: propertySchema,
650981
- example: void 0,
650982
- generateOptionalProperties: true
650983
- });
650984
- const { validExample } = exampleConverter.convert();
650985
- return {
650986
- userSpecifiedExamples: {},
650987
- autogeneratedExamples: { [exampleName]: validExample }
650988
- };
650989
- }
650990
- function maybeGetFernTypeNameExtension(breadcrumbs, schema2, context3) {
650991
- if (context3.isReferenceObject(schema2)) {
650992
- return void 0;
650993
- }
650994
- const fernTypeNameConverter = new extensions_exports.FernTypeNameExtension({
650995
- breadcrumbs,
650996
- schema: schema2,
650997
- context: context3
650998
- });
650999
- return fernTypeNameConverter.convert();
651000
- }
651001
- function collectNamedTypeIdsFromTypeReference(typeReference2, referencedTypes) {
651002
- switch (typeReference2.type) {
651003
- case "named":
651004
- referencedTypes.add(typeReference2.typeId);
651005
- return;
651006
- case "primitive":
651007
- case "unknown":
651008
- return;
651009
- case "container":
651010
- collectNamedTypeIdsFromContainer(typeReference2.container, referencedTypes);
651011
- return;
651012
- }
651013
- }
651014
- function collectNamedTypeIdsFromContainer(container, referencedTypes) {
651015
- switch (container.type) {
651016
- case "list":
651017
- collectNamedTypeIdsFromTypeReference(container.list, referencedTypes);
651018
- return;
651019
- case "set":
651020
- collectNamedTypeIdsFromTypeReference(container.set, referencedTypes);
651021
- return;
651022
- case "optional":
651023
- collectNamedTypeIdsFromTypeReference(container.optional, referencedTypes);
651024
- return;
651025
- case "nullable":
651026
- collectNamedTypeIdsFromTypeReference(container.nullable, referencedTypes);
651027
- return;
651028
- case "map":
651029
- collectNamedTypeIdsFromTypeReference(container.keyType, referencedTypes);
651030
- collectNamedTypeIdsFromTypeReference(container.valueType, referencedTypes);
651031
- return;
651032
- case "literal":
651033
- return;
651034
- }
651035
- }
651036
-
651037
- // ../api-importers/v3-importer-commons/lib/converters/schema/ObjectSchemaConverter.js
651038
650895
  var ObjectSchemaConverter = class extends AbstractConverter {
651039
650896
  schema;
651040
650897
  constructor({ context: context3, breadcrumbs, schema: schema2 }) {
@@ -652683,6 +652540,165 @@ function isMetadataOnlySchema(schema2) {
652683
652540
  return Object.keys(schema2).every((key2) => METADATA_ONLY_FIELDS.has(key2));
652684
652541
  }
652685
652542
 
652543
+ // ../api-importers/v3-importer-commons/lib/utils/ConvertProperties.js
652544
+ function convertProperties({ properties: properties7, required: required6, breadcrumbs, context: context3, errorCollector }) {
652545
+ const convertedProperties = [];
652546
+ let inlinedTypesFromProperties = {};
652547
+ const propertiesByAudience = {};
652548
+ const referencedTypes = /* @__PURE__ */ new Set();
652549
+ for (const [propertyName, propertySchema] of Object.entries(properties7 ?? {})) {
652550
+ const propertyBreadcrumbs = [...breadcrumbs, "properties", propertyName];
652551
+ if (typeof propertySchema !== "object") {
652552
+ errorCollector.collect({
652553
+ message: `Schema property ${propertyName} should be an object`,
652554
+ path: propertyBreadcrumbs
652555
+ });
652556
+ continue;
652557
+ }
652558
+ const propertyId = maybeGetFernTypeNameExtension(breadcrumbs, propertySchema, context3) ?? context3.convertBreadcrumbsToName(propertyBreadcrumbs);
652559
+ const isNullable = "nullable" in propertySchema ? propertySchema.nullable : false;
652560
+ const propertySchemaConverter = new SchemaOrReferenceConverter({
652561
+ context: context3,
652562
+ breadcrumbs: propertyBreadcrumbs,
652563
+ schemaOrReference: propertySchema,
652564
+ schemaIdOverride: propertyId,
652565
+ wrapAsOptional: !required6.includes(propertyName),
652566
+ wrapAsNullable: isNullable
652567
+ });
652568
+ const convertedProperty = propertySchemaConverter.convert();
652569
+ if (convertedProperty != null) {
652570
+ const resolvedPropertySchema = context3.resolveMaybeReference({
652571
+ schemaOrReference: propertySchema,
652572
+ breadcrumbs: propertyBreadcrumbs,
652573
+ skipErrorCollector: true
652574
+ });
652575
+ convertedProperties.push({
652576
+ name: context3.casingsGenerator.generateNameAndWireValue({
652577
+ name: propertyName,
652578
+ wireValue: propertyName
652579
+ }),
652580
+ valueType: convertedProperty.type,
652581
+ docs: propertySchema.description,
652582
+ availability: convertedProperty.availability,
652583
+ propertyAccess: context3.getPropertyAccess(propertySchema),
652584
+ defaultValue: resolvedPropertySchema?.default,
652585
+ v2Examples: convertedProperty.schema?.typeDeclaration?.v2Examples ?? generatePropertyV2Examples({
652586
+ propertySchema,
652587
+ breadcrumbs: propertyBreadcrumbs,
652588
+ context: context3,
652589
+ propertyId
652590
+ })
652591
+ });
652592
+ inlinedTypesFromProperties = {
652593
+ ...inlinedTypesFromProperties,
652594
+ ...convertedProperty.inlinedTypes
652595
+ };
652596
+ if (convertedProperty.schema?.typeDeclaration.referencedTypes != null) {
652597
+ convertedProperty.schema.typeDeclaration.referencedTypes.forEach((type8) => {
652598
+ referencedTypes.add(type8);
652599
+ });
652600
+ }
652601
+ collectNamedTypeIdsFromTypeReference(convertedProperty.type, referencedTypes);
652602
+ for (const audience of convertedProperty.schema?.audiences ?? []) {
652603
+ if (propertiesByAudience[audience] == null) {
652604
+ propertiesByAudience[audience] = /* @__PURE__ */ new Set();
652605
+ }
652606
+ propertiesByAudience[audience].add(propertyName);
652607
+ }
652608
+ }
652609
+ }
652610
+ for (const typeId of Object.keys(inlinedTypesFromProperties)) {
652611
+ referencedTypes.add(typeId);
652612
+ }
652613
+ return { convertedProperties, propertiesByAudience, inlinedTypesFromProperties, referencedTypes };
652614
+ }
652615
+ function generatePropertyV2Examples({ propertySchema, breadcrumbs, context: context3, propertyId }) {
652616
+ const resolvedSchema = context3.resolveMaybeReference({
652617
+ schemaOrReference: propertySchema,
652618
+ breadcrumbs,
652619
+ skipErrorCollector: true
652620
+ });
652621
+ const examples = context3.getExamplesFromSchema({
652622
+ schema: resolvedSchema ?? void 0,
652623
+ breadcrumbs
652624
+ });
652625
+ if (examples.length > 0) {
652626
+ const userSpecifiedExamples = {};
652627
+ for (const [index3, example] of examples.entries()) {
652628
+ const resolvedExample = context3.resolveExample(example);
652629
+ const exampleName2 = `${propertyId}_example_${index3}`;
652630
+ const exampleConverter2 = new ExampleConverter({
652631
+ breadcrumbs,
652632
+ context: context3,
652633
+ schema: propertySchema,
652634
+ example: resolvedExample
652635
+ });
652636
+ const { validExample: validExample2 } = exampleConverter2.convert();
652637
+ userSpecifiedExamples[exampleName2] = validExample2;
652638
+ }
652639
+ return { userSpecifiedExamples, autogeneratedExamples: {} };
652640
+ }
652641
+ const exampleName = `${propertyId}_example_autogenerated`;
652642
+ const exampleConverter = new ExampleConverter({
652643
+ breadcrumbs,
652644
+ context: context3,
652645
+ schema: propertySchema,
652646
+ example: void 0,
652647
+ generateOptionalProperties: true
652648
+ });
652649
+ const { validExample } = exampleConverter.convert();
652650
+ return {
652651
+ userSpecifiedExamples: {},
652652
+ autogeneratedExamples: { [exampleName]: validExample }
652653
+ };
652654
+ }
652655
+ function maybeGetFernTypeNameExtension(breadcrumbs, schema2, context3) {
652656
+ if (context3.isReferenceObject(schema2)) {
652657
+ return void 0;
652658
+ }
652659
+ const fernTypeNameConverter = new extensions_exports.FernTypeNameExtension({
652660
+ breadcrumbs,
652661
+ schema: schema2,
652662
+ context: context3
652663
+ });
652664
+ return fernTypeNameConverter.convert();
652665
+ }
652666
+ function collectNamedTypeIdsFromTypeReference(typeReference2, referencedTypes) {
652667
+ switch (typeReference2.type) {
652668
+ case "named":
652669
+ referencedTypes.add(typeReference2.typeId);
652670
+ return;
652671
+ case "primitive":
652672
+ case "unknown":
652673
+ return;
652674
+ case "container":
652675
+ collectNamedTypeIdsFromContainer(typeReference2.container, referencedTypes);
652676
+ return;
652677
+ }
652678
+ }
652679
+ function collectNamedTypeIdsFromContainer(container, referencedTypes) {
652680
+ switch (container.type) {
652681
+ case "list":
652682
+ collectNamedTypeIdsFromTypeReference(container.list, referencedTypes);
652683
+ return;
652684
+ case "set":
652685
+ collectNamedTypeIdsFromTypeReference(container.set, referencedTypes);
652686
+ return;
652687
+ case "optional":
652688
+ collectNamedTypeIdsFromTypeReference(container.optional, referencedTypes);
652689
+ return;
652690
+ case "nullable":
652691
+ collectNamedTypeIdsFromTypeReference(container.nullable, referencedTypes);
652692
+ return;
652693
+ case "map":
652694
+ collectNamedTypeIdsFromTypeReference(container.keyType, referencedTypes);
652695
+ collectNamedTypeIdsFromTypeReference(container.valueType, referencedTypes);
652696
+ return;
652697
+ case "literal":
652698
+ return;
652699
+ }
652700
+ }
652701
+
652686
652702
  // ../api-importers/v3-importer-commons/lib/converters/schema/ArraySchemaConverter.js
652687
652703
  var ArraySchemaConverter = class _ArraySchemaConverter extends AbstractConverter {
652688
652704
  static LIST_UNKNOWN = TypeReference2.container(ContainerType.list(TypeReference2.unknown()));
@@ -652716,6 +652732,7 @@ var ArraySchemaConverter = class _ArraySchemaConverter extends AbstractConverter
652716
652732
  });
652717
652733
  });
652718
652734
  }
652735
+ collectNamedTypeIdsFromTypeReference(convertedSchema.type, referencedTypes);
652719
652736
  return {
652720
652737
  typeReference: TypeReference2.container(ContainerType.list(convertedSchema.type)),
652721
652738
  referencedTypes,
@@ -670464,7 +670481,7 @@ var AccessTokenPosthogManager = class {
670464
670481
  properties: {
670465
670482
  ...event,
670466
670483
  ...event.properties,
670467
- version: "5.47.4",
670484
+ version: "5.47.6",
670468
670485
  usingAccessToken: true,
670469
670486
  ...getRunIdProperties()
670470
670487
  }
@@ -670528,7 +670545,7 @@ var UserPosthogManager = class {
670528
670545
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
670529
670546
  event: "CLI",
670530
670547
  properties: {
670531
- version: "5.47.4",
670548
+ version: "5.47.6",
670532
670549
  ...event,
670533
670550
  ...event.properties,
670534
670551
  usingAccessToken: false,
@@ -862537,7 +862554,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
862537
862554
  var LOGS_FOLDER_NAME = "logs";
862538
862555
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
862539
862556
  function getCliSource() {
862540
- const version7 = "5.47.4";
862557
+ const version7 = "5.47.6";
862541
862558
  return `cli@${version7}`;
862542
862559
  }
862543
862560
  var DebugLogger = class {
@@ -893766,7 +893783,7 @@ var LegacyDocsPublisher = class {
893766
893783
  previewId,
893767
893784
  disableTemplates: void 0,
893768
893785
  skipUpload,
893769
- cliVersion: "5.47.4",
893786
+ cliVersion: "5.47.6",
893770
893787
  loginCommand: "fern auth login"
893771
893788
  });
893772
893789
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -959147,7 +959164,7 @@ function getAutomationContextFromEnv() {
959147
959164
  config_branch: process.env.FERN_CONFIG_BRANCH,
959148
959165
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
959149
959166
  trigger: process.env.GITHUB_EVENT_NAME,
959150
- cli_version: "5.47.4"
959167
+ cli_version: "5.47.6"
959151
959168
  };
959152
959169
  }
959153
959170
  function isAutomationMode() {
@@ -959973,7 +959990,7 @@ var CliContext = class _CliContext {
959973
959990
  if (false) {
959974
959991
  this.logger.error("CLI_VERSION is not defined");
959975
959992
  }
959976
- return "5.47.4";
959993
+ return "5.47.6";
959977
959994
  }
959978
959995
  getCliName() {
959979
959996
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.47.4",
2
+ "version": "5.47.6",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",