@fern-api/fern-api-dev 5.44.11 → 5.44.12

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 +50 -8
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -669562,7 +669562,7 @@ var AccessTokenPosthogManager = class {
669562
669562
  properties: {
669563
669563
  ...event,
669564
669564
  ...event.properties,
669565
- version: "5.44.11",
669565
+ version: "5.44.12",
669566
669566
  usingAccessToken: true,
669567
669567
  ...getRunIdProperties()
669568
669568
  }
@@ -669626,7 +669626,7 @@ var UserPosthogManager = class {
669626
669626
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
669627
669627
  event: "CLI",
669628
669628
  properties: {
669629
- version: "5.44.11",
669629
+ version: "5.44.12",
669630
669630
  ...event,
669631
669631
  ...event.properties,
669632
669632
  usingAccessToken: false,
@@ -861367,7 +861367,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
861367
861367
  var LOGS_FOLDER_NAME = "logs";
861368
861368
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
861369
861369
  function getCliSource() {
861370
- const version7 = "5.44.11";
861370
+ const version7 = "5.44.12";
861371
861371
  return `cli@${version7}`;
861372
861372
  }
861373
861373
  var DebugLogger = class {
@@ -892459,7 +892459,7 @@ var LegacyDocsPublisher = class {
892459
892459
  previewId,
892460
892460
  disableTemplates: void 0,
892461
892461
  skipUpload,
892462
- cliVersion: "5.44.11",
892462
+ cliVersion: "5.44.12",
892463
892463
  loginCommand: "fern auth login"
892464
892464
  });
892465
892465
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -941307,7 +941307,7 @@ var DynamicSnippetsSwiftTestGenerator = class {
941307
941307
  idx
941308
941308
  });
941309
941309
  await (0, import_promises127.mkdir)(import_node_path40.default.dirname(dynamicSnippetFilePath), { recursive: true });
941310
- await (0, import_promises127.writeFile)(dynamicSnippetFilePath, response.snippet);
941310
+ await (0, import_promises127.writeFile)(dynamicSnippetFilePath, this.wrapSnippetAsLibrary(response.snippet, `Example${idx}`));
941311
941311
  } catch (error50) {
941312
941312
  this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
941313
941313
  }
@@ -941315,14 +941315,56 @@ var DynamicSnippetsSwiftTestGenerator = class {
941315
941315
  this.context.logger.debug("Done generating dynamic snippet tests");
941316
941316
  }
941317
941317
  async initializeProject(outputDir) {
941318
- const absolutePathToOutputDir = join8(outputDir, RelativeFilePath2.of("Snippets"));
941318
+ const absolutePathToOutputDir = join8(outputDir, RelativeFilePath2.of("Tests/Snippets"));
941319
941319
  await (0, import_promises127.mkdir)(absolutePathToOutputDir, { recursive: true });
941320
941320
  return absolutePathToOutputDir;
941321
941321
  }
941322
941322
  getTestFilePath({ absolutePathToOutputDir, idx }) {
941323
941323
  return join8(absolutePathToOutputDir, RelativeFilePath2.of(`Example${idx}.swift`));
941324
941324
  }
941325
+ wrapSnippetAsLibrary(snippet2, enumName) {
941326
+ return wrapSnippetAsLibrary({
941327
+ snippet: snippet2,
941328
+ enumName,
941329
+ warn: (message) => this.context.logger.warn(message)
941330
+ });
941331
+ }
941325
941332
  };
941333
+ function wrapSnippetAsLibrary({ snippet: snippet2, enumName, warn: warn2 }) {
941334
+ const FUNC_DECL = "private func main() async throws {";
941335
+ const FUNC_INVOCATION = "try await main()";
941336
+ if (!snippet2.includes(FUNC_DECL)) {
941337
+ warn2(`Snippet ${enumName} does not match expected format (missing '${FUNC_DECL}'). Writing raw snippet.`);
941338
+ return snippet2;
941339
+ }
941340
+ const lines = snippet2.trimEnd().split("\n");
941341
+ const result = [];
941342
+ let insideFunc = false;
941343
+ let foundInvocation = false;
941344
+ for (const line of lines) {
941345
+ if (line.trimEnd() === FUNC_DECL) {
941346
+ result.push(`enum ${enumName} {`);
941347
+ result.push(" static func snippet() async throws {");
941348
+ insideFunc = true;
941349
+ } else if (line.trimEnd() === FUNC_INVOCATION) {
941350
+ foundInvocation = true;
941351
+ } else if (insideFunc) {
941352
+ result.push(line === "" ? "" : ` ${line}`);
941353
+ } else {
941354
+ result.push(line);
941355
+ }
941356
+ }
941357
+ if (!foundInvocation) {
941358
+ warn2(`Snippet ${enumName} missing expected '${FUNC_INVOCATION}'. Writing raw snippet.`);
941359
+ return snippet2;
941360
+ }
941361
+ while (result.length > 0 && result[result.length - 1] === "") {
941362
+ result.pop();
941363
+ }
941364
+ result.push("}");
941365
+ result.push("");
941366
+ return result.join("\n");
941367
+ }
941326
941368
 
941327
941369
  // ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/typescript/DynamicSnippetsTypeScriptTestGenerator.js
941328
941370
  init_lib8();
@@ -957556,7 +957598,7 @@ function getAutomationContextFromEnv() {
957556
957598
  config_branch: process.env.FERN_CONFIG_BRANCH,
957557
957599
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
957558
957600
  trigger: process.env.GITHUB_EVENT_NAME,
957559
- cli_version: "5.44.11"
957601
+ cli_version: "5.44.12"
957560
957602
  };
957561
957603
  }
957562
957604
  function isAutomationMode() {
@@ -958382,7 +958424,7 @@ var CliContext = class _CliContext {
958382
958424
  if (false) {
958383
958425
  this.logger.error("CLI_VERSION is not defined");
958384
958426
  }
958385
- return "5.44.11";
958427
+ return "5.44.12";
958386
958428
  }
958387
958429
  getCliName() {
958388
958430
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.44.11",
2
+ "version": "5.44.12",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",