@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/provider-utils
|
|
2
2
|
|
|
3
|
+
## 4.0.23
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6247886: chore(provider-utils,google): fix grammar errors in error and warning messages
|
|
8
|
+
|
|
9
|
+
## 4.0.22
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 0469aed: fix: allow inline data URLs in download validation
|
|
14
|
+
|
|
3
15
|
## 4.0.21
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -395,10 +395,13 @@ function validateDownloadUrl(url) {
|
|
|
395
395
|
message: `Invalid URL: ${url}`
|
|
396
396
|
});
|
|
397
397
|
}
|
|
398
|
+
if (parsed.protocol === "data:") {
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
398
401
|
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
399
402
|
throw new DownloadError({
|
|
400
403
|
url,
|
|
401
|
-
message: `URL scheme must be http or
|
|
404
|
+
message: `URL scheme must be http, https, or data, got ${parsed.protocol}`
|
|
402
405
|
});
|
|
403
406
|
}
|
|
404
407
|
const hostname = parsed.hostname;
|
|
@@ -675,7 +678,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
675
678
|
}
|
|
676
679
|
|
|
677
680
|
// src/version.ts
|
|
678
|
-
var VERSION = true ? "4.0.
|
|
681
|
+
var VERSION = true ? "4.0.23" : "0.0.0-test";
|
|
679
682
|
|
|
680
683
|
// src/get-from-api.ts
|
|
681
684
|
var getOriginalFetch = () => globalThis.fetch;
|
|
@@ -823,7 +826,7 @@ function loadApiKey({
|
|
|
823
826
|
}
|
|
824
827
|
if (typeof process === "undefined") {
|
|
825
828
|
throw new import_provider5.LoadAPIKeyError({
|
|
826
|
-
message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables
|
|
829
|
+
message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables are not supported in this environment.`
|
|
827
830
|
});
|
|
828
831
|
}
|
|
829
832
|
apiKey = process.env[environmentVariableName];
|
|
@@ -876,7 +879,7 @@ function loadSetting({
|
|
|
876
879
|
}
|
|
877
880
|
if (typeof process === "undefined") {
|
|
878
881
|
throw new import_provider6.LoadSettingError({
|
|
879
|
-
message: `${description} setting is missing. Pass it using the '${settingName}' parameter. Environment variables
|
|
882
|
+
message: `${description} setting is missing. Pass it using the '${settingName}' parameter. Environment variables are not supported in this environment.`
|
|
880
883
|
});
|
|
881
884
|
}
|
|
882
885
|
settingValue = process.env[environmentVariableName];
|