@ai-sdk/provider-utils 4.0.20 → 4.0.22
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 +10 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -4
- package/dist/index.mjs.map +1 -1
- package/dist/test/index.js +3 -3
- package/package.json +1 -3
- 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.22
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0469aed: fix: allow inline data URLs in download validation
|
|
8
|
+
|
|
9
|
+
## 4.0.21
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 055cd68: fix: publish v6 to latest npm dist tag
|
|
14
|
+
|
|
3
15
|
## 4.0.20
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -28,8 +28,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
33
|
DEFAULT_MAX_DOWNLOAD_SIZE: () => DEFAULT_MAX_DOWNLOAD_SIZE,
|
|
34
34
|
DelayedPromise: () => DelayedPromise,
|
|
35
35
|
DownloadError: () => DownloadError,
|
|
@@ -92,7 +92,7 @@ __export(src_exports, {
|
|
|
92
92
|
withoutTrailingSlash: () => withoutTrailingSlash,
|
|
93
93
|
zodSchema: () => zodSchema
|
|
94
94
|
});
|
|
95
|
-
module.exports = __toCommonJS(
|
|
95
|
+
module.exports = __toCommonJS(index_exports);
|
|
96
96
|
|
|
97
97
|
// src/combine-headers.ts
|
|
98
98
|
function combineHeaders(...headers) {
|
|
@@ -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.22" : "0.0.0-test";
|
|
679
682
|
|
|
680
683
|
// src/get-from-api.ts
|
|
681
684
|
var getOriginalFetch = () => globalThis.fetch;
|
|
@@ -1002,7 +1005,7 @@ function visit(def) {
|
|
|
1002
1005
|
}
|
|
1003
1006
|
|
|
1004
1007
|
// src/to-json-schema/zod3-to-json-schema/options.ts
|
|
1005
|
-
var ignoreOverride = Symbol(
|
|
1008
|
+
var ignoreOverride = /* @__PURE__ */ Symbol(
|
|
1006
1009
|
"Let zodToJsonSchema decide on which parser to use"
|
|
1007
1010
|
);
|
|
1008
1011
|
var defaultOptions = {
|
|
@@ -2180,7 +2183,7 @@ var zod3ToJsonSchema = (schema, options) => {
|
|
|
2180
2183
|
};
|
|
2181
2184
|
|
|
2182
2185
|
// src/schema.ts
|
|
2183
|
-
var schemaSymbol = Symbol.for("vercel.ai.schema");
|
|
2186
|
+
var schemaSymbol = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
|
|
2184
2187
|
function lazySchema(createSchema) {
|
|
2185
2188
|
let schema;
|
|
2186
2189
|
return () => {
|