@fern-api/fern-api-dev 4.94.0 → 4.94.1-16-g570413b0bdb
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 +284 -135
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -80532,11 +80532,11 @@ var require_utils19 = __commonJS({
|
|
|
80532
80532
|
throw new Error(`Parameter "allowedValues" is not provided for "${ruleType}-mime-type" rule`);
|
|
80533
80533
|
if (!value2[type8])
|
|
80534
80534
|
return;
|
|
80535
|
-
for (const
|
|
80536
|
-
if (!allowedValues.includes(
|
|
80535
|
+
for (const mime4 of value2[type8]) {
|
|
80536
|
+
if (!allowedValues.includes(mime4)) {
|
|
80537
80537
|
report({
|
|
80538
|
-
message: `Mime type "${
|
|
80539
|
-
location: location2.child(value2[type8].indexOf(
|
|
80538
|
+
message: `Mime type "${mime4}" is not allowed`,
|
|
80539
|
+
location: location2.child(value2[type8].indexOf(mime4)).key()
|
|
80540
80540
|
});
|
|
80541
80541
|
}
|
|
80542
80542
|
}
|
|
@@ -80547,11 +80547,11 @@ var require_utils19 = __commonJS({
|
|
|
80547
80547
|
throw new Error(`Parameter "allowedValues" is not provided for "${ruleType}-mime-type" rule`);
|
|
80548
80548
|
if (!value2.content)
|
|
80549
80549
|
return;
|
|
80550
|
-
for (const
|
|
80551
|
-
if (!allowedValues.includes(
|
|
80550
|
+
for (const mime4 of Object.keys(value2.content)) {
|
|
80551
|
+
if (!allowedValues.includes(mime4)) {
|
|
80552
80552
|
report({
|
|
80553
|
-
message: `Mime type "${
|
|
80554
|
-
location: location2.child("content").child(
|
|
80553
|
+
message: `Mime type "${mime4}" is not allowed`,
|
|
80554
|
+
location: location2.child("content").child(mime4).key()
|
|
80555
80555
|
});
|
|
80556
80556
|
}
|
|
80557
80557
|
}
|
|
@@ -211541,9 +211541,9 @@ var require_mime_types = __commonJS({
|
|
|
211541
211541
|
return false;
|
|
211542
211542
|
}
|
|
211543
211543
|
var match3 = EXTRACT_TYPE_REGEXP.exec(type8);
|
|
211544
|
-
var
|
|
211545
|
-
if (
|
|
211546
|
-
return
|
|
211544
|
+
var mime4 = match3 && db[match3[1].toLowerCase()];
|
|
211545
|
+
if (mime4 && mime4.charset) {
|
|
211546
|
+
return mime4.charset;
|
|
211547
211547
|
}
|
|
211548
211548
|
if (match3 && TEXT_TYPE_REGEXP.test(match3[1])) {
|
|
211549
211549
|
return "UTF-8";
|
|
@@ -211554,15 +211554,15 @@ var require_mime_types = __commonJS({
|
|
|
211554
211554
|
if (!str3 || typeof str3 !== "string") {
|
|
211555
211555
|
return false;
|
|
211556
211556
|
}
|
|
211557
|
-
var
|
|
211558
|
-
if (!
|
|
211557
|
+
var mime4 = str3.indexOf("/") === -1 ? exports2.lookup(str3) : str3;
|
|
211558
|
+
if (!mime4) {
|
|
211559
211559
|
return false;
|
|
211560
211560
|
}
|
|
211561
|
-
if (
|
|
211562
|
-
var charset2 = exports2.charset(
|
|
211563
|
-
if (charset2)
|
|
211561
|
+
if (mime4.indexOf("charset") === -1) {
|
|
211562
|
+
var charset2 = exports2.charset(mime4);
|
|
211563
|
+
if (charset2) mime4 += "; charset=" + charset2.toLowerCase();
|
|
211564
211564
|
}
|
|
211565
|
-
return
|
|
211565
|
+
return mime4;
|
|
211566
211566
|
}
|
|
211567
211567
|
function extension4(type8) {
|
|
211568
211568
|
if (!type8 || typeof type8 !== "string") {
|
|
@@ -211588,8 +211588,8 @@ var require_mime_types = __commonJS({
|
|
|
211588
211588
|
function populateMaps(extensions2, types4) {
|
|
211589
211589
|
var preference = ["nginx", "apache", void 0, "iana"];
|
|
211590
211590
|
Object.keys(db).forEach(function forEachMimeType(type8) {
|
|
211591
|
-
var
|
|
211592
|
-
var exts =
|
|
211591
|
+
var mime4 = db[type8];
|
|
211592
|
+
var exts = mime4.extensions;
|
|
211593
211593
|
if (!exts || !exts.length) {
|
|
211594
211594
|
return;
|
|
211595
211595
|
}
|
|
@@ -211598,7 +211598,7 @@ var require_mime_types = __commonJS({
|
|
|
211598
211598
|
var extension5 = exts[i9];
|
|
211599
211599
|
if (types4[extension5]) {
|
|
211600
211600
|
var from4 = preference.indexOf(db[types4[extension5]].source);
|
|
211601
|
-
var to10 = preference.indexOf(
|
|
211601
|
+
var to10 = preference.indexOf(mime4.source);
|
|
211602
211602
|
if (types4[extension5] !== "application/octet-stream" && (from4 > to10 || from4 === to10 && types4[extension5].substr(0, 12) === "application/")) {
|
|
211603
211603
|
continue;
|
|
211604
211604
|
}
|
|
@@ -211898,7 +211898,7 @@ var require_form_data = __commonJS({
|
|
|
211898
211898
|
var fs28 = require("fs");
|
|
211899
211899
|
var Stream5 = require("stream").Stream;
|
|
211900
211900
|
var crypto5 = require("crypto");
|
|
211901
|
-
var
|
|
211901
|
+
var mime4 = require_mime_types();
|
|
211902
211902
|
var asynckit = require_asynckit();
|
|
211903
211903
|
var setToStringTag = require_es_set_tostringtag();
|
|
211904
211904
|
var hasOwn2 = require_hasown();
|
|
@@ -212032,16 +212032,16 @@ var require_form_data = __commonJS({
|
|
|
212032
212032
|
FormData6.prototype._getContentType = function(value2, options2) {
|
|
212033
212033
|
var contentType = options2.contentType;
|
|
212034
212034
|
if (!contentType && value2 && value2.name) {
|
|
212035
|
-
contentType =
|
|
212035
|
+
contentType = mime4.lookup(value2.name);
|
|
212036
212036
|
}
|
|
212037
212037
|
if (!contentType && value2 && value2.path) {
|
|
212038
|
-
contentType =
|
|
212038
|
+
contentType = mime4.lookup(value2.path);
|
|
212039
212039
|
}
|
|
212040
212040
|
if (!contentType && value2 && value2.readable && hasOwn2(value2, "httpVersion")) {
|
|
212041
212041
|
contentType = value2.headers["content-type"];
|
|
212042
212042
|
}
|
|
212043
212043
|
if (!contentType && (options2.filepath || options2.filename)) {
|
|
212044
|
-
contentType =
|
|
212044
|
+
contentType = mime4.lookup(options2.filepath || options2.filename);
|
|
212045
212045
|
}
|
|
212046
212046
|
if (!contentType && value2 && typeof value2 === "object") {
|
|
212047
212047
|
contentType = FormData6.DEFAULT_CONTENT_TYPE;
|
|
@@ -282126,7 +282126,7 @@ var require_type_is = __commonJS({
|
|
|
282126
282126
|
"../../../node_modules/.pnpm/type-is@1.6.18/node_modules/type-is/index.js"(exports2, module4) {
|
|
282127
282127
|
"use strict";
|
|
282128
282128
|
var typer = require_media_typer();
|
|
282129
|
-
var
|
|
282129
|
+
var mime4 = require_mime_types();
|
|
282130
282130
|
module4.exports = typeofrequest;
|
|
282131
282131
|
module4.exports.is = typeis;
|
|
282132
282132
|
module4.exports.hasBody = hasbody;
|
|
@@ -282186,7 +282186,7 @@ var require_type_is = __commonJS({
|
|
|
282186
282186
|
if (type8[0] === "+") {
|
|
282187
282187
|
return "*/*" + type8;
|
|
282188
282188
|
}
|
|
282189
|
-
return type8.indexOf("/") === -1 ?
|
|
282189
|
+
return type8.indexOf("/") === -1 ? mime4.lookup(type8) : type8;
|
|
282190
282190
|
}
|
|
282191
282191
|
function mimeMatch(expected, actual) {
|
|
282192
282192
|
if (expected === false) {
|
|
@@ -284305,16 +284305,16 @@ var require_mime = __commonJS({
|
|
|
284305
284305
|
var type8 = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();
|
|
284306
284306
|
return this.extensions[type8];
|
|
284307
284307
|
};
|
|
284308
|
-
var
|
|
284309
|
-
|
|
284310
|
-
|
|
284311
|
-
|
|
284312
|
-
|
|
284308
|
+
var mime4 = new Mime();
|
|
284309
|
+
mime4.define(require_types22());
|
|
284310
|
+
mime4.default_type = mime4.lookup("bin");
|
|
284311
|
+
mime4.Mime = Mime;
|
|
284312
|
+
mime4.charsets = {
|
|
284313
284313
|
lookup: function(mimeType, fallback2) {
|
|
284314
284314
|
return /^text\/|^application\/(javascript|json)/.test(mimeType) ? "UTF-8" : fallback2;
|
|
284315
284315
|
}
|
|
284316
284316
|
};
|
|
284317
|
-
module4.exports =
|
|
284317
|
+
module4.exports = mime4;
|
|
284318
284318
|
}
|
|
284319
284319
|
});
|
|
284320
284320
|
|
|
@@ -284412,7 +284412,7 @@ var require_send = __commonJS({
|
|
|
284412
284412
|
var etag = require_etag();
|
|
284413
284413
|
var fresh = require_fresh();
|
|
284414
284414
|
var fs28 = require("fs");
|
|
284415
|
-
var
|
|
284415
|
+
var mime4 = require_mime();
|
|
284416
284416
|
var ms5 = require_ms();
|
|
284417
284417
|
var onFinished = require_on_finished();
|
|
284418
284418
|
var parseRange = require_range_parser();
|
|
@@ -284429,7 +284429,7 @@ var require_send = __commonJS({
|
|
|
284429
284429
|
var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1e3;
|
|
284430
284430
|
var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/;
|
|
284431
284431
|
module4.exports = send;
|
|
284432
|
-
module4.exports.mime =
|
|
284432
|
+
module4.exports.mime = mime4;
|
|
284433
284433
|
function send(req, path104, options2) {
|
|
284434
284434
|
return new SendStream(req, path104, options2);
|
|
284435
284435
|
}
|
|
@@ -284807,12 +284807,12 @@ var require_send = __commonJS({
|
|
|
284807
284807
|
SendStream.prototype.type = function type8(path104) {
|
|
284808
284808
|
var res = this.res;
|
|
284809
284809
|
if (res.getHeader("Content-Type")) return;
|
|
284810
|
-
var type9 =
|
|
284810
|
+
var type9 = mime4.lookup(path104);
|
|
284811
284811
|
if (!type9) {
|
|
284812
284812
|
debug9("no content-type");
|
|
284813
284813
|
return;
|
|
284814
284814
|
}
|
|
284815
|
-
var charset =
|
|
284815
|
+
var charset = mime4.charsets.lookup(type9);
|
|
284816
284816
|
debug9("content-type %s", type9);
|
|
284817
284817
|
res.setHeader("Content-Type", type9 + (charset ? "; charset=" + charset : ""));
|
|
284818
284818
|
};
|
|
@@ -285782,7 +285782,7 @@ var require_utils29 = __commonJS({
|
|
|
285782
285782
|
var contentType = require_content_type();
|
|
285783
285783
|
var deprecate2 = require_depd()("express");
|
|
285784
285784
|
var flatten3 = require_array_flatten();
|
|
285785
|
-
var
|
|
285785
|
+
var mime4 = require_send().mime;
|
|
285786
285786
|
var etag = require_etag();
|
|
285787
285787
|
var proxyaddr = require_proxy_addr();
|
|
285788
285788
|
var qs9 = require_lib3();
|
|
@@ -285799,7 +285799,7 @@ var require_utils29 = __commonJS({
|
|
|
285799
285799
|
"utils.flatten: use array-flatten npm module instead"
|
|
285800
285800
|
);
|
|
285801
285801
|
exports2.normalizeType = function(type8) {
|
|
285802
|
-
return ~type8.indexOf("/") ? acceptParams(type8) : { value:
|
|
285802
|
+
return ~type8.indexOf("/") ? acceptParams(type8) : { value: mime4.lookup(type8), params: {} };
|
|
285803
285803
|
};
|
|
285804
285804
|
exports2.normalizeTypes = function(types4) {
|
|
285805
285805
|
var ret = [];
|
|
@@ -286688,7 +286688,7 @@ var require_accepts = __commonJS({
|
|
|
286688
286688
|
"../../../node_modules/.pnpm/accepts@1.3.8/node_modules/accepts/index.js"(exports2, module4) {
|
|
286689
286689
|
"use strict";
|
|
286690
286690
|
var Negotiator = require_negotiator();
|
|
286691
|
-
var
|
|
286691
|
+
var mime4 = require_mime_types();
|
|
286692
286692
|
module4.exports = Accepts;
|
|
286693
286693
|
function Accepts(req) {
|
|
286694
286694
|
if (!(this instanceof Accepts)) {
|
|
@@ -286756,7 +286756,7 @@ var require_accepts = __commonJS({
|
|
|
286756
286756
|
return this.negotiator.languages(languages)[0] || false;
|
|
286757
286757
|
};
|
|
286758
286758
|
function extToMime(type8) {
|
|
286759
|
-
return type8.indexOf("/") === -1 ?
|
|
286759
|
+
return type8.indexOf("/") === -1 ? mime4.lookup(type8) : type8;
|
|
286760
286760
|
}
|
|
286761
286761
|
function validMime(type8) {
|
|
286762
286762
|
return typeof type8 === "string";
|
|
@@ -287139,7 +287139,7 @@ var require_response = __commonJS({
|
|
|
287139
287139
|
var cookie = require_cookie();
|
|
287140
287140
|
var send = require_send();
|
|
287141
287141
|
var extname2 = path103.extname;
|
|
287142
|
-
var
|
|
287142
|
+
var mime4 = send.mime;
|
|
287143
287143
|
var resolve15 = path103.resolve;
|
|
287144
287144
|
var vary = require_vary();
|
|
287145
287145
|
var res = Object.create(http13.ServerResponse.prototype);
|
|
@@ -287403,7 +287403,7 @@ var require_response = __commonJS({
|
|
|
287403
287403
|
return this.sendFile(fullPath, opts, done);
|
|
287404
287404
|
};
|
|
287405
287405
|
res.contentType = res.type = function contentType(type8) {
|
|
287406
|
-
var ct8 = type8.indexOf("/") === -1 ?
|
|
287406
|
+
var ct8 = type8.indexOf("/") === -1 ? mime4.lookup(type8) : type8;
|
|
287407
287407
|
return this.set("Content-Type", ct8);
|
|
287408
287408
|
};
|
|
287409
287409
|
res.format = function(obj) {
|
|
@@ -287451,7 +287451,7 @@ var require_response = __commonJS({
|
|
|
287451
287451
|
throw new TypeError("Content-Type cannot be set to an Array");
|
|
287452
287452
|
}
|
|
287453
287453
|
if (!charsetRegExp.test(value2)) {
|
|
287454
|
-
var charset =
|
|
287454
|
+
var charset = mime4.charsets.lookup(value2.split(";")[0]);
|
|
287455
287455
|
if (charset) value2 += "; charset=" + charset.toLowerCase();
|
|
287456
287456
|
}
|
|
287457
287457
|
}
|
|
@@ -485946,7 +485946,9 @@ var Name2 = schemas_exports3.objectWithoutOptionalProperties({
|
|
|
485946
485946
|
// ../../ir-sdk/lib/sdk/serialization/resources/dynamic/resources/auth/types/BasicAuth.js
|
|
485947
485947
|
var BasicAuth = schemas_exports3.objectWithoutOptionalProperties({
|
|
485948
485948
|
username: Name2,
|
|
485949
|
-
|
|
485949
|
+
usernameOmit: schemas_exports3.boolean().optional(),
|
|
485950
|
+
password: Name2,
|
|
485951
|
+
passwordOmit: schemas_exports3.boolean().optional()
|
|
485950
485952
|
});
|
|
485951
485953
|
|
|
485952
485954
|
// ../../ir-sdk/lib/sdk/serialization/resources/dynamic/resources/auth/types/BearerAuth.js
|
|
@@ -505109,18 +505111,18 @@ var fileProcessor = (schema2, _ctx, json3, _params) => {
|
|
|
505109
505111
|
format: "binary",
|
|
505110
505112
|
contentEncoding: "binary"
|
|
505111
505113
|
};
|
|
505112
|
-
const { minimum, maximum, mime:
|
|
505114
|
+
const { minimum, maximum, mime: mime4 } = schema2._zod.bag;
|
|
505113
505115
|
if (minimum !== void 0)
|
|
505114
505116
|
file4.minLength = minimum;
|
|
505115
505117
|
if (maximum !== void 0)
|
|
505116
505118
|
file4.maxLength = maximum;
|
|
505117
|
-
if (
|
|
505118
|
-
if (
|
|
505119
|
-
file4.contentMediaType =
|
|
505119
|
+
if (mime4) {
|
|
505120
|
+
if (mime4.length === 1) {
|
|
505121
|
+
file4.contentMediaType = mime4[0];
|
|
505120
505122
|
Object.assign(_json, file4);
|
|
505121
505123
|
} else {
|
|
505122
505124
|
Object.assign(_json, file4);
|
|
505123
|
-
_json.anyOf =
|
|
505125
|
+
_json.anyOf = mime4.map((m7) => ({ contentMediaType: m7 }));
|
|
505124
505126
|
}
|
|
505125
505127
|
} else {
|
|
505126
505128
|
Object.assign(_json, file4);
|
|
@@ -559088,17 +559090,12 @@ var DynamicSnippetsConverter = class {
|
|
|
559088
559090
|
const scheme = auth8.schemes[0];
|
|
559089
559091
|
switch (scheme.type) {
|
|
559090
559092
|
case "basic": {
|
|
559091
|
-
|
|
559093
|
+
return dynamic_exports.Auth.basic({
|
|
559092
559094
|
username: this.inflateName(scheme.username),
|
|
559093
|
-
|
|
559094
|
-
|
|
559095
|
-
|
|
559096
|
-
|
|
559097
|
-
}
|
|
559098
|
-
if (scheme.passwordOmit) {
|
|
559099
|
-
basicAuth.passwordOmit = scheme.passwordOmit;
|
|
559100
|
-
}
|
|
559101
|
-
return dynamic_exports.Auth.basic(basicAuth);
|
|
559095
|
+
usernameOmit: scheme.usernameOmit,
|
|
559096
|
+
password: this.inflateName(scheme.password),
|
|
559097
|
+
passwordOmit: scheme.passwordOmit
|
|
559098
|
+
});
|
|
559102
559099
|
}
|
|
559103
559100
|
case "bearer":
|
|
559104
559101
|
return dynamic_exports.Auth.bearer({
|
|
@@ -559138,8 +559135,8 @@ var DynamicSnippetsConverter = class {
|
|
|
559138
559135
|
});
|
|
559139
559136
|
case "basic":
|
|
559140
559137
|
return dynamic_exports.AuthValues.basic({
|
|
559141
|
-
username: "<username>",
|
|
559142
|
-
password: "<password>"
|
|
559138
|
+
username: scheme.usernameOmit ? "" : "<username>",
|
|
559139
|
+
password: scheme.passwordOmit ? "" : "<password>"
|
|
559143
559140
|
});
|
|
559144
559141
|
case "header":
|
|
559145
559142
|
return dynamic_exports.AuthValues.header({
|
|
@@ -579376,7 +579373,7 @@ function fromDataURI(uri, asBlob, options2) {
|
|
|
579376
579373
|
if (!match3) {
|
|
579377
579374
|
throw new AxiosError_default("Invalid URL", AxiosError_default.ERR_INVALID_URL);
|
|
579378
579375
|
}
|
|
579379
|
-
const
|
|
579376
|
+
const mime4 = match3[1];
|
|
579380
579377
|
const isBase64 = match3[2];
|
|
579381
579378
|
const body = match3[3];
|
|
579382
579379
|
const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? "base64" : "utf8");
|
|
@@ -579384,7 +579381,7 @@ function fromDataURI(uri, asBlob, options2) {
|
|
|
579384
579381
|
if (!_Blob) {
|
|
579385
579382
|
throw new AxiosError_default("Blob is not supported", AxiosError_default.ERR_NOT_SUPPORT);
|
|
579386
579383
|
}
|
|
579387
|
-
return new _Blob([buffer], { type:
|
|
579384
|
+
return new _Blob([buffer], { type: mime4 });
|
|
579388
579385
|
}
|
|
579389
579386
|
return buffer;
|
|
579390
579387
|
}
|
|
@@ -618020,7 +618017,7 @@ var AccessTokenPosthogManager = class {
|
|
|
618020
618017
|
properties: {
|
|
618021
618018
|
...event,
|
|
618022
618019
|
...event.properties,
|
|
618023
|
-
version: "4.94.
|
|
618020
|
+
version: "4.94.1-16-g570413b0bdb",
|
|
618024
618021
|
usingAccessToken: true
|
|
618025
618022
|
}
|
|
618026
618023
|
});
|
|
@@ -618074,7 +618071,7 @@ var UserPosthogManager = class {
|
|
|
618074
618071
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
618075
618072
|
event: "CLI",
|
|
618076
618073
|
properties: {
|
|
618077
|
-
version: "4.94.
|
|
618074
|
+
version: "4.94.1-16-g570413b0bdb",
|
|
618078
618075
|
...event,
|
|
618079
618076
|
...event.properties,
|
|
618080
618077
|
usingAccessToken: false,
|
|
@@ -797015,6 +797012,7 @@ function convertAvailability5(availability) {
|
|
|
797015
797012
|
// ../docs-resolver/lib/stitchGlobalTheme.js
|
|
797016
797013
|
init_lib6();
|
|
797017
797014
|
var import_promises63 = require("fs/promises");
|
|
797015
|
+
var import_mime_types = __toESM(require_mime_types(), 1);
|
|
797018
797016
|
var import_path53 = __toESM(require("path"), 1);
|
|
797019
797017
|
var import_tmp_promise8 = __toESM(require_tmp_promise(), 1);
|
|
797020
797018
|
function isPresignedUrl(value2) {
|
|
@@ -797023,21 +797021,52 @@ function isPresignedUrl(value2) {
|
|
|
797023
797021
|
function isRemoteUrl(value2) {
|
|
797024
797022
|
return value2.startsWith("http://") || value2.startsWith("https://");
|
|
797025
797023
|
}
|
|
797024
|
+
function parseFilenameFromDisposition(value2) {
|
|
797025
|
+
if (value2 == null) {
|
|
797026
|
+
return void 0;
|
|
797027
|
+
}
|
|
797028
|
+
const match3 = value2.match(/filename\*?=(?:"([^"]+)"|([^;]+))/i);
|
|
797029
|
+
const name2 = match3?.[1] ?? match3?.[2]?.trim();
|
|
797030
|
+
return name2 != null && import_path53.default.extname(name2) !== "" ? name2 : void 0;
|
|
797031
|
+
}
|
|
797032
|
+
function filenameFromUrl(url3) {
|
|
797033
|
+
try {
|
|
797034
|
+
const params2 = new URL(url3).searchParams;
|
|
797035
|
+
const rcd = params2.get("response-content-disposition");
|
|
797036
|
+
return parseFilenameFromDisposition(rcd);
|
|
797037
|
+
} catch {
|
|
797038
|
+
return void 0;
|
|
797039
|
+
}
|
|
797040
|
+
}
|
|
797026
797041
|
async function downloadToTemp(url3, tmpDir, index3) {
|
|
797027
|
-
const
|
|
797028
|
-
try {
|
|
797029
|
-
const pathname = new URL(url3).pathname;
|
|
797030
|
-
const dot = pathname.lastIndexOf(".");
|
|
797031
|
-
return dot >= 0 ? pathname.slice(dot) : "";
|
|
797032
|
-
} catch {
|
|
797033
|
-
return "";
|
|
797034
|
-
}
|
|
797035
|
-
})();
|
|
797036
|
-
const dest = import_path53.default.join(tmpDir, `theme_asset_${index3}${ext2}`);
|
|
797042
|
+
const urlFilename = filenameFromUrl(url3);
|
|
797037
797043
|
const res = await fetch(url3);
|
|
797038
797044
|
if (!res.ok) {
|
|
797039
797045
|
throw new Error(`Failed to download theme asset: ${res.status} ${url3}`);
|
|
797040
797046
|
}
|
|
797047
|
+
const cdFilename = parseFilenameFromDisposition(res.headers.get("content-disposition"));
|
|
797048
|
+
const filename = urlFilename ?? cdFilename ?? (() => {
|
|
797049
|
+
const ext2 = (() => {
|
|
797050
|
+
const contentType = res.headers.get("content-type")?.split(";")[0]?.trim();
|
|
797051
|
+
if (contentType) {
|
|
797052
|
+
const mapped = import_mime_types.default.extension(contentType);
|
|
797053
|
+
if (mapped) {
|
|
797054
|
+
return `.${mapped}`;
|
|
797055
|
+
}
|
|
797056
|
+
}
|
|
797057
|
+
return "";
|
|
797058
|
+
})() || (() => {
|
|
797059
|
+
try {
|
|
797060
|
+
const pathname = new URL(url3).pathname;
|
|
797061
|
+
const dot = pathname.lastIndexOf(".");
|
|
797062
|
+
return dot >= 0 ? pathname.slice(dot) : "";
|
|
797063
|
+
} catch {
|
|
797064
|
+
return "";
|
|
797065
|
+
}
|
|
797066
|
+
})();
|
|
797067
|
+
return `theme_asset_${index3}${ext2}`;
|
|
797068
|
+
})();
|
|
797069
|
+
const dest = import_path53.default.join(tmpDir, filename);
|
|
797041
797070
|
const buf = Buffer.from(await res.arrayBuffer());
|
|
797042
797071
|
await (0, import_promises63.writeFile)(dest, buf);
|
|
797043
797072
|
return dest;
|
|
@@ -829166,7 +829195,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
829166
829195
|
var LOGS_FOLDER_NAME = "logs";
|
|
829167
829196
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
829168
829197
|
function getCliSource() {
|
|
829169
|
-
const version7 = "4.94.
|
|
829198
|
+
const version7 = "4.94.1-16-g570413b0bdb";
|
|
829170
829199
|
return `cli@${version7}`;
|
|
829171
829200
|
}
|
|
829172
829201
|
var DebugLogger = class {
|
|
@@ -840053,7 +840082,7 @@ init_lib6();
|
|
|
840053
840082
|
var import_crypto8 = require("crypto");
|
|
840054
840083
|
var import_promises94 = require("fs/promises");
|
|
840055
840084
|
init_lodash();
|
|
840056
|
-
var
|
|
840085
|
+
var mime2 = __toESM(require_mime_types(), 1);
|
|
840057
840086
|
|
|
840058
840087
|
// ../generation/remote-generation/remote-workspace-runner/lib/measureImageSizes.js
|
|
840059
840088
|
init_lib4();
|
|
@@ -840214,7 +840243,7 @@ async function publishDocs({ token, organization, docsWorkspace, domain: domain3
|
|
|
840214
840243
|
const sanitizedToAbsoluteMap = new Map(filesWithSanitizedPaths.map((file4) => [file4.sanitizedPath, file4.absoluteFilePath]));
|
|
840215
840244
|
const filesWithMimeType = filesWithSanitizedPaths.map((fileMetadata) => ({
|
|
840216
840245
|
...fileMetadata,
|
|
840217
|
-
mediaType:
|
|
840246
|
+
mediaType: mime2.lookup(fileMetadata.absoluteFilePath)
|
|
840218
840247
|
})).filter((fileMetadata) => fileMetadata.mediaType !== false);
|
|
840219
840248
|
const imagesToMeasure = filesWithMimeType.filter((file4) => MediaType.parse(file4.mediaType)?.isImage() ?? false).map((file4) => file4.absoluteFilePath);
|
|
840220
840249
|
const measuredImages = await measureImageSizes(imagesToMeasure, MEASURE_IMAGE_BATCH_SIZE, context3);
|
|
@@ -840494,7 +840523,7 @@ async function uploadFiles(filesToUpload, docsWorkspacePath, context3, batchSize
|
|
|
840494
840523
|
const absoluteFilePath = sanitizedToAbsoluteMap.get(key2) || resolve6(docsWorkspacePath, RelativeFilePath2.of(key2));
|
|
840495
840524
|
try {
|
|
840496
840525
|
const uploadUrl = extractUploadUrl(urlValue);
|
|
840497
|
-
const mimeType =
|
|
840526
|
+
const mimeType = mime2.lookup(absoluteFilePath);
|
|
840498
840527
|
await axios_default.put(uploadUrl, await (0, import_promises94.readFile)(absoluteFilePath), {
|
|
840499
840528
|
headers: {
|
|
840500
840529
|
"Content-Type": mimeType === false ? "application/octet-stream" : mimeType,
|
|
@@ -841129,7 +841158,7 @@ var LegacyDocsPublisher = class {
|
|
|
841129
841158
|
previewId,
|
|
841130
841159
|
disableTemplates: void 0,
|
|
841131
841160
|
skipUpload,
|
|
841132
|
-
cliVersion: "4.94.
|
|
841161
|
+
cliVersion: "4.94.1-16-g570413b0bdb",
|
|
841133
841162
|
loginCommand: "fern auth login"
|
|
841134
841163
|
});
|
|
841135
841164
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -842216,9 +842245,30 @@ var import_child_process8 = require("child_process");
|
|
|
842216
842245
|
var import_crypto9 = require("crypto");
|
|
842217
842246
|
var import_promises96 = require("fs/promises");
|
|
842218
842247
|
init_js_yaml();
|
|
842219
|
-
var
|
|
842248
|
+
var import_mime_types2 = __toESM(require_mime_types(), 1);
|
|
842220
842249
|
var import_path63 = __toESM(require("path"), 1);
|
|
842221
842250
|
var FDR_ORIGIN2 = process.env.FERN_FDR_ORIGIN ?? "https://registry-dev2.buildwithfern.com" ?? "https://registry.buildwithfern.com";
|
|
842251
|
+
function describeFetchError(error50) {
|
|
842252
|
+
if (!(error50 instanceof Error)) {
|
|
842253
|
+
return String(error50);
|
|
842254
|
+
}
|
|
842255
|
+
const cause = error50.cause;
|
|
842256
|
+
if (cause instanceof Error) {
|
|
842257
|
+
return cause.message;
|
|
842258
|
+
}
|
|
842259
|
+
return error50.message;
|
|
842260
|
+
}
|
|
842261
|
+
function parseErrorDetail(body) {
|
|
842262
|
+
try {
|
|
842263
|
+
const parsed = JSON.parse(body);
|
|
842264
|
+
const message = parsed.message ?? parsed.error?.message;
|
|
842265
|
+
if (typeof message === "string") {
|
|
842266
|
+
return message;
|
|
842267
|
+
}
|
|
842268
|
+
} catch {
|
|
842269
|
+
}
|
|
842270
|
+
return void 0;
|
|
842271
|
+
}
|
|
842222
842272
|
function getGitRoot() {
|
|
842223
842273
|
try {
|
|
842224
842274
|
return (0, import_child_process8.execSync)("git rev-parse --show-toplevel", { encoding: "utf-8" }).trim();
|
|
@@ -842231,49 +842281,81 @@ function posixBindPath(gitRoot, absolutePath) {
|
|
|
842231
842281
|
const relative5 = import_path63.default.relative(gitRoot, absolutePath);
|
|
842232
842282
|
return [repoName, ...relative5.split(import_path63.default.sep)].join("/");
|
|
842233
842283
|
}
|
|
842234
|
-
async function uploadToCas(content5, contentType, bindPath, orgId, token, label) {
|
|
842284
|
+
async function uploadToCas(content5, contentType, bindPath, orgId, token, label, context3) {
|
|
842235
842285
|
const hash5 = (0, import_crypto9.createHash)("sha256").update(content5).digest("hex");
|
|
842236
842286
|
const casUrl = `${FDR_ORIGIN2}/v2/registry/content/${hash5}?orgId=${encodeURIComponent(orgId)}`;
|
|
842237
|
-
|
|
842238
|
-
|
|
842239
|
-
|
|
842240
|
-
|
|
842241
|
-
|
|
842287
|
+
context3.stdout.debug(` CAS check: PUT ${casUrl} (${contentType}, ${content5.byteLength} bytes)`);
|
|
842288
|
+
let checkRes;
|
|
842289
|
+
try {
|
|
842290
|
+
checkRes = await fetch(casUrl, {
|
|
842291
|
+
method: "PUT",
|
|
842292
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}` },
|
|
842293
|
+
body: JSON.stringify({ contentType, contentLength: content5.byteLength })
|
|
842294
|
+
});
|
|
842295
|
+
} catch (err) {
|
|
842296
|
+
throw new CliError({
|
|
842297
|
+
message: `CAS check for ${label} failed \u2014 could not reach ${FDR_ORIGIN2}: ${describeFetchError(err)}`,
|
|
842298
|
+
code: CliError.Code.NetworkError
|
|
842299
|
+
});
|
|
842300
|
+
}
|
|
842242
842301
|
if (!checkRes.ok) {
|
|
842243
842302
|
const errorBody = await checkRes.text();
|
|
842303
|
+
const detail = parseErrorDetail(errorBody) ?? errorBody;
|
|
842244
842304
|
throw new CliError({
|
|
842245
|
-
message: `CAS check failed for ${label}: HTTP ${checkRes.status} \u2014 ${
|
|
842305
|
+
message: `CAS check failed for ${label}: HTTP ${checkRes.status} \u2014 ${detail}`,
|
|
842246
842306
|
code: CliError.Code.NetworkError
|
|
842247
842307
|
});
|
|
842248
842308
|
}
|
|
842249
842309
|
const checkBody = await checkRes.json();
|
|
842310
|
+
context3.stdout.debug(` CAS status for ${label}: ${checkBody.status}`);
|
|
842250
842311
|
if (checkBody.status === "upload_required" && checkBody.uploadUrl != null) {
|
|
842251
|
-
|
|
842252
|
-
|
|
842253
|
-
|
|
842254
|
-
|
|
842255
|
-
|
|
842312
|
+
context3.stdout.debug(` Uploading ${label} to S3 (${content5.byteLength} bytes)...`);
|
|
842313
|
+
let uploadRes;
|
|
842314
|
+
try {
|
|
842315
|
+
uploadRes = await fetch(checkBody.uploadUrl, {
|
|
842316
|
+
method: "PUT",
|
|
842317
|
+
headers: { "Content-Type": contentType },
|
|
842318
|
+
body: new Uint8Array(content5.buffer, content5.byteOffset, content5.byteLength)
|
|
842319
|
+
});
|
|
842320
|
+
} catch (err) {
|
|
842321
|
+
throw new CliError({
|
|
842322
|
+
message: `S3 upload for ${label} failed \u2014 could not reach upload URL: ${describeFetchError(err)}`,
|
|
842323
|
+
code: CliError.Code.NetworkError
|
|
842324
|
+
});
|
|
842325
|
+
}
|
|
842256
842326
|
if (!uploadRes.ok) {
|
|
842327
|
+
const errorBody = await uploadRes.text().catch(() => "");
|
|
842257
842328
|
throw new CliError({
|
|
842258
|
-
message: `S3 upload failed for ${label}: HTTP ${uploadRes.status}`,
|
|
842329
|
+
message: `S3 upload failed for ${label}: HTTP ${uploadRes.status}${errorBody ? ` \u2014 ${errorBody}` : ""}`,
|
|
842259
842330
|
code: CliError.Code.NetworkError
|
|
842260
842331
|
});
|
|
842261
842332
|
}
|
|
842262
842333
|
}
|
|
842263
|
-
const
|
|
842264
|
-
|
|
842265
|
-
|
|
842266
|
-
|
|
842267
|
-
|
|
842334
|
+
const bindUrl = `${FDR_ORIGIN2}/v2/registry/files/${orgId}/${bindPath}`;
|
|
842335
|
+
context3.stdout.debug(` Binding ${label} \u2192 ${bindPath}`);
|
|
842336
|
+
let bindRes;
|
|
842337
|
+
try {
|
|
842338
|
+
bindRes = await fetch(bindUrl, {
|
|
842339
|
+
method: "PUT",
|
|
842340
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}` },
|
|
842341
|
+
body: JSON.stringify({ hash: hash5, contentType })
|
|
842342
|
+
});
|
|
842343
|
+
} catch (err) {
|
|
842344
|
+
throw new CliError({
|
|
842345
|
+
message: `File bind for ${label} failed \u2014 could not reach ${FDR_ORIGIN2}: ${describeFetchError(err)}`,
|
|
842346
|
+
code: CliError.Code.NetworkError
|
|
842347
|
+
});
|
|
842348
|
+
}
|
|
842268
842349
|
if (!bindRes.ok) {
|
|
842350
|
+
const errorBody = await bindRes.text().catch(() => "");
|
|
842269
842351
|
throw new CliError({
|
|
842270
|
-
message: `File bind failed for ${label}: HTTP ${bindRes.status}`,
|
|
842352
|
+
message: `File bind failed for ${label}: HTTP ${bindRes.status}${errorBody ? ` \u2014 ${errorBody}` : ""}`,
|
|
842271
842353
|
code: CliError.Code.NetworkError
|
|
842272
842354
|
});
|
|
842273
842355
|
}
|
|
842274
842356
|
return hash5;
|
|
842275
842357
|
}
|
|
842276
|
-
async function uploadFileToCas(absolutePath, orgId, token, gitRoot) {
|
|
842358
|
+
async function uploadFileToCas(absolutePath, orgId, token, gitRoot, context3) {
|
|
842277
842359
|
try {
|
|
842278
842360
|
await (0, import_promises96.access)(absolutePath);
|
|
842279
842361
|
} catch {
|
|
@@ -842283,9 +842365,9 @@ async function uploadFileToCas(absolutePath, orgId, token, gitRoot) {
|
|
|
842283
842365
|
});
|
|
842284
842366
|
}
|
|
842285
842367
|
const content5 = await (0, import_promises96.readFile)(absolutePath);
|
|
842286
|
-
const contentType =
|
|
842368
|
+
const contentType = import_mime_types2.default.lookup(absolutePath) || "application/octet-stream";
|
|
842287
842369
|
const bindPath = posixBindPath(gitRoot, absolutePath);
|
|
842288
|
-
return uploadToCas(content5, contentType, bindPath, orgId, token, import_path63.default.basename(absolutePath));
|
|
842370
|
+
return uploadToCas(content5, contentType, bindPath, orgId, token, import_path63.default.basename(absolutePath), context3);
|
|
842289
842371
|
}
|
|
842290
842372
|
async function processFileField(value2, themeDir, orgId, token, gitRoot, context3) {
|
|
842291
842373
|
if (value2 == null) {
|
|
@@ -842296,26 +842378,39 @@ async function processFileField(value2, themeDir, orgId, token, gitRoot, context
|
|
|
842296
842378
|
}
|
|
842297
842379
|
const abs = import_path63.default.resolve(themeDir, value2);
|
|
842298
842380
|
context3.stdout.debug(` Uploading ${value2}...`);
|
|
842299
|
-
const hash5 = await uploadFileToCas(abs, orgId, token, gitRoot);
|
|
842381
|
+
const hash5 = await uploadFileToCas(abs, orgId, token, gitRoot, context3);
|
|
842300
842382
|
return { hash: hash5 };
|
|
842301
842383
|
}
|
|
842302
842384
|
async function processThemeConfig(raw, themeDir, orgId, token, gitRoot, context3) {
|
|
842303
842385
|
const cfg = { ...raw };
|
|
842304
|
-
|
|
842386
|
+
let filesUploaded = 0;
|
|
842387
|
+
const field5 = async (v6) => {
|
|
842388
|
+
const result = await processFileField(v6, themeDir, orgId, token, gitRoot, context3);
|
|
842389
|
+
if (result != null && typeof result === "object") {
|
|
842390
|
+
filesUploaded++;
|
|
842391
|
+
}
|
|
842392
|
+
return result;
|
|
842393
|
+
};
|
|
842305
842394
|
if (cfg.logo != null && typeof cfg.logo === "object") {
|
|
842395
|
+
context3.stdout.debug("Processing logo...");
|
|
842306
842396
|
const logo = { ...cfg.logo };
|
|
842307
842397
|
logo.dark = await field5(logo.dark);
|
|
842308
842398
|
logo.light = await field5(logo.light);
|
|
842309
842399
|
cfg.logo = logo;
|
|
842310
842400
|
}
|
|
842401
|
+
if (cfg.favicon != null) {
|
|
842402
|
+
context3.stdout.debug("Processing favicon...");
|
|
842403
|
+
}
|
|
842311
842404
|
cfg.favicon = await field5(cfg.favicon);
|
|
842312
842405
|
if (cfg["background-image"] != null && typeof cfg["background-image"] === "object") {
|
|
842406
|
+
context3.stdout.debug("Processing background-image...");
|
|
842313
842407
|
const bg2 = { ...cfg["background-image"] };
|
|
842314
842408
|
bg2.dark = await field5(bg2.dark);
|
|
842315
842409
|
bg2.light = await field5(bg2.light);
|
|
842316
842410
|
cfg["background-image"] = bg2;
|
|
842317
842411
|
}
|
|
842318
842412
|
if (cfg.typography != null && typeof cfg.typography === "object") {
|
|
842413
|
+
context3.stdout.debug("Processing typography fonts...");
|
|
842319
842414
|
const typo = { ...cfg.typography };
|
|
842320
842415
|
for (const fontKey of ["bodyFont", "headingsFont", "codeFont"]) {
|
|
842321
842416
|
const font = typo[fontKey];
|
|
@@ -842337,10 +842432,12 @@ async function processThemeConfig(raw, themeDir, orgId, token, gitRoot, context3
|
|
|
842337
842432
|
}
|
|
842338
842433
|
if (cfg.css != null) {
|
|
842339
842434
|
const cssList = Array.isArray(cfg.css) ? cfg.css : [cfg.css];
|
|
842435
|
+
context3.stdout.debug(`Processing ${cssList.length} CSS file(s)...`);
|
|
842340
842436
|
cfg.css = await Promise.all(cssList.map((item) => typeof item === "string" ? field5(item) : item));
|
|
842341
842437
|
}
|
|
842342
842438
|
if (cfg.js != null) {
|
|
842343
842439
|
const jsList = Array.isArray(cfg.js) ? cfg.js : [cfg.js];
|
|
842440
|
+
context3.stdout.debug(`Processing ${jsList.length} JS file(s)...`);
|
|
842344
842441
|
cfg.js = await Promise.all(jsList.map(async (entry) => {
|
|
842345
842442
|
if (typeof entry === "string") {
|
|
842346
842443
|
return field5(entry);
|
|
@@ -842358,9 +842455,16 @@ async function processThemeConfig(raw, themeDir, orgId, token, gitRoot, context3
|
|
|
842358
842455
|
return entry;
|
|
842359
842456
|
}));
|
|
842360
842457
|
}
|
|
842458
|
+
if (cfg.header != null) {
|
|
842459
|
+
context3.stdout.debug("Processing header component...");
|
|
842460
|
+
}
|
|
842361
842461
|
cfg.header = await field5(cfg.header);
|
|
842462
|
+
if (cfg.footer != null) {
|
|
842463
|
+
context3.stdout.debug("Processing footer component...");
|
|
842464
|
+
}
|
|
842362
842465
|
cfg.footer = await field5(cfg.footer);
|
|
842363
842466
|
if (cfg.metadata != null && typeof cfg.metadata === "object") {
|
|
842467
|
+
context3.stdout.debug("Processing metadata images...");
|
|
842364
842468
|
const meta5 = { ...cfg.metadata };
|
|
842365
842469
|
for (const imgKey of ["og:image", "twitter:image", "og:background-image", "og:logo"]) {
|
|
842366
842470
|
if (typeof meta5[imgKey] === "string") {
|
|
@@ -842369,7 +842473,7 @@ async function processThemeConfig(raw, themeDir, orgId, token, gitRoot, context3
|
|
|
842369
842473
|
}
|
|
842370
842474
|
cfg.metadata = meta5;
|
|
842371
842475
|
}
|
|
842372
|
-
return cfg;
|
|
842476
|
+
return { config: cfg, filesUploaded };
|
|
842373
842477
|
}
|
|
842374
842478
|
var UploadThemeCommand = class {
|
|
842375
842479
|
async handle(context3, args) {
|
|
@@ -842392,16 +842496,32 @@ var UploadThemeCommand = class {
|
|
|
842392
842496
|
throw new CliError({ message: "theme.yml must be a YAML object", code: CliError.Code.ConfigError });
|
|
842393
842497
|
}
|
|
842394
842498
|
context3.stdout.info(`Uploading theme "${args.name}" for org "${orgId}"...`);
|
|
842395
|
-
|
|
842396
|
-
|
|
842397
|
-
|
|
842398
|
-
|
|
842399
|
-
|
|
842400
|
-
}
|
|
842499
|
+
context3.stdout.debug(`FDR origin: ${FDR_ORIGIN2}`);
|
|
842500
|
+
context3.stdout.debug(`Theme directory: ${themeDir}`);
|
|
842501
|
+
const { config: processedConfig, filesUploaded } = await processThemeConfig(rawYaml, themeDir, orgId, token.value, gitRoot, context3);
|
|
842502
|
+
if (filesUploaded > 0) {
|
|
842503
|
+
context3.stdout.info(`Uploaded ${filesUploaded} file asset(s) to CAS`);
|
|
842504
|
+
}
|
|
842505
|
+
const saveUrl = `${FDR_ORIGIN2}/v2/registry/themes/${orgId}`;
|
|
842506
|
+
context3.stdout.debug(`Saving theme to ${saveUrl}`);
|
|
842507
|
+
let res;
|
|
842508
|
+
try {
|
|
842509
|
+
res = await fetch(saveUrl, {
|
|
842510
|
+
method: "POST",
|
|
842511
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${token.value}` },
|
|
842512
|
+
body: JSON.stringify({ name: args.name, config: processedConfig })
|
|
842513
|
+
});
|
|
842514
|
+
} catch (err) {
|
|
842515
|
+
throw new CliError({
|
|
842516
|
+
message: `Failed to save theme "${args.name}" \u2014 could not reach ${FDR_ORIGIN2}: ${describeFetchError(err)}`,
|
|
842517
|
+
code: CliError.Code.NetworkError
|
|
842518
|
+
});
|
|
842519
|
+
}
|
|
842401
842520
|
if (!res.ok) {
|
|
842402
842521
|
const body = await res.text();
|
|
842522
|
+
const detail = parseErrorDetail(body) ?? body;
|
|
842403
842523
|
throw new CliError({
|
|
842404
|
-
message: `Failed to save theme: HTTP ${res.status} \u2014 ${
|
|
842524
|
+
message: `Failed to save theme "${args.name}": HTTP ${res.status} \u2014 ${detail}`,
|
|
842405
842525
|
code: CliError.Code.NetworkError
|
|
842406
842526
|
});
|
|
842407
842527
|
}
|
|
@@ -870099,10 +870219,23 @@ var EndpointSnippetGenerator4 = class {
|
|
|
870099
870219
|
this.context.errors.add({ severity: Severity.Warning, message });
|
|
870100
870220
|
}
|
|
870101
870221
|
getRootClientBasicAuthArgs({ auth: auth8, values: values2 }) {
|
|
870222
|
+
const authRecord = auth8;
|
|
870223
|
+
const usernameOmitted = !!authRecord.usernameOmit;
|
|
870224
|
+
const passwordOmitted = !!authRecord.passwordOmit;
|
|
870225
|
+
const credentialParts = [];
|
|
870226
|
+
if (!usernameOmitted) {
|
|
870227
|
+
credentialParts.push(`"${values2.username}"`);
|
|
870228
|
+
}
|
|
870229
|
+
if (!passwordOmitted) {
|
|
870230
|
+
credentialParts.push(`"${values2.password}"`);
|
|
870231
|
+
}
|
|
870232
|
+
if (credentialParts.length === 0) {
|
|
870233
|
+
return [];
|
|
870234
|
+
}
|
|
870102
870235
|
return [
|
|
870103
870236
|
{
|
|
870104
870237
|
name: "credentials",
|
|
870105
|
-
value: java_exports.TypeLiteral.raw(
|
|
870238
|
+
value: java_exports.TypeLiteral.raw(credentialParts.join(", "))
|
|
870106
870239
|
}
|
|
870107
870240
|
];
|
|
870108
870241
|
}
|
|
@@ -875781,6 +875914,7 @@ var DynamicTypeLiteralMapper3 = class {
|
|
|
875781
875914
|
}
|
|
875782
875915
|
}
|
|
875783
875916
|
convertDiscriminatedUnion({ discriminatedUnion: discriminatedUnion2, value: value2 }) {
|
|
875917
|
+
const typedDictRequests = this.context.useTypedDictRequests();
|
|
875784
875918
|
const discriminatedUnionTypeInstance = this.context.resolveDiscriminatedUnionTypeInstance({
|
|
875785
875919
|
discriminatedUnion: discriminatedUnion2,
|
|
875786
875920
|
value: value2
|
|
@@ -875796,6 +875930,13 @@ var DynamicTypeLiteralMapper3 = class {
|
|
|
875796
875930
|
if (unionProperties == null) {
|
|
875797
875931
|
return python_exports.TypeInstantiation.nop();
|
|
875798
875932
|
}
|
|
875933
|
+
if (typedDictRequests) {
|
|
875934
|
+
const discriminantEntry = {
|
|
875935
|
+
name: this.context.getPropertyName(discriminatedUnion2.discriminant.name),
|
|
875936
|
+
value: python_exports.TypeInstantiation.str(discriminatedUnionTypeInstance.discriminantValue.wireValue)
|
|
875937
|
+
};
|
|
875938
|
+
return python_exports.TypeInstantiation.typedDict([discriminantEntry, ...unionProperties], { multiline: true });
|
|
875939
|
+
}
|
|
875799
875940
|
const variantClassReference = this.context.getDiscriminatedUnionVariantClassReference({
|
|
875800
875941
|
unionDeclaration: discriminatedUnion2.declaration,
|
|
875801
875942
|
discriminantValue: unionVariant.discriminantValue
|
|
@@ -875926,7 +876067,11 @@ var DynamicTypeLiteralMapper3 = class {
|
|
|
875926
876067
|
return result.filter((entry) => !python_exports.TypeInstantiation.isNop(entry.value));
|
|
875927
876068
|
}
|
|
875928
876069
|
convertObject({ object_, value: value2 }) {
|
|
876070
|
+
const typedDictRequests = this.context.useTypedDictRequests();
|
|
875929
876071
|
const entries23 = this.convertObjectEntries({ object_, value: value2 });
|
|
876072
|
+
if (typedDictRequests) {
|
|
876073
|
+
return python_exports.TypeInstantiation.typedDict(entries23, { multiline: true });
|
|
876074
|
+
}
|
|
875930
876075
|
const classReference4 = this.context.getTypeClassReference(object_.declaration);
|
|
875931
876076
|
return python_exports.TypeInstantiation.reference(python_exports.instantiateClass({
|
|
875932
876077
|
classReference: classReference4,
|
|
@@ -876077,6 +876222,7 @@ var DynamicTypeLiteralMapper3 = class {
|
|
|
876077
876222
|
}
|
|
876078
876223
|
}
|
|
876079
876224
|
synthesizeDefaultNamed({ named, typeId, seen }) {
|
|
876225
|
+
const typedDictRequests = this.context.useTypedDictRequests();
|
|
876080
876226
|
const newSeen = new Set(seen);
|
|
876081
876227
|
newSeen.add(typeId);
|
|
876082
876228
|
switch (named.type) {
|
|
@@ -876112,6 +876258,9 @@ var DynamicTypeLiteralMapper3 = class {
|
|
|
876112
876258
|
});
|
|
876113
876259
|
}
|
|
876114
876260
|
}
|
|
876261
|
+
if (typedDictRequests) {
|
|
876262
|
+
return python_exports.TypeInstantiation.typedDict(entries23, { multiline: true });
|
|
876263
|
+
}
|
|
876115
876264
|
const classReference4 = this.context.getTypeClassReference(named.declaration);
|
|
876116
876265
|
return python_exports.TypeInstantiation.reference(python_exports.instantiateClass({
|
|
876117
876266
|
classReference: classReference4,
|
|
@@ -890818,7 +890967,7 @@ function resolveNaming({ namespaceExport, naming }) {
|
|
|
890818
890967
|
// ../../../generators/typescript-v2/dynamic-snippets/lib/context/DynamicTypeLiteralMapper.js
|
|
890819
890968
|
init_lib4();
|
|
890820
890969
|
|
|
890821
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
890970
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/index.mjs
|
|
890822
890971
|
var api_exports21 = {};
|
|
890823
890972
|
__export(api_exports21, {
|
|
890824
890973
|
commons: () => commons_exports57,
|
|
@@ -890826,10 +890975,10 @@ __export(api_exports21, {
|
|
|
890826
890975
|
generatorExec: () => generatorExec_exports28
|
|
890827
890976
|
});
|
|
890828
890977
|
|
|
890829
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
890978
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/commons/index.mjs
|
|
890830
890979
|
var commons_exports57 = {};
|
|
890831
890980
|
|
|
890832
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
890981
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/dynamic/index.mjs
|
|
890833
890982
|
var dynamic_exports28 = {};
|
|
890834
890983
|
__export(dynamic_exports28, {
|
|
890835
890984
|
ErrorSeverity: () => ErrorSeverity28,
|
|
@@ -890848,28 +890997,28 @@ __export(dynamic_exports28, {
|
|
|
890848
890997
|
variables: () => variables_exports43
|
|
890849
890998
|
});
|
|
890850
890999
|
|
|
890851
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
891000
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/dynamic/resources/auth/index.mjs
|
|
890852
891001
|
var auth_exports61 = {};
|
|
890853
891002
|
|
|
890854
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
891003
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/dynamic/resources/commons/index.mjs
|
|
890855
891004
|
var commons_exports58 = {};
|
|
890856
891005
|
|
|
890857
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
891006
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/dynamic/resources/declaration/index.mjs
|
|
890858
891007
|
var declaration_exports28 = {};
|
|
890859
891008
|
|
|
890860
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
891009
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/dynamic/resources/endpoints/index.mjs
|
|
890861
891010
|
var endpoints_exports28 = {};
|
|
890862
891011
|
|
|
890863
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
891012
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/dynamic/resources/environment/index.mjs
|
|
890864
891013
|
var environment_exports53 = {};
|
|
890865
891014
|
|
|
890866
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
891015
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/dynamic/resources/http/index.mjs
|
|
890867
891016
|
var http_exports41 = {};
|
|
890868
891017
|
__export(http_exports41, {
|
|
890869
891018
|
HttpMethod: () => HttpMethod44
|
|
890870
891019
|
});
|
|
890871
891020
|
|
|
890872
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
891021
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/dynamic/resources/http/types/HttpMethod.mjs
|
|
890873
891022
|
var HttpMethod44 = {
|
|
890874
891023
|
Get: "GET",
|
|
890875
891024
|
Post: "POST",
|
|
@@ -890879,35 +891028,35 @@ var HttpMethod44 = {
|
|
|
890879
891028
|
Head: "HEAD"
|
|
890880
891029
|
};
|
|
890881
891030
|
|
|
890882
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
891031
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/dynamic/resources/ir/index.mjs
|
|
890883
891032
|
var ir_exports55 = {};
|
|
890884
891033
|
|
|
890885
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
891034
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/dynamic/resources/snippets/index.mjs
|
|
890886
891035
|
var snippets_exports28 = {};
|
|
890887
891036
|
__export(snippets_exports28, {
|
|
890888
891037
|
ErrorSeverity: () => ErrorSeverity28
|
|
890889
891038
|
});
|
|
890890
891039
|
|
|
890891
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
891040
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/dynamic/resources/snippets/types/ErrorSeverity.mjs
|
|
890892
891041
|
var ErrorSeverity28 = {
|
|
890893
891042
|
Critical: "CRITICAL",
|
|
890894
891043
|
Warning: "WARNING"
|
|
890895
891044
|
};
|
|
890896
891045
|
|
|
890897
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
891046
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/dynamic/resources/types/index.mjs
|
|
890898
891047
|
var types_exports61 = {};
|
|
890899
891048
|
__export(types_exports61, {
|
|
890900
891049
|
ObjectPropertyAccess: () => ObjectPropertyAccess39,
|
|
890901
891050
|
PrimitiveTypeV1: () => PrimitiveTypeV141
|
|
890902
891051
|
});
|
|
890903
891052
|
|
|
890904
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
891053
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/dynamic/resources/types/types/ObjectPropertyAccess.mjs
|
|
890905
891054
|
var ObjectPropertyAccess39 = {
|
|
890906
891055
|
ReadOnly: "READ_ONLY",
|
|
890907
891056
|
WriteOnly: "WRITE_ONLY"
|
|
890908
891057
|
};
|
|
890909
891058
|
|
|
890910
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
891059
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/dynamic/resources/types/types/PrimitiveTypeV1.mjs
|
|
890911
891060
|
var PrimitiveTypeV141 = {
|
|
890912
891061
|
Integer: "INTEGER",
|
|
890913
891062
|
/**
|
|
@@ -890927,23 +891076,23 @@ var PrimitiveTypeV141 = {
|
|
|
890927
891076
|
BigInteger: "BIG_INTEGER"
|
|
890928
891077
|
};
|
|
890929
891078
|
|
|
890930
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
891079
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/dynamic/resources/variables/index.mjs
|
|
890931
891080
|
var variables_exports43 = {};
|
|
890932
891081
|
|
|
890933
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
891082
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/generatorExec/index.mjs
|
|
890934
891083
|
var generatorExec_exports28 = {};
|
|
890935
891084
|
__export(generatorExec_exports28, {
|
|
890936
891085
|
LicenseId: () => LicenseId28,
|
|
890937
891086
|
config: () => config_exports28
|
|
890938
891087
|
});
|
|
890939
891088
|
|
|
890940
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
891089
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/generatorExec/resources/config/index.mjs
|
|
890941
891090
|
var config_exports28 = {};
|
|
890942
891091
|
__export(config_exports28, {
|
|
890943
891092
|
LicenseId: () => LicenseId28
|
|
890944
891093
|
});
|
|
890945
891094
|
|
|
890946
|
-
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@
|
|
891095
|
+
// ../../../node_modules/.pnpm/@fern-api+dynamic-ir-sdk@66.1.0/node_modules/@fern-api/dynamic-ir-sdk/dist/esm/api/resources/generatorExec/resources/config/types/LicenseId.mjs
|
|
890947
891096
|
var LicenseId28 = {
|
|
890948
891097
|
Mit: "MIT",
|
|
890949
891098
|
Apache2: "Apache-2.0"
|
|
@@ -915501,7 +915650,7 @@ var CliContext = class _CliContext {
|
|
|
915501
915650
|
if (false) {
|
|
915502
915651
|
this.logger.error("CLI_VERSION is not defined");
|
|
915503
915652
|
}
|
|
915504
|
-
return "4.94.
|
|
915653
|
+
return "4.94.1-16-g570413b0bdb";
|
|
915505
915654
|
}
|
|
915506
915655
|
getCliName() {
|
|
915507
915656
|
if (false) {
|
package/package.json
CHANGED