@fern-api/fern-api-dev 3.40.1 → 3.41.1

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 +101 -22
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -1307518,6 +1307518,7 @@ __export(serialization_exports, {
1307518
1307518
  AiChatLocation: () => AiChatLocation2,
1307519
1307519
  AiChatModel: () => AiChatModel2,
1307520
1307520
  AiChatWebsiteDatasource: () => AiChatWebsiteDatasource,
1307521
+ AiExamplesConfig: () => AiExamplesConfig,
1307521
1307522
  AnalyticsConfig: () => AnalyticsConfig,
1307522
1307523
  AnnouncementConfig: () => AnnouncementConfig,
1307523
1307524
  ApiReferenceConfiguration: () => ApiReferenceConfiguration,
@@ -1307645,6 +1307646,7 @@ __export(docs_exports2, {
1307645
1307646
  AiChatLocation: () => AiChatLocation2,
1307646
1307647
  AiChatModel: () => AiChatModel2,
1307647
1307648
  AiChatWebsiteDatasource: () => AiChatWebsiteDatasource,
1307649
+ AiExamplesConfig: () => AiExamplesConfig,
1307648
1307650
  AnalyticsConfig: () => AnalyticsConfig,
1307649
1307651
  AnnouncementConfig: () => AnnouncementConfig,
1307650
1307652
  ApiReferenceConfiguration: () => ApiReferenceConfiguration,
@@ -1309152,6 +1309154,12 @@ var AnalyticsConfig = schemas_exports.object({
1309152
1309154
  ga4: GoogleAnalytics4Config.optional()
1309153
1309155
  });
1309154
1309156
 
1309157
+ // ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/AiExamplesConfig.js
1309158
+ var AiExamplesConfig = schemas_exports.object({
1309159
+ enabled: schemas_exports.boolean().optional(),
1309160
+ style: schemas_exports.string().optional()
1309161
+ });
1309162
+
1309155
1309163
  // ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/CustomDomain.js
1309156
1309164
  var CustomDomain = schemas_exports.undiscriminatedUnion([
1309157
1309165
  schemas_exports.string(),
@@ -1309719,6 +1309727,7 @@ var DocsConfiguration = schemas_exports.object({
1309719
1309727
  languages: schemas_exports.list(Language2).optional(),
1309720
1309728
  aiChat: schemas_exports.property("ai-chat", AiChatConfig.optional()),
1309721
1309729
  aiSearch: schemas_exports.property("ai-search", AiChatConfig.optional()),
1309730
+ aiExamples: schemas_exports.property("ai-examples", AiExamplesConfig.optional()),
1309722
1309731
  metadata: MetadataConfig.optional(),
1309723
1309732
  redirects: schemas_exports.list(RedirectConfig).optional(),
1309724
1309733
  logo: LogoConfiguration.optional(),
@@ -1309770,11 +1309779,11 @@ var PlaygroundButtonSettings = schemas_exports.object({
1309770
1309779
 
1309771
1309780
  // ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/PlaygroundSettings.js
1309772
1309781
  var PlaygroundSettings = schemas_exports.object({
1309782
+ hidden: schemas_exports.boolean().optional(),
1309773
1309783
  environments: schemas_exports.list(schemas_exports.string()).optional(),
1309774
1309784
  button: PlaygroundButtonSettings.optional(),
1309775
1309785
  oauth: schemas_exports.boolean().optional(),
1309776
- limitWebsocketMessagesPerConnection: schemas_exports.property("limit-websocket-messages-per-connection", schemas_exports.number().optional()),
1309777
- hidden: schemas_exports.boolean().optional()
1309786
+ limitWebsocketMessagesPerConnection: schemas_exports.property("limit-websocket-messages-per-connection", schemas_exports.number().optional())
1309778
1309787
  });
1309779
1309788
 
1309780
1309789
  // ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/ApiReferenceConfiguration.js
@@ -1415650,7 +1415659,7 @@ var AccessTokenPosthogManager = class {
1415650
1415659
  properties: {
1415651
1415660
  ...event,
1415652
1415661
  ...event.properties,
1415653
- version: "3.40.1",
1415662
+ version: "3.41.1",
1415654
1415663
  usingAccessToken: true
1415655
1415664
  }
1415656
1415665
  });
@@ -1415749,7 +1415758,7 @@ var UserPosthogManager = class {
1415749
1415758
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
1415750
1415759
  event: "CLI",
1415751
1415760
  properties: {
1415752
- version: "3.40.1",
1415761
+ version: "3.41.1",
1415753
1415762
  ...event,
1415754
1415763
  ...event.properties,
1415755
1415764
  usingAccessToken: false,
@@ -1495940,7 +1495949,7 @@ var CliContext = class {
1495940
1495949
  if (false) {
1495941
1495950
  this.logger.error("CLI_VERSION is not defined");
1495942
1495951
  }
1495943
- return "3.40.1";
1495952
+ return "3.41.1";
1495944
1495953
  }
1495945
1495954
  getCliName() {
1495946
1495955
  if (false) {
@@ -1507225,6 +1507234,7 @@ var OneOfSchema2 = schemas_exports8.union("type", {
1507225
1507234
  // ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/finalIr/types/DiscriminatedOneOfSchema.js
1507226
1507235
  var DiscriminatedOneOfSchema = schemas_exports8.objectWithoutOptionalProperties({
1507227
1507236
  discriminantProperty: schemas_exports8.string(),
1507237
+ discriminantPropertyNameOverride: schemas_exports8.string().optional(),
1507228
1507238
  commonProperties: schemas_exports8.list(schemas_exports8.lazyObject(() => CommonProperty)),
1507229
1507239
  schemas: schemas_exports8.record(schemas_exports8.string(), schemas_exports8.lazy(() => Schema4))
1507230
1507240
  }).extend(WithSdkGroupName).extend(WithNamespace).extend(WithName3).extend(WithDescription).extend(WithAvailability3).extend(WithEncoding).extend(WithSource).extend(WithTitle).extend(WithInline);
@@ -1507714,6 +1507724,7 @@ var OneOfSchemaWithExample2 = schemas_exports8.union("type", {
1507714
1507724
  // ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/parseIr/types/DiscriminatedOneOfSchemaWithExample.js
1507715
1507725
  var DiscriminatedOneOfSchemaWithExample = schemas_exports8.objectWithoutOptionalProperties({
1507716
1507726
  discriminantProperty: schemas_exports8.string(),
1507727
+ discriminantPropertyNameOverride: schemas_exports8.string().optional(),
1507717
1507728
  commonProperties: schemas_exports8.list(schemas_exports8.lazyObject(() => CommonPropertyWithExample)),
1507718
1507729
  schemas: schemas_exports8.record(schemas_exports8.string(), schemas_exports8.lazy(() => SchemaWithExample2))
1507719
1507730
  }).extend(WithSdkGroupName).extend(WithNamespace).extend(WithName3).extend(WithDescription).extend(WithAvailability3).extend(WithEncoding).extend(WithSource).extend(WithTitle).extend(WithInline);
@@ -1509196,7 +1509207,7 @@ function buildOneOfTypeDeclaration({ schema: schema2, context: context2, declara
1509196
1509207
  return {
1509197
1509208
  name: schema2.nameOverride ?? schema2.generatedName,
1509198
1509209
  schema: {
1509199
- discriminant: schema2.discriminantProperty,
1509210
+ discriminant: schema2.discriminantPropertyNameOverride != null ? { name: schema2.discriminantPropertyNameOverride, value: schema2.discriminantProperty } : schema2.discriminantProperty,
1509200
1509211
  "base-properties": baseProperties,
1509201
1509212
  docs: schema2.description ?? void 0,
1509202
1509213
  availability: schema2.availability != null ? convertAvailability2(schema2.availability) : void 0,
@@ -1514290,6 +1514301,7 @@ function convertAvailability3(propertySchema) {
1514290
1514301
  // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertDiscriminatedOneOf.js
1514291
1514302
  function convertDiscriminatedOneOf({ nameOverride, generatedName, title: title5, breadcrumbs, properties: properties7, description, availability, required: required5, wrapAsOptional, wrapAsNullable, discriminator, context: context2, namespace, groupName, encoding, source: source2 }) {
1514292
1514303
  const discriminant8 = discriminator.propertyName;
1514304
+ const discriminantNameOverride = getExtension(discriminator, FernOpenAPIExtension.FERN_PROPERTY_NAME);
1514293
1514305
  const unionSubTypes = Object.fromEntries(Object.entries(discriminator.mapping ?? {}).map(([discriminantValue, schema2]) => {
1514294
1514306
  const subtypeReference = convertReferenceObject({
1514295
1514307
  $ref: schema2
@@ -1514320,6 +1514332,7 @@ function convertDiscriminatedOneOf({ nameOverride, generatedName, title: title5,
1514320
1514332
  description,
1514321
1514333
  availability,
1514322
1514334
  discriminant: discriminant8,
1514335
+ discriminantNameOverride,
1514323
1514336
  subtypes: unionSubTypes,
1514324
1514337
  namespace,
1514325
1514338
  groupName,
@@ -1514358,17 +1514371,19 @@ function convertDiscriminatedOneOfWithVariants({ nameOverride, generatedName, ti
1514358
1514371
  description,
1514359
1514372
  availability,
1514360
1514373
  discriminant: discriminant8,
1514374
+ discriminantNameOverride: void 0,
1514361
1514375
  subtypes: unionSubTypes,
1514362
1514376
  namespace,
1514363
1514377
  groupName,
1514364
1514378
  source: source2
1514365
1514379
  });
1514366
1514380
  }
1514367
- function wrapDiscriminatedOneOf({ nameOverride, generatedName, title: title5, wrapAsOptional, wrapAsNullable, properties: properties7, description, availability, discriminant: discriminant8, subtypes, namespace, groupName, source: source2 }) {
1514381
+ function wrapDiscriminatedOneOf({ nameOverride, generatedName, title: title5, wrapAsOptional, wrapAsNullable, properties: properties7, description, availability, discriminant: discriminant8, discriminantNameOverride, subtypes, namespace, groupName, source: source2 }) {
1514368
1514382
  let result = SchemaWithExample.oneOf(OneOfSchemaWithExample.discriminated({
1514369
1514383
  description,
1514370
1514384
  availability,
1514371
1514385
  discriminantProperty: discriminant8,
1514386
+ discriminantPropertyNameOverride: discriminantNameOverride,
1514372
1514387
  nameOverride,
1514373
1514388
  generatedName,
1514374
1514389
  title: title5,
@@ -1515045,6 +1515060,7 @@ function convertToOneOf(oneOfSchema) {
1515045
1515060
  description: oneOfSchema.description,
1515046
1515061
  availability: oneOfSchema.availability,
1515047
1515062
  discriminantProperty: oneOfSchema.discriminantProperty,
1515063
+ discriminantPropertyNameOverride: oneOfSchema.discriminantPropertyNameOverride,
1515048
1515064
  generatedName: oneOfSchema.generatedName,
1515049
1515065
  title: oneOfSchema.title,
1515050
1515066
  nameOverride: oneOfSchema.nameOverride,
@@ -1518255,6 +1518271,7 @@ function convertToOneOf2(oneOfSchema) {
1518255
1518271
  description: oneOfSchema.description,
1518256
1518272
  availability: oneOfSchema.availability,
1518257
1518273
  discriminantProperty: oneOfSchema.discriminantProperty,
1518274
+ discriminantPropertyNameOverride: oneOfSchema.discriminantPropertyNameOverride,
1518258
1518275
  generatedName: oneOfSchema.generatedName,
1518259
1518276
  nameOverride: oneOfSchema.nameOverride,
1518260
1518277
  title: oneOfSchema.title,
@@ -1542670,6 +1542687,16 @@ var properties4 = {
1542670
1542687
  }
1542671
1542688
  ]
1542672
1542689
  },
1542690
+ "ai-examples": {
1542691
+ oneOf: [
1542692
+ {
1542693
+ $ref: "#/definitions/docs.AiExamplesConfig"
1542694
+ },
1542695
+ {
1542696
+ type: "null"
1542697
+ }
1542698
+ ]
1542699
+ },
1542673
1542700
  metadata: {
1542674
1542701
  oneOf: [
1542675
1542702
  {
@@ -1544027,6 +1544054,16 @@ var definitions4 = {
1544027
1544054
  "docs.PlaygroundSettings": {
1544028
1544055
  type: "object",
1544029
1544056
  properties: {
1544057
+ hidden: {
1544058
+ oneOf: [
1544059
+ {
1544060
+ type: "boolean"
1544061
+ },
1544062
+ {
1544063
+ type: "null"
1544064
+ }
1544065
+ ]
1544066
+ },
1544030
1544067
  environments: {
1544031
1544068
  oneOf: [
1544032
1544069
  {
@@ -1546386,6 +1546423,32 @@ var definitions4 = {
1546386
1546423
  },
1546387
1546424
  additionalProperties: false
1546388
1546425
  },
1546426
+ "docs.AiExamplesConfig": {
1546427
+ type: "object",
1546428
+ properties: {
1546429
+ enabled: {
1546430
+ oneOf: [
1546431
+ {
1546432
+ type: "boolean"
1546433
+ },
1546434
+ {
1546435
+ type: "null"
1546436
+ }
1546437
+ ]
1546438
+ },
1546439
+ style: {
1546440
+ oneOf: [
1546441
+ {
1546442
+ type: "string"
1546443
+ },
1546444
+ {
1546445
+ type: "null"
1546446
+ }
1546447
+ ]
1546448
+ }
1546449
+ },
1546450
+ additionalProperties: false
1546451
+ },
1546389
1546452
  "docs.TwitterCardSetting": {
1546390
1546453
  type: "string",
1546391
1546454
  enum: [
@@ -1579076,7 +1579139,6 @@ var ConcurrentEndpointProcessor = class {
1579076
1579139
  return { ...this.stats };
1579077
1579140
  }
1579078
1579141
  };
1579079
- var hasLoggedInfoMessage = false;
1579080
1579142
  function isOpenApiSpec(specContent) {
1579081
1579143
  try {
1579082
1579144
  try {
@@ -1579168,17 +1579230,6 @@ async function enhanceExamplesWithAI(apiDefinition, config2, context2, token, or
1579168
1579230
  }
1579169
1579231
  }
1579170
1579232
  async function performAIEnhancement(apiDefinition, config2, context2, token, organizationId, sourceFilePath, apiName) {
1579171
- if (!hasLoggedInfoMessage) {
1579172
- const message = source_default.blue("Notice: new feature added (experimental)!\n\n") + "We are generating realistic examples for endpoints in your spec.\nThis will not override your current examples. Please wait a moment.\n\nFuture runs will use saved examples. If you wish to override the content of the\nexamples, please edit and commit auto-generated `ai_examples_override.yml` files.";
1579173
- const boxedMessage = boxen(message, {
1579174
- padding: 1,
1579175
- textAlignment: "left",
1579176
- borderColor: "blue",
1579177
- borderStyle: "round"
1579178
- });
1579179
- context2.logger.info("\n" + boxedMessage + "\n");
1579180
- hasLoggedInfoMessage = true;
1579181
- }
1579182
1579233
  const enhancer = new LambdaExampleEnhancer(config2, context2, token, organizationId);
1579183
1579234
  const circuitBreaker = new CircuitBreaker();
1579184
1579235
  let openApiSpec;
@@ -1591635,7 +1591686,7 @@ var import_path37 = __toESM(require("path"), 1);
1591635
1591686
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
1591636
1591687
  var LOGS_FOLDER_NAME = "logs";
1591637
1591688
  function getCliSource() {
1591638
- const version6 = "3.40.1";
1591689
+ const version6 = "3.41.1";
1591639
1591690
  return `cli@${version6}`;
1591640
1591691
  }
1591641
1591692
  var DebugLogger = class {
@@ -1595107,6 +1595158,16 @@ var definitions5 = {
1595107
1595158
  "docs.PlaygroundSettings": {
1595108
1595159
  type: "object",
1595109
1595160
  properties: {
1595161
+ hidden: {
1595162
+ oneOf: [
1595163
+ {
1595164
+ type: "boolean"
1595165
+ },
1595166
+ {
1595167
+ type: "null"
1595168
+ }
1595169
+ ]
1595170
+ },
1595110
1595171
  environments: {
1595111
1595172
  oneOf: [
1595112
1595173
  {
@@ -1596934,6 +1596995,16 @@ var definitions6 = {
1596934
1596995
  "docs.PlaygroundSettings": {
1596935
1596996
  type: "object",
1596936
1596997
  properties: {
1596998
+ hidden: {
1596999
+ oneOf: [
1597000
+ {
1597001
+ type: "boolean"
1597002
+ },
1597003
+ {
1597004
+ type: "null"
1597005
+ }
1597006
+ ]
1597007
+ },
1596937
1597008
  environments: {
1596938
1597009
  oneOf: [
1596939
1597010
  {
@@ -1598394,6 +1598465,14 @@ async function visitDocsConfigFileYamlAst({ contents, visitor, absoluteFilepathT
1598394
1598465
  analytics: noop2,
1598395
1598466
  aiChat: noop2,
1598396
1598467
  aiSearch: noop2,
1598468
+ aiExamples: async (aiExamples) => {
1598469
+ if (aiExamples != null && typeof aiExamples === "object") {
1598470
+ await visitObjectAsync(aiExamples, {
1598471
+ enabled: noop2,
1598472
+ style: noop2
1598473
+ });
1598474
+ }
1598475
+ },
1598397
1598476
  pageActions: noop2,
1598398
1598477
  announcement: noop2,
1598399
1598478
  backgroundImage: async (background) => {
@@ -1626826,7 +1626905,7 @@ async function publishDocs({ token, organization, docsWorkspace, domain: domain2
1626826
1626905
  },
1626827
1626906
  registerApi: async ({ ir: ir14, snippetsConfig, playgroundConfig, apiName, workspace }) => {
1626828
1626907
  let apiDefinition = convertIrToFdrApi({ ir: ir14, snippetsConfig, playgroundConfig, context: context2 });
1626829
- const aiEnhancerConfig = getAIEnhancerConfig(withAiExamples, docsWorkspace.config.experimental?.aiExampleStyleInstructions);
1626908
+ const aiEnhancerConfig = getAIEnhancerConfig(withAiExamples, docsWorkspace.config.aiExamples?.style ?? docsWorkspace.config.experimental?.aiExampleStyleInstructions);
1626830
1626909
  if (aiEnhancerConfig && workspace) {
1626831
1626910
  const sources = workspace.getSources();
1626832
1626911
  const openApiSource = sources.find((source2) => source2.type === "openapi");
@@ -1627566,7 +1627645,7 @@ async function runRemoteGenerationForDocsWorkspace({ organization, apiWorkspaces
1627566
1627645
  isPrivate: maybeInstance.private,
1627567
1627646
  disableTemplates,
1627568
1627647
  skipUpload,
1627569
- withAiExamples: docsWorkspace.config.experimental?.aiExamples ?? true,
1627648
+ withAiExamples: docsWorkspace.config.aiExamples?.enabled ?? docsWorkspace.config.experimental?.aiExamples ?? true,
1627570
1627649
  targetAudiences: maybeInstance.audiences ? Array.isArray(maybeInstance.audiences) ? maybeInstance.audiences : [maybeInstance.audiences] : void 0
1627571
1627650
  });
1627572
1627651
  const publishTime = performance.now() - publishStart;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.40.1",
2
+ "version": "3.41.1",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",