@fern-api/fern-api-dev 4.68.1 → 4.68.2-1-ge641e90bb18

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 +66 -52
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -226337,9 +226337,9 @@ var require_bl = __commonJS({
226337
226337
  }
226338
226338
  });
226339
226339
 
226340
- // ../../../node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/debug.js
226340
+ // ../../../node_modules/.pnpm/follow-redirects@1.16.0/node_modules/follow-redirects/debug.js
226341
226341
  var require_debug2 = __commonJS({
226342
- "../../../node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/debug.js"(exports2, module4) {
226342
+ "../../../node_modules/.pnpm/follow-redirects@1.16.0/node_modules/follow-redirects/debug.js"(exports2, module4) {
226343
226343
  "use strict";
226344
226344
  var debug9;
226345
226345
  module4.exports = function() {
@@ -226358,9 +226358,9 @@ var require_debug2 = __commonJS({
226358
226358
  }
226359
226359
  });
226360
226360
 
226361
- // ../../../node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/index.js
226361
+ // ../../../node_modules/.pnpm/follow-redirects@1.16.0/node_modules/follow-redirects/index.js
226362
226362
  var require_follow_redirects = __commonJS({
226363
- "../../../node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/index.js"(exports2, module4) {
226363
+ "../../../node_modules/.pnpm/follow-redirects@1.16.0/node_modules/follow-redirects/index.js"(exports2, module4) {
226364
226364
  "use strict";
226365
226365
  var url3 = require("url");
226366
226366
  var URL4 = url3.URL;
@@ -226383,6 +226383,11 @@ var require_follow_redirects = __commonJS({
226383
226383
  } catch (error50) {
226384
226384
  useNativeURL = error50.code === "ERR_INVALID_URL";
226385
226385
  }
226386
+ var sensitiveHeaders = [
226387
+ "Authorization",
226388
+ "Proxy-Authorization",
226389
+ "Cookie"
226390
+ ];
226386
226391
  var preservedUrlFields = [
226387
226392
  "auth",
226388
226393
  "host",
@@ -226447,6 +226452,7 @@ var require_follow_redirects = __commonJS({
226447
226452
  self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause }));
226448
226453
  }
226449
226454
  };
226455
+ this._headerFilter = new RegExp("^(?:" + sensitiveHeaders.concat(options2.sensitiveHeaders).map(escapeRegex2).join("|") + ")$", "i");
226450
226456
  this._performRequest();
226451
226457
  }
226452
226458
  RedirectableRequest.prototype = Object.create(Writable2.prototype);
@@ -226584,6 +226590,9 @@ var require_follow_redirects = __commonJS({
226584
226590
  if (!options2.headers) {
226585
226591
  options2.headers = {};
226586
226592
  }
226593
+ if (!isArray7(options2.sensitiveHeaders)) {
226594
+ options2.sensitiveHeaders = [];
226595
+ }
226587
226596
  if (options2.host) {
226588
226597
  if (!options2.hostname) {
226589
226598
  options2.hostname = options2.host;
@@ -226689,7 +226698,7 @@ var require_follow_redirects = __commonJS({
226689
226698
  this._isRedirect = true;
226690
226699
  spreadUrlObject(redirectUrl, this._options);
226691
226700
  if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) {
226692
- removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
226701
+ removeMatchingHeaders(this._headerFilter, this._options.headers);
226693
226702
  }
226694
226703
  if (isFunction10(beforeRedirect)) {
226695
226704
  var responseDetails = {
@@ -226838,6 +226847,9 @@ var require_follow_redirects = __commonJS({
226838
226847
  var dot = subdomain.length - domain3.length - 1;
226839
226848
  return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain3);
226840
226849
  }
226850
+ function isArray7(value) {
226851
+ return value instanceof Array;
226852
+ }
226841
226853
  function isString6(value) {
226842
226854
  return typeof value === "string" || value instanceof String;
226843
226855
  }
@@ -226850,6 +226862,9 @@ var require_follow_redirects = __commonJS({
226850
226862
  function isURL2(value) {
226851
226863
  return URL4 && value instanceof URL4;
226852
226864
  }
226865
+ function escapeRegex2(regex5) {
226866
+ return regex5.replace(/[\]\\/()*+?.$]/g, "\\$&");
226867
+ }
226853
226868
  module4.exports = wrap10({ http: http13, https: https5 });
226854
226869
  module4.exports.wrap = wrap10;
226855
226870
  }
@@ -627624,7 +627639,7 @@ var AccessTokenPosthogManager = class {
627624
627639
  properties: {
627625
627640
  ...event,
627626
627641
  ...event.properties,
627627
- version: "4.68.1",
627642
+ version: "4.68.2-1-ge641e90bb18",
627628
627643
  usingAccessToken: true
627629
627644
  }
627630
627645
  });
@@ -627678,7 +627693,7 @@ var UserPosthogManager = class {
627678
627693
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
627679
627694
  event: "CLI",
627680
627695
  properties: {
627681
- version: "4.68.1",
627696
+ version: "4.68.2-1-ge641e90bb18",
627682
627697
  ...event,
627683
627698
  ...event.properties,
627684
627699
  usingAccessToken: false,
@@ -843953,7 +843968,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
843953
843968
  var LOGS_FOLDER_NAME = "logs";
843954
843969
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
843955
843970
  function getCliSource() {
843956
- const version7 = "4.68.1";
843971
+ const version7 = "4.68.2-1-ge641e90bb18";
843957
843972
  return `cli@${version7}`;
843958
843973
  }
843959
843974
  var DebugLogger = class {
@@ -844834,7 +844849,7 @@ var ReferencedAPICollector = class {
844834
844849
  constructor(context3) {
844835
844850
  this.context = context3;
844836
844851
  }
844837
- addReferencedAPI({ ir: ir15, snippetsConfig, playgroundConfig, graphqlOperations = {}, graphqlTypes = {} }) {
844852
+ addReferencedAPI({ ir: ir15, snippetsConfig, playgroundConfig, apiName, graphqlOperations = {}, graphqlTypes = {} }) {
844838
844853
  try {
844839
844854
  const id2 = v4_default();
844840
844855
  const dbApiDefinition = convertAPIDefinitionToDb(convertIrToFdrApi({
@@ -844843,7 +844858,8 @@ var ReferencedAPICollector = class {
844843
844858
  playgroundConfig,
844844
844859
  graphqlOperations,
844845
844860
  graphqlTypes,
844846
- context: this.context
844861
+ context: this.context,
844862
+ apiNameOverride: apiName
844847
844863
  }), FdrAPI_exports.ApiDefinitionId(id2), new SDKSnippetHolder({
844848
844864
  snippetsConfigWithSdkId: {},
844849
844865
  snippetsBySdkId: {},
@@ -855201,7 +855217,7 @@ var LegacyDocsPublisher = class {
855201
855217
  previewId,
855202
855218
  disableTemplates: void 0,
855203
855219
  skipUpload,
855204
- cliVersion: "4.68.1"
855220
+ cliVersion: "4.68.2-1-ge641e90bb18"
855205
855221
  });
855206
855222
  if (taskContext.getResult() === TaskResult.Failure) {
855207
855223
  return { success: false };
@@ -870284,13 +870300,15 @@ var Class2 = class _Class extends DefinedType {
870284
870300
  annotations = [];
870285
870301
  primaryConstructor;
870286
870302
  namespaceReferences = [];
870303
+ skipNamespaceDeclaration;
870287
870304
  constructors = [];
870288
870305
  operators = [];
870289
870306
  nestedClasses = [];
870290
870307
  nestedInterfaces = [];
870291
870308
  rawBodyBlocks = [];
870292
- constructor({ name: name2, namespace, access: access6, static_, abstract_, sealed, partial: partial2, readonly: readonly2, parentClassReference, interfaceReferences, enclosingType, type: type8, summary, doc, annotations, primaryConstructor, origin: origin2 }, generation) {
870309
+ constructor({ name: name2, namespace, access: access6, static_, abstract_, sealed, partial: partial2, readonly: readonly2, parentClassReference, interfaceReferences, enclosingType, type: type8, summary, doc, annotations, primaryConstructor, skipNamespaceDeclaration, origin: origin2 }, generation) {
870293
870310
  super({ name: name2, namespace, access: access6, partial: partial2, interfaceReferences, enclosingType, origin: origin2 }, generation);
870311
+ this.skipNamespaceDeclaration = skipNamespaceDeclaration ?? false;
870294
870312
  this.static_ = static_ ?? false;
870295
870313
  this.abstract_ = abstract_ ?? false;
870296
870314
  this.sealed = sealed ?? false;
@@ -870352,7 +870370,7 @@ var Class2 = class _Class extends DefinedType {
870352
870370
  this.namespaceReferences.forEach((namespace) => {
870353
870371
  writer2.addNamespace(namespace);
870354
870372
  });
870355
- if (!this.isNested) {
870373
+ if (!this.isNested && !this.skipNamespaceDeclaration) {
870356
870374
  writer2.writeLine(`namespace ${this.namespace};`);
870357
870375
  writer2.newLine();
870358
870376
  }
@@ -870360,7 +870378,9 @@ var Class2 = class _Class extends DefinedType {
870360
870378
  this.annotations.forEach((annotation) => {
870361
870379
  annotation.write(writer2);
870362
870380
  });
870363
- writer2.writeNewLineIfLastLineNot();
870381
+ if (!this.skipNamespaceDeclaration) {
870382
+ writer2.writeNewLineIfLastLineNot();
870383
+ }
870364
870384
  writer2.write(`${this.access}`);
870365
870385
  if (this.static_) {
870366
870386
  writer2.write(" static");
@@ -872383,7 +872403,7 @@ var CSharp = class {
872383
872403
  args.name = this.model.getClassNameFor(args.origin);
872384
872404
  }
872385
872405
  if (args.enclosingType) {
872386
- if (args.namespace) {
872406
+ if (args.namespace && args.namespace !== args.enclosingType.namespace) {
872387
872407
  throw new Error(`ClassReference: Both enclosingType and namespace cannot be provided`);
872388
872408
  }
872389
872409
  args.namespace = args.enclosingType.namespace;
@@ -874329,6 +874349,8 @@ var Generation = class {
874329
874349
  useDefaultRequestParameterValues: () => this.customConfig["use-default-request-parameter-values"] ?? false,
874330
874350
  /** When true, redacts the response body in deserialization error exceptions and adds a custom ToString override to the base API exception. Default: false. */
874331
874351
  redactResponseBodyOnError: () => this.customConfig["redact-response-body-on-error"] ?? false,
874352
+ /** When true, generates inline types as nested classes inside a static Types class on the parent type, instead of as separate top-level files. Default: false. */
874353
+ enableInlineTypes: () => this.customConfig["enable-inline-types"] ?? false,
874332
874354
  /** Temporary mapping of websocket environment configurations. Default: {}. */
874333
874355
  temporaryWebsocketEnvironments: () => this.customConfig["temporary-websocket-environments"] ?? {},
874334
874356
  /** Custom name for the base API exception class. Default: "" (auto-generated). */
@@ -875984,7 +876006,7 @@ var DynamicTypeMapper = class extends WithGeneration {
875984
876006
  if (named == null) {
875985
876007
  return this.convertUnknown();
875986
876008
  }
875987
- return this.convertNamed({ named });
876009
+ return this.convertNamed({ named, typeId: args.typeReference.value });
875988
876010
  }
875989
876011
  case "optional":
875990
876012
  case "nullable": {
@@ -876001,13 +876023,13 @@ var DynamicTypeMapper = class extends WithGeneration {
876001
876023
  assertNever(args.typeReference);
876002
876024
  }
876003
876025
  }
876004
- convertToClassReference(named) {
876026
+ convertToClassReference(named, typeId) {
876005
876027
  return this.csharp.classReference({
876006
876028
  origin: named.declaration,
876007
876029
  namespace: this.context.getNamespace(named.declaration.fernFilepath)
876008
876030
  });
876009
876031
  }
876010
- convertNamed({ named }) {
876032
+ convertNamed({ named, typeId }) {
876011
876033
  switch (named.type) {
876012
876034
  case "alias":
876013
876035
  if (this.settings.generateLiterals && named.typeReference.type === "literal") {
@@ -876019,24 +876041,15 @@ var DynamicTypeMapper = class extends WithGeneration {
876019
876041
  return this.convert({ typeReference: named.typeReference });
876020
876042
  case "enum":
876021
876043
  case "object":
876022
- return this.csharp.classReference({
876023
- origin: named.declaration,
876024
- namespace: this.context.getNamespace(named.declaration.fernFilepath)
876025
- });
876044
+ return this.convertToClassReference(named, typeId);
876026
876045
  case "discriminatedUnion":
876027
876046
  if (!this.settings.shouldGeneratedDiscriminatedUnions) {
876028
876047
  return this.Primitive.object;
876029
876048
  }
876030
- return this.csharp.classReference({
876031
- origin: named.declaration,
876032
- namespace: this.context.getNamespace(named.declaration.fernFilepath)
876033
- });
876049
+ return this.convertToClassReference(named, typeId);
876034
876050
  case "undiscriminatedUnion":
876035
876051
  if (this.settings.shouldGenerateUndiscriminatedUnions) {
876036
- return this.csharp.classReference({
876037
- origin: named.declaration,
876038
- namespace: this.context.getNamespace(named.declaration.fernFilepath)
876039
- });
876052
+ return this.convertToClassReference(named, typeId);
876040
876053
  }
876041
876054
  return this.OneOf.OneOf(named.types.map((typeReference2) => {
876042
876055
  return this.convert({ typeReference: typeReference2 });
@@ -876377,7 +876390,7 @@ var DynamicSnippetsGeneratorContext = class _DynamicSnippetsGeneratorContext ext
876377
876390
  Object.entries(this.ir.types).sort((a10, b19) => {
876378
876391
  return a10[0].length - b19[0].length;
876379
876392
  }).forEach(([typeId, type8]) => {
876380
- this.dynamicTypeMapper.convertToClassReference(type8);
876393
+ this.dynamicTypeMapper.convertToClassReference(type8, typeId);
876381
876394
  });
876382
876395
  for (const [idx, request7] of requests3.entries()) {
876383
876396
  this.csharp.classReference({
@@ -876418,7 +876431,7 @@ var EndpointSnippetGenerator2 = class extends WithGeneration {
876418
876431
  async generateSnippet({ endpoint: endpoint3, request: request7, options: options2 }) {
876419
876432
  const code5 = this.buildCodeBlock({ endpoint: endpoint3, snippet: request7, options: options2 });
876420
876433
  return code5.toString({
876421
- namespace: "Usage",
876434
+ namespace: "Examples",
876422
876435
  generation: this.generation,
876423
876436
  allNamespaceSegments: /* @__PURE__ */ new Set(),
876424
876437
  allTypeClassReferences: /* @__PURE__ */ new Map(),
@@ -876432,7 +876445,7 @@ var EndpointSnippetGenerator2 = class extends WithGeneration {
876432
876445
  generateSnippetSync({ endpoint: endpoint3, request: request7, options: options2 }) {
876433
876446
  const code5 = this.buildCodeBlock({ endpoint: endpoint3, snippet: request7, options: options2 });
876434
876447
  return code5.toString({
876435
- namespace: "Usage",
876448
+ namespace: "Examples",
876436
876449
  generation: this.generation,
876437
876450
  allNamespaceSegments: /* @__PURE__ */ new Set(),
876438
876451
  allTypeClassReferences: /* @__PURE__ */ new Map(),
@@ -876464,14 +876477,17 @@ var EndpointSnippetGenerator2 = class extends WithGeneration {
876464
876477
  }
876465
876478
  buildFullCodeBlock({ body, options: options2 }) {
876466
876479
  const config5 = this.getConfig(options2);
876480
+ const methodName = config5.fullStyleMethodName ?? config5.fullStyleClassName ?? "Example";
876467
876481
  const class_6 = this.csharp.class_({
876468
- name: config5.fullStyleClassName ?? "Example",
876469
- namespace: "Usage",
876482
+ name: "Examples",
876483
+ namespace: "Examples",
876484
+ partial: true,
876485
+ skipNamespaceDeclaration: true,
876470
876486
  access: ast_exports.Access.Public
876471
876487
  });
876472
876488
  class_6.addNamespaceReference(this.Types.RootClientForSnippets.namespace);
876473
876489
  class_6.addMethod({
876474
- name: "Do",
876490
+ name: methodName,
876475
876491
  access: ast_exports.Access.Public,
876476
876492
  isAsync: true,
876477
876493
  parameters: [],
@@ -877114,18 +877130,16 @@ function convertIr(ir15) {
877114
877130
  }
877115
877131
 
877116
877132
  // ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/csharp/DynamicSnippetsCsharpTestGenerator.js
877117
- var PROJECT_FILE_CONTENT = `
877118
- <Project Sdk="Microsoft.NET.Sdk">
877119
- <PropertyGroup>
877120
- <TargetFramework>net8.0</TargetFramework>
877121
- <LangVersion>12</LangVersion>
877122
- <ImplicitUsings>enable</ImplicitUsings>
877123
- <Nullable>enable</Nullable>
877124
- </PropertyGroup>
877125
-
877126
- <ItemGroup>
877127
- <ProjectReference Include="..\\..\\**\\*.csproj" Exclude="..\\..\\**\\*.DynamicSnippets.csproj;..\\..\\**\\*.Test.csproj" />
877128
- </ItemGroup>
877133
+ var PROJECT_FILE_CONTENT = `<Project Sdk="Microsoft.NET.Sdk">
877134
+ <PropertyGroup>
877135
+ <TargetFramework>net10.0</TargetFramework>
877136
+ <RootNamespace>Snippets</RootNamespace>
877137
+ <ImplicitUsings>enable</ImplicitUsings>
877138
+ <Nullable>enable</Nullable>
877139
+ </PropertyGroup>
877140
+ <ItemGroup>
877141
+ <ProjectReference Include="..\\**\\*.csproj" Exclude="..\\**\\*.Test.csproj;..\\Snippets\\*.csproj" />
877142
+ </ItemGroup>
877129
877143
  </Project>`;
877130
877144
  var DynamicSnippetsCsharpTestGenerator = class {
877131
877145
  context;
@@ -877154,7 +877168,7 @@ var DynamicSnippetsCsharpTestGenerator = class {
877154
877168
  }
877155
877169
  const response = await this.dynamicSnippetsGenerator.generate(convertedRequest, {
877156
877170
  config: {
877157
- fullStyleClassName: `Example${idx}`
877171
+ fullStyleMethodName: `Example${idx}`
877158
877172
  },
877159
877173
  style: Style2.Full,
877160
877174
  endpointId
@@ -877169,9 +877183,9 @@ var DynamicSnippetsCsharpTestGenerator = class {
877169
877183
  this.context.logger.debug("Done generating dynamic snippet tests");
877170
877184
  }
877171
877185
  async initializeProject(outputDir) {
877172
- const absolutePathToOutputDir = join8(outputDir, RelativeFilePath2.of("src/SeedApi.DynamicSnippets"));
877186
+ const absolutePathToOutputDir = join8(outputDir, RelativeFilePath2.of("Snippets"));
877173
877187
  await (0, import_promises93.mkdir)(absolutePathToOutputDir, { recursive: true });
877174
- await (0, import_promises93.writeFile)(join8(absolutePathToOutputDir, RelativeFilePath2.of("SeedApi.DynamicSnippets.csproj")), PROJECT_FILE_CONTENT);
877188
+ await (0, import_promises93.writeFile)(join8(absolutePathToOutputDir, RelativeFilePath2.of("Snippets.csproj")), PROJECT_FILE_CONTENT);
877175
877189
  return absolutePathToOutputDir;
877176
877190
  }
877177
877191
  getTestFilePath({ absolutePathToOutputDir, idx }) {
@@ -928943,7 +928957,7 @@ var CliContext = class _CliContext {
928943
928957
  if (false) {
928944
928958
  this.logger.error("CLI_VERSION is not defined");
928945
928959
  }
928946
- return "4.68.1";
928960
+ return "4.68.2-1-ge641e90bb18";
928947
928961
  }
928948
928962
  getCliName() {
928949
928963
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.68.1",
2
+ "version": "4.68.2-1-ge641e90bb18",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",