@ai-sdk/provider-utils 4.0.21 → 4.0.23
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 +12 -0
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -3
- package/src/load-api-key.ts +1 -1
- package/src/load-setting.ts +1 -1
- package/src/validate-download-url.ts +7 -2
package/dist/index.mjs
CHANGED
|
@@ -299,10 +299,13 @@ function validateDownloadUrl(url) {
|
|
|
299
299
|
message: `Invalid URL: ${url}`
|
|
300
300
|
});
|
|
301
301
|
}
|
|
302
|
+
if (parsed.protocol === "data:") {
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
302
305
|
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
303
306
|
throw new DownloadError({
|
|
304
307
|
url,
|
|
305
|
-
message: `URL scheme must be http or
|
|
308
|
+
message: `URL scheme must be http, https, or data, got ${parsed.protocol}`
|
|
306
309
|
});
|
|
307
310
|
}
|
|
308
311
|
const hostname = parsed.hostname;
|
|
@@ -579,7 +582,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
579
582
|
}
|
|
580
583
|
|
|
581
584
|
// src/version.ts
|
|
582
|
-
var VERSION = true ? "4.0.
|
|
585
|
+
var VERSION = true ? "4.0.23" : "0.0.0-test";
|
|
583
586
|
|
|
584
587
|
// src/get-from-api.ts
|
|
585
588
|
var getOriginalFetch = () => globalThis.fetch;
|
|
@@ -727,7 +730,7 @@ function loadApiKey({
|
|
|
727
730
|
}
|
|
728
731
|
if (typeof process === "undefined") {
|
|
729
732
|
throw new LoadAPIKeyError({
|
|
730
|
-
message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables
|
|
733
|
+
message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables are not supported in this environment.`
|
|
731
734
|
});
|
|
732
735
|
}
|
|
733
736
|
apiKey = process.env[environmentVariableName];
|
|
@@ -780,7 +783,7 @@ function loadSetting({
|
|
|
780
783
|
}
|
|
781
784
|
if (typeof process === "undefined") {
|
|
782
785
|
throw new LoadSettingError({
|
|
783
|
-
message: `${description} setting is missing. Pass it using the '${settingName}' parameter. Environment variables
|
|
786
|
+
message: `${description} setting is missing. Pass it using the '${settingName}' parameter. Environment variables are not supported in this environment.`
|
|
784
787
|
});
|
|
785
788
|
}
|
|
786
789
|
settingValue = process.env[environmentVariableName];
|