@fern-api/fern-api-dev 4.68.0 → 4.68.1-1-g56ebc56eef0

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 +49 -32
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -627624,14 +627624,17 @@ var AccessTokenPosthogManager = class {
627624
627624
  properties: {
627625
627625
  ...event,
627626
627626
  ...event.properties,
627627
- version: "4.68.0",
627627
+ version: "4.68.1-1-g56ebc56eef0",
627628
627628
  usingAccessToken: true
627629
627629
  }
627630
627630
  });
627631
627631
  }
627632
627632
  }
627633
627633
  async flush() {
627634
- await this.posthog.flush();
627634
+ try {
627635
+ await Promise.race([this.posthog.flush(), new Promise((resolve13) => setTimeout(resolve13, 3e3))]);
627636
+ } catch {
627637
+ }
627635
627638
  }
627636
627639
  };
627637
627640
 
@@ -627675,7 +627678,7 @@ var UserPosthogManager = class {
627675
627678
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
627676
627679
  event: "CLI",
627677
627680
  properties: {
627678
- version: "4.68.0",
627681
+ version: "4.68.1-1-g56ebc56eef0",
627679
627682
  ...event,
627680
627683
  ...event.properties,
627681
627684
  usingAccessToken: false,
@@ -627684,7 +627687,10 @@ var UserPosthogManager = class {
627684
627687
  });
627685
627688
  }
627686
627689
  async flush() {
627687
- await this.posthog.flush();
627690
+ try {
627691
+ await Promise.race([this.posthog.flush(), new Promise((resolve13) => setTimeout(resolve13, 3e3))]);
627692
+ } catch {
627693
+ }
627688
627694
  }
627689
627695
  userEmail;
