@typespec/compiler 0.56.0-dev.15 → 0.56.0-dev.16
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/dist/manifest.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/core/fetch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/core/fetch.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACzB;AACD;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAkCzD"}
|
package/dist/src/core/fetch.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import https from "https";
|
|
1
|
+
import followRedirects from "follow-redirects";
|
|
3
2
|
import { compilerAssert } from "./diagnostics.js";
|
|
4
3
|
/**
|
|
5
4
|
* Basic implementation of fetch to fit our needs.
|
|
@@ -12,13 +11,14 @@ export function fetch(uri) {
|
|
|
12
11
|
});
|
|
13
12
|
function request(uri, resolve, reject) {
|
|
14
13
|
const url = new URL(uri);
|
|
15
|
-
const protocol = url.protocol === "https:"
|
|
14
|
+
const protocol = url.protocol === "https:"
|
|
15
|
+
? followRedirects.https
|
|
16
|
+
: url.protocol === "http:"
|
|
17
|
+
? followRedirects.http
|
|
18
|
+
: undefined;
|
|
16
19
|
compilerAssert(protocol, `Protocol '${url.protocol}' is not supported`);
|
|
17
20
|
protocol
|
|
18
21
|
.get(url, (res) => {
|
|
19
|
-
if ((res.statusCode === 301 || res.statusCode === 302) && res.headers.location) {
|
|
20
|
-
return request(res.headers.location, resolve, reject);
|
|
21
|
-
}
|
|
22
22
|
let data = "";
|
|
23
23
|
res.on("data", (chunk) => {
|
|
24
24
|
data += chunk;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../src/core/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../src/core/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMlD;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,GAAW;IAC/B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,SAAS,OAAO,CAAC,GAAW,EAAE,OAAqC,EAAE,MAA0B;QAC7F,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QACzB,MAAM,QAAQ,GACZ,GAAG,CAAC,QAAQ,KAAK,QAAQ;YACvB,CAAC,CAAC,eAAe,CAAC,KAAK;YACvB,CAAC,CAAC,GAAG,CAAC,QAAQ,KAAK,OAAO;gBACxB,CAAC,CAAC,eAAe,CAAC,IAAI;gBACtB,CAAC,CAAC,SAAS,CAAC;QAClB,cAAc,CAAC,QAAQ,EAAE,aAAa,GAAG,CAAC,QAAQ,oBAAoB,CAAC,CAAC;QAExE,QAAQ;aACL,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;YAChB,IAAI,IAAI,GAAG,EAAE,CAAC;YAEd,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;gBACvB,IAAI,IAAI,KAAK,CAAC;YAChB,CAAC,CAAC,CAAC;YAEH,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;gBACjB,OAAO,CAAC;oBACN,GAAG,EAAE,GAAG,CAAC,IAAI;oBACb,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;iBAClC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;aACD,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACnB,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;IACP,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/compiler",
|
|
3
|
-
"version": "0.56.0-dev.
|
|
3
|
+
"version": "0.56.0-dev.16",
|
|
4
4
|
"description": "TypeSpec Compiler Preview",
|
|
5
5
|
"author": "Microsoft Corporation",
|
|
6
6
|
"license": "MIT",
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"@babel/code-frame": "~7.24.2",
|
|
65
65
|
"ajv": "~8.12.0",
|
|
66
66
|
"change-case": "~5.4.4",
|
|
67
|
+
"follow-redirects": "^1.15.6",
|
|
67
68
|
"globby": "~14.0.1",
|
|
68
69
|
"mustache": "~4.2.0",
|
|
69
70
|
"picocolors": "~1.0.0",
|
|
@@ -77,6 +78,7 @@
|
|
|
77
78
|
},
|
|
78
79
|
"devDependencies": {
|
|
79
80
|
"@types/babel__code-frame": "~7.0.6",
|
|
81
|
+
"@types/follow-redirects": "^1.14.4",
|
|
80
82
|
"@types/mustache": "~4.2.5",
|
|
81
83
|
"@types/node": "~18.11.19",
|
|
82
84
|
"@types/prompts": "~2.4.9",
|