@fern-api/fern-api-dev 5.55.2 → 5.56.1
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 +450 -274
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -99819,8 +99819,8 @@ var require_graceful_fs = __commonJS({
|
|
|
99819
99819
|
}
|
|
99820
99820
|
}
|
|
99821
99821
|
var fs$writeFile = fs35.writeFile;
|
|
99822
|
-
fs35.writeFile =
|
|
99823
|
-
function
|
|
99822
|
+
fs35.writeFile = writeFile99;
|
|
99823
|
+
function writeFile99(path119, data2, options2, cb) {
|
|
99824
99824
|
if (typeof options2 === "function")
|
|
99825
99825
|
cb = options2, options2 = null;
|
|
99826
99826
|
return go$writeFile(path119, data2, options2, cb);
|
|
@@ -129372,7 +129372,8 @@ var init_OpenApiSettingsSchema2 = __esm({
|
|
|
129372
129372
|
"resolve-aliases": ResolveAliases.optional(),
|
|
129373
129373
|
"group-multi-api-environments": schemas_exports8.boolean().optional(),
|
|
129374
129374
|
"default-integer-format": DefaultIntegerFormat2.optional(),
|
|
129375
|
-
"infer-discriminated-union-base-properties": schemas_exports8.boolean().optional()
|
|
129375
|
+
"infer-discriminated-union-base-properties": schemas_exports8.boolean().optional(),
|
|
129376
|
+
"disambiguate-request-names": schemas_exports8.boolean().optional()
|
|
129376
129377
|
}).extend(BaseApiSettingsSchema);
|
|
129377
129378
|
}
|
|
129378
129379
|
});
|
|
@@ -150769,7 +150770,8 @@ var init_options2 = __esm({
|
|
|
150769
150770
|
inferForwardCompatible: false,
|
|
150770
150771
|
coerceConstsTo: "enums-coerceable-to-literals",
|
|
150771
150772
|
respectByteFormat: false,
|
|
150772
|
-
shouldInferDiscriminatedUnionBaseProperties: false
|
|
150773
|
+
shouldInferDiscriminatedUnionBaseProperties: false,
|
|
150774
|
+
disambiguateRequestNames: true
|
|
150773
150775
|
};
|
|
150774
150776
|
}
|
|
150775
150777
|
});
|
|
@@ -164834,6 +164836,9 @@ function endpointHasNonRequestBodyParameters({ context: context3, convertedParam
|
|
|
164834
164836
|
function getDisambiguatedRequestName({ baseBreadcrumbs, requestBreadcrumbs, isMultipleRequests, request: request7, context: context3 }) {
|
|
164835
164837
|
const nameBreadcrumbs = isMultipleRequests ? getDifferentiatedBreadcrumbs({ breadcrumbs: requestBreadcrumbs, request: request7 }) : requestBreadcrumbs;
|
|
164836
164838
|
const computedName = getGeneratedTypeName(nameBreadcrumbs, context3.options.preserveSchemaIds);
|
|
164839
|
+
if (!context3.options.disambiguateRequestNames) {
|
|
164840
|
+
return computedName;
|
|
164841
|
+
}
|
|
164837
164842
|
const componentSchemas = context3.document.components?.schemas;
|
|
164838
164843
|
if (componentSchemas == null) {
|
|
164839
164844
|
return computedName;
|
|
@@ -197626,7 +197631,8 @@ var init_getAPIDefinitionSettings = __esm({
|
|
|
197626
197631
|
resolveSchemaCollisions: "resolveSchemaCollisions",
|
|
197627
197632
|
inferForwardCompatible: "inferForwardCompatible",
|
|
197628
197633
|
coerceConstsTo: "coerceConstsTo",
|
|
197629
|
-
shouldInferDiscriminatedUnionBaseProperties: "shouldInferDiscriminatedUnionBaseProperties"
|
|
197634
|
+
shouldInferDiscriminatedUnionBaseProperties: "shouldInferDiscriminatedUnionBaseProperties",
|
|
197635
|
+
disambiguateRequestNames: "disambiguateRequestNames"
|
|
197630
197636
|
};
|
|
197631
197637
|
}
|
|
197632
197638
|
});
|
|
@@ -259145,7 +259151,8 @@ function parseOpenApiDefinitionSettingsSchema(settings) {
|
|
|
259145
259151
|
multiServerStrategy: settings?.["multi-server-strategy"],
|
|
259146
259152
|
defaultIntegerFormat: settings?.["default-integer-format"],
|
|
259147
259153
|
pathParameterOrder: settings?.["path-parameter-order"],
|
|
259148
|
-
shouldInferDiscriminatedUnionBaseProperties: settings?.["infer-discriminated-union-base-properties"]
|
|
259154
|
+
shouldInferDiscriminatedUnionBaseProperties: settings?.["infer-discriminated-union-base-properties"],
|
|
259155
|
+
disambiguateRequestNames: settings?.["disambiguate-request-names"]
|
|
259149
259156
|
};
|
|
259150
259157
|
}
|
|
259151
259158
|
function parseAsyncApiDefinitionSettingsSchema(settings) {
|
|
@@ -260004,7 +260011,8 @@ var init_convertGeneratorsConfiguration = __esm({
|
|
|
260004
260011
|
resolveSchemaCollisions: void 0,
|
|
260005
260012
|
inferForwardCompatible: void 0,
|
|
260006
260013
|
coerceConstsTo: void 0,
|
|
260007
|
-
shouldInferDiscriminatedUnionBaseProperties: void 0
|
|
260014
|
+
shouldInferDiscriminatedUnionBaseProperties: void 0,
|
|
260015
|
+
disambiguateRequestNames: void 0
|
|
260008
260016
|
};
|
|
260009
260017
|
}
|
|
260010
260018
|
});
|
|
@@ -454794,129 +454802,20 @@ var init_lib65 = __esm({
|
|
|
454794
454802
|
}
|
|
454795
454803
|
});
|
|
454796
454804
|
|
|
454797
|
-
// ../register/lib/ai-example-enhancer/
|
|
454798
|
-
|
|
454799
|
-
|
|
454800
|
-
|
|
454801
|
-
}
|
|
454802
|
-
const obj = value2;
|
|
454803
|
-
const keys25 = Object.keys(obj);
|
|
454804
|
-
if (keys25.length === 0 || keys25.length > 2) {
|
|
454805
|
-
return false;
|
|
454806
|
-
}
|
|
454807
|
-
const hasType = "type" in obj && typeof obj.type === "string";
|
|
454808
|
-
const hasValue = "value" in obj;
|
|
454809
|
-
return hasType && keys25.length === 1 || hasType && hasValue && keys25.length === 2 || hasValue && keys25.length === 1;
|
|
454810
|
-
}
|
|
454811
|
-
function unwrapExampleValue(value2) {
|
|
454812
|
-
if (value2 === null || value2 === void 0) {
|
|
454813
|
-
return value2;
|
|
454814
|
-
}
|
|
454815
|
-
if (Array.isArray(value2)) {
|
|
454816
|
-
return value2.map(unwrapExampleValue);
|
|
454817
|
-
}
|
|
454818
|
-
if (typeof value2 !== "object") {
|
|
454819
|
-
return value2;
|
|
454820
|
-
}
|
|
454821
|
-
const obj = value2;
|
|
454822
|
-
if (isFdrTypedValueWrapper(obj)) {
|
|
454823
|
-
if ("value" in obj) {
|
|
454824
|
-
return unwrapExampleValue(obj.value);
|
|
454825
|
-
}
|
|
454826
|
-
return void 0;
|
|
454827
|
-
}
|
|
454828
|
-
const result = {};
|
|
454829
|
-
for (const [key2, val] of Object.entries(obj)) {
|
|
454830
|
-
const unwrapped = unwrapExampleValue(val);
|
|
454831
|
-
if (unwrapped !== void 0) {
|
|
454832
|
-
result[key2] = unwrapped;
|
|
454833
|
-
}
|
|
454834
|
-
}
|
|
454835
|
-
return result;
|
|
454836
|
-
}
|
|
454837
|
-
function isEmptyObject3(value2) {
|
|
454838
|
-
if (value2 === null || value2 === void 0) {
|
|
454839
|
-
return true;
|
|
454840
|
-
}
|
|
454841
|
-
if (typeof value2 !== "object") {
|
|
454842
|
-
return false;
|
|
454843
|
-
}
|
|
454844
|
-
if (Array.isArray(value2)) {
|
|
454845
|
-
return value2.length === 0;
|
|
454846
|
-
}
|
|
454847
|
-
return Object.keys(value2).length === 0;
|
|
454848
|
-
}
|
|
454849
|
-
function filterRequestBody(requestBody, pathParameters, queryParameters, headers2) {
|
|
454850
|
-
const extractedPathParams = {};
|
|
454851
|
-
const extractedQueryParams = {};
|
|
454852
|
-
const extractedHeaders = {};
|
|
454853
|
-
if (requestBody === null || requestBody === void 0 || typeof requestBody !== "object" || Array.isArray(requestBody)) {
|
|
454854
|
-
return { filteredBody: requestBody, extractedPathParams, extractedQueryParams, extractedHeaders };
|
|
454855
|
-
}
|
|
454856
|
-
const bodyRecord = requestBody;
|
|
454857
|
-
const filteredBody = {};
|
|
454858
|
-
const pathParamKeys = new Set(Object.keys(pathParameters ?? {}));
|
|
454859
|
-
const queryParamKeys = new Set(Object.keys(queryParameters ?? {}));
|
|
454860
|
-
const headerKeys = new Set(Object.keys(headers2 ?? {}));
|
|
454861
|
-
for (const [key2, value2] of Object.entries(bodyRecord)) {
|
|
454862
|
-
const normalizedKey = key2.toLowerCase().replace(/[-_]/g, "");
|
|
454863
|
-
let isPathParam = false;
|
|
454864
|
-
let isQueryParam = false;
|
|
454865
|
-
let isHeader = false;
|
|
454866
|
-
for (const pathKey of pathParamKeys) {
|
|
454867
|
-
const normalizedPathKey = pathKey.toLowerCase().replace(/[-_]/g, "");
|
|
454868
|
-
if (normalizedKey === normalizedPathKey) {
|
|
454869
|
-
isPathParam = true;
|
|
454870
|
-
extractedPathParams[pathKey] = value2;
|
|
454871
|
-
break;
|
|
454872
|
-
}
|
|
454873
|
-
}
|
|
454874
|
-
if (!isPathParam) {
|
|
454875
|
-
for (const queryKey of queryParamKeys) {
|
|
454876
|
-
const normalizedQueryKey = queryKey.toLowerCase().replace(/[-_]/g, "");
|
|
454877
|
-
if (normalizedKey === normalizedQueryKey) {
|
|
454878
|
-
isQueryParam = true;
|
|
454879
|
-
extractedQueryParams[queryKey] = value2;
|
|
454880
|
-
break;
|
|
454881
|
-
}
|
|
454882
|
-
}
|
|
454883
|
-
}
|
|
454884
|
-
if (!isPathParam && !isQueryParam) {
|
|
454885
|
-
for (const headerKey of headerKeys) {
|
|
454886
|
-
const normalizedHeaderKey = headerKey.toLowerCase().replace(/[-_]/g, "");
|
|
454887
|
-
if (normalizedKey === normalizedHeaderKey) {
|
|
454888
|
-
isHeader = true;
|
|
454889
|
-
extractedHeaders[headerKey] = value2;
|
|
454890
|
-
break;
|
|
454891
|
-
}
|
|
454892
|
-
}
|
|
454893
|
-
}
|
|
454894
|
-
if (!isPathParam && !isQueryParam && !isHeader) {
|
|
454895
|
-
filteredBody[key2] = value2;
|
|
454896
|
-
}
|
|
454897
|
-
}
|
|
454898
|
-
return { filteredBody, extractedPathParams, extractedQueryParams, extractedHeaders };
|
|
454899
|
-
}
|
|
454900
|
-
var init_filterHelpers = __esm({
|
|
454901
|
-
"../register/lib/ai-example-enhancer/filterHelpers.js"() {
|
|
454902
|
-
"use strict";
|
|
454903
|
-
}
|
|
454904
|
-
});
|
|
454905
|
-
|
|
454906
|
-
// ../register/lib/ai-example-enhancer/lambdaClient.js
|
|
454907
|
-
var DEFAULT_AI_ENHANCEMENT_MAX_RETRIES, DEFAULT_AI_ENHANCEMENT_TIMEOUT_MS, LambdaExampleEnhancer;
|
|
454908
|
-
var init_lambdaClient = __esm({
|
|
454909
|
-
"../register/lib/ai-example-enhancer/lambdaClient.js"() {
|
|
454805
|
+
// ../register/lib/ai-example-enhancer/faiClient.js
|
|
454806
|
+
var DEFAULT_AI_ENHANCEMENT_MAX_RETRIES, DEFAULT_AI_ENHANCEMENT_TIMEOUT_MS, FaiExampleEnhancer;
|
|
454807
|
+
var init_faiClient = __esm({
|
|
454808
|
+
"../register/lib/ai-example-enhancer/faiClient.js"() {
|
|
454910
454809
|
"use strict";
|
|
454911
454810
|
init_lib4();
|
|
454912
454811
|
init_lib35();
|
|
454913
454812
|
init_lib6();
|
|
454914
454813
|
DEFAULT_AI_ENHANCEMENT_MAX_RETRIES = 0;
|
|
454915
454814
|
DEFAULT_AI_ENHANCEMENT_TIMEOUT_MS = 15e3;
|
|
454916
|
-
|
|
454815
|
+
FaiExampleEnhancer = class {
|
|
454917
454816
|
config;
|
|
454918
454817
|
context;
|
|
454919
|
-
|
|
454818
|
+
faiOrigin;
|
|
454920
454819
|
venusOrigin;
|
|
454921
454820
|
token;
|
|
454922
454821
|
jwtPromise;
|
|
@@ -454932,14 +454831,14 @@ var init_lambdaClient = __esm({
|
|
|
454932
454831
|
styleInstructions: config5.styleInstructions
|
|
454933
454832
|
};
|
|
454934
454833
|
this.context = context3;
|
|
454935
|
-
const
|
|
454936
|
-
if (!
|
|
454834
|
+
const faiOrigin = "https://fai-dev2.buildwithfern.com";
|
|
454835
|
+
if (!faiOrigin) {
|
|
454937
454836
|
throw new CliError({
|
|
454938
|
-
message: "
|
|
454837
|
+
message: "DEFAULT_FAI_ORIGIN environment variable is not set. AI example enhancement requires this to be configured.",
|
|
454939
454838
|
code: CliError.Code.EnvironmentError
|
|
454940
454839
|
});
|
|
454941
454840
|
}
|
|
454942
|
-
this.
|
|
454841
|
+
this.faiOrigin = faiOrigin;
|
|
454943
454842
|
this.venusOrigin = "https://venus-dev2.buildwithfern.com";
|
|
454944
454843
|
this.token = token;
|
|
454945
454844
|
this.organizationId = organizationId;
|
|
@@ -455044,7 +454943,7 @@ var init_lambdaClient = __esm({
|
|
|
455044
454943
|
const maxAttempts = this.config.maxRetries + 1;
|
|
455045
454944
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
455046
454945
|
try {
|
|
455047
|
-
this.context.logger.debug(`Enhancing example for ${request7.method} ${request7.endpointPath} via
|
|
454946
|
+
this.context.logger.debug(`Enhancing example for ${request7.method} ${request7.endpointPath} via FAI (attempt ${attempt}/${maxAttempts})`);
|
|
455048
454947
|
const requestBody = {
|
|
455049
454948
|
method: request7.method,
|
|
455050
454949
|
endpointPath: request7.endpointPath,
|
|
@@ -455060,7 +454959,7 @@ var init_lambdaClient = __esm({
|
|
|
455060
454959
|
...requestBody,
|
|
455061
454960
|
openApiSpec: request7.openApiSpec ? `[OpenAPI spec present: ${request7.openApiSpec.length} chars]` : "[No OpenAPI spec]"
|
|
455062
454961
|
}, null, 2)}`);
|
|
455063
|
-
const response = await fetch(`${this.
|
|
454962
|
+
const response = await fetch(`${this.faiOrigin}/examples/enhance`, {
|
|
455064
454963
|
method: "POST",
|
|
455065
454964
|
headers: {
|
|
455066
454965
|
"Content-Type": "application/json",
|
|
@@ -455072,7 +454971,7 @@ var init_lambdaClient = __esm({
|
|
|
455072
454971
|
if (!response.ok) {
|
|
455073
454972
|
const errorText = await response.text();
|
|
455074
454973
|
throw new CliError({
|
|
455075
|
-
message: `
|
|
454974
|
+
message: `FAI returned ${response.status}: ${errorText || response.statusText}`,
|
|
455076
454975
|
code: CliError.Code.NetworkError
|
|
455077
454976
|
});
|
|
455078
454977
|
}
|
|
@@ -455100,6 +454999,115 @@ var init_lambdaClient = __esm({
|
|
|
455100
454999
|
}
|
|
455101
455000
|
});
|
|
455102
455001
|
|
|
455002
|
+
// ../register/lib/ai-example-enhancer/filterHelpers.js
|
|
455003
|
+
function isFdrTypedValueWrapper(value2) {
|
|
455004
|
+
if (value2 === null || value2 === void 0 || typeof value2 !== "object" || Array.isArray(value2)) {
|
|
455005
|
+
return false;
|
|
455006
|
+
}
|
|
455007
|
+
const obj = value2;
|
|
455008
|
+
const keys25 = Object.keys(obj);
|
|
455009
|
+
if (keys25.length === 0 || keys25.length > 2) {
|
|
455010
|
+
return false;
|
|
455011
|
+
}
|
|
455012
|
+
const hasType = "type" in obj && typeof obj.type === "string";
|
|
455013
|
+
const hasValue = "value" in obj;
|
|
455014
|
+
return hasType && keys25.length === 1 || hasType && hasValue && keys25.length === 2 || hasValue && keys25.length === 1;
|
|
455015
|
+
}
|
|
455016
|
+
function unwrapExampleValue(value2) {
|
|
455017
|
+
if (value2 === null || value2 === void 0) {
|
|
455018
|
+
return value2;
|
|
455019
|
+
}
|
|
455020
|
+
if (Array.isArray(value2)) {
|
|
455021
|
+
return value2.map(unwrapExampleValue);
|
|
455022
|
+
}
|
|
455023
|
+
if (typeof value2 !== "object") {
|
|
455024
|
+
return value2;
|
|
455025
|
+
}
|
|
455026
|
+
const obj = value2;
|
|
455027
|
+
if (isFdrTypedValueWrapper(obj)) {
|
|
455028
|
+
if ("value" in obj) {
|
|
455029
|
+
return unwrapExampleValue(obj.value);
|
|
455030
|
+
}
|
|
455031
|
+
return void 0;
|
|
455032
|
+
}
|
|
455033
|
+
const result = {};
|
|
455034
|
+
for (const [key2, val] of Object.entries(obj)) {
|
|
455035
|
+
const unwrapped = unwrapExampleValue(val);
|
|
455036
|
+
if (unwrapped !== void 0) {
|
|
455037
|
+
result[key2] = unwrapped;
|
|
455038
|
+
}
|
|
455039
|
+
}
|
|
455040
|
+
return result;
|
|
455041
|
+
}
|
|
455042
|
+
function isEmptyObject3(value2) {
|
|
455043
|
+
if (value2 === null || value2 === void 0) {
|
|
455044
|
+
return true;
|
|
455045
|
+
}
|
|
455046
|
+
if (typeof value2 !== "object") {
|
|
455047
|
+
return false;
|
|
455048
|
+
}
|
|
455049
|
+
if (Array.isArray(value2)) {
|
|
455050
|
+
return value2.length === 0;
|
|
455051
|
+
}
|
|
455052
|
+
return Object.keys(value2).length === 0;
|
|
455053
|
+
}
|
|
455054
|
+
function filterRequestBody(requestBody, pathParameters, queryParameters, headers2) {
|
|
455055
|
+
const extractedPathParams = {};
|
|
455056
|
+
const extractedQueryParams = {};
|
|
455057
|
+
const extractedHeaders = {};
|
|
455058
|
+
if (requestBody === null || requestBody === void 0 || typeof requestBody !== "object" || Array.isArray(requestBody)) {
|
|
455059
|
+
return { filteredBody: requestBody, extractedPathParams, extractedQueryParams, extractedHeaders };
|
|
455060
|
+
}
|
|
455061
|
+
const bodyRecord = requestBody;
|
|
455062
|
+
const filteredBody = {};
|
|
455063
|
+
const pathParamKeys = new Set(Object.keys(pathParameters ?? {}));
|
|
455064
|
+
const queryParamKeys = new Set(Object.keys(queryParameters ?? {}));
|
|
455065
|
+
const headerKeys = new Set(Object.keys(headers2 ?? {}));
|
|
455066
|
+
for (const [key2, value2] of Object.entries(bodyRecord)) {
|
|
455067
|
+
const normalizedKey = key2.toLowerCase().replace(/[-_]/g, "");
|
|
455068
|
+
let isPathParam = false;
|
|
455069
|
+
let isQueryParam = false;
|
|
455070
|
+
let isHeader = false;
|
|
455071
|
+
for (const pathKey of pathParamKeys) {
|
|
455072
|
+
const normalizedPathKey = pathKey.toLowerCase().replace(/[-_]/g, "");
|
|
455073
|
+
if (normalizedKey === normalizedPathKey) {
|
|
455074
|
+
isPathParam = true;
|
|
455075
|
+
extractedPathParams[pathKey] = value2;
|
|
455076
|
+
break;
|
|
455077
|
+
}
|
|
455078
|
+
}
|
|
455079
|
+
if (!isPathParam) {
|
|
455080
|
+
for (const queryKey of queryParamKeys) {
|
|
455081
|
+
const normalizedQueryKey = queryKey.toLowerCase().replace(/[-_]/g, "");
|
|
455082
|
+
if (normalizedKey === normalizedQueryKey) {
|
|
455083
|
+
isQueryParam = true;
|
|
455084
|
+
extractedQueryParams[queryKey] = value2;
|
|
455085
|
+
break;
|
|
455086
|
+
}
|
|
455087
|
+
}
|
|
455088
|
+
}
|
|
455089
|
+
if (!isPathParam && !isQueryParam) {
|
|
455090
|
+
for (const headerKey of headerKeys) {
|
|
455091
|
+
const normalizedHeaderKey = headerKey.toLowerCase().replace(/[-_]/g, "");
|
|
455092
|
+
if (normalizedKey === normalizedHeaderKey) {
|
|
455093
|
+
isHeader = true;
|
|
455094
|
+
extractedHeaders[headerKey] = value2;
|
|
455095
|
+
break;
|
|
455096
|
+
}
|
|
455097
|
+
}
|
|
455098
|
+
}
|
|
455099
|
+
if (!isPathParam && !isQueryParam && !isHeader) {
|
|
455100
|
+
filteredBody[key2] = value2;
|
|
455101
|
+
}
|
|
455102
|
+
}
|
|
455103
|
+
return { filteredBody, extractedPathParams, extractedQueryParams, extractedHeaders };
|
|
455104
|
+
}
|
|
455105
|
+
var init_filterHelpers = __esm({
|
|
455106
|
+
"../register/lib/ai-example-enhancer/filterHelpers.js"() {
|
|
455107
|
+
"use strict";
|
|
455108
|
+
}
|
|
455109
|
+
});
|
|
455110
|
+
|
|
455103
455111
|
// ../register/lib/ai-example-enhancer/spinnerStatusCoordinator.js
|
|
455104
455112
|
var SpinnerStatusCoordinator;
|
|
455105
455113
|
var init_spinnerStatusCoordinator = __esm({
|
|
@@ -455307,13 +455315,13 @@ async function removeInvalidAiExamples({ sourceFilePath, context: context3 }) {
|
|
|
455307
455315
|
}
|
|
455308
455316
|
}
|
|
455309
455317
|
}
|
|
455310
|
-
const { writeFile:
|
|
455318
|
+
const { writeFile: writeFile99 } = await import("fs/promises");
|
|
455311
455319
|
const yamlContent = index_vite_proxy_tmp_default.dump(parsed, {
|
|
455312
455320
|
indent: 2,
|
|
455313
455321
|
lineWidth: -1,
|
|
455314
455322
|
noRefs: true
|
|
455315
455323
|
});
|
|
455316
|
-
await
|
|
455324
|
+
await writeFile99(overrideFilePath, yamlContent, "utf-8");
|
|
455317
455325
|
context3.logger.info(`Removed ${validationResult.invalidCount} invalid AI examples from ai_examples_override.yml`);
|
|
455318
455326
|
return {
|
|
455319
455327
|
removedCount: validationResult.invalidCount,
|
|
@@ -455705,7 +455713,7 @@ async function enhanceExamplesWithAI(apiDefinition, config5, context3, token, or
|
|
|
455705
455713
|
}
|
|
455706
455714
|
}
|
|
455707
455715
|
async function performAIEnhancement(apiDefinition, config5, context3, token, organizationId, sourceSpecs, apiName) {
|
|
455708
|
-
const enhancer = new
|
|
455716
|
+
const enhancer = new FaiExampleEnhancer(config5, context3, token, organizationId);
|
|
455709
455717
|
const circuitBreaker = new CircuitBreaker();
|
|
455710
455718
|
let openApiSpec;
|
|
455711
455719
|
let endpointsNeedingRegeneration = /* @__PURE__ */ new Set();
|
|
@@ -455918,7 +455926,7 @@ function collectWorkItems(pkg2, coveredEndpoints, endpointsNeedingRegeneration,
|
|
|
455918
455926
|
}
|
|
455919
455927
|
async function processEndpointsConcurrently(allWorkItems, enhancer, context3, organizationId, stats, enhancedExampleRecords, openApiSpec, sourceFilePath, statusId, apiStats, circuitBreaker) {
|
|
455920
455928
|
const maxConcurrentRequests = parseInt(process.env.FERN_AI_MAX_CONCURRENT || "25", 10);
|
|
455921
|
-
context3.logger.debug(`Processing ${allWorkItems.length} endpoints with max ${maxConcurrentRequests} concurrent
|
|
455929
|
+
context3.logger.debug(`Processing ${allWorkItems.length} endpoints with max ${maxConcurrentRequests} concurrent FAI calls using rolling window queue`);
|
|
455922
455930
|
if (circuitBreaker?.shouldSkip()) {
|
|
455923
455931
|
context3.logger.debug(`Circuit breaker is open after ${circuitBreaker.getFailureCount()} failures (threshold: ${circuitBreaker.getThreshold()}). Skipping AI enhancement for remaining endpoints.`);
|
|
455924
455932
|
return /* @__PURE__ */ new Map();
|
|
@@ -456035,7 +456043,7 @@ async function processEndpoint(workItem, enhancer, context3, organizationId, sta
|
|
|
456035
456043
|
const result = await enhancer.enhanceExample(request7);
|
|
456036
456044
|
circuitBreaker?.recordSuccess();
|
|
456037
456045
|
if (result.enhancedRequestExample != null && request7.originalRequestExample != null) {
|
|
456038
|
-
const unwrapped =
|
|
456046
|
+
const unwrapped = unwrapBodyEnvelope(result.enhancedRequestExample);
|
|
456039
456047
|
const originalHasBody = isObjectWithKey(request7.originalRequestExample, "body");
|
|
456040
456048
|
if (unwrapped.wasWrapped && !originalHasBody) {
|
|
456041
456049
|
result.enhancedRequestExample = backfillMissingFields(unwrapped.inner, request7.originalRequestExample);
|
|
@@ -456319,7 +456327,7 @@ function extractExampleValue(bodyV3) {
|
|
|
456319
456327
|
function isObjectWithKey(value2, key2) {
|
|
456320
456328
|
return typeof value2 === "object" && value2 !== null && !Array.isArray(value2) && key2 in value2;
|
|
456321
456329
|
}
|
|
456322
|
-
function
|
|
456330
|
+
function unwrapBodyEnvelope(value2) {
|
|
456323
456331
|
if (typeof value2 === "object" && value2 !== null && !Array.isArray(value2) && "body" in value2) {
|
|
456324
456332
|
return { wasWrapped: true, inner: value2.body };
|
|
456325
456333
|
}
|
|
@@ -456357,8 +456365,8 @@ var init_enhanceExamplesWithAI = __esm({
|
|
|
456357
456365
|
init_lib65();
|
|
456358
456366
|
import_promises72 = require("fs/promises");
|
|
456359
456367
|
init_js_yaml();
|
|
456368
|
+
init_faiClient();
|
|
456360
456369
|
init_filterHelpers();
|
|
456361
|
-
init_lambdaClient();
|
|
456362
456370
|
init_spinnerStatusCoordinator();
|
|
456363
456371
|
init_validateAiExamples();
|
|
456364
456372
|
init_writeAiExamplesOverride();
|
|
@@ -478555,8 +478563,8 @@ var require_graceful_fs2 = __commonJS({
|
|
|
478555
478563
|
}
|
|
478556
478564
|
}
|
|
478557
478565
|
var fs$writeFile = fs35.writeFile;
|
|
478558
|
-
fs35.writeFile =
|
|
478559
|
-
function
|
|
478566
|
+
fs35.writeFile = writeFile99;
|
|
478567
|
+
function writeFile99(path119, data2, options2, cb) {
|
|
478560
478568
|
if (typeof options2 === "function")
|
|
478561
478569
|
cb = options2, options2 = null;
|
|
478562
478570
|
return go$writeFile(path119, data2, options2, cb);
|
|
@@ -571784,7 +571792,7 @@ var require_dist24 = __commonJS({
|
|
|
571784
571792
|
return copy;
|
|
571785
571793
|
}
|
|
571786
571794
|
};
|
|
571787
|
-
var
|
|
571795
|
+
var import_promises214 = require("fs/promises");
|
|
571788
571796
|
var import_node_path310 = require("path");
|
|
571789
571797
|
async function resolveInputs(args) {
|
|
571790
571798
|
const {
|
|
@@ -571837,7 +571845,7 @@ var require_dist24 = __commonJS({
|
|
|
571837
571845
|
}
|
|
571838
571846
|
}
|
|
571839
571847
|
const oursPath = (0, import_node_path310.join)(outputDir, resolvedPath);
|
|
571840
|
-
const ours = await (0,
|
|
571848
|
+
const ours = await (0, import_promises214.readFile)(oursPath, "utf-8").catch(() => null);
|
|
571841
571849
|
let ghostTheirs = null;
|
|
571842
571850
|
let baseTreeUnreachable = false;
|
|
571843
571851
|
if (!base4 && !renameSourcePath) {
|
|
@@ -572079,7 +572087,7 @@ var require_dist24 = __commonJS({
|
|
|
572079
572087
|
conflictReasonHint
|
|
572080
572088
|
};
|
|
572081
572089
|
}
|
|
572082
|
-
var
|
|
572090
|
+
var import_promises215 = require("fs/promises");
|
|
572083
572091
|
var import_node_path45 = require("path");
|
|
572084
572092
|
async function runMergeAndRecord(args) {
|
|
572085
572093
|
const { plan, inputs, patch: patch5, accumulator } = args;
|
|
@@ -572089,14 +572097,14 @@ var require_dist24 = __commonJS({
|
|
|
572089
572097
|
}
|
|
572090
572098
|
if (plan.kind === "new-file-only-user") {
|
|
572091
572099
|
accumulator.recordMerge(resolvedPath, plan.theirs, patch5.base_generation);
|
|
572092
|
-
await (0,
|
|
572093
|
-
await (0,
|
|
572100
|
+
await (0, import_promises215.mkdir)((0, import_node_path45.dirname)(oursPath), { recursive: true });
|
|
572101
|
+
await (0, import_promises215.writeFile)(oursPath, plan.theirs);
|
|
572094
572102
|
return { file: resolvedPath, status: "merged", reason: "new-file" };
|
|
572095
572103
|
}
|
|
572096
572104
|
if (plan.kind === "new-file-both") {
|
|
572097
572105
|
const merged2 = threeWayMerge("", ours, plan.theirs);
|
|
572098
|
-
await (0,
|
|
572099
|
-
await (0,
|
|
572106
|
+
await (0, import_promises215.mkdir)((0, import_node_path45.dirname)(oursPath), { recursive: true });
|
|
572107
|
+
await (0, import_promises215.writeFile)(oursPath, merged2.content);
|
|
572100
572108
|
const unreachableFlag = plan.baseTreeUnreachable ? { baseTreeUnreachable: true } : {};
|
|
572101
572109
|
if (merged2.hasConflicts) {
|
|
572102
572110
|
return {
|
|
@@ -572112,8 +572120,8 @@ var require_dist24 = __commonJS({
|
|
|
572112
572120
|
return { file: resolvedPath, status: "merged", ...unreachableFlag };
|
|
572113
572121
|
}
|
|
572114
572122
|
const merged = threeWayMerge(plan.mergeBase, ours, plan.theirs);
|
|
572115
|
-
await (0,
|
|
572116
|
-
await (0,
|
|
572123
|
+
await (0, import_promises215.mkdir)((0, import_node_path45.dirname)(oursPath), { recursive: true });
|
|
572124
|
+
await (0, import_promises215.writeFile)(oursPath, merged.content);
|
|
572117
572125
|
if (merged.hasConflicts) {
|
|
572118
572126
|
accumulator.recordConflict(resolvedPath, plan.theirs, patch5.base_generation);
|
|
572119
572127
|
return {
|
|
@@ -620636,7 +620644,7 @@ var require_jsonfile = __commonJS({
|
|
|
620636
620644
|
const str2 = stringify5(obj, options2);
|
|
620637
620645
|
await universalify.fromCallback(fs34.writeFile)(file4, str2, options2);
|
|
620638
620646
|
}
|
|
620639
|
-
var
|
|
620647
|
+
var writeFile99 = universalify.fromPromise(_writeFile);
|
|
620640
620648
|
function writeFileSync9(file4, obj, options2 = {}) {
|
|
620641
620649
|
const fs34 = options2.fs || _fs;
|
|
620642
620650
|
const str2 = stringify5(obj, options2);
|
|
@@ -620645,7 +620653,7 @@ var require_jsonfile = __commonJS({
|
|
|
620645
620653
|
module4.exports = {
|
|
620646
620654
|
readFile: readFile119,
|
|
620647
620655
|
readFileSync: readFileSync19,
|
|
620648
|
-
writeFile:
|
|
620656
|
+
writeFile: writeFile99,
|
|
620649
620657
|
writeFileSync: writeFileSync9
|
|
620650
620658
|
};
|
|
620651
620659
|
}
|
|
@@ -678367,7 +678375,14 @@ var OpenApiSettingsSchema2 = BaseApiSettingsSchema2.extend({
|
|
|
678367
678375
|
* so SDKs can expose them directly on the union type without casting.
|
|
678368
678376
|
* Defaults to false.
|
|
678369
678377
|
*/
|
|
678370
|
-
inferDiscriminatedUnionBaseProperties: external_exports.boolean().optional()
|
|
678378
|
+
inferDiscriminatedUnionBaseProperties: external_exports.boolean().optional(),
|
|
678379
|
+
/**
|
|
678380
|
+
* If true, disambiguate generated request wrapper names that collide with
|
|
678381
|
+
* component schema names by replacing the "Request" suffix with "Body".
|
|
678382
|
+
* If false, keep the original "Request" suffix regardless of collisions.
|
|
678383
|
+
* Defaults to true.
|
|
678384
|
+
*/
|
|
678385
|
+
"disambiguate-request-names": external_exports.boolean().optional()
|
|
678371
678386
|
});
|
|
678372
678387
|
|
|
678373
678388
|
// ../config/lib/schemas/specs/OpenApiSpecSchema.js
|
|
@@ -686956,7 +686971,7 @@ var AccessTokenPosthogManager = class {
|
|
|
686956
686971
|
properties: {
|
|
686957
686972
|
...event,
|
|
686958
686973
|
...event.properties,
|
|
686959
|
-
version: "5.
|
|
686974
|
+
version: "5.56.1",
|
|
686960
686975
|
usingAccessToken: true,
|
|
686961
686976
|
...getRunIdProperties()
|
|
686962
686977
|
}
|
|
@@ -687022,7 +687037,7 @@ var UserPosthogManager = class {
|
|
|
687022
687037
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
687023
687038
|
event: "CLI",
|
|
687024
687039
|
properties: {
|
|
687025
|
-
version: "5.
|
|
687040
|
+
version: "5.56.1",
|
|
687026
687041
|
...event,
|
|
687027
687042
|
...event.properties,
|
|
687028
687043
|
usingAccessToken: false,
|
|
@@ -693834,7 +693849,8 @@ var LegacyApiSpecAdapter = class {
|
|
|
693834
693849
|
groupMultiApiEnvironments: settings.groupMultiApiEnvironments,
|
|
693835
693850
|
defaultIntegerFormat: this.adaptDefaultIntegerFormat(settings.defaultIntegerFormat),
|
|
693836
693851
|
coerceConstsTo: settings.coerceConstsTo,
|
|
693837
|
-
shouldInferDiscriminatedUnionBaseProperties: settings.inferDiscriminatedUnionBaseProperties
|
|
693852
|
+
shouldInferDiscriminatedUnionBaseProperties: settings.inferDiscriminatedUnionBaseProperties,
|
|
693853
|
+
disambiguateRequestNames: settings["disambiguate-request-names"]
|
|
693838
693854
|
};
|
|
693839
693855
|
const hasSettings = Object.values(result).some((v3) => v3 != null);
|
|
693840
693856
|
return hasSettings ? result : void 0;
|
|
@@ -832441,10 +832457,10 @@ var IntermediateRepresentationMigratorBuilderImpl = class {
|
|
|
832441
832457
|
constructor(migrations) {
|
|
832442
832458
|
this.migrations = migrations;
|
|
832443
832459
|
}
|
|
832444
|
-
withMigration(
|
|
832460
|
+
withMigration(migration24) {
|
|
832445
832461
|
return new BuildaleIntermediateRepresentationMigratorBuilderImpl([
|
|
832446
832462
|
...this.migrations,
|
|
832447
|
-
|
|
832463
|
+
migration24
|
|
832448
832464
|
]);
|
|
832449
832465
|
}
|
|
832450
832466
|
};
|
|
@@ -832462,14 +832478,14 @@ var IntermediateRepresentationMigratorImpl = class {
|
|
|
832462
832478
|
migrateForGenerator({ intermediateRepresentation, context: context3, targetGenerator }) {
|
|
832463
832479
|
return this.migrate({
|
|
832464
832480
|
intermediateRepresentation,
|
|
832465
|
-
shouldMigrate: (
|
|
832481
|
+
shouldMigrate: (migration24) => this.shouldRunMigration({ migration: migration24, targetGenerator }),
|
|
832466
832482
|
context: context3,
|
|
832467
832483
|
targetGenerator
|
|
832468
832484
|
});
|
|
832469
832485
|
}
|
|
832470
|
-
migrateThroughMigration({ migration:
|
|
832486
|
+
migrateThroughMigration({ migration: migration24, intermediateRepresentation, context: context3, targetGenerator }) {
|
|
832471
832487
|
return this.migrateThroughVersion({
|
|
832472
|
-
version:
|
|
832488
|
+
version: migration24.earlierVersion,
|
|
832473
832489
|
intermediateRepresentation,
|
|
832474
832490
|
context: context3,
|
|
832475
832491
|
targetGenerator
|
|
@@ -832531,24 +832547,24 @@ var IntermediateRepresentationMigratorImpl = class {
|
|
|
832531
832547
|
unrecognizedObjectKeys: "strip"
|
|
832532
832548
|
});
|
|
832533
832549
|
};
|
|
832534
|
-
for (const
|
|
832535
|
-
if (!shouldMigrate(
|
|
832550
|
+
for (const migration24 of this.migrations) {
|
|
832551
|
+
if (!shouldMigrate(migration24)) {
|
|
832536
832552
|
break;
|
|
832537
832553
|
}
|
|
832538
|
-
context3.logger.debug(`Migrating IR from ${
|
|
832539
|
-
migrated =
|
|
832554
|
+
context3.logger.debug(`Migrating IR from ${migration24.laterVersion} to ${migration24.earlierVersion}`);
|
|
832555
|
+
migrated = migration24.migrateBackwards(migrated, {
|
|
832540
832556
|
taskContext: context3,
|
|
832541
832557
|
targetGenerator
|
|
832542
832558
|
});
|
|
832543
|
-
jsonify = () => Promise.resolve().then(() =>
|
|
832559
|
+
jsonify = () => Promise.resolve().then(() => migration24.jsonifyEarlierVersion(migrated));
|
|
832544
832560
|
}
|
|
832545
832561
|
return {
|
|
832546
832562
|
ir: migrated,
|
|
832547
832563
|
jsonify
|
|
832548
832564
|
};
|
|
832549
832565
|
}
|
|
832550
|
-
shouldRunMigration({ migration:
|
|
832551
|
-
const minVersionToExclude =
|
|
832566
|
+
shouldRunMigration({ migration: migration24, targetGenerator }) {
|
|
832567
|
+
const minVersionToExclude = migration24.firstGeneratorVersionToConsumeNewIR[targetGenerator.name];
|
|
832552
832568
|
if (minVersionToExclude == null) {
|
|
832553
832569
|
throw new CliError({
|
|
832554
832570
|
message: `Cannot migrate intermediate representation. Unrecognized generator: ${targetGenerator.name}. If leveraging a custom generator, ensure you are specifying "ir-version" within the generator configuration.`,
|
|
@@ -832560,7 +832576,7 @@ var IntermediateRepresentationMigratorImpl = class {
|
|
|
832560
832576
|
return true;
|
|
832561
832577
|
case GeneratorWasNotCreatedYet:
|
|
832562
832578
|
throw new CliError({
|
|
832563
|
-
message: `Cannot migrate intermediate representation. Generator was created after intermediate representation ${
|
|
832579
|
+
message: `Cannot migrate intermediate representation. Generator was created after intermediate representation ${migration24.laterVersion}.`,
|
|
832564
832580
|
code: CliError.Code.VersionError
|
|
832565
832581
|
});
|
|
832566
832582
|
}
|
|
@@ -832575,9 +832591,9 @@ var IntermediateRepresentationMigratorImpl = class {
|
|
|
832575
832591
|
}
|
|
832576
832592
|
getIRVersionForGenerator({ targetGenerator }) {
|
|
832577
832593
|
let lastIrVersion = this.migrations[0]?.laterVersion;
|
|
832578
|
-
for (const
|
|
832579
|
-
if (this.shouldRunMigration({ migration:
|
|
832580
|
-
lastIrVersion =
|
|
832594
|
+
for (const migration24 of this.migrations) {
|
|
832595
|
+
if (this.shouldRunMigration({ migration: migration24, targetGenerator })) {
|
|
832596
|
+
lastIrVersion = migration24.earlierVersion;
|
|
832581
832597
|
} else {
|
|
832582
832598
|
break;
|
|
832583
832599
|
}
|
|
@@ -868116,7 +868132,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
868116
868132
|
var LOGS_FOLDER_NAME = "logs";
|
|
868117
868133
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
868118
868134
|
function getCliSource() {
|
|
868119
|
-
const version7 = "5.
|
|
868135
|
+
const version7 = "5.56.1";
|
|
868120
868136
|
return `cli@${version7}`;
|
|
868121
868137
|
}
|
|
868122
868138
|
var DebugLogger = class {
|
|
@@ -870537,11 +870553,17 @@ async function downloadBundle({ bucketUrl, logger: logger4, preferCached, app =
|
|
|
870537
870553
|
}
|
|
870538
870554
|
const workspaceConfigPath = import_path69.default.join(absolutePathToBundleFolder, "pnpm-workspace.yaml");
|
|
870539
870555
|
if (!(0, import_fs28.existsSync)(workspaceConfigPath)) {
|
|
870540
|
-
await (0, import_promises97.writeFile)(workspaceConfigPath, "
|
|
870556
|
+
await (0, import_promises97.writeFile)(workspaceConfigPath, "packages: []\nonlyBuiltDependencies:\n - esbuild\n");
|
|
870557
|
+
} else {
|
|
870558
|
+
const existingWorkspaceConfig = await (0, import_promises97.readFile)(workspaceConfigPath, "utf-8");
|
|
870559
|
+
if (!existingWorkspaceConfig.includes("packages:")) {
|
|
870560
|
+
await (0, import_promises97.writeFile)(workspaceConfigPath, `packages: []
|
|
870561
|
+
${existingWorkspaceConfig}`);
|
|
870562
|
+
}
|
|
870541
870563
|
}
|
|
870542
870564
|
try {
|
|
870543
870565
|
logger4.debug("Installing esbuild");
|
|
870544
|
-
await loggingExeca(logger4, "pnpm", ["i", "esbuild"], {
|
|
870566
|
+
await loggingExeca(logger4, "pnpm", ["i", "-w", "esbuild"], {
|
|
870545
870567
|
cwd: absolutePathToBundleFolder,
|
|
870546
870568
|
doNotPipeOutput: true
|
|
870547
870569
|
});
|
|
@@ -870560,7 +870582,7 @@ async function downloadBundle({ bucketUrl, logger: logger4, preferCached, app =
|
|
|
870560
870582
|
}
|
|
870561
870583
|
try {
|
|
870562
870584
|
logger4.debug("Installing esbuild after upgrading corepack");
|
|
870563
|
-
await loggingExeca(logger4, "pnpm", ["i", "esbuild"], {
|
|
870585
|
+
await loggingExeca(logger4, "pnpm", ["i", "-w", "esbuild"], {
|
|
870564
870586
|
cwd: absolutePathToBundleFolder,
|
|
870565
870587
|
doNotPipeOutput: true
|
|
870566
870588
|
});
|
|
@@ -900510,7 +900532,7 @@ var LegacyDocsPublisher = class {
|
|
|
900510
900532
|
previewId,
|
|
900511
900533
|
disableTemplates: void 0,
|
|
900512
900534
|
skipUpload,
|
|
900513
|
-
cliVersion: "5.
|
|
900535
|
+
cliVersion: "5.56.1",
|
|
900514
900536
|
loginCommand: "fern auth login"
|
|
900515
900537
|
});
|
|
900516
900538
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -957274,20 +957296,20 @@ Please check your internet connection and npm configuration, then try again.`,
|
|
|
957274
957296
|
* Returns migrations where: from < migration.version <= to
|
|
957275
957297
|
*/
|
|
957276
957298
|
filterMigrations({ migrations, from: from4, to: to2 }) {
|
|
957277
|
-
return migrations.filter((
|
|
957278
|
-
const migrationVersion = import_semver14.default.parse(
|
|
957299
|
+
return migrations.filter((migration24) => {
|
|
957300
|
+
const migrationVersion = import_semver14.default.parse(migration24.version);
|
|
957279
957301
|
const fromVersion = import_semver14.default.parse(from4);
|
|
957280
957302
|
const toVersion = import_semver14.default.parse(to2);
|
|
957281
957303
|
if (migrationVersion == null) {
|
|
957282
|
-
this.logger.warn(`Migration has invalid semver version: ${
|
|
957304
|
+
this.logger.warn(`Migration has invalid semver version: ${migration24.version}. Skipping.`);
|
|
957283
957305
|
return false;
|
|
957284
957306
|
}
|
|
957285
957307
|
if (fromVersion == null) {
|
|
957286
|
-
this.logger.warn(`Invalid 'from' version: ${from4}. Skipping migration ${
|
|
957308
|
+
this.logger.warn(`Invalid 'from' version: ${from4}. Skipping migration ${migration24.version}.`);
|
|
957287
957309
|
return false;
|
|
957288
957310
|
}
|
|
957289
957311
|
if (toVersion == null) {
|
|
957290
|
-
this.logger.warn(`Invalid 'to' version: ${to2}. Skipping migration ${
|
|
957312
|
+
this.logger.warn(`Invalid 'to' version: ${to2}. Skipping migration ${migration24.version}.`);
|
|
957291
957313
|
return false;
|
|
957292
957314
|
}
|
|
957293
957315
|
return import_semver14.default.gt(migrationVersion, fromVersion) && import_semver14.default.lte(migrationVersion, toVersion);
|
|
@@ -957307,17 +957329,17 @@ Please check your internet connection and npm configuration, then try again.`,
|
|
|
957307
957329
|
runMigrations({ migrations, config: config5 }) {
|
|
957308
957330
|
let currentConfig = config5;
|
|
957309
957331
|
const appliedVersions = [];
|
|
957310
|
-
for (const
|
|
957332
|
+
for (const migration24 of migrations) {
|
|
957311
957333
|
try {
|
|
957312
|
-
currentConfig =
|
|
957334
|
+
currentConfig = migration24.migrateGeneratorConfig({
|
|
957313
957335
|
config: currentConfig,
|
|
957314
957336
|
context: { logger: this.logger }
|
|
957315
957337
|
});
|
|
957316
|
-
appliedVersions.push(
|
|
957338
|
+
appliedVersions.push(migration24.version);
|
|
957317
957339
|
} catch (error50) {
|
|
957318
957340
|
const errorMessage = extractErrorMessage(error50);
|
|
957319
957341
|
throw new CliError({
|
|
957320
|
-
message: `Failed to apply migration for version ${
|
|
957342
|
+
message: `Failed to apply migration for version ${migration24.version}.
|
|
957321
957343
|
|
|
957322
957344
|
Reason: ${errorMessage}
|
|
957323
957345
|
|
|
@@ -957513,9 +957535,9 @@ var UpdateCommand = class {
|
|
|
957513
957535
|
context3.stderr.info(`${Icons.success} ${source_default.green("Updated SDK targets:")}`);
|
|
957514
957536
|
for (const update of updates) {
|
|
957515
957537
|
context3.stderr.info(source_default.green(` ${update.name}: ${source_default.dim(update.currentVersion)} \u2192 ${update.latestVersion}`));
|
|
957516
|
-
const
|
|
957517
|
-
if (
|
|
957518
|
-
context3.stderr.info(source_default.dim(` Applied ${
|
|
957538
|
+
const migration24 = migrationInfo.get(update.name);
|
|
957539
|
+
if (migration24 != null) {
|
|
957540
|
+
context3.stderr.info(source_default.dim(` Applied ${migration24.migrationsApplied} config migration(s): ${migration24.appliedVersions.join(", ")}`));
|
|
957519
957541
|
}
|
|
957520
957542
|
if (update.changelogUrl != null) {
|
|
957521
957543
|
context3.stderr.info(source_default.dim(` Changelog: ${update.changelogUrl}`));
|
|
@@ -966779,7 +966801,7 @@ function getAutomationContextFromEnv() {
|
|
|
966779
966801
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
966780
966802
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
966781
966803
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
966782
|
-
cli_version: "5.
|
|
966804
|
+
cli_version: "5.56.1"
|
|
966783
966805
|
};
|
|
966784
966806
|
}
|
|
966785
966807
|
function isAutomationMode() {
|
|
@@ -967611,7 +967633,7 @@ var CliContext = class _CliContext {
|
|
|
967611
967633
|
if (false) {
|
|
967612
967634
|
this.logger.error("CLI_VERSION is not defined");
|
|
967613
967635
|
}
|
|
967614
|
-
return "5.
|
|
967636
|
+
return "5.56.1";
|
|
967615
967637
|
}
|
|
967616
967638
|
getCliName() {
|
|
967617
967639
|
if (false) {
|
|
@@ -968426,20 +968448,20 @@ If the problem persists, you can:
|
|
|
968426
968448
|
}
|
|
968427
968449
|
function filterMigrations(params2) {
|
|
968428
968450
|
const { migrations, from: from4, to: to2, logger: logger4 } = params2;
|
|
968429
|
-
return migrations.filter((
|
|
968430
|
-
const migrationVersion = import_semver15.default.parse(
|
|
968451
|
+
return migrations.filter((migration24) => {
|
|
968452
|
+
const migrationVersion = import_semver15.default.parse(migration24.version);
|
|
968431
968453
|
const fromVersion = import_semver15.default.parse(from4);
|
|
968432
968454
|
const toVersion = import_semver15.default.parse(to2);
|
|
968433
968455
|
if (migrationVersion == null) {
|
|
968434
|
-
logger4.warn(`Migration has invalid semver version: ${
|
|
968456
|
+
logger4.warn(`Migration has invalid semver version: ${migration24.version}. Skipping this migration.`);
|
|
968435
968457
|
return false;
|
|
968436
968458
|
}
|
|
968437
968459
|
if (fromVersion == null) {
|
|
968438
|
-
logger4.warn(`Invalid 'from' version: ${from4}. Skipping migration ${
|
|
968460
|
+
logger4.warn(`Invalid 'from' version: ${from4}. Skipping migration ${migration24.version}.`);
|
|
968439
968461
|
return false;
|
|
968440
968462
|
}
|
|
968441
968463
|
if (toVersion == null) {
|
|
968442
|
-
logger4.warn(`Invalid 'to' version: ${to2}. Skipping migration ${
|
|
968464
|
+
logger4.warn(`Invalid 'to' version: ${to2}. Skipping migration ${migration24.version}.`);
|
|
968443
968465
|
return false;
|
|
968444
968466
|
}
|
|
968445
968467
|
return import_semver15.default.gt(migrationVersion, fromVersion) && import_semver15.default.lte(migrationVersion, toVersion);
|
|
@@ -968459,17 +968481,17 @@ function runMigrations(params2) {
|
|
|
968459
968481
|
const { migrations, logger: logger4 } = params2;
|
|
968460
968482
|
let currentConfig = params2.config;
|
|
968461
968483
|
const appliedVersions = [];
|
|
968462
|
-
for (const
|
|
968484
|
+
for (const migration24 of migrations) {
|
|
968463
968485
|
try {
|
|
968464
968486
|
const context3 = {
|
|
968465
968487
|
logger: logger4
|
|
968466
968488
|
};
|
|
968467
|
-
currentConfig =
|
|
968468
|
-
appliedVersions.push(
|
|
968489
|
+
currentConfig = migration24.migrateGeneratorConfig({ config: currentConfig, context: context3 });
|
|
968490
|
+
appliedVersions.push(migration24.version);
|
|
968469
968491
|
} catch (error50) {
|
|
968470
968492
|
const errorMessage = extractErrorMessage(error50);
|
|
968471
968493
|
throw new CliError({
|
|
968472
|
-
message: `Failed to apply migration for version ${
|
|
968494
|
+
message: `Failed to apply migration for version ${migration24.version}.
|
|
968473
968495
|
|
|
968474
968496
|
Reason: ${errorMessage}
|
|
968475
968497
|
|
|
@@ -970865,7 +970887,7 @@ function listPreviewGroups({
|
|
|
970865
970887
|
init_lib19();
|
|
970866
970888
|
init_lib6();
|
|
970867
970889
|
init_source();
|
|
970868
|
-
var
|
|
970890
|
+
var import_promises195 = require("fs/promises");
|
|
970869
970891
|
|
|
970870
970892
|
// ../cli-migrations/lib/runMigrations.js
|
|
970871
970893
|
init_lib4();
|
|
@@ -973939,6 +973961,159 @@ var versionMigrations22 = {
|
|
|
973939
973961
|
};
|
|
973940
973962
|
var __default22 = versionMigrations22;
|
|
973941
973963
|
|
|
973964
|
+
// ../cli-migrations/lib/migrations/4.106.1/disable-disambiguate-request-names/migration.js
|
|
973965
|
+
init_lib19();
|
|
973966
|
+
init_lib8();
|
|
973967
|
+
init_source();
|
|
973968
|
+
var import_promises193 = require("fs/promises");
|
|
973969
|
+
init_js_yaml();
|
|
973970
|
+
var migration23 = {
|
|
973971
|
+
name: "disable-disambiguate-request-names",
|
|
973972
|
+
summary: `Sets 'disambiguate-request-names: false' for existing OpenAPI specs to preserve backwards compatibility.
|
|
973973
|
+
Starting with version 4.106.1, generated request wrapper names that collide with component schema names
|
|
973974
|
+
are disambiguated by replacing the "Request" suffix with "Body". This migration explicitly disables that
|
|
973975
|
+
behavior so existing projects keep their current request wrapper names.`,
|
|
973976
|
+
run: async ({ context: context3 }) => {
|
|
973977
|
+
const absolutePathToFernDirectory = await getFernDirectory();
|
|
973978
|
+
if (absolutePathToFernDirectory == null) {
|
|
973979
|
+
context3.failAndThrow("Fern directory not found. Failed to run migration");
|
|
973980
|
+
return;
|
|
973981
|
+
}
|
|
973982
|
+
const { files, directories } = await getFilesAndDirectories8(absolutePathToFernDirectory);
|
|
973983
|
+
const apisDirectory = directories.find((dir) => dir.name === "apis");
|
|
973984
|
+
if (apisDirectory == null) {
|
|
973985
|
+
await updateGeneratorsYml6({
|
|
973986
|
+
context: context3,
|
|
973987
|
+
files
|
|
973988
|
+
});
|
|
973989
|
+
} else {
|
|
973990
|
+
for (const workspace of apisDirectory.contents) {
|
|
973991
|
+
if (workspace.type !== "directory") {
|
|
973992
|
+
continue;
|
|
973993
|
+
}
|
|
973994
|
+
const absoluteFilepathToWorkspace = join8(absolutePathToFernDirectory, RelativeFilePath2.of("apis"), RelativeFilePath2.of(workspace.name));
|
|
973995
|
+
await updateGeneratorsYml6({
|
|
973996
|
+
context: context3,
|
|
973997
|
+
...await getFilesAndDirectories8(join8(absoluteFilepathToWorkspace))
|
|
973998
|
+
});
|
|
973999
|
+
}
|
|
974000
|
+
}
|
|
974001
|
+
}
|
|
974002
|
+
};
|
|
974003
|
+
async function updateGeneratorsYml6({ context: context3, files }) {
|
|
974004
|
+
const generatorsYmlFile = files.find((file4) => file4.name === "generators.yml" || file4.name === "generators.yaml");
|
|
974005
|
+
if (generatorsYmlFile == null) {
|
|
974006
|
+
return;
|
|
974007
|
+
}
|
|
974008
|
+
const generatorsYmlContents = index_vite_proxy_tmp_default.load(generatorsYmlFile.contents);
|
|
974009
|
+
if (generatorsYmlContents == null || typeof generatorsYmlContents !== "object") {
|
|
974010
|
+
return;
|
|
974011
|
+
}
|
|
974012
|
+
let modified = false;
|
|
974013
|
+
const doc = generatorsYmlContents;
|
|
974014
|
+
if ("api" in doc && typeof doc.api === "object" && doc.api != null) {
|
|
974015
|
+
const api2 = doc.api;
|
|
974016
|
+
if ("specs" in api2 && Array.isArray(api2.specs)) {
|
|
974017
|
+
for (const spec of api2.specs) {
|
|
974018
|
+
if (typeof spec !== "object" || spec == null) {
|
|
974019
|
+
continue;
|
|
974020
|
+
}
|
|
974021
|
+
const specObj = spec;
|
|
974022
|
+
if (!("openapi" in specObj)) {
|
|
974023
|
+
continue;
|
|
974024
|
+
}
|
|
974025
|
+
if (!("settings" in specObj) || typeof specObj.settings !== "object" || specObj.settings == null) {
|
|
974026
|
+
specObj.settings = {};
|
|
974027
|
+
}
|
|
974028
|
+
const settings = specObj.settings;
|
|
974029
|
+
if (!("disambiguate-request-names" in settings)) {
|
|
974030
|
+
settings["disambiguate-request-names"] = false;
|
|
974031
|
+
modified = true;
|
|
974032
|
+
}
|
|
974033
|
+
}
|
|
974034
|
+
}
|
|
974035
|
+
if ("settings" in api2 && typeof api2.settings === "object" && api2.settings != null) {
|
|
974036
|
+
const settings = api2.settings;
|
|
974037
|
+
if (!("disambiguate-request-names" in settings)) {
|
|
974038
|
+
settings["disambiguate-request-names"] = false;
|
|
974039
|
+
modified = true;
|
|
974040
|
+
}
|
|
974041
|
+
} else if (!("specs" in api2)) {
|
|
974042
|
+
if (!("settings" in api2)) {
|
|
974043
|
+
api2.settings = { "disambiguate-request-names": false };
|
|
974044
|
+
modified = true;
|
|
974045
|
+
}
|
|
974046
|
+
}
|
|
974047
|
+
}
|
|
974048
|
+
if ("groups" in doc && typeof doc.groups === "object" && doc.groups != null) {
|
|
974049
|
+
const groups2 = doc.groups;
|
|
974050
|
+
for (const groupName of Object.keys(groups2)) {
|
|
974051
|
+
const group = groups2[groupName];
|
|
974052
|
+
if (typeof group !== "object" || group == null) {
|
|
974053
|
+
continue;
|
|
974054
|
+
}
|
|
974055
|
+
const groupObj = group;
|
|
974056
|
+
if (!("generators" in groupObj) || !Array.isArray(groupObj.generators)) {
|
|
974057
|
+
continue;
|
|
974058
|
+
}
|
|
974059
|
+
for (const generator of groupObj.generators) {
|
|
974060
|
+
if (typeof generator !== "object" || generator == null) {
|
|
974061
|
+
continue;
|
|
974062
|
+
}
|
|
974063
|
+
const generatorObj = generator;
|
|
974064
|
+
if (!("api" in generatorObj) || typeof generatorObj.api !== "object" || generatorObj.api == null) {
|
|
974065
|
+
continue;
|
|
974066
|
+
}
|
|
974067
|
+
const apiObj = generatorObj.api;
|
|
974068
|
+
if (!("settings" in apiObj) || typeof apiObj.settings !== "object" || apiObj.settings == null) {
|
|
974069
|
+
continue;
|
|
974070
|
+
}
|
|
974071
|
+
const settings = apiObj.settings;
|
|
974072
|
+
if (!("disambiguate-request-names" in settings)) {
|
|
974073
|
+
settings["disambiguate-request-names"] = false;
|
|
974074
|
+
modified = true;
|
|
974075
|
+
}
|
|
974076
|
+
}
|
|
974077
|
+
}
|
|
974078
|
+
}
|
|
974079
|
+
if (!modified) {
|
|
974080
|
+
context3.logger.debug("No OpenAPI specs found for disambiguate-request-names migration. Skipping...");
|
|
974081
|
+
return;
|
|
974082
|
+
}
|
|
974083
|
+
const firstLine = generatorsYmlFile.contents.split("\n")[0];
|
|
974084
|
+
let schemaComment;
|
|
974085
|
+
if (firstLine?.startsWith("# yaml-language-server:")) {
|
|
974086
|
+
schemaComment = firstLine;
|
|
974087
|
+
}
|
|
974088
|
+
let documentToWrite = index_vite_proxy_tmp_default.dump(generatorsYmlContents);
|
|
974089
|
+
if (schemaComment && documentToWrite.indexOf(schemaComment) === -1) {
|
|
974090
|
+
documentToWrite = `${schemaComment}
|
|
974091
|
+
${documentToWrite}`;
|
|
974092
|
+
}
|
|
974093
|
+
await (0, import_promises193.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
974094
|
+
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
974095
|
+
}
|
|
974096
|
+
async function getFilesAndDirectories8(absoluteFilepath) {
|
|
974097
|
+
const contents = await getDirectoryContents(absoluteFilepath);
|
|
974098
|
+
const files = [];
|
|
974099
|
+
const directories = [];
|
|
974100
|
+
for (const fileOrFolder of contents) {
|
|
974101
|
+
if (fileOrFolder.type === "directory") {
|
|
974102
|
+
directories.push(fileOrFolder);
|
|
974103
|
+
} else {
|
|
974104
|
+
files.push(fileOrFolder);
|
|
974105
|
+
}
|
|
974106
|
+
}
|
|
974107
|
+
return { files, directories };
|
|
974108
|
+
}
|
|
974109
|
+
|
|
974110
|
+
// ../cli-migrations/lib/migrations/4.106.1/index.js
|
|
974111
|
+
var versionMigrations23 = {
|
|
974112
|
+
version: "4.106.1",
|
|
974113
|
+
migrations: [migration23]
|
|
974114
|
+
};
|
|
974115
|
+
var __default23 = versionMigrations23;
|
|
974116
|
+
|
|
973942
974117
|
// ../cli-migrations/lib/migrations/all.js
|
|
973943
974118
|
var ALL_MIGRATIONS = [
|
|
973944
974119
|
__default,
|
|
@@ -973962,7 +974137,8 @@ var ALL_MIGRATIONS = [
|
|
|
973962
974137
|
__default19,
|
|
973963
974138
|
__default20,
|
|
973964
974139
|
__default21,
|
|
973965
|
-
__default22
|
|
974140
|
+
__default22,
|
|
974141
|
+
__default23
|
|
973966
974142
|
];
|
|
973967
974143
|
|
|
973968
974144
|
// ../cli-migrations/lib/migrations/getMigrationsToRun.js
|
|
@@ -973991,7 +974167,7 @@ async function runMigrations2({ fromVersion, toVersion, context: context3, yes =
|
|
|
973991
974167
|
context3.logger.debug("No migrations needed.");
|
|
973992
974168
|
return;
|
|
973993
974169
|
} else {
|
|
973994
|
-
context3.logger.debug("Migrations need to be run:\n" + migrationsToRun.flatMap(({ migrations }) => migrations.map((
|
|
974170
|
+
context3.logger.debug("Migrations need to be run:\n" + migrationsToRun.flatMap(({ migrations }) => migrations.map((migration24) => ` - ${migration24.name}`)).join("\n"));
|
|
973995
974171
|
}
|
|
973996
974172
|
if (yes) {
|
|
973997
974173
|
context3.logger.debug("Skipping migration confirmation prompt because --yes was provided.");
|
|
@@ -974006,13 +974182,13 @@ async function runMigrations2({ fromVersion, toVersion, context: context3, yes =
|
|
|
974006
974182
|
return;
|
|
974007
974183
|
}
|
|
974008
974184
|
}
|
|
974009
|
-
const migrationsWithTasks = migrationsToRun.flatMap(({ migrations, version: version7 }) => migrations.map((
|
|
974010
|
-
migration:
|
|
974011
|
-
context: context3.addInteractiveTask({ name: `${version7} ${
|
|
974185
|
+
const migrationsWithTasks = migrationsToRun.flatMap(({ migrations, version: version7 }) => migrations.map((migration24) => ({
|
|
974186
|
+
migration: migration24,
|
|
974187
|
+
context: context3.addInteractiveTask({ name: `${version7} ${migration24.name}` })
|
|
974012
974188
|
})));
|
|
974013
|
-
for (const { migration:
|
|
974189
|
+
for (const { migration: migration24, context: contextForMigration } of migrationsWithTasks) {
|
|
974014
974190
|
const finishableContext = contextForMigration.start();
|
|
974015
|
-
await
|
|
974191
|
+
await migration24.run({
|
|
974016
974192
|
context: finishableContext
|
|
974017
974193
|
});
|
|
974018
974194
|
finishableContext.finish();
|
|
@@ -974026,11 +974202,11 @@ async function askForConfirmation2(migrationsToRun) {
|
|
|
974026
974202
|
const QUESTION_KEY = "wantsToContinue";
|
|
974027
974203
|
const lines = ["Some migrations need to be run:"];
|
|
974028
974204
|
for (const { migrations } of migrationsToRun) {
|
|
974029
|
-
for (const
|
|
974205
|
+
for (const migration24 of migrations) {
|
|
974030
974206
|
lines.push(addPrefixToString({
|
|
974031
974207
|
prefix: " \u25E6 ",
|
|
974032
|
-
content: `${
|
|
974033
|
-
${source_default.dim(
|
|
974208
|
+
content: `${migration24.name}
|
|
974209
|
+
${source_default.dim(migration24.summary)}`
|
|
974034
974210
|
}));
|
|
974035
974211
|
}
|
|
974036
974212
|
}
|
|
@@ -974049,7 +974225,7 @@ init_lib33();
|
|
|
974049
974225
|
init_lib27();
|
|
974050
974226
|
init_lib6();
|
|
974051
974227
|
init_source();
|
|
974052
|
-
var
|
|
974228
|
+
var import_promises194 = require("fs/promises");
|
|
974053
974229
|
|
|
974054
974230
|
// ../../../node_modules/.pnpm/immer@10.2.0/node_modules/immer/dist/immer.mjs
|
|
974055
974231
|
var NOTHING = /* @__PURE__ */ Symbol.for("immer-nothing");
|
|
@@ -975105,7 +975281,7 @@ async function upgrade({
|
|
|
975105
975281
|
const newProjectConfig = produce(projectConfig2.rawConfig, (draft) => {
|
|
975106
975282
|
draft.version = resolvedTargetVersion;
|
|
975107
975283
|
});
|
|
975108
|
-
await (0,
|
|
975284
|
+
await (0, import_promises194.writeFile)(
|
|
975109
975285
|
projectConfig2._absolutePath,
|
|
975110
975286
|
ensureFinalNewline(JSON.stringify(newProjectConfig, void 0, 2))
|
|
975111
975287
|
);
|
|
@@ -975262,7 +975438,7 @@ async function upgradeGeneratorsForAllWorkspaces({
|
|
|
975262
975438
|
absolutePathToWorkspace: workspace.absoluteFilePath
|
|
975263
975439
|
});
|
|
975264
975440
|
if (absolutePathToGeneratorsConfiguration != null && result.updatedConfiguration != null) {
|
|
975265
|
-
await (0,
|
|
975441
|
+
await (0, import_promises195.writeFile)(absolutePathToGeneratorsConfiguration, result.updatedConfiguration);
|
|
975266
975442
|
}
|
|
975267
975443
|
for (const upgrade2 of result.appliedUpgrades) {
|
|
975268
975444
|
const normalizedName = addDefaultDockerOrgIfNotPresent(upgrade2.generatorName);
|
|
@@ -975740,7 +975916,7 @@ async function previewDocsWorkspace({
|
|
|
975740
975916
|
// src/commands/docs-diff/docsDiff.ts
|
|
975741
975917
|
init_lib8();
|
|
975742
975918
|
init_lib6();
|
|
975743
|
-
var
|
|
975919
|
+
var import_promises196 = require("fs/promises");
|
|
975744
975920
|
var import_pngjs2 = __toESM(require_png(), 1);
|
|
975745
975921
|
async function getSlugForFiles2({
|
|
975746
975922
|
previewUrl,
|
|
@@ -975963,8 +976139,8 @@ async function generateComparisons2({
|
|
|
975963
976139
|
afterPath,
|
|
975964
976140
|
comparisonBasePath
|
|
975965
976141
|
}) {
|
|
975966
|
-
const beforePng = import_pngjs2.PNG.sync.read(await (0,
|
|
975967
|
-
const afterPng = import_pngjs2.PNG.sync.read(await (0,
|
|
976142
|
+
const beforePng = import_pngjs2.PNG.sync.read(await (0, import_promises196.readFile)(beforePath));
|
|
976143
|
+
const afterPng = import_pngjs2.PNG.sync.read(await (0, import_promises196.readFile)(afterPath));
|
|
975968
976144
|
const beforeOriginalHeight = beforePng.height;
|
|
975969
976145
|
const afterOriginalHeight = afterPng.height;
|
|
975970
976146
|
const width = Math.max(beforePng.width, afterPng.width);
|
|
@@ -976002,7 +976178,7 @@ async function generateComparisons2({
|
|
|
976002
976178
|
const sideBySide = createSideBySideComparison2(croppedBefore, croppedAfter, 20, true);
|
|
976003
976179
|
const outPath = `${base4}-region-${i5 + 1}.png`;
|
|
976004
976180
|
const pngBuffer = import_pngjs2.PNG.sync.write(sideBySide);
|
|
976005
|
-
await (0,
|
|
976181
|
+
await (0, import_promises196.writeFile)(outPath, new Uint8Array(pngBuffer));
|
|
976006
976182
|
results.push({ changePercent, boundingBox, comparisonPath: outPath });
|
|
976007
976183
|
}
|
|
976008
976184
|
return results;
|
|
@@ -976081,7 +976257,7 @@ async function docsDiff({
|
|
|
976081
976257
|
outputDir.startsWith("/") ? outputDir : join8(cwd(), RelativeFilePath2.of(outputDir))
|
|
976082
976258
|
);
|
|
976083
976259
|
if (!await doesPathExist(outputPath)) {
|
|
976084
|
-
await (0,
|
|
976260
|
+
await (0, import_promises196.mkdir)(outputPath, { recursive: true });
|
|
976085
976261
|
}
|
|
976086
976262
|
const results = [];
|
|
976087
976263
|
await cliContext.runTask(async (context3) => {
|
|
@@ -976509,7 +976685,7 @@ init_lib6();
|
|
|
976509
976685
|
// src/commands/docs-theme/ThemeExporter.ts
|
|
976510
976686
|
init_lib12();
|
|
976511
976687
|
init_lib8();
|
|
976512
|
-
var
|
|
976688
|
+
var import_promises197 = require("fs/promises");
|
|
976513
976689
|
init_js_yaml();
|
|
976514
976690
|
var import_path109 = __toESM(require("path"), 1);
|
|
976515
976691
|
var ThemeExporter = class {
|
|
@@ -976522,18 +976698,18 @@ var ThemeExporter = class {
|
|
|
976522
976698
|
const docsDir = import_path109.default.dirname(docsYmlPath);
|
|
976523
976699
|
const outDir = output2 != null ? import_path109.default.resolve(process.cwd(), output2) : import_path109.default.join(this.docsWorkspace.absoluteFilePath, "theme");
|
|
976524
976700
|
context3.logger.info(`Exporting theme-eligible fields from docs.yml \u2192 ${outDir}`);
|
|
976525
|
-
const raw = index_vite_proxy_tmp_default.load(await (0,
|
|
976701
|
+
const raw = index_vite_proxy_tmp_default.load(await (0, import_promises197.readFile)(docsYmlPath, "utf-8"));
|
|
976526
976702
|
const themeConfig = {};
|
|
976527
976703
|
for (const [k4, v3] of Object.entries(raw)) {
|
|
976528
976704
|
if (docs_yml_exports.THEME_ELIGIBLE_YAML_KEYS.has(k4)) {
|
|
976529
976705
|
themeConfig[k4] = v3;
|
|
976530
976706
|
}
|
|
976531
976707
|
}
|
|
976532
|
-
await (0,
|
|
976708
|
+
await (0, import_promises197.mkdir)(outDir, { recursive: true });
|
|
976533
976709
|
const assetsDir = import_path109.default.join(outDir, "assets");
|
|
976534
|
-
await (0,
|
|
976710
|
+
await (0, import_promises197.mkdir)(assetsDir, { recursive: true });
|
|
976535
976711
|
const exported = await copyLocalFiles(themeConfig, docsDir, assetsDir);
|
|
976536
|
-
await (0,
|
|
976712
|
+
await (0, import_promises197.writeFile)(import_path109.default.join(outDir, "theme.yml"), index_vite_proxy_tmp_default.dump(exported), "utf-8");
|
|
976537
976713
|
context3.logger.info(`Theme exported to ${outDir}/theme.yml`);
|
|
976538
976714
|
}
|
|
976539
976715
|
};
|
|
@@ -976547,8 +976723,8 @@ async function copyLocalFiles(obj, sourceDir, assetsDir) {
|
|
|
976547
976723
|
const destRelative = relFromSource.startsWith("..") ? relFromProject.startsWith("..") ? import_path109.default.basename(abs) : relFromProject : relFromSource;
|
|
976548
976724
|
const dest = import_path109.default.join(assetsDir, destRelative);
|
|
976549
976725
|
try {
|
|
976550
|
-
await (0,
|
|
976551
|
-
await (0,
|
|
976726
|
+
await (0, import_promises197.mkdir)(import_path109.default.dirname(dest), { recursive: true });
|
|
976727
|
+
await (0, import_promises197.copyFile)(abs, dest);
|
|
976552
976728
|
return `./assets/${destRelative.split(import_path109.default.sep).join("/")}`;
|
|
976553
976729
|
} catch {
|
|
976554
976730
|
return obj;
|
|
@@ -976640,7 +976816,7 @@ async function listDocsThemes({
|
|
|
976640
976816
|
|
|
976641
976817
|
// src/commands/docs-theme/uploadDocsTheme.ts
|
|
976642
976818
|
init_lib6();
|
|
976643
|
-
var
|
|
976819
|
+
var import_promises199 = require("fs/promises");
|
|
976644
976820
|
init_js_yaml();
|
|
976645
976821
|
var import_path111 = __toESM(require("path"), 1);
|
|
976646
976822
|
|
|
@@ -976649,7 +976825,7 @@ init_lib8();
|
|
|
976649
976825
|
init_lib6();
|
|
976650
976826
|
var import_child_process13 = require("child_process");
|
|
976651
976827
|
var import_crypto10 = require("crypto");
|
|
976652
|
-
var
|
|
976828
|
+
var import_promises198 = require("fs/promises");
|
|
976653
976829
|
var import_mime_types2 = __toESM(require_mime_types(), 1);
|
|
976654
976830
|
var import_path110 = __toESM(require("path"), 1);
|
|
976655
976831
|
function getGitRoot() {
|
|
@@ -976693,7 +976869,7 @@ var ThemeConfigProcessor = class {
|
|
|
976693
976869
|
filePaths.map(async (filePath) => {
|
|
976694
976870
|
const abs = import_path110.default.resolve(this.themeDir, filePath);
|
|
976695
976871
|
try {
|
|
976696
|
-
await (0,
|
|
976872
|
+
await (0, import_promises198.access)(abs);
|
|
976697
976873
|
} catch {
|
|
976698
976874
|
errors4.push(`Referenced file not found: ${abs}`);
|
|
976699
976875
|
}
|
|
@@ -976858,7 +977034,7 @@ ${errors4.map((e2) => ` - ${e2}`).join("\n")}`,
|
|
|
976858
977034
|
return { config: cfg, filesUploaded };
|
|
976859
977035
|
}
|
|
976860
977036
|
async uploadFileToCas(absolutePath) {
|
|
976861
|
-
const content5 = await (0,
|
|
977037
|
+
const content5 = await (0, import_promises198.readFile)(absolutePath);
|
|
976862
977038
|
const contentType = import_mime_types2.default.lookup(absolutePath) || "application/octet-stream";
|
|
976863
977039
|
const bindPath = posixBindPath(this.gitRoot, absolutePath);
|
|
976864
977040
|
return this.uploadToCas(content5, contentType, bindPath, import_path110.default.basename(absolutePath));
|
|
@@ -976973,7 +977149,7 @@ async function uploadDocsTheme({
|
|
|
976973
977149
|
await cliContext.runTask(async (context3) => {
|
|
976974
977150
|
let rawYaml;
|
|
976975
977151
|
try {
|
|
976976
|
-
const content5 = await (0,
|
|
977152
|
+
const content5 = await (0, import_promises199.readFile)(themeYmlPath, "utf-8");
|
|
976977
977153
|
rawYaml = index_vite_proxy_tmp_default.load(content5, { schema: index_vite_proxy_tmp_default.JSON_SCHEMA });
|
|
976978
977154
|
} catch {
|
|
976979
977155
|
context3.failAndThrow(
|
|
@@ -977028,7 +977204,7 @@ async function uploadDocsTheme({
|
|
|
977028
977204
|
// src/commands/downgrade/downgrade.ts
|
|
977029
977205
|
init_lib19();
|
|
977030
977206
|
init_lib6();
|
|
977031
|
-
var
|
|
977207
|
+
var import_promises200 = require("fs/promises");
|
|
977032
977208
|
function ensureFinalNewline2(content5) {
|
|
977033
977209
|
return content5.endsWith("\n") ? content5 : content5 + "\n";
|
|
977034
977210
|
}
|
|
@@ -977053,7 +977229,7 @@ async function downgrade({
|
|
|
977053
977229
|
const newProjectConfig = produce(projectConfig.rawConfig, (draft) => {
|
|
977054
977230
|
draft.version = targetVersion;
|
|
977055
977231
|
});
|
|
977056
|
-
await (0,
|
|
977232
|
+
await (0, import_promises200.writeFile)(projectConfig._absolutePath, ensureFinalNewline2(JSON.stringify(newProjectConfig, void 0, 2)));
|
|
977057
977233
|
cliContext.logger.info(`Updated ${PROJECT_CONFIG_FILENAME} to version ${targetVersion}`);
|
|
977058
977234
|
}
|
|
977059
977235
|
|
|
@@ -977061,7 +977237,7 @@ async function downgrade({
|
|
|
977061
977237
|
init_lib36();
|
|
977062
977238
|
init_lib8();
|
|
977063
977239
|
init_lib22();
|
|
977064
|
-
var
|
|
977240
|
+
var import_promises201 = require("fs/promises");
|
|
977065
977241
|
init_js_yaml();
|
|
977066
977242
|
|
|
977067
977243
|
// src/commands/export/convertIrToOpenApi.ts
|
|
@@ -978483,8 +978659,8 @@ async function generateOpenAPIForWorkspaces({
|
|
|
978483
978659
|
ir: ir3,
|
|
978484
978660
|
mode: "openapi"
|
|
978485
978661
|
});
|
|
978486
|
-
await (0,
|
|
978487
|
-
await (0,
|
|
978662
|
+
await (0, import_promises201.mkdir)(dirname6(outputPath), { recursive: true });
|
|
978663
|
+
await (0, import_promises201.writeFile)(
|
|
978488
978664
|
outputPath,
|
|
978489
978665
|
outputPath.endsWith(".json") ? JSON.stringify(openapi, void 0, indent4) : index_vite_proxy_tmp_default.dump(openapi, { indent: indent4 })
|
|
978490
978666
|
);
|
|
@@ -979090,7 +979266,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
979090
979266
|
// src/commands/generate-overrides/compareOpenAPISpecs.ts
|
|
979091
979267
|
init_lib8();
|
|
979092
979268
|
init_lib6();
|
|
979093
|
-
var
|
|
979269
|
+
var import_promises202 = require("fs/promises");
|
|
979094
979270
|
init_js_yaml();
|
|
979095
979271
|
async function compareOpenAPISpecs({
|
|
979096
979272
|
originalPath,
|
|
@@ -979132,12 +979308,12 @@ async function compareOpenAPISpecs({
|
|
|
979132
979308
|
}
|
|
979133
979309
|
outputPath = join8(dirname6(originalPath), RelativeFilePath2.of(overridesFilename));
|
|
979134
979310
|
}
|
|
979135
|
-
await (0,
|
|
979311
|
+
await (0, import_promises202.writeFile)(outputPath, index_vite_proxy_tmp_default.dump(overrides, { lineWidth: -1, noRefs: true }));
|
|
979136
979312
|
context3.logger.info(`Overrides written to ${outputPath}`);
|
|
979137
979313
|
});
|
|
979138
979314
|
}
|
|
979139
979315
|
async function loadSpec2(filepath, context3) {
|
|
979140
|
-
const contents = await (0,
|
|
979316
|
+
const contents = await (0, import_promises202.readFile)(filepath, "utf8");
|
|
979141
979317
|
try {
|
|
979142
979318
|
return JSON.parse(contents);
|
|
979143
979319
|
} catch {
|
|
@@ -979245,7 +979421,7 @@ init_lib35();
|
|
|
979245
979421
|
init_lib16();
|
|
979246
979422
|
init_lib15();
|
|
979247
979423
|
init_lib6();
|
|
979248
|
-
var
|
|
979424
|
+
var import_promises203 = require("fs/promises");
|
|
979249
979425
|
init_js_yaml();
|
|
979250
979426
|
async function writeOverridesForWorkspaces({
|
|
979251
979427
|
project,
|
|
@@ -979271,7 +979447,7 @@ async function writeOverridesForWorkspaces({
|
|
|
979271
979447
|
async function readExistingOverrides(overridesFilepath, context3) {
|
|
979272
979448
|
let parsedOverrides = null;
|
|
979273
979449
|
try {
|
|
979274
|
-
const contents = (await (0,
|
|
979450
|
+
const contents = (await (0, import_promises203.readFile)(overridesFilepath, "utf8")).toString();
|
|
979275
979451
|
try {
|
|
979276
979452
|
parsedOverrides = JSON.parse(contents);
|
|
979277
979453
|
} catch (err) {
|
|
@@ -979336,7 +979512,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
979336
979512
|
for (const overridesPath of overridesPaths) {
|
|
979337
979513
|
const existingOverrides = await readExistingOverrides(overridesPath, context3);
|
|
979338
979514
|
const content5 = generateOverridesContent({ ir: ir3, existingOverrides, includeModels, context: context3 });
|
|
979339
|
-
await (0,
|
|
979515
|
+
await (0, import_promises203.writeFile)(overridesPath, index_vite_proxy_tmp_default.dump(content5));
|
|
979340
979516
|
}
|
|
979341
979517
|
} else {
|
|
979342
979518
|
const content5 = generateOverridesContent({ ir: ir3, existingOverrides: {}, includeModels, context: context3 });
|
|
@@ -979350,7 +979526,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
979350
979526
|
overridesFilename = `${nameWithoutExt}-overrides${extension4}`;
|
|
979351
979527
|
}
|
|
979352
979528
|
}
|
|
979353
|
-
await (0,
|
|
979529
|
+
await (0, import_promises203.writeFile)(
|
|
979354
979530
|
join8(dirname6(spec.absoluteFilepath), RelativeFilePath2.of(overridesFilename)),
|
|
979355
979531
|
index_vite_proxy_tmp_default.dump(content5)
|
|
979356
979532
|
);
|
|
@@ -979809,7 +979985,7 @@ function convertIRtoJsonSchema(args) {
|
|
|
979809
979985
|
// src/commands/jsonschema/generateJsonschemaForWorkspace.ts
|
|
979810
979986
|
init_lib21();
|
|
979811
979987
|
init_source();
|
|
979812
|
-
var
|
|
979988
|
+
var import_promises204 = require("fs/promises");
|
|
979813
979989
|
async function generateJsonschemaForWorkspaces({
|
|
979814
979990
|
typeLocator,
|
|
979815
979991
|
project,
|
|
@@ -979857,9 +980033,9 @@ async function generateJsonschemaForWorkspaces({
|
|
|
979857
980033
|
context: context3
|
|
979858
980034
|
});
|
|
979859
980035
|
if (!await doesPathExist(dirname6(jsonschemaFilepath))) {
|
|
979860
|
-
await (0,
|
|
980036
|
+
await (0, import_promises204.mkdir)(dirname6(jsonschemaFilepath), { recursive: true });
|
|
979861
980037
|
}
|
|
979862
|
-
await (0,
|
|
980038
|
+
await (0, import_promises204.writeFile)(jsonschemaFilepath, JSON.stringify(jsonSchema, null, 2));
|
|
979863
980039
|
context3.logger.info(source_default.green(`Wrote JSON Schema to ${jsonschemaFilepath}`));
|
|
979864
980040
|
});
|
|
979865
980041
|
})
|
|
@@ -979869,7 +980045,7 @@ async function generateJsonschemaForWorkspaces({
|
|
|
979869
980045
|
// src/commands/merge/mergeOpenAPIWithOverrides.ts
|
|
979870
980046
|
init_lib8();
|
|
979871
980047
|
init_lib6();
|
|
979872
|
-
var
|
|
980048
|
+
var import_promises205 = require("fs/promises");
|
|
979873
980049
|
init_js_yaml();
|
|
979874
980050
|
var HTTP_METHODS4 = /* @__PURE__ */ new Set(["get", "put", "post", "delete", "options", "head", "patch", "trace"]);
|
|
979875
980051
|
async function mergeOpenAPIWithOverrides({
|
|
@@ -979898,11 +980074,11 @@ async function mergeOpenAPIWithOverrides({
|
|
|
979898
980074
|
if (split2) {
|
|
979899
980075
|
const examples = extractEnrichedExamples2(openapi, merged);
|
|
979900
980076
|
const output2 = isJson ? JSON.stringify(examples, null, 2) : index_vite_proxy_tmp_default.dump(examples, { lineWidth: -1, noRefs: true });
|
|
979901
|
-
await (0,
|
|
980077
|
+
await (0, import_promises205.writeFile)(outputPath, output2);
|
|
979902
980078
|
context3.logger.info(`Extracted enriched examples written to ${outputPath}`);
|
|
979903
980079
|
} else {
|
|
979904
980080
|
const output2 = isJson ? JSON.stringify(merged, null, 2) : index_vite_proxy_tmp_default.dump(merged, { lineWidth: -1, noRefs: true });
|
|
979905
|
-
await (0,
|
|
980081
|
+
await (0, import_promises205.writeFile)(outputPath, output2);
|
|
979906
980082
|
if (outputPath === openapiPath) {
|
|
979907
980083
|
context3.logger.info(`Enriched ${openapiPath} in-place`);
|
|
979908
980084
|
} else {
|
|
@@ -979912,7 +980088,7 @@ async function mergeOpenAPIWithOverrides({
|
|
|
979912
980088
|
});
|
|
979913
980089
|
}
|
|
979914
980090
|
async function loadYamlOrJson(filepath, context3) {
|
|
979915
|
-
const contents = await (0,
|
|
980091
|
+
const contents = await (0, import_promises205.readFile)(filepath, "utf8");
|
|
979916
980092
|
try {
|
|
979917
980093
|
return JSON.parse(contents);
|
|
979918
980094
|
} catch {
|
|
@@ -980707,7 +980883,7 @@ init_lib35();
|
|
|
980707
980883
|
init_lib6();
|
|
980708
980884
|
init_esm19();
|
|
980709
980885
|
init_axios2();
|
|
980710
|
-
var
|
|
980886
|
+
var import_promises206 = require("fs/promises");
|
|
980711
980887
|
var import_path117 = __toESM(require("path"), 1);
|
|
980712
980888
|
init_index_min2();
|
|
980713
980889
|
var import_tmp_promise20 = __toESM(require_tmp_promise(), 1);
|
|
@@ -980761,7 +980937,7 @@ async function registerWorkspacesV1({
|
|
|
980761
980937
|
context3.logger.debug(`Compressing definition at ${tmpDir.path}`);
|
|
980762
980938
|
await Kn({ file: tarPath, cwd: resolvedWorkspace.absoluteFilePath }, ["."]);
|
|
980763
980939
|
context3.logger.info("Uploading definition...");
|
|
980764
|
-
await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0,
|
|
980940
|
+
await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0, import_promises206.readFile)(tarPath));
|
|
980765
980941
|
context3.logger.info(
|
|
980766
980942
|
`Registered @${project.config.organization}/${resolvedWorkspace.definition.rootApiFile.contents.name}:${registerApiResponse.body.version}`
|
|
980767
980943
|
);
|
|
@@ -980818,7 +980994,7 @@ function getAIEnhancerConfig2() {
|
|
|
980818
980994
|
// src/commands/resolve-specs/resolveSpecsForWorkspaces.ts
|
|
980819
980995
|
init_lib8();
|
|
980820
980996
|
init_lib35();
|
|
980821
|
-
var
|
|
980997
|
+
var import_promises207 = require("fs/promises");
|
|
980822
980998
|
var import_path118 = __toESM(require("path"), 1);
|
|
980823
980999
|
async function resolveSpecsForWorkspaces({
|
|
980824
981000
|
project,
|
|
@@ -980838,14 +981014,14 @@ async function resolveSpecsForWorkspaces({
|
|
|
980838
981014
|
return;
|
|
980839
981015
|
}
|
|
980840
981016
|
const workspaceOutputDir = project.apiWorkspaces.length > 1 ? AbsoluteFilePath2.of(import_path118.default.join(outputDir, workspace.workspaceName ?? "api")) : outputDir;
|
|
980841
|
-
await (0,
|
|
981017
|
+
await (0, import_promises207.mkdir)(workspaceOutputDir, { recursive: true });
|
|
980842
981018
|
const manifest = await collectRawSpecs({
|
|
980843
981019
|
specs,
|
|
980844
981020
|
hostOutputDir: workspaceOutputDir,
|
|
980845
981021
|
containerBaseDir: ".",
|
|
980846
981022
|
context: context3
|
|
980847
981023
|
});
|
|
980848
|
-
await (0,
|
|
981024
|
+
await (0, import_promises207.writeFile)(
|
|
980849
981025
|
import_path118.default.join(workspaceOutputDir, SPECS_MANIFEST_FILENAME),
|
|
980850
981026
|
JSON.stringify(manifest, void 0, 4)
|
|
980851
981027
|
);
|
|
@@ -981055,7 +981231,7 @@ init_lib17();
|
|
|
981055
981231
|
init_lib19();
|
|
981056
981232
|
init_lib8();
|
|
981057
981233
|
init_lib6();
|
|
981058
|
-
var
|
|
981234
|
+
var import_promises208 = __toESM(require("fs/promises"), 1);
|
|
981059
981235
|
|
|
981060
981236
|
// src/commands/sdk-preview/computePreviewVersion.ts
|
|
981061
981237
|
var BASE_VERSION = "0.0.1";
|
|
@@ -981175,7 +981351,7 @@ async function sdkPreview({
|
|
|
981175
981351
|
const firstPath = pathOutputs[0];
|
|
981176
981352
|
const absolutePathToOutput = firstPath != null ? AbsoluteFilePath2.of(resolve6(cwd(), firstPath)) : void 0;
|
|
981177
981353
|
if (absolutePathToOutput != null) {
|
|
981178
|
-
await
|
|
981354
|
+
await import_promises208.default.mkdir(absolutePathToOutput, { recursive: true });
|
|
981179
981355
|
}
|
|
981180
981356
|
for (const workspace of project.apiWorkspaces) {
|
|
981181
981357
|
if (workspace.generatorsConfiguration == null) {
|
|
@@ -981365,7 +981541,7 @@ async function sdkPreview({
|
|
|
981365
981541
|
init_lib33();
|
|
981366
981542
|
init_lib6();
|
|
981367
981543
|
init_source();
|
|
981368
|
-
var
|
|
981544
|
+
var import_promises209 = require("fs/promises");
|
|
981369
981545
|
var import_path119 = require("path");
|
|
981370
981546
|
async function getPackageManagerBinDir(logger4, pm) {
|
|
981371
981547
|
let command3;
|
|
@@ -981411,7 +981587,7 @@ async function detectInstallationMethod(logger4) {
|
|
|
981411
981587
|
logger4.debug(`Found fern at: ${fernPath}`);
|
|
981412
981588
|
let resolvedPath;
|
|
981413
981589
|
try {
|
|
981414
|
-
resolvedPath = await (0,
|
|
981590
|
+
resolvedPath = await (0, import_promises209.realpath)(fernPath);
|
|
981415
981591
|
logger4.debug(`Resolved to: ${resolvedPath}`);
|
|
981416
981592
|
} catch (error50) {
|
|
981417
981593
|
logger4.debug(`Failed to resolve symlink: ${error50}`);
|
|
@@ -981725,22 +981901,22 @@ init_lib19();
|
|
|
981725
981901
|
init_lib8();
|
|
981726
981902
|
init_lib6();
|
|
981727
981903
|
var fs33 = __toESM(require("fs"), 1);
|
|
981728
|
-
var
|
|
981904
|
+
var import_promises210 = require("fs/promises");
|
|
981729
981905
|
init_graphql();
|
|
981730
981906
|
init_js_yaml();
|
|
981731
981907
|
var import_stream18 = require("stream");
|
|
981732
|
-
var
|
|
981908
|
+
var import_promises211 = require("stream/promises");
|
|
981733
981909
|
async function fetchAndWriteFile(url3, path119, logger4, indent4) {
|
|
981734
981910
|
const resp = await fetch(url3);
|
|
981735
981911
|
if (resp.ok && resp.body) {
|
|
981736
981912
|
logger4.debug("Origin successfully fetched, writing to file");
|
|
981737
981913
|
const fileStream = fs33.createWriteStream(path119);
|
|
981738
|
-
await (0,
|
|
981739
|
-
const fileContents = await (0,
|
|
981914
|
+
await (0, import_promises211.finished)(import_stream18.Readable.fromWeb(resp.body).pipe(fileStream));
|
|
981915
|
+
const fileContents = await (0, import_promises210.readFile)(path119, "utf8");
|
|
981740
981916
|
try {
|
|
981741
|
-
await (0,
|
|
981917
|
+
await (0, import_promises210.writeFile)(path119, JSON.stringify(JSON.parse(fileContents), void 0, indent4), "utf8");
|
|
981742
981918
|
} catch (e2) {
|
|
981743
|
-
await (0,
|
|
981919
|
+
await (0, import_promises210.writeFile)(path119, index_vite_proxy_tmp_default.dump(index_vite_proxy_tmp_default.load(fileContents), { indent: indent4 }), "utf8");
|
|
981744
981920
|
}
|
|
981745
981921
|
logger4.debug("File written successfully");
|
|
981746
981922
|
}
|
|
@@ -981896,14 +982072,14 @@ async function tryDirectJSONFetch(url3, logger4) {
|
|
|
981896
982072
|
async function fetchGraphQLSchemaWithAutoDetection(url3, path119, logger4) {
|
|
981897
982073
|
const postResult = await tryGraphQLIntrospection(url3, logger4);
|
|
981898
982074
|
if (postResult.success) {
|
|
981899
|
-
await (0,
|
|
982075
|
+
await (0, import_promises210.writeFile)(path119, postResult.result, "utf8");
|
|
981900
982076
|
logger4.info("Successfully fetched GraphQL schema using POST introspection");
|
|
981901
982077
|
return;
|
|
981902
982078
|
}
|
|
981903
982079
|
logger4.debug(`POST introspection failed: ${postResult.error}`);
|
|
981904
982080
|
const getResult = await tryDirectJSONFetch(url3, logger4);
|
|
981905
982081
|
if (getResult.success) {
|
|
981906
|
-
await (0,
|
|
982082
|
+
await (0, import_promises210.writeFile)(path119, getResult.result, "utf8");
|
|
981907
982083
|
logger4.info("Successfully fetched GraphQL schema using direct JSON fetch");
|
|
981908
982084
|
return;
|
|
981909
982085
|
}
|
|
@@ -982613,7 +982789,7 @@ async function validateWorkspaces({
|
|
|
982613
982789
|
init_lib19();
|
|
982614
982790
|
init_lib8();
|
|
982615
982791
|
init_source();
|
|
982616
|
-
var
|
|
982792
|
+
var import_promises212 = require("fs/promises");
|
|
982617
982793
|
init_js_yaml();
|
|
982618
982794
|
var import_path121 = __toESM(require("path"), 1);
|
|
982619
982795
|
async function writeDefinitionForWorkspaces({
|
|
@@ -982695,22 +982871,22 @@ async function writeFernDefinition({
|
|
|
982695
982871
|
return a3.localeCompare(b5);
|
|
982696
982872
|
};
|
|
982697
982873
|
if (await doesPathExist(absolutePathToOutputDirectory)) {
|
|
982698
|
-
await (0,
|
|
982874
|
+
await (0, import_promises212.rm)(absolutePathToOutputDirectory, { recursive: true });
|
|
982699
982875
|
}
|
|
982700
|
-
await (0,
|
|
982701
|
-
await (0,
|
|
982876
|
+
await (0, import_promises212.mkdir)(absolutePathToOutputDirectory, { recursive: true });
|
|
982877
|
+
await (0, import_promises212.writeFile)(
|
|
982702
982878
|
join8(absolutePathToOutputDirectory, RelativeFilePath2.of(ROOT_API_FILENAME)),
|
|
982703
982879
|
index_vite_proxy_tmp_default.dump(definition3.rootApiFile.contents, { sortKeys })
|
|
982704
982880
|
);
|
|
982705
982881
|
for (const [relativePath, packageMarker] of Object.entries(definition3.packageMarkers)) {
|
|
982706
982882
|
const absoluteFilepath = join8(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
|
|
982707
|
-
await (0,
|
|
982708
|
-
await (0,
|
|
982883
|
+
await (0, import_promises212.mkdir)(dirname6(absoluteFilepath), { recursive: true });
|
|
982884
|
+
await (0, import_promises212.writeFile)(absoluteFilepath, index_vite_proxy_tmp_default.dump(packageMarker.contents, { sortKeys }));
|
|
982709
982885
|
}
|
|
982710
982886
|
for (const [relativePath, definitionFile] of Object.entries(definition3.namedDefinitionFiles)) {
|
|
982711
982887
|
const absoluteFilepath = join8(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
|
|
982712
|
-
await (0,
|
|
982713
|
-
await (0,
|
|
982888
|
+
await (0, import_promises212.mkdir)(dirname6(absoluteFilepath), { recursive: true });
|
|
982889
|
+
await (0, import_promises212.writeFile)(absoluteFilepath, index_vite_proxy_tmp_default.dump(definitionFile.contents, { sortKeys }));
|
|
982714
982890
|
}
|
|
982715
982891
|
}
|
|
982716
982892
|
|
|
@@ -982718,7 +982894,7 @@ async function writeFernDefinition({
|
|
|
982718
982894
|
init_lib67();
|
|
982719
982895
|
init_lib8();
|
|
982720
982896
|
init_source();
|
|
982721
|
-
var
|
|
982897
|
+
var import_promises213 = require("fs/promises");
|
|
982722
982898
|
async function writeDocsDefinitionForProject({
|
|
982723
982899
|
project,
|
|
982724
982900
|
outputPath,
|
|
@@ -982750,7 +982926,7 @@ async function writeDocsDefinitionForProject({
|
|
|
982750
982926
|
targetAudiences: docsWorkspace.config.instances[0]?.audiences ? Array.isArray(docsWorkspace.config.instances[0].audiences) ? docsWorkspace.config.instances[0].audiences : [docsWorkspace.config.instances[0].audiences] : void 0
|
|
982751
982927
|
});
|
|
982752
982928
|
const docsDefinition = await docsResolver.resolve();
|
|
982753
|
-
await (0,
|
|
982929
|
+
await (0, import_promises213.writeFile)(AbsoluteFilePath2.of(outputPath), JSON.stringify(docsDefinition, null, 2));
|
|
982754
982930
|
context3.logger.info(source_default.green(`Docs definition written to ${outputPath}`));
|
|
982755
982931
|
});
|
|
982756
982932
|
}
|