627690
627696
  async getUserEmail() {
@@ -631201,7 +631207,10 @@ var TelemetryClient = class _TelemetryClient {
631201
631207
  async flush() {
631202
631208
  const promises = [];
631203
631209
  if (this.posthog != null) {
631204
- promises.push(this.posthog.shutdown().catch(() => void 0));
631210
+ promises.push(Promise.race([
631211
+ this.posthog.shutdown().catch(() => void 0),
631212
+ new Promise((resolve13) => setTimeout(resolve13, 3e3))
631213
+ ]));
631205
631214
  }
631206
631215
  if (this.sentry !== void 0) {
631207
631216
  promises.push(Promise.resolve(this.sentry.flush(2e3)).catch(() => void 0));
@@ -843944,7 +843953,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
843944
843953
  var LOGS_FOLDER_NAME = "logs";
843945
843954
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
843946
843955
  function getCliSource() {
843947
- const version7 = "4.68.0";
843956
+ const version7 = "4.68.1-1-g56ebc56eef0";
843948
843957
  return `cli@${version7}`;
843949
843958
  }
843950
843959
  var DebugLogger = class {
@@ -855192,7 +855201,7 @@ var LegacyDocsPublisher = class {
855192
855201
  previewId,
855193
855202
  disableTemplates: void 0,
855194
855203
  skipUpload,
855195
- cliVersion: "4.68.0"
855204
+ cliVersion: "4.68.1-1-g56ebc56eef0"
855196
855205
  });
855197
855206
  if (taskContext.getResult() === TaskResult.Failure) {
855198
855207
  return { success: false };
@@ -870275,13 +870284,15 @@ var Class2 = class _Class extends DefinedType {
870275
870284
  annotations = [];
870276
870285
  primaryConstructor;
870277
870286
  namespaceReferences = [];
870287
+ skipNamespaceDeclaration;
870278
870288
  constructors = [];
870279
870289
  operators = [];
870280
870290
  nestedClasses = [];
870281
870291
  nestedInterfaces = [];
870282
870292
  rawBodyBlocks = [];
870283
- 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) {
870293
+ 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) {
870284
870294
  super({ name: name2, namespace, access: access6, partial: partial2, interfaceReferences, enclosingType, origin: origin2 }, generation);
870295
+ this.skipNamespaceDeclaration = skipNamespaceDeclaration ?? false;
870285
870296
  this.static_ = static_ ?? false;
870286
870297
  this.abstract_ = abstract_ ?? false;
870287
870298
  this.sealed = sealed ?? false;
@@ -870343,7 +870354,7 @@ var Class2 = class _Class extends DefinedType {
870343
870354
  this.namespaceReferences.forEach((namespace) => {
870344
870355
  writer2.addNamespace(namespace);
870345
870356
  });
870346
- if (!this.isNested) {
870357
+ if (!this.isNested && !this.skipNamespaceDeclaration) {
870347
870358
  writer2.writeLine(`namespace ${this.namespace};`);
870348
870359
  writer2.newLine();
870349
870360
  }
@@ -870351,7 +870362,9 @@ var Class2 = class _Class extends DefinedType {
870351
870362
  this.annotations.forEach((annotation) => {
870352
870363
  annotation.write(writer2);
870353
870364
  });
870354
- writer2.writeNewLineIfLastLineNot();
870365
+ if (!this.skipNamespaceDeclaration) {
870366
+ writer2.writeNewLineIfLastLineNot();
870367
+ }
870355
870368
  writer2.write(`${this.access}`);
870356
870369
  if (this.static_) {
870357
870370
  writer2.write(" static");
@@ -876409,7 +876422,7 @@ var EndpointSnippetGenerator2 = class extends WithGeneration {
876409
876422
  async generateSnippet({ endpoint: endpoint3, request: request7, options: options2 }) {
876410
876423
  const code5 = this.buildCodeBlock({ endpoint: endpoint3, snippet: request7, options: options2 });
876411
876424
  return code5.toString({
876412
- namespace: "Usage",
876425
+ namespace: "Examples",
876413
876426
  generation: this.generation,
876414
876427
  allNamespaceSegments: /* @__PURE__ */ new Set(),
876415
876428
  allTypeClassReferences: /* @__PURE__ */ new Map(),
@@ -876423,7 +876436,7 @@ var EndpointSnippetGenerator2 = class extends WithGeneration {
876423
876436
  generateSnippetSync({ endpoint: endpoint3, request: request7, options: options2 }) {
876424
876437
  const code5 = this.buildCodeBlock({ endpoint: endpoint3, snippet: request7, options: options2 });
876425
876438
  return code5.toString({
876426
- namespace: "Usage",
876439
+ namespace: "Examples",
876427
876440
  generation: this.generation,
876428
876441
  allNamespaceSegments: /* @__PURE__ */ new Set(),
876429
876442
  allTypeClassReferences: /* @__PURE__ */ new Map(),
@@ -876455,14 +876468,17 @@ var EndpointSnippetGenerator2 = class extends WithGeneration {
876455
876468
  }
876456
876469
  buildFullCodeBlock({ body, options: options2 }) {
876457
876470
  const config5 = this.getConfig(options2);
876471
+ const methodName = config5.fullStyleMethodName ?? config5.fullStyleClassName ?? "Example";
876458
876472
  const class_6 = this.csharp.class_({
876459
- name: config5.fullStyleClassName ?? "Example",
876460
- namespace: "Usage",
876473
+ name: "Examples",
876474
+ namespace: "Examples",
876475
+ partial: true,
876476
+ skipNamespaceDeclaration: true,
876461
876477
  access: ast_exports.Access.Public
876462
876478
  });
876463
876479
  class_6.addNamespaceReference(this.Types.RootClientForSnippets.namespace);
876464
876480
  class_6.addMethod({
876465
- name: "Do",
876481
+ name: methodName,
876466
876482
  access: ast_exports.Access.Public,
876467
876483
  isAsync: true,
876468
876484
  parameters: [],
@@ -877105,18 +877121,16 @@ function convertIr(ir15) {
877105
877121
  }
877106
877122
 
877107
877123
  // ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/csharp/DynamicSnippetsCsharpTestGenerator.js
877108
- var PROJECT_FILE_CONTENT = `
877109
- <Project Sdk="Microsoft.NET.Sdk">
877110
- <PropertyGroup>
877111
- <TargetFramework>net8.0</TargetFramework>
877112
- <LangVersion>12</LangVersion>
877113
- <ImplicitUsings>enable</ImplicitUsings>
877114
- <Nullable>enable</Nullable>
877115
- </PropertyGroup>
877116
-
877117
- <ItemGroup>
877118
- <ProjectReference Include="..\\..\\**\\*.csproj" Exclude="..\\..\\**\\*.DynamicSnippets.csproj;..\\..\\**\\*.Test.csproj" />
877119
- </ItemGroup>
877124
+ var PROJECT_FILE_CONTENT = `<Project Sdk="Microsoft.NET.Sdk">
877125
+ <PropertyGroup>
877126
+ <TargetFramework>net10.0</TargetFramework>
877127
+ <RootNamespace>Snippets</RootNamespace>
877128
+ <ImplicitUsings>enable</ImplicitUsings>
877129
+ <Nullable>enable</Nullable>
877130
+ </PropertyGroup>
877131
+ <ItemGroup>
877132
+ <ProjectReference Include="..\\**\\*.csproj" Exclude="..\\**\\*.Test.csproj;..\\Snippets\\*.csproj" />
877133
+ </ItemGroup>
877120
877134
  </Project>`;
877121
877135
  var DynamicSnippetsCsharpTestGenerator = class {
877122
877136
  context;
@@ -877145,7 +877159,7 @@ var DynamicSnippetsCsharpTestGenerator = class {
877145
877159
  }
877146
877160
  const response = await this.dynamicSnippetsGenerator.generate(convertedRequest, {
877147
877161
  config: {
877148
- fullStyleClassName: `Example${idx}`
877162
+ fullStyleMethodName: `Example${idx}`
877149
877163
  },
877150
877164
  style: Style2.Full,
877151
877165
  endpointId
@@ -877160,9 +877174,9 @@ var DynamicSnippetsCsharpTestGenerator = class {
877160
877174
  this.context.logger.debug("Done generating dynamic snippet tests");
877161
877175
  }
877162
877176
  async initializeProject(outputDir) {
877163
- const absolutePathToOutputDir = join8(outputDir, RelativeFilePath2.of("src/SeedApi.DynamicSnippets"));
877177
+ const absolutePathToOutputDir = join8(outputDir, RelativeFilePath2.of("Snippets"));
877164
877178
  await (0, import_promises93.mkdir)(absolutePathToOutputDir, { recursive: true });
877165
- await (0, import_promises93.writeFile)(join8(absolutePathToOutputDir, RelativeFilePath2.of("SeedApi.DynamicSnippets.csproj")), PROJECT_FILE_CONTENT);
877179
+ await (0, import_promises93.writeFile)(join8(absolutePathToOutputDir, RelativeFilePath2.of("Snippets.csproj")), PROJECT_FILE_CONTENT);
877166
877180
  return absolutePathToOutputDir;
877167
877181
  }
877168
877182
  getTestFilePath({ absolutePathToOutputDir, idx }) {
@@ -928934,7 +928948,7 @@ var CliContext = class _CliContext {
928934
928948
  if (false) {
928935
928949
  this.logger.error("CLI_VERSION is not defined");
928936
928950
  }
928937
- return "4.68.0";
928951
+ return "4.68.1-1-g56ebc56eef0";
928938
928952
  }
928939
928953
  getCliName() {
928940
928954
  if (false) {
@@ -928990,7 +929004,10 @@ var CliContext = class _CliContext {
928990
929004
  await this.nudgeUpgradeIfAvailable();
928991
929005
  }
928992
929006
  this.ttyAwareLogger.finish();
928993
- await this.posthogManager.flush();
929007
+ try {
929008
+ await this.posthogManager.flush();
929009
+ } catch {
929010
+ }
928994
929011
  await this.sentryClient.flush();
928995
929012
  this.exitProgram({ code: code5 });
928996
929013
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.68.0",
2
+ "version": "4.68.1-1-g56ebc56eef0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",