@ai-sdk/provider-utils 4.0.46 → 4.0.48
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 +6 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/add-additional-properties-to-json-schema.ts +9 -2
- package/src/safe-node-fetch.ts +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/provider-utils
|
|
2
2
|
|
|
3
|
+
## 4.0.48
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5642849: fix(provider-utils): allow imports in runtimes without a global fetch function
|
|
8
|
+
|
|
9
|
+
## 4.0.47
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 2d172fb: Preserve schema-valued additional properties when converting Zod 4 schemas.
|
|
14
|
+
|
|
3
15
|
## 4.0.46
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -549,6 +549,9 @@ async function getDefaultDownloadFetch() {
|
|
|
549
549
|
return safeNodeFetchPromise != null ? safeNodeFetchPromise : safeNodeFetchPromise = createSafeNodeFetch();
|
|
550
550
|
}
|
|
551
551
|
function isNodeDefaultFetch(fetch) {
|
|
552
|
+
if (typeof fetch !== "function") {
|
|
553
|
+
return false;
|
|
554
|
+
}
|
|
552
555
|
const source = Function.prototype.toString.call(fetch);
|
|
553
556
|
return source.includes("internal/deps/undici") || source.includes("lazy loading of undici");
|
|
554
557
|
}
|
|
@@ -892,7 +895,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
892
895
|
}
|
|
893
896
|
|
|
894
897
|
// src/version.ts
|
|
895
|
-
var VERSION = true ? "4.0.
|
|
898
|
+
var VERSION = true ? "4.0.48" : "0.0.0-test";
|
|
896
899
|
|
|
897
900
|
// src/get-from-api.ts
|
|
898
901
|
var getOriginalFetch = () => globalThis.fetch;
|
|
@@ -1194,7 +1197,8 @@ var z4 = __toESM(require("zod/v4"));
|
|
|
1194
1197
|
// src/add-additional-properties-to-json-schema.ts
|
|
1195
1198
|
function addAdditionalPropertiesToJsonSchema(jsonSchema2) {
|
|
1196
1199
|
if (jsonSchema2.type === "object" || Array.isArray(jsonSchema2.type) && jsonSchema2.type.includes("object")) {
|
|
1197
|
-
|
|
1200
|
+
const { additionalProperties } = jsonSchema2;
|
|
1201
|
+
jsonSchema2.additionalProperties = additionalProperties != null && typeof additionalProperties !== "boolean" ? visit(additionalProperties) : false;
|
|
1198
1202
|
const { properties } = jsonSchema2;
|
|
1199
1203
|
if (properties != null) {
|
|
1200
1204
|
for (const key of Object.keys(properties)) {
|