@fern-api/fern-api-dev 5.23.3-839-gd570dc5b08c → 5.23.3-842-gd46e9a00cdc

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 +54 -31
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -685536,7 +685536,7 @@ var AccessTokenPosthogManager = class {
685536
685536
  properties: {
685537
685537
  ...event,
685538
685538
  ...event.properties,
685539
- version: "5.23.3-839-gd570dc5b08c",
685539
+ version: "5.23.3-842-gd46e9a00cdc",
685540
685540
  usingAccessToken: true,
685541
685541
  ...getRunIdProperties()
685542
685542
  }
@@ -685602,7 +685602,7 @@ var UserPosthogManager = class {
685602
685602
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
685603
685603
  event: "CLI",
685604
685604
  properties: {
685605
- version: "5.23.3-839-gd570dc5b08c",
685605
+ version: "5.23.3-842-gd46e9a00cdc",
685606
685606
  ...event,
685607
685607
  ...event.properties,
685608
685608
  usingAccessToken: false,
@@ -866664,7 +866664,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
866664
866664
  var LOGS_FOLDER_NAME = "logs";
866665
866665
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
866666
866666
  function getCliSource() {
866667
- const version7 = "5.23.3-839-gd570dc5b08c";
866667
+ const version7 = "5.23.3-842-gd46e9a00cdc";
866668
866668
  return `cli@${version7}`;
866669
866669
  }
866670
866670
  var DebugLogger = class {
@@ -898891,7 +898891,7 @@ var LegacyDocsPublisher = class {
898891
898891
  previewId,
898892
898892
  disableTemplates: void 0,
898893
898893
  skipUpload,
898894
- cliVersion: "5.23.3-839-gd570dc5b08c",
898894
+ cliVersion: "5.23.3-842-gd46e9a00cdc",
898895
898895
  loginCommand: "fern auth login"
898896
898896
  });
898897
898897
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -920485,6 +920485,7 @@ var DynamicSnippetsGeneratorContext = class _DynamicSnippetsGeneratorContext ext
920485
920485
  // ../../../generators/csharp/dynamic-snippets/lib/EndpointSnippetGenerator.js
920486
920486
  init_lib4();
920487
920487
  init_lodash();
920488
+ var REQUEST_PARAMETER_NAME = "request";
920488
920489
  var EndpointSnippetGenerator = class extends WithGeneration {
920489
920490
  context;
920490
920491
  constructor({ context: context3 }) {
@@ -920861,33 +920862,31 @@ var EndpointSnippetGenerator = class extends WithGeneration {
920861
920862
  }
920862
920863
  }
920863
920864
  getMethodArgsForInlinedRequest({ request: request7, snippet }) {
920864
- const args = [];
920865
920865
  this.context.errors.scope(Scope4.PathParameters);
920866
- const pathParameterFields = [];
920867
920866
  const pathParameters = [...this.context.ir.pathParameters ?? [], ...request7.pathParameters ?? []];
920868
- if (pathParameters.length > 0) {
920869
- pathParameterFields.push(...this.getPathParameters({ namedParameters: pathParameters, snippet }));
920870
- }
920867
+ const includePathParameters = this.context.includePathParametersInWrappedRequest({
920868
+ request: request7,
920869
+ inlinePathParameters: this.settings.shouldInlinePathParameters
920870
+ });
920871
+ const pathParameterFields = includePathParameters ? this.getPathParameters({ namedParameters: pathParameters, snippet }) : [];
920872
+ const separatePathParameterArgs = includePathParameters ? [] : this.getPathParameterArguments({ namedParameters: pathParameters, snippet });
920871
920873
  this.context.errors.unscope();
920872
920874
  this.context.errors.scope(Scope4.RequestBody);
920873
920875
  const filePropertyInfo = this.getFilePropertyInfo({ request: request7, snippet });
920874
920876
  this.context.errors.unscope();
920875
- if (!this.context.includePathParametersInWrappedRequest({
920876
- request: request7,
920877
- inlinePathParameters: this.settings.shouldInlinePathParameters
920878
- })) {
920879
- args.push(...pathParameterFields.map((field5) => field5.value));
920880
- }
920881
- args.push(this.getInlinedRequestArg({
920877
+ const requestArg = this.getInlinedRequestArg({
920882
920878
  request: request7,
920883
920879
  snippet,
920884
- pathParameterFields: this.context.includePathParametersInWrappedRequest({
920885
- request: request7,
920886
- inlinePathParameters: this.settings.shouldInlinePathParameters
920887
- }) ? pathParameterFields : [],
920880
+ pathParameterFields,
920888
920881
  filePropertyInfo
920889
- }));
920890
- return args;
920882
+ });
920883
+ if (separatePathParameterArgs.length > 0) {
920884
+ return [
920885
+ ...separatePathParameterArgs.map((arg) => this.namedArgument({ name: arg.name, value: arg.value })),
920886
+ this.namedArgument({ name: REQUEST_PARAMETER_NAME, value: requestArg })
920887
+ ];
920888
+ }
920889
+ return [requestArg];
920891
920890
  }
920892
920891
  getFilePropertyInfo({ request: request7, snippet }) {
920893
920892
  if (request7.body == null || !this.context.isFileUploadRequestBody(request7.body)) {
@@ -920999,20 +920998,44 @@ var EndpointSnippetGenerator = class extends WithGeneration {
920999
920998
  }
921000
920999
  }
921001
921000
  getMethodArgsForBodyRequest({ request: request7, snippet }) {
921002
- const args = [];
921003
921001
  this.context.errors.scope(Scope4.PathParameters);
921004
921002
  const pathParameters = [...this.context.ir.pathParameters ?? [], ...request7.pathParameters ?? []];
921005
- if (pathParameters.length > 0) {
921006
- args.push(...this.getPathParameters({ namedParameters: pathParameters, snippet }).map((field5) => field5.value));
921007
- }
921003
+ const pathParameterArgs = this.getPathParameterArguments({ namedParameters: pathParameters, snippet });
921008
921004
  this.context.errors.unscope();
921009
921005
  this.context.errors.scope(Scope4.RequestBody);
921010
- if (request7.body != null) {
921011
- args.push(this.getBodyRequestArg({ body: request7.body, value: snippet.requestBody }));
921012
- }
921006
+ const bodyArg = request7.body != null ? this.getBodyRequestArg({ body: request7.body, value: snippet.requestBody }) : void 0;
921013
921007
  this.context.errors.unscope();
921008
+ if (pathParameterArgs.length > 0 && bodyArg != null) {
921009
+ return [
921010
+ ...pathParameterArgs.map((arg) => this.namedArgument({ name: arg.name, value: arg.value })),
921011
+ this.namedArgument({ name: REQUEST_PARAMETER_NAME, value: bodyArg })
921012
+ ];
921013
+ }
921014
+ const args = pathParameterArgs.map((arg) => arg.value);
921015
+ if (bodyArg != null) {
921016
+ args.push(bodyArg);
921017
+ }
921014
921018
  return args;
921015
921019
  }
921020
+ getPathParameterArguments({ namedParameters, snippet }) {
921021
+ const pathParameters = this.context.associateByWireValueOrDefault({
921022
+ parameters: namedParameters,
921023
+ values: snippet.pathParameters ?? {}
921024
+ });
921025
+ return pathParameters.map((parameter6) => ({
921026
+ name: this.context.getParameterName(parameter6.name.name),
921027
+ value: this.context.dynamicLiteralMapper.convert({
921028
+ ...parameter6,
921029
+ fallbackToDefault: parameter6.name.wireValue
921030
+ })
921031
+ }));
921032
+ }
921033
+ namedArgument({ name: name2, value: value2 }) {
921034
+ return this.csharp.codeblock((writer2) => {
921035
+ writer2.write(`${name2}: `);
921036
+ writer2.writeNode(value2);
921037
+ });
921038
+ }
921016
921039
  getBodyRequestArg({ body, value: value2 }) {
921017
921040
  switch (body.type) {
921018
921041
  case "bytes": {
@@ -964940,7 +964963,7 @@ function getAutomationContextFromEnv() {
964940
964963
  config_branch: process.env.FERN_CONFIG_BRANCH,
964941
964964
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
964942
964965
  trigger: process.env.GITHUB_EVENT_NAME,
964943
- cli_version: "5.23.3-839-gd570dc5b08c"
964966
+ cli_version: "5.23.3-842-gd46e9a00cdc"
964944
964967
  };
964945
964968
  }
964946
964969
  function isAutomationMode() {
@@ -965772,7 +965795,7 @@ var CliContext = class _CliContext {
965772
965795
  if (false) {
965773
965796
  this.logger.error("CLI_VERSION is not defined");
965774
965797
  }
965775
- return "5.23.3-839-gd570dc5b08c";
965798
+ return "5.23.3-842-gd46e9a00cdc";
965776
965799
  }
965777
965800
  getCliName() {
965778
965801
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.23.3-839-gd570dc5b08c",
2
+ "version": "5.23.3-842-gd46e9a00cdc",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",