@fern-api/fern-api-dev 5.44.11 → 5.44.13
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.
- package/cli.cjs +89 -21
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -660747,7 +660747,7 @@ var NoConflictingParameterNamesRule = {
|
|
|
660747
660747
|
const mergedParams = mergeParameters(pathLevelParams, operationParams);
|
|
660748
660748
|
const nameToParams = {};
|
|
660749
660749
|
for (const param of mergedParams) {
|
|
660750
|
-
const normalizedName = toCamelCase3(param.name);
|
|
660750
|
+
const normalizedName = toCamelCase3(param.fernParameterName ?? param.name);
|
|
660751
660751
|
if (normalizedName === "") {
|
|
660752
660752
|
continue;
|
|
660753
660753
|
}
|
|
@@ -660762,7 +660762,10 @@ var NoConflictingParameterNamesRule = {
|
|
|
660762
660762
|
if (distinctTypes.size <= 1) {
|
|
660763
660763
|
continue;
|
|
660764
660764
|
}
|
|
660765
|
-
const paramDescriptions = params2.map((p14) =>
|
|
660765
|
+
const paramDescriptions = params2.map((p14) => {
|
|
660766
|
+
const effectiveName = p14.fernParameterName ?? p14.name;
|
|
660767
|
+
return `${p14.in} parameter '${effectiveName}'`;
|
|
660768
|
+
}).join(", ");
|
|
660766
660769
|
violations.push({
|
|
660767
660770
|
name: "no-conflicting-parameter-names",
|
|
660768
660771
|
severity: "error",
|
|
@@ -660821,7 +660824,8 @@ function resolveParam(param, api2, visited = /* @__PURE__ */ new Set()) {
|
|
|
660821
660824
|
return void 0;
|
|
660822
660825
|
}
|
|
660823
660826
|
if (typeof paramObj.in === "string" && typeof paramObj.name === "string") {
|
|
660824
|
-
|
|
660827
|
+
const fernParameterName = typeof paramObj["x-fern-parameter-name"] === "string" ? paramObj["x-fern-parameter-name"] : void 0;
|
|
660828
|
+
return { in: paramObj.in, name: paramObj.name, fernParameterName };
|
|
660825
660829
|
}
|
|
660826
660830
|
return void 0;
|
|
660827
660831
|
}
|
|
@@ -669562,7 +669566,7 @@ var AccessTokenPosthogManager = class {
|
|
|
669562
669566
|
properties: {
|
|
669563
669567
|
...event,
|
|
669564
669568
|
...event.properties,
|
|
669565
|
-
version: "5.44.
|
|
669569
|
+
version: "5.44.13",
|
|
669566
669570
|
usingAccessToken: true,
|
|
669567
669571
|
...getRunIdProperties()
|
|
669568
669572
|
}
|
|
@@ -669626,7 +669630,7 @@ var UserPosthogManager = class {
|
|
|
669626
669630
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
669627
669631
|
event: "CLI",
|
|
669628
669632
|
properties: {
|
|
669629
|
-
version: "5.44.
|
|
669633
|
+
version: "5.44.13",
|
|
669630
669634
|
...event,
|
|
669631
669635
|
...event.properties,
|
|
669632
669636
|
usingAccessToken: false,
|
|
@@ -861367,7 +861371,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
861367
861371
|
var LOGS_FOLDER_NAME = "logs";
|
|
861368
861372
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
861369
861373
|
function getCliSource() {
|
|
861370
|
-
const version7 = "5.44.
|
|
861374
|
+
const version7 = "5.44.13";
|
|
861371
861375
|
return `cli@${version7}`;
|
|
861372
861376
|
}
|
|
861373
861377
|
var DebugLogger = class {
|
|
@@ -892459,7 +892463,7 @@ var LegacyDocsPublisher = class {
|
|
|
892459
892463
|
previewId,
|
|
892460
892464
|
disableTemplates: void 0,
|
|
892461
892465
|
skipUpload,
|
|
892462
|
-
cliVersion: "5.44.
|
|
892466
|
+
cliVersion: "5.44.13",
|
|
892463
892467
|
loginCommand: "fern auth login"
|
|
892464
892468
|
});
|
|
892465
892469
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -925028,14 +925032,25 @@ var EndpointSnippetGenerator5 = class {
|
|
|
925028
925032
|
getMethodArgsForBodyRequest({ request: request7, snippet: snippet2 }) {
|
|
925029
925033
|
const args = [];
|
|
925030
925034
|
this.context.errors.scope(Scope4.PathParameters);
|
|
925031
|
-
const
|
|
925032
|
-
|
|
925033
|
-
|
|
925035
|
+
const irPathParameters = this.context.ir.pathParameters ?? [];
|
|
925036
|
+
const requiredIrPathParameters = irPathParameters.filter((p14) => p14.variable == null);
|
|
925037
|
+
const optionalIrPathParameters = irPathParameters.filter((p14) => p14.variable != null);
|
|
925038
|
+
const requiredPathParameters = [...requiredIrPathParameters, ...request7.pathParameters ?? []];
|
|
925039
|
+
if (requiredPathParameters.length > 0) {
|
|
925040
|
+
args.push(...this.getPathParameters({ namedParameters: requiredPathParameters, snippet: snippet2 }).map((field5) => field5.value));
|
|
925034
925041
|
}
|
|
925035
925042
|
this.context.errors.unscope();
|
|
925036
925043
|
this.context.errors.scope(Scope4.RequestBody);
|
|
925037
925044
|
if (request7.body != null) {
|
|
925038
|
-
|
|
925045
|
+
const bodyArg = this.getBodyRequestArg({ body: request7.body, value: snippet2.requestBody });
|
|
925046
|
+
if (!php_exports.TypeLiteral.isNop(bodyArg)) {
|
|
925047
|
+
args.push(bodyArg);
|
|
925048
|
+
}
|
|
925049
|
+
}
|
|
925050
|
+
this.context.errors.unscope();
|
|
925051
|
+
this.context.errors.scope(Scope4.PathParameters);
|
|
925052
|
+
if (optionalIrPathParameters.length > 0) {
|
|
925053
|
+
args.push(...this.getPathParameters({ namedParameters: optionalIrPathParameters, snippet: snippet2 }).map((field5) => field5.value));
|
|
925039
925054
|
}
|
|
925040
925055
|
this.context.errors.unscope();
|
|
925041
925056
|
return args;
|
|
@@ -925062,17 +925077,25 @@ var EndpointSnippetGenerator5 = class {
|
|
|
925062
925077
|
const args = [];
|
|
925063
925078
|
const inlinePathParameters = this.context.customConfig?.inlinePathParameters ?? false;
|
|
925064
925079
|
this.context.errors.scope(Scope4.PathParameters);
|
|
925065
|
-
const
|
|
925066
|
-
const
|
|
925067
|
-
|
|
925068
|
-
|
|
925069
|
-
|
|
925080
|
+
const irPathParameters = this.context.ir.pathParameters ?? [];
|
|
925081
|
+
const requiredIrPathParameters = irPathParameters.filter((p14) => p14.variable == null);
|
|
925082
|
+
const optionalIrPathParameters = irPathParameters.filter((p14) => p14.variable != null);
|
|
925083
|
+
const requiredPathParameterFields = [];
|
|
925084
|
+
const requiredPathParams = [...requiredIrPathParameters, ...request7.pathParameters ?? []];
|
|
925085
|
+
if (requiredPathParams.length > 0) {
|
|
925086
|
+
requiredPathParameterFields.push(...this.getPathParameters({ namedParameters: requiredPathParams, snippet: snippet2 }));
|
|
925087
|
+
}
|
|
925088
|
+
const optionalPathParameterFields = [];
|
|
925089
|
+
if (optionalIrPathParameters.length > 0) {
|
|
925090
|
+
optionalPathParameterFields.push(...this.getPathParameters({ namedParameters: optionalIrPathParameters, snippet: snippet2 }));
|
|
925091
|
+
}
|
|
925092
|
+
const pathParameterFields = [...requiredPathParameterFields, ...optionalPathParameterFields];
|
|
925070
925093
|
this.context.errors.unscope();
|
|
925071
925094
|
this.context.errors.scope(Scope4.RequestBody);
|
|
925072
925095
|
const filePropertyInfo = this.getFilePropertyInfo({ request: request7, snippet: snippet2 });
|
|
925073
925096
|
this.context.errors.unscope();
|
|
925074
925097
|
if (!this.context.includePathParametersInWrappedRequest({ request: request7, inlinePathParameters })) {
|
|
925075
|
-
args.push(...
|
|
925098
|
+
args.push(...requiredPathParameterFields.map((field5) => field5.value));
|
|
925076
925099
|
}
|
|
925077
925100
|
if (this.context.needsRequestParameter({
|
|
925078
925101
|
request: request7,
|
|
@@ -925090,6 +925113,9 @@ var EndpointSnippetGenerator5 = class {
|
|
|
925090
925113
|
filePropertyInfo
|
|
925091
925114
|
}));
|
|
925092
925115
|
}
|
|
925116
|
+
if (!this.context.includePathParametersInWrappedRequest({ request: request7, inlinePathParameters })) {
|
|
925117
|
+
args.push(...optionalPathParameterFields.map((field5) => field5.value));
|
|
925118
|
+
}
|
|
925093
925119
|
return args;
|
|
925094
925120
|
}
|
|
925095
925121
|
getFilePropertyInfo({ request: request7, snippet: snippet2 }) {
|
|
@@ -941307,7 +941333,7 @@ var DynamicSnippetsSwiftTestGenerator = class {
|
|
|
941307
941333
|
idx
|
|
941308
941334
|
});
|
|
941309
941335
|
await (0, import_promises127.mkdir)(import_node_path40.default.dirname(dynamicSnippetFilePath), { recursive: true });
|
|
941310
|
-
await (0, import_promises127.writeFile)(dynamicSnippetFilePath, response.snippet);
|
|
941336
|
+
await (0, import_promises127.writeFile)(dynamicSnippetFilePath, this.wrapSnippetAsLibrary(response.snippet, `Example${idx}`));
|
|
941311
941337
|
} catch (error50) {
|
|
941312
941338
|
this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
|
|
941313
941339
|
}
|
|
@@ -941315,14 +941341,56 @@ var DynamicSnippetsSwiftTestGenerator = class {
|
|
|
941315
941341
|
this.context.logger.debug("Done generating dynamic snippet tests");
|
|
941316
941342
|
}
|
|
941317
941343
|
async initializeProject(outputDir) {
|
|
941318
|
-
const absolutePathToOutputDir = join8(outputDir, RelativeFilePath2.of("Snippets"));
|
|
941344
|
+
const absolutePathToOutputDir = join8(outputDir, RelativeFilePath2.of("Tests/Snippets"));
|
|
941319
941345
|
await (0, import_promises127.mkdir)(absolutePathToOutputDir, { recursive: true });
|
|
941320
941346
|
return absolutePathToOutputDir;
|
|
941321
941347
|
}
|
|
941322
941348
|
getTestFilePath({ absolutePathToOutputDir, idx }) {
|
|
941323
941349
|
return join8(absolutePathToOutputDir, RelativeFilePath2.of(`Example${idx}.swift`));
|
|
941324
941350
|
}
|
|
941351
|
+
wrapSnippetAsLibrary(snippet2, enumName) {
|
|
941352
|
+
return wrapSnippetAsLibrary({
|
|
941353
|
+
snippet: snippet2,
|
|
941354
|
+
enumName,
|
|
941355
|
+
warn: (message) => this.context.logger.warn(message)
|
|
941356
|
+
});
|
|
941357
|
+
}
|
|
941325
941358
|
};
|
|
941359
|
+
function wrapSnippetAsLibrary({ snippet: snippet2, enumName, warn: warn2 }) {
|
|
941360
|
+
const FUNC_DECL = "private func main() async throws {";
|
|
941361
|
+
const FUNC_INVOCATION = "try await main()";
|
|
941362
|
+
if (!snippet2.includes(FUNC_DECL)) {
|
|
941363
|
+
warn2(`Snippet ${enumName} does not match expected format (missing '${FUNC_DECL}'). Writing raw snippet.`);
|
|
941364
|
+
return snippet2;
|
|
941365
|
+
}
|
|
941366
|
+
const lines = snippet2.trimEnd().split("\n");
|
|
941367
|
+
const result = [];
|
|
941368
|
+
let insideFunc = false;
|
|
941369
|
+
let foundInvocation = false;
|
|
941370
|
+
for (const line of lines) {
|
|
941371
|
+
if (line.trimEnd() === FUNC_DECL) {
|
|
941372
|
+
result.push(`enum ${enumName} {`);
|
|
941373
|
+
result.push(" static func snippet() async throws {");
|
|
941374
|
+
insideFunc = true;
|
|
941375
|
+
} else if (line.trimEnd() === FUNC_INVOCATION) {
|
|
941376
|
+
foundInvocation = true;
|
|
941377
|
+
} else if (insideFunc) {
|
|
941378
|
+
result.push(line === "" ? "" : ` ${line}`);
|
|
941379
|
+
} else {
|
|
941380
|
+
result.push(line);
|
|
941381
|
+
}
|
|
941382
|
+
}
|
|
941383
|
+
if (!foundInvocation) {
|
|
941384
|
+
warn2(`Snippet ${enumName} missing expected '${FUNC_INVOCATION}'. Writing raw snippet.`);
|
|
941385
|
+
return snippet2;
|
|
941386
|
+
}
|
|
941387
|
+
while (result.length > 0 && result[result.length - 1] === "") {
|
|
941388
|
+
result.pop();
|
|
941389
|
+
}
|
|
941390
|
+
result.push("}");
|
|
941391
|
+
result.push("");
|
|
941392
|
+
return result.join("\n");
|
|
941393
|
+
}
|
|
941326
941394
|
|
|
941327
941395
|
// ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/typescript/DynamicSnippetsTypeScriptTestGenerator.js
|
|
941328
941396
|
init_lib8();
|
|
@@ -957556,7 +957624,7 @@ function getAutomationContextFromEnv() {
|
|
|
957556
957624
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
957557
957625
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
957558
957626
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
957559
|
-
cli_version: "5.44.
|
|
957627
|
+
cli_version: "5.44.13"
|
|
957560
957628
|
};
|
|
957561
957629
|
}
|
|
957562
957630
|
function isAutomationMode() {
|
|
@@ -958382,7 +958450,7 @@ var CliContext = class _CliContext {
|
|
|
958382
958450
|
if (false) {
|
|
958383
958451
|
this.logger.error("CLI_VERSION is not defined");
|
|
958384
958452
|
}
|
|
958385
|
-
return "5.44.
|
|
958453
|
+
return "5.44.13";
|
|
958386
958454
|
}
|
|
958387
958455
|
getCliName() {
|
|
958388
958456
|
if (false) {
|
package/package.json
CHANGED