@fern-api/fern-api-dev 5.21.1 → 5.22.0-6-g27bd77bb4a2
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 +318 -56
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -40040,12 +40040,15 @@ var require_data = __commonJS({
|
|
|
40040
40040
|
}
|
|
40041
40041
|
});
|
|
40042
40042
|
|
|
40043
|
-
// ../../../node_modules/.pnpm/fast-uri@3.1.
|
|
40043
|
+
// ../../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js
|
|
40044
40044
|
var require_utils16 = __commonJS({
|
|
40045
|
-
"../../../node_modules/.pnpm/fast-uri@3.1.
|
|
40045
|
+
"../../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js"(exports2, module4) {
|
|
40046
40046
|
"use strict";
|
|
40047
40047
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
40048
40048
|
var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
40049
|
+
var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
40050
|
+
var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
|
|
40051
|
+
var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
|
|
40049
40052
|
function stringArrayToHexStripped(input3) {
|
|
40050
40053
|
let acc = "";
|
|
40051
40054
|
let code5 = 0;
|
|
@@ -40238,27 +40241,77 @@ var require_utils16 = __commonJS({
|
|
|
40238
40241
|
}
|
|
40239
40242
|
return output2.join("");
|
|
40240
40243
|
}
|
|
40241
|
-
|
|
40242
|
-
|
|
40243
|
-
|
|
40244
|
-
|
|
40245
|
-
|
|
40246
|
-
|
|
40247
|
-
|
|
40248
|
-
|
|
40249
|
-
|
|
40250
|
-
|
|
40244
|
+
var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
|
|
40245
|
+
var HOST_DELIM_RE = /[@/?#:]/g;
|
|
40246
|
+
var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
|
|
40247
|
+
function reescapeHostDelimiters(host, isIP3) {
|
|
40248
|
+
const re10 = isIP3 ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
|
|
40249
|
+
re10.lastIndex = 0;
|
|
40250
|
+
return host.replace(re10, (ch) => HOST_DELIMS[ch]);
|
|
40251
|
+
}
|
|
40252
|
+
function normalizePercentEncoding(input3, decodeUnreserved = false) {
|
|
40253
|
+
if (input3.indexOf("%") === -1) {
|
|
40254
|
+
return input3;
|
|
40251
40255
|
}
|
|
40252
|
-
|
|
40253
|
-
|
|
40256
|
+
let output2 = "";
|
|
40257
|
+
for (let i9 = 0; i9 < input3.length; i9++) {
|
|
40258
|
+
if (input3[i9] === "%" && i9 + 2 < input3.length) {
|
|
40259
|
+
const hex3 = input3.slice(i9 + 1, i9 + 3);
|
|
40260
|
+
if (isHexPair(hex3)) {
|
|
40261
|
+
const normalizedHex = hex3.toUpperCase();
|
|
40262
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
40263
|
+
if (decodeUnreserved && isUnreserved(decoded)) {
|
|
40264
|
+
output2 += decoded;
|
|
40265
|
+
} else {
|
|
40266
|
+
output2 += "%" + normalizedHex;
|
|
40267
|
+
}
|
|
40268
|
+
i9 += 2;
|
|
40269
|
+
continue;
|
|
40270
|
+
}
|
|
40271
|
+
}
|
|
40272
|
+
output2 += input3[i9];
|
|
40254
40273
|
}
|
|
40255
|
-
|
|
40256
|
-
|
|
40274
|
+
return output2;
|
|
40275
|
+
}
|
|
40276
|
+
function normalizePathEncoding(input3) {
|
|
40277
|
+
let output2 = "";
|
|
40278
|
+
for (let i9 = 0; i9 < input3.length; i9++) {
|
|
40279
|
+
if (input3[i9] === "%" && i9 + 2 < input3.length) {
|
|
40280
|
+
const hex3 = input3.slice(i9 + 1, i9 + 3);
|
|
40281
|
+
if (isHexPair(hex3)) {
|
|
40282
|
+
const normalizedHex = hex3.toUpperCase();
|
|
40283
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
40284
|
+
if (decoded !== "." && isUnreserved(decoded)) {
|
|
40285
|
+
output2 += decoded;
|
|
40286
|
+
} else {
|
|
40287
|
+
output2 += "%" + normalizedHex;
|
|
40288
|
+
}
|
|
40289
|
+
i9 += 2;
|
|
40290
|
+
continue;
|
|
40291
|
+
}
|
|
40292
|
+
}
|
|
40293
|
+
if (isPathCharacter(input3[i9])) {
|
|
40294
|
+
output2 += input3[i9];
|
|
40295
|
+
} else {
|
|
40296
|
+
output2 += escape(input3[i9]);
|
|
40297
|
+
}
|
|
40257
40298
|
}
|
|
40258
|
-
|
|
40259
|
-
|
|
40299
|
+
return output2;
|
|
40300
|
+
}
|
|
40301
|
+
function escapePreservingEscapes(input3) {
|
|
40302
|
+
let output2 = "";
|
|
40303
|
+
for (let i9 = 0; i9 < input3.length; i9++) {
|
|
40304
|
+
if (input3[i9] === "%" && i9 + 2 < input3.length) {
|
|
40305
|
+
const hex3 = input3.slice(i9 + 1, i9 + 3);
|
|
40306
|
+
if (isHexPair(hex3)) {
|
|
40307
|
+
output2 += "%" + hex3.toUpperCase();
|
|
40308
|
+
i9 += 2;
|
|
40309
|
+
continue;
|
|
40310
|
+
}
|
|
40311
|
+
}
|
|
40312
|
+
output2 += escape(input3[i9]);
|
|
40260
40313
|
}
|
|
40261
|
-
return
|
|
40314
|
+
return output2;
|
|
40262
40315
|
}
|
|
40263
40316
|
function recomposeAuthority(component) {
|
|
40264
40317
|
const uriTokens = [];
|
|
@@ -40273,7 +40326,7 @@ var require_utils16 = __commonJS({
|
|
|
40273
40326
|
if (ipV6res.isIPV6 === true) {
|
|
40274
40327
|
host = `[${ipV6res.escapedHost}]`;
|
|
40275
40328
|
} else {
|
|
40276
|
-
host =
|
|
40329
|
+
host = reescapeHostDelimiters(host, false);
|
|
40277
40330
|
}
|
|
40278
40331
|
}
|
|
40279
40332
|
uriTokens.push(host);
|
|
@@ -40287,7 +40340,10 @@ var require_utils16 = __commonJS({
|
|
|
40287
40340
|
module4.exports = {
|
|
40288
40341
|
nonSimpleDomain,
|
|
40289
40342
|
recomposeAuthority,
|
|
40290
|
-
|
|
40343
|
+
reescapeHostDelimiters,
|
|
40344
|
+
normalizePercentEncoding,
|
|
40345
|
+
normalizePathEncoding,
|
|
40346
|
+
escapePreservingEscapes,
|
|
40291
40347
|
removeDotSegments,
|
|
40292
40348
|
isIPv4,
|
|
40293
40349
|
isUUID,
|
|
@@ -40297,9 +40353,9 @@ var require_utils16 = __commonJS({
|
|
|
40297
40353
|
}
|
|
40298
40354
|
});
|
|
40299
40355
|
|
|
40300
|
-
// ../../../node_modules/.pnpm/fast-uri@3.1.
|
|
40356
|
+
// ../../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/schemes.js
|
|
40301
40357
|
var require_schemes = __commonJS({
|
|
40302
|
-
"../../../node_modules/.pnpm/fast-uri@3.1.
|
|
40358
|
+
"../../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/schemes.js"(exports2, module4) {
|
|
40303
40359
|
"use strict";
|
|
40304
40360
|
var { isUUID } = require_utils16();
|
|
40305
40361
|
var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
|
|
@@ -40507,16 +40563,16 @@ var require_schemes = __commonJS({
|
|
|
40507
40563
|
}
|
|
40508
40564
|
});
|
|
40509
40565
|
|
|
40510
|
-
// ../../../node_modules/.pnpm/fast-uri@3.1.
|
|
40566
|
+
// ../../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js
|
|
40511
40567
|
var require_fast_uri = __commonJS({
|
|
40512
|
-
"../../../node_modules/.pnpm/fast-uri@3.1.
|
|
40568
|
+
"../../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js"(exports2, module4) {
|
|
40513
40569
|
"use strict";
|
|
40514
|
-
var { normalizeIPv6, removeDotSegments, recomposeAuthority,
|
|
40570
|
+
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils16();
|
|
40515
40571
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
40516
40572
|
function normalize13(uri, options2) {
|
|
40517
40573
|
if (typeof uri === "string") {
|
|
40518
40574
|
uri = /** @type {T} */
|
|
40519
|
-
|
|
40575
|
+
normalizeString(uri, options2);
|
|
40520
40576
|
} else if (typeof uri === "object") {
|
|
40521
40577
|
uri = /** @type {T} */
|
|
40522
40578
|
parse19(serialize5(uri, options2), options2);
|
|
@@ -40583,19 +40639,9 @@ var require_fast_uri = __commonJS({
|
|
|
40583
40639
|
return target;
|
|
40584
40640
|
}
|
|
40585
40641
|
function equal(uriA, uriB, options2) {
|
|
40586
|
-
|
|
40587
|
-
|
|
40588
|
-
|
|
40589
|
-
} else if (typeof uriA === "object") {
|
|
40590
|
-
uriA = serialize5(normalizeComponentEncoding(uriA, true), { ...options2, skipEscape: true });
|
|
40591
|
-
}
|
|
40592
|
-
if (typeof uriB === "string") {
|
|
40593
|
-
uriB = unescape(uriB);
|
|
40594
|
-
uriB = serialize5(normalizeComponentEncoding(parse19(uriB, options2), true), { ...options2, skipEscape: true });
|
|
40595
|
-
} else if (typeof uriB === "object") {
|
|
40596
|
-
uriB = serialize5(normalizeComponentEncoding(uriB, true), { ...options2, skipEscape: true });
|
|
40597
|
-
}
|
|
40598
|
-
return uriA.toLowerCase() === uriB.toLowerCase();
|
|
40642
|
+
const normalizedA = normalizeComparableURI(uriA, options2);
|
|
40643
|
+
const normalizedB = normalizeComparableURI(uriB, options2);
|
|
40644
|
+
return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA.toLowerCase() === normalizedB.toLowerCase();
|
|
40599
40645
|
}
|
|
40600
40646
|
function serialize5(cmpts, opts) {
|
|
40601
40647
|
const component = {
|
|
@@ -40620,12 +40666,12 @@ var require_fast_uri = __commonJS({
|
|
|
40620
40666
|
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options2);
|
|
40621
40667
|
if (component.path !== void 0) {
|
|
40622
40668
|
if (!options2.skipEscape) {
|
|
40623
|
-
component.path =
|
|
40669
|
+
component.path = escapePreservingEscapes(component.path);
|
|
40624
40670
|
if (component.scheme !== void 0) {
|
|
40625
40671
|
component.path = component.path.split("%3A").join(":");
|
|
40626
40672
|
}
|
|
40627
40673
|
} else {
|
|
40628
|
-
component.path =
|
|
40674
|
+
component.path = normalizePercentEncoding(component.path);
|
|
40629
40675
|
}
|
|
40630
40676
|
}
|
|
40631
40677
|
if (options2.reference !== "suffix" && component.scheme) {
|
|
@@ -40660,7 +40706,16 @@ var require_fast_uri = __commonJS({
|
|
|
40660
40706
|
return uriTokens.join("");
|
|
40661
40707
|
}
|
|
40662
40708
|
var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
40663
|
-
function
|
|
40709
|
+
function getParseError(parsed, matches) {
|
|
40710
|
+
if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
|
|
40711
|
+
return 'URI path must start with "/" when authority is present.';
|
|
40712
|
+
}
|
|
40713
|
+
if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) {
|
|
40714
|
+
return "URI port is malformed.";
|
|
40715
|
+
}
|
|
40716
|
+
return void 0;
|
|
40717
|
+
}
|
|
40718
|
+
function parseWithStatus(uri, opts) {
|
|
40664
40719
|
const options2 = Object.assign({}, opts);
|
|
40665
40720
|
const parsed = {
|
|
40666
40721
|
scheme: void 0,
|
|
@@ -40671,6 +40726,7 @@ var require_fast_uri = __commonJS({
|
|
|
40671
40726
|
query: void 0,
|
|
40672
40727
|
fragment: void 0
|
|
40673
40728
|
};
|
|
40729
|
+
let malformedAuthorityOrPort = false;
|
|
40674
40730
|
let isIP3 = false;
|
|
40675
40731
|
if (options2.reference === "suffix") {
|
|
40676
40732
|
if (options2.scheme) {
|
|
@@ -40691,6 +40747,11 @@ var require_fast_uri = __commonJS({
|
|
|
40691
40747
|
if (isNaN(parsed.port)) {
|
|
40692
40748
|
parsed.port = matches[5];
|
|
40693
40749
|
}
|
|
40750
|
+
const parseError = getParseError(parsed, matches);
|
|
40751
|
+
if (parseError !== void 0) {
|
|
40752
|
+
parsed.error = parsed.error || parseError;
|
|
40753
|
+
malformedAuthorityOrPort = true;
|
|
40754
|
+
}
|
|
40694
40755
|
if (parsed.host) {
|
|
40695
40756
|
const ipv4result = isIPv4(parsed.host);
|
|
40696
40757
|
if (ipv4result === false) {
|
|
@@ -40729,14 +40790,18 @@ var require_fast_uri = __commonJS({
|
|
|
40729
40790
|
parsed.scheme = unescape(parsed.scheme);
|
|
40730
40791
|
}
|
|
40731
40792
|
if (parsed.host !== void 0) {
|
|
40732
|
-
parsed.host = unescape(parsed.host);
|
|
40793
|
+
parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP3);
|
|
40733
40794
|
}
|
|
40734
40795
|
}
|
|
40735
40796
|
if (parsed.path) {
|
|
40736
|
-
parsed.path =
|
|
40797
|
+
parsed.path = normalizePathEncoding(parsed.path);
|
|
40737
40798
|
}
|
|
40738
40799
|
if (parsed.fragment) {
|
|
40739
|
-
|
|
40800
|
+
try {
|
|
40801
|
+
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
40802
|
+
} catch {
|
|
40803
|
+
parsed.error = parsed.error || "URI malformed";
|
|
40804
|
+
}
|
|
40740
40805
|
}
|
|
40741
40806
|
}
|
|
40742
40807
|
if (schemeHandler && schemeHandler.parse) {
|
|
@@ -40745,7 +40810,29 @@ var require_fast_uri = __commonJS({
|
|
|
40745
40810
|
} else {
|
|
40746
40811
|
parsed.error = parsed.error || "URI can not be parsed.";
|
|
40747
40812
|
}
|
|
40748
|
-
return parsed;
|
|
40813
|
+
return { parsed, malformedAuthorityOrPort };
|
|
40814
|
+
}
|
|
40815
|
+
function parse19(uri, opts) {
|
|
40816
|
+
return parseWithStatus(uri, opts).parsed;
|
|
40817
|
+
}
|
|
40818
|
+
function normalizeString(uri, opts) {
|
|
40819
|
+
return normalizeStringWithStatus(uri, opts).normalized;
|
|
40820
|
+
}
|
|
40821
|
+
function normalizeStringWithStatus(uri, opts) {
|
|
40822
|
+
const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
|
|
40823
|
+
return {
|
|
40824
|
+
normalized: malformedAuthorityOrPort ? uri : serialize5(parsed, opts),
|
|
40825
|
+
malformedAuthorityOrPort
|
|
40826
|
+
};
|
|
40827
|
+
}
|
|
40828
|
+
function normalizeComparableURI(uri, opts) {
|
|
40829
|
+
if (typeof uri === "string") {
|
|
40830
|
+
const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts);
|
|
40831
|
+
return malformedAuthorityOrPort ? void 0 : normalized;
|
|
40832
|
+
}
|
|
40833
|
+
if (typeof uri === "object") {
|
|
40834
|
+
return serialize5(uri, opts);
|
|
40835
|
+
}
|
|
40749
40836
|
}
|
|
40750
40837
|
var fastUri = {
|
|
40751
40838
|
SCHEMES,
|
|
@@ -661252,7 +661339,7 @@ var AccessTokenPosthogManager = class {
|
|
|
661252
661339
|
properties: {
|
|
661253
661340
|
...event,
|
|
661254
661341
|
...event.properties,
|
|
661255
|
-
version: "5.
|
|
661342
|
+
version: "5.22.0-6-g27bd77bb4a2",
|
|
661256
661343
|
usingAccessToken: true,
|
|
661257
661344
|
...getRunIdProperties()
|
|
661258
661345
|
}
|
|
@@ -661307,7 +661394,7 @@ var UserPosthogManager = class {
|
|
|
661307
661394
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
661308
661395
|
event: "CLI",
|
|
661309
661396
|
properties: {
|
|
661310
|
-
version: "5.
|
|
661397
|
+
version: "5.22.0-6-g27bd77bb4a2",
|
|
661311
661398
|
...event,
|
|
661312
661399
|
...event.properties,
|
|
661313
661400
|
usingAccessToken: false,
|
|
@@ -852580,7 +852667,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
852580
852667
|
var LOGS_FOLDER_NAME = "logs";
|
|
852581
852668
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
852582
852669
|
function getCliSource() {
|
|
852583
|
-
const version7 = "5.
|
|
852670
|
+
const version7 = "5.22.0-6-g27bd77bb4a2";
|
|
852584
852671
|
return `cli@${version7}`;
|
|
852585
852672
|
}
|
|
852586
852673
|
var DebugLogger = class {
|
|
@@ -865389,7 +865476,7 @@ var LegacyDocsPublisher = class {
|
|
|
865389
865476
|
previewId,
|
|
865390
865477
|
disableTemplates: void 0,
|
|
865391
865478
|
skipUpload,
|
|
865392
|
-
cliVersion: "5.
|
|
865479
|
+
cliVersion: "5.22.0-6-g27bd77bb4a2",
|
|
865393
865480
|
loginCommand: "fern auth login"
|
|
865394
865481
|
});
|
|
865395
865482
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -920086,6 +920173,180 @@ function addGenerateCommand(cli) {
|
|
|
920086
920173
|
}));
|
|
920087
920174
|
}
|
|
920088
920175
|
|
|
920176
|
+
// ../cli-v2/lib/commands/sdk/list/command.js
|
|
920177
|
+
var import_generators_sdk4 = __toESM(require_generators_sdk(), 1);
|
|
920178
|
+
var GENERATOR_TYPES = ["sdk", "model", "server"];
|
|
920179
|
+
var ListCommand2 = class {
|
|
920180
|
+
async handle(context3, args) {
|
|
920181
|
+
const configuredTargets = await this.loadConfiguredTargets(context3);
|
|
920182
|
+
const languageFilter = args.language != null ? this.parseLanguageFilter(args.language) : void 0;
|
|
920183
|
+
const typeFilter = args.type != null ? this.parseTypeFilter(args.type) : void 0;
|
|
920184
|
+
const availableGenerators = await this.fetchAvailableGenerators({ context: context3, languageFilter, typeFilter });
|
|
920185
|
+
if (args.json) {
|
|
920186
|
+
this.printJson({ context: context3, configuredTargets, availableGenerators, languageFilter, typeFilter });
|
|
920187
|
+
return;
|
|
920188
|
+
}
|
|
920189
|
+
this.printHuman({ context: context3, configuredTargets, availableGenerators, languageFilter, typeFilter });
|
|
920190
|
+
}
|
|
920191
|
+
async loadConfiguredTargets(context3) {
|
|
920192
|
+
const result = await context3.loadWorkspace();
|
|
920193
|
+
if (result == null || !result.success) {
|
|
920194
|
+
if (result != null && !result.success) {
|
|
920195
|
+
context3.stderr.warn(source_default.dim(" Warning: Could not load fern.yml \u2014 showing unconfigured generators only."));
|
|
920196
|
+
}
|
|
920197
|
+
return [];
|
|
920198
|
+
}
|
|
920199
|
+
return result.workspace.sdks?.targets ?? [];
|
|
920200
|
+
}
|
|
920201
|
+
async fetchAvailableGenerators({ context: context3, languageFilter, typeFilter }) {
|
|
920202
|
+
const fdrOrigin = "https://registry-dev2.buildwithfern.com";
|
|
920203
|
+
const client3 = new import_generators_sdk4.FernRegistryClient({ environment: fdrOrigin });
|
|
920204
|
+
try {
|
|
920205
|
+
const response = await client3.generators.listGenerators();
|
|
920206
|
+
if (!response.ok) {
|
|
920207
|
+
context3.stderr.warn(source_default.dim(" Could not fetch available generators from registry."));
|
|
920208
|
+
return [];
|
|
920209
|
+
}
|
|
920210
|
+
let generators = response.body;
|
|
920211
|
+
if (languageFilter != null) {
|
|
920212
|
+
generators = generators.filter((g8) => g8.generatorLanguage === languageFilter);
|
|
920213
|
+
}
|
|
920214
|
+
if (typeFilter != null) {
|
|
920215
|
+
generators = generators.filter((g8) => g8.generatorType.type === typeFilter);
|
|
920216
|
+
}
|
|
920217
|
+
return generators;
|
|
920218
|
+
} catch {
|
|
920219
|
+
context3.stderr.warn(source_default.dim(" Could not fetch available generators from registry (network error)."));
|
|
920220
|
+
return [];
|
|
920221
|
+
}
|
|
920222
|
+
}
|
|
920223
|
+
printJson({ context: context3, configuredTargets, availableGenerators, languageFilter, typeFilter }) {
|
|
920224
|
+
const filteredTargets = this.filterConfiguredTargets({
|
|
920225
|
+
targets: configuredTargets,
|
|
920226
|
+
languageFilter,
|
|
920227
|
+
typeFilter
|
|
920228
|
+
});
|
|
920229
|
+
const configured = filteredTargets.map((t3) => ({
|
|
920230
|
+
name: t3.name,
|
|
920231
|
+
language: t3.lang,
|
|
920232
|
+
version: t3.version,
|
|
920233
|
+
output: this.formatOutput(t3),
|
|
920234
|
+
groups: t3.groups ?? [],
|
|
920235
|
+
image: t3.image
|
|
920236
|
+
}));
|
|
920237
|
+
const configuredImages = new Set(configuredTargets.map((t3) => t3.image));
|
|
920238
|
+
const available = availableGenerators.filter((g8) => !configuredImages.has(g8.dockerImage)).map((g8) => ({
|
|
920239
|
+
id: g8.id,
|
|
920240
|
+
displayName: g8.displayName,
|
|
920241
|
+
type: g8.generatorType.type,
|
|
920242
|
+
language: g8.generatorLanguage ?? null,
|
|
920243
|
+
dockerImage: g8.dockerImage
|
|
920244
|
+
}));
|
|
920245
|
+
context3.stdout.info(JSON.stringify({ configured, available }, null, 2));
|
|
920246
|
+
}
|
|
920247
|
+
printHuman({ context: context3, configuredTargets, availableGenerators, languageFilter, typeFilter }) {
|
|
920248
|
+
const filteredTargets = this.filterConfiguredTargets({
|
|
920249
|
+
targets: configuredTargets,
|
|
920250
|
+
languageFilter,
|
|
920251
|
+
typeFilter
|
|
920252
|
+
});
|
|
920253
|
+
if (filteredTargets.length > 0) {
|
|
920254
|
+
context3.stderr.info(`${Icons.info} ${source_default.cyan("Configured SDKs:")}`);
|
|
920255
|
+
context3.stderr.info("");
|
|
920256
|
+
for (const target of filteredTargets) {
|
|
920257
|
+
const version7 = source_default.dim(`v${target.version}`.padEnd(20));
|
|
920258
|
+
const output2 = source_default.dim(`\u2192 ${this.formatOutput(target)}`);
|
|
920259
|
+
const groups2 = target.groups != null && target.groups.length > 0 ? source_default.dim(` [${target.groups.join(", ")}]`) : "";
|
|
920260
|
+
const displayName = LANGUAGE_DISPLAY_NAMES[target.lang];
|
|
920261
|
+
context3.stderr.info(` ${source_default.white(displayName.padEnd(14))} ${version7} ${output2}${groups2}`);
|
|
920262
|
+
}
|
|
920263
|
+
} else if (languageFilter == null && typeFilter == null) {
|
|
920264
|
+
context3.stderr.info(source_default.dim("No SDK targets configured."));
|
|
920265
|
+
} else if (typeFilter != null && typeFilter !== "sdk") {
|
|
920266
|
+
context3.stderr.info(source_default.dim("Configured targets are always of type 'sdk'; none match the given type filter."));
|
|
920267
|
+
} else {
|
|
920268
|
+
context3.stderr.info(source_default.dim("No configured SDK targets match the given filters."));
|
|
920269
|
+
}
|
|
920270
|
+
const configuredImages = new Set(configuredTargets.map((t3) => t3.image));
|
|
920271
|
+
const unconfigured = availableGenerators.filter((g8) => !configuredImages.has(g8.dockerImage));
|
|
920272
|
+
if (unconfigured.length > 0) {
|
|
920273
|
+
context3.stderr.info("");
|
|
920274
|
+
context3.stderr.info(`${Icons.info} ${source_default.cyan("Available (not configured):")}`);
|
|
920275
|
+
context3.stderr.info("");
|
|
920276
|
+
for (const gen of unconfigured) {
|
|
920277
|
+
const lang = gen.generatorLanguage != null ? source_default.dim(gen.generatorLanguage.padEnd(12)) : source_default.dim("".padEnd(12));
|
|
920278
|
+
const type8 = source_default.dim(`[${gen.generatorType.type}]`);
|
|
920279
|
+
context3.stderr.info(` ${source_default.white(gen.displayName.padEnd(20))} ${lang} ${type8}`);
|
|
920280
|
+
}
|
|
920281
|
+
context3.stderr.info("");
|
|
920282
|
+
context3.stderr.info(source_default.dim(" Run 'fern sdk add --target <language>' to add a new SDK."));
|
|
920283
|
+
} else if (availableGenerators.length > 0) {
|
|
920284
|
+
context3.stderr.info("");
|
|
920285
|
+
context3.stderr.info(source_default.dim(" All available generators are already configured."));
|
|
920286
|
+
}
|
|
920287
|
+
}
|
|
920288
|
+
filterConfiguredTargets({ targets: targets2, languageFilter, typeFilter }) {
|
|
920289
|
+
let filtered = targets2;
|
|
920290
|
+
if (languageFilter != null) {
|
|
920291
|
+
filtered = filtered.filter((t3) => t3.lang === languageFilter);
|
|
920292
|
+
}
|
|
920293
|
+
if (typeFilter != null) {
|
|
920294
|
+
if (typeFilter !== "sdk") {
|
|
920295
|
+
return [];
|
|
920296
|
+
}
|
|
920297
|
+
}
|
|
920298
|
+
return filtered;
|
|
920299
|
+
}
|
|
920300
|
+
formatOutput(target) {
|
|
920301
|
+
if (target.output.git != null) {
|
|
920302
|
+
const git = target.output.git;
|
|
920303
|
+
if (schemas_exports13.isGitOutputGitHubRepository(git)) {
|
|
920304
|
+
return git.repository;
|
|
920305
|
+
}
|
|
920306
|
+
if (schemas_exports13.isGitOutputSelfHosted(git)) {
|
|
920307
|
+
return git.uri;
|
|
920308
|
+
}
|
|
920309
|
+
}
|
|
920310
|
+
return target.output.path ?? "./";
|
|
920311
|
+
}
|
|
920312
|
+
parseLanguageFilter(value2) {
|
|
920313
|
+
const lang = LANGUAGES.find((l9) => l9 === value2.toLowerCase());
|
|
920314
|
+
if (lang != null) {
|
|
920315
|
+
return lang;
|
|
920316
|
+
}
|
|
920317
|
+
const supported = LANGUAGES.join(", ");
|
|
920318
|
+
throw new CliError({
|
|
920319
|
+
message: `"${value2}" is not a supported language. Supported: ${supported}`,
|
|
920320
|
+
code: CliError.Code.ConfigError
|
|
920321
|
+
});
|
|
920322
|
+
}
|
|
920323
|
+
parseTypeFilter(value2) {
|
|
920324
|
+
const type8 = GENERATOR_TYPES.find((t3) => t3 === value2.toLowerCase());
|
|
920325
|
+
if (type8 != null) {
|
|
920326
|
+
return type8;
|
|
920327
|
+
}
|
|
920328
|
+
const supported = GENERATOR_TYPES.join(", ");
|
|
920329
|
+
throw new CliError({
|
|
920330
|
+
message: `"${value2}" is not a supported generator type. Supported: ${supported}`,
|
|
920331
|
+
code: CliError.Code.ConfigError
|
|
920332
|
+
});
|
|
920333
|
+
}
|
|
920334
|
+
};
|
|
920335
|
+
function addListCommand2(cli) {
|
|
920336
|
+
const cmd = new ListCommand2();
|
|
920337
|
+
command2(cli, "list", "List configured and available SDK generators", (context3, args) => cmd.handle(context3, args), (yargs) => yargs.option("language", {
|
|
920338
|
+
type: "string",
|
|
920339
|
+
description: "Filter by language (e.g. typescript, python, go)"
|
|
920340
|
+
}).option("type", {
|
|
920341
|
+
type: "string",
|
|
920342
|
+
description: "Filter by generator type (sdk, model, server)"
|
|
920343
|
+
}).option("json", {
|
|
920344
|
+
type: "boolean",
|
|
920345
|
+
default: false,
|
|
920346
|
+
description: "Output results as JSON to stdout"
|
|
920347
|
+
}));
|
|
920348
|
+
}
|
|
920349
|
+
|
|
920089
920350
|
// ../cli-v2/lib/commands/sdk/preview/command.js
|
|
920090
920351
|
var PreviewCommand2 = class {
|
|
920091
920352
|
generateCommand = new GenerateCommand();
|
|
@@ -920725,6 +920986,7 @@ function addSdkCommand(cli) {
|
|
|
920725
920986
|
addAddCommand,
|
|
920726
920987
|
addCheckCommand4,
|
|
920727
920988
|
addGenerateCommand,
|
|
920989
|
+
addListCommand2,
|
|
920728
920990
|
addPreviewCommand2,
|
|
920729
920991
|
addUpdateCommand
|
|
920730
920992
|
]);
|
|
@@ -939694,7 +939956,7 @@ var InteractiveTaskContextImpl = class extends TaskContextImpl {
|
|
|
939694
939956
|
};
|
|
939695
939957
|
|
|
939696
939958
|
// src/cli-context/upgrade-utils/getFernUpgradeMessage.ts
|
|
939697
|
-
var
|
|
939959
|
+
var import_generators_sdk5 = __toESM(require_generators_sdk(), 1);
|
|
939698
939960
|
function hasGeneratorUpgrade(generatorUpgradeInfo) {
|
|
939699
939961
|
return generatorUpgradeInfo.filter((gui) => gui.isUpgradeAvailable).length > 0;
|
|
939700
939962
|
}
|
|
@@ -939770,7 +940032,7 @@ ${await normalizeGeneratorName2(generatorUpgrade.generatorName)} (${generatorUpg
|
|
|
939770
940032
|
}) : message;
|
|
939771
940033
|
}
|
|
939772
940034
|
async function normalizeGeneratorName2(generatorImage) {
|
|
939773
|
-
const client3 = new
|
|
940035
|
+
const client3 = new import_generators_sdk5.FernRegistryClient({
|
|
939774
940036
|
environment: "https://registry-dev2.buildwithfern.com"
|
|
939775
940037
|
});
|
|
939776
940038
|
const generatorResponse = await client3.generators.getGeneratorByImage({ dockerImage: generatorImage });
|
|
@@ -940017,7 +940279,7 @@ var CliContext = class _CliContext {
|
|
|
940017
940279
|
if (false) {
|
|
940018
940280
|
this.logger.error("CLI_VERSION is not defined");
|
|
940019
940281
|
}
|
|
940020
|
-
return "5.
|
|
940282
|
+
return "5.22.0-6-g27bd77bb4a2";
|
|
940021
940283
|
}
|
|
940022
940284
|
getCliName() {
|
|
940023
940285
|
if (false) {
|
|
@@ -940472,7 +940734,7 @@ async function loadProjectAndRegisterWorkspacesWithContext(cliContext, args, reg
|
|
|
940472
940734
|
}
|
|
940473
940735
|
|
|
940474
940736
|
// src/cliV2.ts
|
|
940475
|
-
var
|
|
940737
|
+
var import_generators_sdk6 = __toESM(require_generators_sdk(), 1);
|
|
940476
940738
|
var import_promises142 = require("fs/promises");
|
|
940477
940739
|
|
|
940478
940740
|
// src/commands/generator-list/getGeneratorList.ts
|
|
@@ -941404,7 +941666,7 @@ function addGeneratorCommands(cli, cliContext) {
|
|
|
941404
941666
|
description: "Whether or not to include major versions within the upgrade. Defaults to false, meaning major versions will be skipped."
|
|
941405
941667
|
}).option("channel", {
|
|
941406
941668
|
demandOption: false,
|
|
941407
|
-
choices: Object.values(
|
|
941669
|
+
choices: Object.values(import_generators_sdk6.FernRegistry.generators.ReleaseType)
|
|
941408
941670
|
}).option("list", {
|
|
941409
941671
|
demandOption: false,
|
|
941410
941672
|
boolean: true,
|
package/package.json
CHANGED