@ai-sdk/provider-utils 4.0.61 → 4.0.62
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/CHANGELOG.md +7 -0
- package/dist/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/encode-path-segment.ts +15 -0
- package/src/index.ts +1 -0
- package/src/validate-download-url.ts +3 -2
package/dist/index.mjs
CHANGED
|
@@ -284,7 +284,7 @@ function validateDownloadUrl(url) {
|
|
|
284
284
|
message: `URL must have a hostname`
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
|
-
if (hostname === "localhost" || hostname.endsWith(".local") || hostname.endsWith(".localhost")) {
|
|
287
|
+
if (hostname === "localhost" || hostname.endsWith(".local") || hostname.endsWith(".localhost") || hostname.endsWith(".internal")) {
|
|
288
288
|
throw new DownloadError({
|
|
289
289
|
url,
|
|
290
290
|
message: `URL with hostname ${hostname} is not allowed`
|
|
@@ -739,6 +739,12 @@ var createIdGenerator = ({
|
|
|
739
739
|
};
|
|
740
740
|
var generateId = createIdGenerator();
|
|
741
741
|
|
|
742
|
+
// src/encode-path-segment.ts
|
|
743
|
+
function encodePathSegment(value) {
|
|
744
|
+
const encodedValue = encodeURIComponent(value);
|
|
745
|
+
return encodedValue === "." ? "%252E" : encodedValue === ".." ? "%252E%252E" : encodedValue;
|
|
746
|
+
}
|
|
747
|
+
|
|
742
748
|
// src/get-error-message.ts
|
|
743
749
|
function getErrorMessage(error) {
|
|
744
750
|
if (error == null) {
|
|
@@ -893,7 +899,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
893
899
|
}
|
|
894
900
|
|
|
895
901
|
// src/version.ts
|
|
896
|
-
var VERSION = true ? "4.0.
|
|
902
|
+
var VERSION = true ? "4.0.62" : "0.0.0-test";
|
|
897
903
|
|
|
898
904
|
// src/get-from-api.ts
|
|
899
905
|
var getOriginalFetch = () => globalThis.fetch;
|
|
@@ -3581,6 +3587,7 @@ export {
|
|
|
3581
3587
|
delay,
|
|
3582
3588
|
downloadBlob,
|
|
3583
3589
|
dynamicTool,
|
|
3590
|
+
encodePathSegment,
|
|
3584
3591
|
executeTool,
|
|
3585
3592
|
extractResponseHeaders,
|
|
3586
3593
|
fetchWithValidatedEndpoint,
|