@ai-sdk/provider-utils 3.0.41 → 3.0.43

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/dist/index.mjs CHANGED
@@ -209,7 +209,7 @@ function validateDownloadUrl(url) {
209
209
  message: `URL must have a hostname`
210
210
  });
211
211
  }
212
- if (hostname === "localhost" || hostname.endsWith(".local") || hostname.endsWith(".localhost")) {
212
+ if (hostname === "localhost" || hostname.endsWith(".local") || hostname.endsWith(".localhost") || hostname.endsWith(".internal")) {
213
213
  throw new DownloadError({
214
214
  url,
215
215
  message: `URL with hostname ${hostname} is not allowed`
@@ -580,6 +580,12 @@ var createIdGenerator = ({
580
580
  };
581
581
  var generateId = createIdGenerator();
582
582
 
583
+ // src/encode-path-segment.ts
584
+ function encodePathSegment(value) {
585
+ const encodedValue = encodeURIComponent(value);
586
+ return encodedValue === "." ? "%252E" : encodedValue === ".." ? "%252E%252E" : encodedValue;
587
+ }
588
+
583
589
  // src/get-error-message.ts
584
590
  function getErrorMessage(error) {
585
591
  if (error == null) {
@@ -734,7 +740,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
734
740
  }
735
741
 
736
742
  // src/version.ts
737
- var VERSION = true ? "3.0.41" : "0.0.0-test";
743
+ var VERSION = true ? "3.0.43" : "0.0.0-test";
738
744
 
739
745
  // src/get-from-api.ts
740
746
  var getOriginalFetch = () => globalThis.fetch;
@@ -3285,6 +3291,14 @@ function convertBase64ToUint8Array(base64String) {
3285
3291
  return Uint8Array.from(latin1string, (byte) => byte.codePointAt(0));
3286
3292
  }
3287
3293
  function convertUint8ArrayToBase64(array) {
3294
+ var _a2;
3295
+ if (typeof ((_a2 = globalThis.Buffer) == null ? void 0 : _a2.from) === "function") {
3296
+ return globalThis.Buffer.from(
3297
+ array.buffer,
3298
+ array.byteOffset,
3299
+ array.byteLength
3300
+ ).toString("base64");
3301
+ }
3288
3302
  const chunks = [];
3289
3303
  const chunkSize = 4096;
3290
3304
  for (let i = 0; i < array.length; i += chunkSize) {
@@ -3357,6 +3371,7 @@ export {
3357
3371
  createStatusCodeErrorResponseHandler,
3358
3372
  delay,
3359
3373
  dynamicTool,
3374
+ encodePathSegment,
3360
3375
  executeTool,
3361
3376
  extractResponseHeaders,
3362
3377
  fetchWithValidatedEndpoint,