fern-api 0.39.11 → 0.39.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.cjs +93 -69
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -81211,9 +81211,9 @@ var require_symlink = __commonJS({
|
|
|
81211
81211
|
if (areIdentical(srcStat, dstStat))
|
|
81212
81212
|
return;
|
|
81213
81213
|
}
|
|
81214
|
-
const
|
|
81215
|
-
srcpath =
|
|
81216
|
-
const toType = await symlinkType(
|
|
81214
|
+
const relative4 = await symlinkPaths(srcpath, dstpath);
|
|
81215
|
+
srcpath = relative4.toDst;
|
|
81216
|
+
const toType = await symlinkType(relative4.toCwd, type2);
|
|
81217
81217
|
const dir = path45.dirname(dstpath);
|
|
81218
81218
|
if (!await pathExists2(dir)) {
|
|
81219
81219
|
await mkdirs(dir);
|
|
@@ -81232,9 +81232,9 @@ var require_symlink = __commonJS({
|
|
|
81232
81232
|
if (areIdentical(srcStat, dstStat))
|
|
81233
81233
|
return;
|
|
81234
81234
|
}
|
|
81235
|
-
const
|
|
81236
|
-
srcpath =
|
|
81237
|
-
type2 = symlinkTypeSync(
|
|
81235
|
+
const relative4 = symlinkPathsSync(srcpath, dstpath);
|
|
81236
|
+
srcpath = relative4.toDst;
|
|
81237
|
+
type2 = symlinkTypeSync(relative4.toCwd, type2);
|
|
81238
81238
|
const dir = path45.dirname(dstpath);
|
|
81239
81239
|
const exists = fs8.existsSync(dir);
|
|
81240
81240
|
if (exists)
|
|
@@ -86020,8 +86020,8 @@ var require_follow_redirects = __commonJS({
|
|
|
86020
86020
|
}
|
|
86021
86021
|
return parsed;
|
|
86022
86022
|
}
|
|
86023
|
-
function resolveUrl(
|
|
86024
|
-
return useNativeURL ? new URL2(
|
|
86023
|
+
function resolveUrl(relative4, base2) {
|
|
86024
|
+
return useNativeURL ? new URL2(relative4, base2) : parseUrl(url.resolve(base2, relative4));
|
|
86025
86025
|
}
|
|
86026
86026
|
function validateUrl(input) {
|
|
86027
86027
|
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
@@ -368671,51 +368671,51 @@ var require_uri_all = __commonJS({
|
|
|
368671
368671
|
}
|
|
368672
368672
|
return uriTokens.join("");
|
|
368673
368673
|
}
|
|
368674
|
-
function resolveComponents(base3,
|
|
368674
|
+
function resolveComponents(base3, relative4) {
|
|
368675
368675
|
var options2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
368676
368676
|
var skipNormalization = arguments[3];
|
|
368677
368677
|
var target = {};
|
|
368678
368678
|
if (!skipNormalization) {
|
|
368679
368679
|
base3 = parse10(serialize5(base3, options2), options2);
|
|
368680
|
-
|
|
368680
|
+
relative4 = parse10(serialize5(relative4, options2), options2);
|
|
368681
368681
|
}
|
|
368682
368682
|
options2 = options2 || {};
|
|
368683
|
-
if (!options2.tolerant &&
|
|
368684
|
-
target.scheme =
|
|
368685
|
-
target.userinfo =
|
|
368686
|
-
target.host =
|
|
368687
|
-
target.port =
|
|
368688
|
-
target.path = removeDotSegments(
|
|
368689
|
-
target.query =
|
|
368683
|
+
if (!options2.tolerant && relative4.scheme) {
|
|
368684
|
+
target.scheme = relative4.scheme;
|
|
368685
|
+
target.userinfo = relative4.userinfo;
|
|
368686
|
+
target.host = relative4.host;
|
|
368687
|
+
target.port = relative4.port;
|
|
368688
|
+
target.path = removeDotSegments(relative4.path || "");
|
|
368689
|
+
target.query = relative4.query;
|
|
368690
368690
|
} else {
|
|
368691
|
-
if (
|
|
368692
|
-
target.userinfo =
|
|
368693
|
-
target.host =
|
|
368694
|
-
target.port =
|
|
368695
|
-
target.path = removeDotSegments(
|
|
368696
|
-
target.query =
|
|
368691
|
+
if (relative4.userinfo !== void 0 || relative4.host !== void 0 || relative4.port !== void 0) {
|
|
368692
|
+
target.userinfo = relative4.userinfo;
|
|
368693
|
+
target.host = relative4.host;
|
|
368694
|
+
target.port = relative4.port;
|
|
368695
|
+
target.path = removeDotSegments(relative4.path || "");
|
|
368696
|
+
target.query = relative4.query;
|
|
368697
368697
|
} else {
|
|
368698
|
-
if (!
|
|
368698
|
+
if (!relative4.path) {
|
|
368699
368699
|
target.path = base3.path;
|
|
368700
|
-
if (
|
|
368701
|
-
target.query =
|
|
368700
|
+
if (relative4.query !== void 0) {
|
|
368701
|
+
target.query = relative4.query;
|
|
368702
368702
|
} else {
|
|
368703
368703
|
target.query = base3.query;
|
|
368704
368704
|
}
|
|
368705
368705
|
} else {
|
|
368706
|
-
if (
|
|
368707
|
-
target.path = removeDotSegments(
|
|
368706
|
+
if (relative4.path.charAt(0) === "/") {
|
|
368707
|
+
target.path = removeDotSegments(relative4.path);
|
|
368708
368708
|
} else {
|
|
368709
368709
|
if ((base3.userinfo !== void 0 || base3.host !== void 0 || base3.port !== void 0) && !base3.path) {
|
|
368710
|
-
target.path = "/" +
|
|
368710
|
+
target.path = "/" + relative4.path;
|
|
368711
368711
|
} else if (!base3.path) {
|
|
368712
|
-
target.path =
|
|
368712
|
+
target.path = relative4.path;
|
|
368713
368713
|
} else {
|
|
368714
|
-
target.path = base3.path.slice(0, base3.path.lastIndexOf("/") + 1) +
|
|
368714
|
+
target.path = base3.path.slice(0, base3.path.lastIndexOf("/") + 1) + relative4.path;
|
|
368715
368715
|
}
|
|
368716
368716
|
target.path = removeDotSegments(target.path);
|
|
368717
368717
|
}
|
|
368718
|
-
target.query =
|
|
368718
|
+
target.query = relative4.query;
|
|
368719
368719
|
}
|
|
368720
368720
|
target.userinfo = base3.userinfo;
|
|
368721
368721
|
target.host = base3.host;
|
|
@@ -368723,7 +368723,7 @@ var require_uri_all = __commonJS({
|
|
|
368723
368723
|
}
|
|
368724
368724
|
target.scheme = base3.scheme;
|
|
368725
368725
|
}
|
|
368726
|
-
target.fragment =
|
|
368726
|
+
target.fragment = relative4.fragment;
|
|
368727
368727
|
return target;
|
|
368728
368728
|
}
|
|
368729
368729
|
function resolve6(baseURI, relativeURI, options2) {
|
|
@@ -430518,7 +430518,7 @@ var require_lib20 = __commonJS({
|
|
|
430518
430518
|
// ../../../node_modules/.pnpm/depd@2.0.0/node_modules/depd/index.js
|
|
430519
430519
|
var require_depd = __commonJS({
|
|
430520
430520
|
"../../../node_modules/.pnpm/depd@2.0.0/node_modules/depd/index.js"(exports2, module2) {
|
|
430521
|
-
var
|
|
430521
|
+
var relative4 = require("path").relative;
|
|
430522
430522
|
module2.exports = depd;
|
|
430523
430523
|
var basePath = process.cwd();
|
|
430524
430524
|
function containsNamespace(str3, namespace) {
|
|
@@ -430710,7 +430710,7 @@ var require_depd = __commonJS({
|
|
|
430710
430710
|
return formatted;
|
|
430711
430711
|
}
|
|
430712
430712
|
function formatLocation(callSite) {
|
|
430713
|
-
return
|
|
430713
|
+
return relative4(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2];
|
|
430714
430714
|
}
|
|
430715
430715
|
function getStack() {
|
|
430716
430716
|
var limit = Error.stackTraceLimit;
|
|
@@ -1192625,7 +1192625,7 @@ var AccessTokenPosthogManager = class {
|
|
|
1192625
1192625
|
properties: {
|
|
1192626
1192626
|
...event,
|
|
1192627
1192627
|
...event.properties,
|
|
1192628
|
-
version: "0.39.
|
|
1192628
|
+
version: "0.39.12",
|
|
1192629
1192629
|
usingAccessToken: true
|
|
1192630
1192630
|
}
|
|
1192631
1192631
|
});
|
|
@@ -1192687,7 +1192687,7 @@ var UserPosthogManager = class {
|
|
|
1192687
1192687
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
1192688
1192688
|
event: "CLI",
|
|
1192689
1192689
|
properties: {
|
|
1192690
|
-
version: "0.39.
|
|
1192690
|
+
version: "0.39.12",
|
|
1192691
1192691
|
...event,
|
|
1192692
1192692
|
...event.properties
|
|
1192693
1192693
|
}
|
|
@@ -1222814,10 +1222814,10 @@ var CliContext = class {
|
|
|
1222814
1222814
|
return "fern-api";
|
|
1222815
1222815
|
}
|
|
1222816
1222816
|
getPackageVersion() {
|
|
1222817
|
-
if ("0.39.
|
|
1222817
|
+
if ("0.39.12" == null) {
|
|
1222818
1222818
|
this.logger.error("CLI_VERSION is not defined");
|
|
1222819
1222819
|
}
|
|
1222820
|
-
return "0.39.
|
|
1222820
|
+
return "0.39.12";
|
|
1222821
1222821
|
}
|
|
1222822
1222822
|
getCliName() {
|
|
1222823
1222823
|
if ("fern" == null) {
|
|
@@ -1231179,16 +1231179,16 @@ function collect(events, tokenTypes) {
|
|
|
1231179
1231179
|
}
|
|
1231180
1231180
|
return result;
|
|
1231181
1231181
|
}
|
|
1231182
|
-
function relativeToPoint(stops,
|
|
1231182
|
+
function relativeToPoint(stops, relative4) {
|
|
1231183
1231183
|
let index2 = 0;
|
|
1231184
|
-
while (index2 < stops.length && stops[index2][0] <=
|
|
1231184
|
+
while (index2 < stops.length && stops[index2][0] <= relative4) {
|
|
1231185
1231185
|
index2 += 1;
|
|
1231186
1231186
|
}
|
|
1231187
1231187
|
if (index2 === 0) {
|
|
1231188
1231188
|
return void 0;
|
|
1231189
1231189
|
}
|
|
1231190
1231190
|
const [stopRelative, stopAbsolute] = stops[index2 - 1];
|
|
1231191
|
-
const rest =
|
|
1231191
|
+
const rest = relative4 - stopRelative;
|
|
1231192
1231192
|
return {
|
|
1231193
1231193
|
line: stopAbsolute.line,
|
|
1231194
1231194
|
column: stopAbsolute.column + rest,
|
|
@@ -1240311,7 +1240311,7 @@ async function convertTransport({ file, serviceDeclaration, sourceResolver }) {
|
|
|
1240311
1240311
|
source: serviceDeclaration.source,
|
|
1240312
1240312
|
file
|
|
1240313
1240313
|
});
|
|
1240314
|
-
if (resolvedSource.type !== "protobuf") {
|
|
1240314
|
+
if (resolvedSource == null || resolvedSource.type !== "protobuf") {
|
|
1240315
1240315
|
return Transport.http();
|
|
1240316
1240316
|
}
|
|
1240317
1240317
|
const protobufService = convertProtobufService({
|
|
@@ -1241870,7 +1241870,7 @@ async function convertTypeDeclarationSource({ file, typeDeclaration, typeName, s
|
|
|
1241870
1241870
|
source: typeDeclaration.source,
|
|
1241871
1241871
|
file
|
|
1241872
1241872
|
});
|
|
1241873
|
-
if (resolvedSource.type !== "protobuf") {
|
|
1241873
|
+
if (resolvedSource == null || resolvedSource.type !== "protobuf") {
|
|
1241874
1241874
|
return void 0;
|
|
1241875
1241875
|
}
|
|
1241876
1241876
|
return Source.proto(convertSourceToProtobufType({
|
|
@@ -1244146,17 +1244146,21 @@ var ProtobufParser = class {
|
|
|
1244146
1244146
|
|
|
1244147
1244147
|
// ../generation/ir-generator/lib/resolvers/SourceResolver.js
|
|
1244148
1244148
|
var SourceResolverImpl = class {
|
|
1244149
|
+
context;
|
|
1244149
1244150
|
workspace;
|
|
1244150
1244151
|
sourceCache;
|
|
1244151
|
-
constructor(workspace) {
|
|
1244152
|
+
constructor(context, workspace) {
|
|
1244153
|
+
this.context = context;
|
|
1244152
1244154
|
this.workspace = workspace;
|
|
1244153
1244155
|
this.sourceCache = /* @__PURE__ */ new Map();
|
|
1244154
1244156
|
}
|
|
1244155
1244157
|
async resolveSourceOrThrow({ source, file }) {
|
|
1244156
1244158
|
const resolvedType = await this.resolveSource({ source, file });
|
|
1244157
1244159
|
if (resolvedType == null) {
|
|
1244158
|
-
|
|
1244159
|
-
|
|
1244160
|
+
if (isRawProtobufSourceSchema(source)) {
|
|
1244161
|
+
throw new Error(`Cannot resolve source ${source.proto} from file ${file.relativeFilepath}`);
|
|
1244162
|
+
}
|
|
1244163
|
+
this.context.logger.warn(`Cannot resolve source ${source.openapi} from file ${file.relativeFilepath}`);
|
|
1244160
1244164
|
}
|
|
1244161
1244165
|
return resolvedType;
|
|
1244162
1244166
|
}
|
|
@@ -1244448,7 +1244452,7 @@ function getAudienceForEnvironment(environmentId, rawEnvironments) {
|
|
|
1244448
1244452
|
}
|
|
1244449
1244453
|
|
|
1244450
1244454
|
// ../generation/ir-generator/lib/generateIntermediateRepresentation.js
|
|
1244451
|
-
async function generateIntermediateRepresentation({ fdrApiDefinitionId, workspace, generationLanguage, keywords: keywords2, smartCasing, disableExamples, audiences, readme, packageName, version: version3 }) {
|
|
1244455
|
+
async function generateIntermediateRepresentation({ fdrApiDefinitionId, workspace, generationLanguage, keywords: keywords2, smartCasing, disableExamples, audiences, readme, packageName, version: version3, context }) {
|
|
1244452
1244456
|
const casingsGenerator = constructCasingsGenerator({ generationLanguage, keywords: keywords2, smartCasing });
|
|
1244453
1244457
|
const irGraph = new IrGraph(audiences);
|
|
1244454
1244458
|
const rootApiFileContext = constructRootApiFileContext({
|
|
@@ -1244468,7 +1244472,7 @@ async function generateIntermediateRepresentation({ fdrApiDefinitionId, workspac
|
|
|
1244468
1244472
|
const errorResolver = new ErrorResolverImpl(workspace);
|
|
1244469
1244473
|
const exampleResolver = new ExampleResolverImpl(typeResolver);
|
|
1244470
1244474
|
const variableResolver = new VariableResolverImpl();
|
|
1244471
|
-
const sourceResolver = new SourceResolverImpl(workspace);
|
|
1244475
|
+
const sourceResolver = new SourceResolverImpl(context, workspace);
|
|
1244472
1244476
|
const intermediateRepresentation = {
|
|
1244473
1244477
|
fdrApiDefinitionId,
|
|
1244474
1244478
|
apiVersion: await convertApiVersionScheme({
|
|
@@ -1246927,7 +1246931,8 @@ async function registerApi({ organization, workspace, context, token, audiences,
|
|
|
1246927
1246931
|
disableExamples: false,
|
|
1246928
1246932
|
readme: void 0,
|
|
1246929
1246933
|
version: void 0,
|
|
1246930
|
-
packageName: void 0
|
|
1246934
|
+
packageName: void 0,
|
|
1246935
|
+
context
|
|
1246931
1246936
|
});
|
|
1246932
1246937
|
const fdrService = createFdrService({
|
|
1246933
1246938
|
token: token.value
|
|
@@ -1247294,7 +1247299,8 @@ var DocsDefinitionResolver = class {
|
|
|
1247294
1247299
|
disableExamples: false,
|
|
1247295
1247300
|
readme: void 0,
|
|
1247296
1247301
|
version: void 0,
|
|
1247297
|
-
packageName: void 0
|
|
1247302
|
+
packageName: void 0,
|
|
1247303
|
+
context: this.taskContext
|
|
1247298
1247304
|
});
|
|
1247299
1247305
|
const apiDefinitionId = await this.registerApi({ ir, snippetsConfig });
|
|
1247300
1247306
|
const api = convertIrToApiDefinition(ir, apiDefinitionId);
|
|
@@ -1294878,7 +1294884,8 @@ async function generateIrForFernWorkspace({
|
|
|
1294878
1294884
|
audiences,
|
|
1294879
1294885
|
readme,
|
|
1294880
1294886
|
version: void 0,
|
|
1294881
|
-
packageName: void 0
|
|
1294887
|
+
packageName: void 0,
|
|
1294888
|
+
context
|
|
1294882
1294889
|
});
|
|
1294883
1294890
|
}
|
|
1294884
1294891
|
|
|
@@ -1305861,7 +1305868,8 @@ async function getIntermediateRepresentation2({ workspace, audiences, generatorI
|
|
|
1305861
1305868
|
disableExamples: generatorInvocation.disableExamples,
|
|
1305862
1305869
|
readme: generatorInvocation.readme,
|
|
1305863
1305870
|
version: version3,
|
|
1305864
|
-
packageName
|
|
1305871
|
+
packageName,
|
|
1305872
|
+
context
|
|
1305865
1305873
|
});
|
|
1305866
1305874
|
if (sourceConfig != null) {
|
|
1305867
1305875
|
intermediateRepresentation.sourceConfig = sourceConfig;
|
|
@@ -1306285,6 +1306293,7 @@ var import_fiddle_sdk4 = __toESM(require_fiddle_sdk(), 1);
|
|
|
1306285
1306293
|
var import_axios6 = __toESM(require_axios4(), 1);
|
|
1306286
1306294
|
var import_form_data2 = __toESM(require_form_data(), 1);
|
|
1306287
1306295
|
var import_promises48 = require("fs/promises");
|
|
1306296
|
+
var import_path39 = require("path");
|
|
1306288
1306297
|
var import_tar2 = __toESM(require_tar(), 1);
|
|
1306289
1306298
|
var import_tmp_promise10 = __toESM(require_tmp_promise(), 1);
|
|
1306290
1306299
|
async function createAndStartJob({ projectConfig, workspace, organization, intermediateRepresentation, generatorInvocation, version: version3, context, shouldLogS3Url, token, whitelabel, irVersionOverride, absolutePathToPreview }) {
|
|
@@ -1306333,6 +1306342,18 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
|
|
|
1306333
1306342
|
});
|
|
1306334
1306343
|
const absolutePathToFernConfigJson = join(absolutePathToTmpFernDirectory, RelativeFilePath.of(PROJECT_CONFIG_FILENAME));
|
|
1306335
1306344
|
await (0, import_promises48.writeFile)(absolutePathToFernConfigJson, JSON.stringify(projectConfig.rawConfig, void 0, 2));
|
|
1306345
|
+
try {
|
|
1306346
|
+
const sources = workspace.getSources();
|
|
1306347
|
+
for (const source of sources) {
|
|
1306348
|
+
const sourceContents = await (0, import_promises48.readFile)(source.absoluteFilePath);
|
|
1306349
|
+
const relativeLocation = (0, import_path39.relative)(workspace.absoluteFilepath, source.absoluteFilePath);
|
|
1306350
|
+
const absolutePathToSourceFile = join(absolutePathToTmpFernDirectory, RelativeFilePath.of(relativeLocation));
|
|
1306351
|
+
await (0, import_promises48.mkdir)(dirname(absolutePathToSourceFile), { recursive: true });
|
|
1306352
|
+
await (0, import_promises48.writeFile)(absolutePathToSourceFile, sourceContents);
|
|
1306353
|
+
}
|
|
1306354
|
+
} catch (error) {
|
|
1306355
|
+
context.logger.debug(`Failed to write source files to disk, continuing: ${error}`);
|
|
1306356
|
+
}
|
|
1306336
1306357
|
const tarPath = join(absolutePathToTmpDir, RelativeFilePath.of("definition.tgz"));
|
|
1306337
1306358
|
await import_tar2.default.create({ file: tarPath, cwd: absolutePathToTmpFernDirectory }, ["."]);
|
|
1306338
1306359
|
context.logger.debug("Getting upload URL for Fern definition.");
|
|
@@ -1306537,7 +1306558,7 @@ var import_axios7 = __toESM(require_axios4(), 1);
|
|
|
1306537
1306558
|
var import_decompress3 = __toESM(require_decompress(), 1);
|
|
1306538
1306559
|
var import_fs9 = require("fs");
|
|
1306539
1306560
|
var import_promises49 = require("fs/promises");
|
|
1306540
|
-
var
|
|
1306561
|
+
var import_path40 = __toESM(require("path"), 1);
|
|
1306541
1306562
|
var import_promises50 = require("stream/promises");
|
|
1306542
1306563
|
var import_tmp_promise11 = __toESM(require_tmp_promise(), 1);
|
|
1306543
1306564
|
var _isFinished, _createdSnippets, _snippetsS3PreSignedReadUrl;
|
|
@@ -1306622,7 +1306643,7 @@ var RemoteTaskHandler = class {
|
|
|
1306622
1306643
|
} : void 0;
|
|
1306623
1306644
|
}
|
|
1306624
1306645
|
getAbsolutePathToLocalOutput() {
|
|
1306625
|
-
return this.absolutePathToPreview != null ? join(this.absolutePathToPreview, RelativeFilePath.of(
|
|
1306646
|
+
return this.absolutePathToPreview != null ? join(this.absolutePathToPreview, RelativeFilePath.of(import_path40.default.basename(this.generatorInvocation.name))) : this.generatorInvocation.absolutePathToLocalOutput;
|
|
1306626
1306647
|
}
|
|
1306627
1306648
|
get isFinished() {
|
|
1306628
1306649
|
return __privateGet(this, _isFinished);
|
|
@@ -1306653,7 +1306674,7 @@ async function downloadZipForTask({ s3PreSignedReadUrl, absolutePathToLocalOutpu
|
|
|
1306653
1306674
|
responseType: "stream"
|
|
1306654
1306675
|
});
|
|
1306655
1306676
|
const tmpDir = await import_tmp_promise11.default.dir({ prefix: "fern", unsafeCleanup: true });
|
|
1306656
|
-
const outputZipPath =
|
|
1306677
|
+
const outputZipPath = import_path40.default.join(tmpDir.path, "output.zip");
|
|
1306657
1306678
|
await (0, import_promises50.pipeline)(request.data, (0, import_fs9.createWriteStream)(outputZipPath));
|
|
1306658
1306679
|
if (await doesPathExist(absolutePathToLocalOutput)) {
|
|
1306659
1306680
|
await (0, import_promises49.rm)(absolutePathToLocalOutput, { recursive: true });
|
|
@@ -1306782,7 +1306803,8 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
1306782
1306803
|
audiences,
|
|
1306783
1306804
|
readme,
|
|
1306784
1306805
|
packageName,
|
|
1306785
|
-
version: version3 ?? await computeSemanticVersion({ fdr, packageName, generatorInvocation })
|
|
1306806
|
+
version: version3 ?? await computeSemanticVersion({ fdr, packageName, generatorInvocation }),
|
|
1306807
|
+
context: interactiveTaskContext
|
|
1306786
1306808
|
});
|
|
1306787
1306809
|
const sources = workspace.getSources();
|
|
1306788
1306810
|
const apiDefinition = convertIrToFdrApi({ ir, snippetsConfig: {} });
|
|
@@ -1307721,7 +1307743,8 @@ async function mockServer({
|
|
|
1307721
1307743
|
disableExamples: false,
|
|
1307722
1307744
|
readme: void 0,
|
|
1307723
1307745
|
version: void 0,
|
|
1307724
|
-
packageName: void 0
|
|
1307746
|
+
packageName: void 0,
|
|
1307747
|
+
context
|
|
1307725
1307748
|
});
|
|
1307726
1307749
|
const mockServer2 = new MockServer({
|
|
1307727
1307750
|
context,
|
|
@@ -1307737,7 +1307760,7 @@ async function mockServer({
|
|
|
1307737
1307760
|
var import_fiddle_sdk6 = __toESM(require_fiddle_sdk(), 1);
|
|
1307738
1307761
|
var import_axios9 = __toESM(require_axios4(), 1);
|
|
1307739
1307762
|
var import_promises53 = require("fs/promises");
|
|
1307740
|
-
var
|
|
1307763
|
+
var import_path41 = __toESM(require("path"), 1);
|
|
1307741
1307764
|
var import_tar3 = __toESM(require_tar(), 1);
|
|
1307742
1307765
|
var import_tmp_promise13 = __toESM(require_tmp_promise(), 1);
|
|
1307743
1307766
|
async function registerWorkspacesV1({
|
|
@@ -1307782,7 +1307805,7 @@ async function registerWorkspacesV1({
|
|
|
1307782
1307805
|
return;
|
|
1307783
1307806
|
}
|
|
1307784
1307807
|
const tmpDir = await import_tmp_promise13.default.dir();
|
|
1307785
|
-
const tarPath =
|
|
1307808
|
+
const tarPath = import_path41.default.join(tmpDir.path, "definition.tgz");
|
|
1307786
1307809
|
context.logger.debug(`Compressing definition at ${tmpDir.path}`);
|
|
1307787
1307810
|
await import_tar3.default.create({ file: tarPath, cwd: resolvedWorkspace.absoluteFilepath }, ["."]);
|
|
1307788
1307811
|
context.logger.info("Uploading definition...");
|
|
@@ -1307852,7 +1307875,8 @@ async function testOutput({
|
|
|
1307852
1307875
|
disableExamples: false,
|
|
1307853
1307876
|
readme: void 0,
|
|
1307854
1307877
|
version: void 0,
|
|
1307855
|
-
packageName: void 0
|
|
1307878
|
+
packageName: void 0,
|
|
1307879
|
+
context
|
|
1307856
1307880
|
});
|
|
1307857
1307881
|
const mockServer2 = new MockServer({
|
|
1307858
1307882
|
context,
|
|
@@ -1310280,7 +1310304,7 @@ async function upgrade({
|
|
|
1310280
1310304
|
|
|
1310281
1310305
|
// src/commands/upgrade/upgradeGenerator.ts
|
|
1310282
1310306
|
var import_promises77 = require("fs/promises");
|
|
1310283
|
-
var
|
|
1310307
|
+
var import_path42 = __toESM(require("path"), 1);
|
|
1310284
1310308
|
var semver3 = __toESM(require_semver2(), 1);
|
|
1310285
1310309
|
var import_yaml11 = __toESM(require_dist3(), 1);
|
|
1310286
1310310
|
async function loadAndUpdateGenerators({
|
|
@@ -1310304,7 +1310328,7 @@ async function loadAndUpdateGenerators({
|
|
|
1310304
1310328
|
return void 0;
|
|
1310305
1310329
|
}
|
|
1310306
1310330
|
if (!import_yaml11.default.isMap(generatorGroups)) {
|
|
1310307
|
-
context.failAndThrow(`Expected 'groups' to be a map in ${
|
|
1310331
|
+
context.failAndThrow(`Expected 'groups' to be a map in ${import_path42.default.relative(process.cwd(), filepath)}`);
|
|
1310308
1310332
|
return void 0;
|
|
1310309
1310333
|
}
|
|
1310310
1310334
|
context.logger.debug(`Groups found: ${generatorGroups.toString()}`);
|
|
@@ -1310313,7 +1310337,7 @@ async function loadAndUpdateGenerators({
|
|
|
1310313
1310337
|
const group = groupBlock.value;
|
|
1310314
1310338
|
if (!import_yaml11.default.isMap(group)) {
|
|
1310315
1310339
|
context.failAndThrow(
|
|
1310316
|
-
`Expected group ${groupName} to be a map in ${
|
|
1310340
|
+
`Expected group ${groupName} to be a map in ${import_path42.default.relative(process.cwd(), filepath)}`
|
|
1310317
1310341
|
);
|
|
1310318
1310342
|
continue;
|
|
1310319
1310343
|
}
|
|
@@ -1310323,7 +1310347,7 @@ async function loadAndUpdateGenerators({
|
|
|
1310323
1310347
|
const generators = group.get("generators");
|
|
1310324
1310348
|
if (!import_yaml11.default.isSeq(generators)) {
|
|
1310325
1310349
|
context.failAndThrow(
|
|
1310326
|
-
`Expected group ${groupName} to have a 'generators' key in ${
|
|
1310350
|
+
`Expected group ${groupName} to have a 'generators' key in ${import_path42.default.relative(process.cwd(), filepath)}`
|
|
1310327
1310351
|
);
|
|
1310328
1310352
|
continue;
|
|
1310329
1310353
|
}
|
|
@@ -1310331,7 +1310355,7 @@ async function loadAndUpdateGenerators({
|
|
|
1310331
1310355
|
for (const generator of generators.items) {
|
|
1310332
1310356
|
if (!import_yaml11.default.isMap(generator)) {
|
|
1310333
1310357
|
context.failAndThrow(
|
|
1310334
|
-
`Expected generator in group ${groupName} to be a map in ${
|
|
1310358
|
+
`Expected generator in group ${groupName} to be a map in ${import_path42.default.relative(process.cwd(), filepath)}`
|
|
1310335
1310359
|
);
|
|
1310336
1310360
|
}
|
|
1310337
1310361
|
if (generatorFilter != null && generator.get("name") !== generatorFilter) {
|
|
@@ -1310426,7 +1310450,7 @@ async function validateWorkspaces({
|
|
|
1310426
1310450
|
|
|
1310427
1310451
|
// src/commands/write-definition/writeDefinitionForWorkspaces.ts
|
|
1310428
1310452
|
var import_promises78 = require("fs/promises");
|
|
1310429
|
-
var
|
|
1310453
|
+
var import_path43 = __toESM(require("path"), 1);
|
|
1310430
1310454
|
async function writeDefinitionForWorkspaces({
|
|
1310431
1310455
|
project,
|
|
1310432
1310456
|
cliContext,
|
|
@@ -1310460,7 +1310484,7 @@ async function writeDefinitionForFernWorkspace({
|
|
|
1310460
1310484
|
absolutePathToOutputDirectory
|
|
1310461
1310485
|
});
|
|
1310462
1310486
|
context.logger.info(
|
|
1310463
|
-
source_default.green(`Wrote imported definition at ${
|
|
1310487
|
+
source_default.green(`Wrote imported definition at ${import_path43.default.relative(process.cwd(), absolutePathToOutputDirectory)}`)
|
|
1310464
1310488
|
);
|
|
1310465
1310489
|
}
|
|
1310466
1310490
|
}
|
|
@@ -1310479,7 +1310503,7 @@ async function writeDefinitionForOpenAPIWorkspace2({
|
|
|
1310479
1310503
|
absolutePathToOutputDirectory
|
|
1310480
1310504
|
});
|
|
1310481
1310505
|
context.logger.info(
|
|
1310482
|
-
source_default.green(`Wrote definition to ${
|
|
1310506
|
+
source_default.green(`Wrote definition to ${import_path43.default.relative(process.cwd(), absolutePathToOutputDirectory)}`)
|
|
1310483
1310507
|
);
|
|
1310484
1310508
|
}
|
|
1310485
1310509
|
async function writeFernDefinition2({
|