@fern-api/fern-api-dev 5.33.3 → 5.33.5
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 +63 -28
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -606677,6 +606677,7 @@ function buildUrl({ file: file4, service, endpoint: endpoint3, pathParams }) {
|
|
|
606677
606677
|
|
|
606678
606678
|
// ../generation/ir-generator/lib/converters/services/convertHttpResponse.js
|
|
606679
606679
|
init_lib4();
|
|
606680
|
+
init_lib6();
|
|
606680
606681
|
function convertHttpResponse({ endpoint: endpoint3, file: file4, typeResolver }) {
|
|
606681
606682
|
const responseBody = convertHttpResponseBody({
|
|
606682
606683
|
endpoint: endpoint3,
|
|
@@ -606800,11 +606801,8 @@ function convertJsonResponse(response, docs2, file4, typeResolver) {
|
|
|
606800
606801
|
if (responseTypeReference == null) {
|
|
606801
606802
|
return void 0;
|
|
606802
606803
|
}
|
|
606803
|
-
const responseBodyType =
|
|
606804
|
-
const resolvedType =
|
|
606805
|
-
type: responseTypeReference,
|
|
606806
|
-
file: file4
|
|
606807
|
-
});
|
|
606804
|
+
const responseBodyType = parseJsonResponseTypeReference({ response, responseTypeReference, file: file4 });
|
|
606805
|
+
const resolvedType = resolveJsonResponseType({ responseTypeReference, file: file4, typeResolver });
|
|
606808
606806
|
const responseProperty = typeof response !== "string" ? response.property : void 0;
|
|
606809
606807
|
if (responseProperty != null) {
|
|
606810
606808
|
return HttpResponseBody.json(JsonResponse.nestedPropertyAsResponse({
|
|
@@ -606825,6 +606823,32 @@ function convertJsonResponse(response, docs2, file4, typeResolver) {
|
|
|
606825
606823
|
v2Examples: void 0
|
|
606826
606824
|
}));
|
|
606827
606825
|
}
|
|
606826
|
+
function parseJsonResponseTypeReference({ response, responseTypeReference, file: file4 }) {
|
|
606827
|
+
try {
|
|
606828
|
+
return file4.parseTypeReference(typeof response === "string" ? response : { ...response, type: responseTypeReference });
|
|
606829
|
+
} catch (error50) {
|
|
606830
|
+
throw toResponseTypeValidationError({ error: error50, responseTypeReference });
|
|
606831
|
+
}
|
|
606832
|
+
}
|
|
606833
|
+
function resolveJsonResponseType({ responseTypeReference, file: file4, typeResolver }) {
|
|
606834
|
+
try {
|
|
606835
|
+
return typeResolver.resolveTypeOrThrow({
|
|
606836
|
+
type: responseTypeReference,
|
|
606837
|
+
file: file4
|
|
606838
|
+
});
|
|
606839
|
+
} catch (error50) {
|
|
606840
|
+
throw toResponseTypeValidationError({ error: error50, responseTypeReference });
|
|
606841
|
+
}
|
|
606842
|
+
}
|
|
606843
|
+
function toResponseTypeValidationError({ error: error50, responseTypeReference }) {
|
|
606844
|
+
if (error50 instanceof CliError && error50.code === CliError.Code.ResolutionError) {
|
|
606845
|
+
return new CliError({
|
|
606846
|
+
message: `Response type ${responseTypeReference} is not defined.`,
|
|
606847
|
+
code: CliError.Code.ValidationError
|
|
606848
|
+
});
|
|
606849
|
+
}
|
|
606850
|
+
return error50;
|
|
606851
|
+
}
|
|
606828
606852
|
|
|
606829
606853
|
// ../generation/ir-generator/lib/converters/services/convertPagination.js
|
|
606830
606854
|
init_lib4();
|
|
@@ -658834,25 +658858,36 @@ async function detectAirGappedMode(url3, logger4, timeoutMs = 5e3) {
|
|
|
658834
658858
|
}
|
|
658835
658859
|
async function performAirGapDetection(url3, logger4, timeoutMs) {
|
|
658836
658860
|
logger4.debug(`Detecting air-gapped mode by checking connectivity to ${url3}`);
|
|
658837
|
-
|
|
658838
|
-
|
|
658839
|
-
|
|
658840
|
-
|
|
658841
|
-
|
|
658842
|
-
|
|
658843
|
-
|
|
658844
|
-
|
|
658845
|
-
|
|
658846
|
-
|
|
658847
|
-
|
|
658848
|
-
|
|
658849
|
-
|
|
658850
|
-
|
|
658851
|
-
|
|
658861
|
+
const maxAttempts = 3;
|
|
658862
|
+
let lastErrorMessage;
|
|
658863
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
658864
|
+
try {
|
|
658865
|
+
const res = await fetch(url3, {
|
|
658866
|
+
method: "GET",
|
|
658867
|
+
signal: AbortSignal.timeout(timeoutMs)
|
|
658868
|
+
});
|
|
658869
|
+
await res.body?.cancel().catch(() => void 0);
|
|
658870
|
+
airGapDetectionResult = false;
|
|
658871
|
+
logger4.debug("Network check succeeded - not in air-gapped mode");
|
|
658872
|
+
return false;
|
|
658873
|
+
} catch (error50) {
|
|
658874
|
+
const errorMessage = extractErrorMessage(error50);
|
|
658875
|
+
const causeMessage = error50 instanceof Error && error50.cause ? ` (cause: ${extractErrorMessage(error50.cause)})` : "";
|
|
658876
|
+
lastErrorMessage = `${errorMessage}${causeMessage}`;
|
|
658877
|
+
if (!isNetworkError(errorMessage)) {
|
|
658878
|
+
airGapDetectionResult = false;
|
|
658879
|
+
return false;
|
|
658880
|
+
}
|
|
658881
|
+
if (attempt < maxAttempts) {
|
|
658882
|
+
const delayMs = attempt * 500;
|
|
658883
|
+
logger4.debug(`Network check attempt ${attempt}/${maxAttempts} failed: ${lastErrorMessage} \u2014 retrying in ${delayMs}ms`);
|
|
658884
|
+
await new Promise((resolve15) => setTimeout(resolve15, delayMs));
|
|
658885
|
+
}
|
|
658852
658886
|
}
|
|
658853
|
-
airGapDetectionResult = false;
|
|
658854
|
-
return false;
|
|
658855
658887
|
}
|
|
658888
|
+
airGapDetectionResult = true;
|
|
658889
|
+
logger4.debug(`Network check failed after ${maxAttempts} attempts - entering air-gapped mode: ${lastErrorMessage}`);
|
|
658890
|
+
return true;
|
|
658856
658891
|
}
|
|
658857
658892
|
async function detectAirGappedModeForProtobuf(absoluteFilepathToProtobufRoot, logger4, bufCommand = "buf") {
|
|
658858
658893
|
const bufLockPath = join8(absoluteFilepathToProtobufRoot, RelativeFilePath2.of("buf.lock"));
|
|
@@ -668443,7 +668478,7 @@ var AccessTokenPosthogManager = class {
|
|
|
668443
668478
|
properties: {
|
|
668444
668479
|
...event,
|
|
668445
668480
|
...event.properties,
|
|
668446
|
-
version: "5.33.
|
|
668481
|
+
version: "5.33.5",
|
|
668447
668482
|
usingAccessToken: true,
|
|
668448
668483
|
...getRunIdProperties()
|
|
668449
668484
|
}
|
|
@@ -668507,7 +668542,7 @@ var UserPosthogManager = class {
|
|
|
668507
668542
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
668508
668543
|
event: "CLI",
|
|
668509
668544
|
properties: {
|
|
668510
|
-
version: "5.33.
|
|
668545
|
+
version: "5.33.5",
|
|
668511
668546
|
...event,
|
|
668512
668547
|
...event.properties,
|
|
668513
668548
|
usingAccessToken: false,
|
|
@@ -860304,7 +860339,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
860304
860339
|
var LOGS_FOLDER_NAME = "logs";
|
|
860305
860340
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
860306
860341
|
function getCliSource() {
|
|
860307
|
-
const version7 = "5.33.
|
|
860342
|
+
const version7 = "5.33.5";
|
|
860308
860343
|
return `cli@${version7}`;
|
|
860309
860344
|
}
|
|
860310
860345
|
var DebugLogger = class {
|
|
@@ -879150,7 +879185,7 @@ var LegacyDocsPublisher = class {
|
|
|
879150
879185
|
previewId,
|
|
879151
879186
|
disableTemplates: void 0,
|
|
879152
879187
|
skipUpload,
|
|
879153
|
-
cliVersion: "5.33.
|
|
879188
|
+
cliVersion: "5.33.5",
|
|
879154
879189
|
loginCommand: "fern auth login"
|
|
879155
879190
|
});
|
|
879156
879191
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -953850,7 +953885,7 @@ function getAutomationContextFromEnv() {
|
|
|
953850
953885
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
953851
953886
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
953852
953887
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
953853
|
-
cli_version: "5.33.
|
|
953888
|
+
cli_version: "5.33.5"
|
|
953854
953889
|
};
|
|
953855
953890
|
}
|
|
953856
953891
|
function isAutomationMode() {
|
|
@@ -954676,7 +954711,7 @@ var CliContext = class _CliContext {
|
|
|
954676
954711
|
if (false) {
|
|
954677
954712
|
this.logger.error("CLI_VERSION is not defined");
|
|
954678
954713
|
}
|
|
954679
|
-
return "5.33.
|
|
954714
|
+
return "5.33.5";
|
|
954680
954715
|
}
|
|
954681
954716
|
getCliName() {
|
|
954682
954717
|
if (false) {
|
package/package.json
CHANGED