@ai-sdk/provider-utils 2.1.7 → 2.1.8

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ai-sdk/provider-utils
2
2
 
3
+ ## 2.1.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 2e898b4: chore (ai): move mockId test helper into provider utils
8
+
3
9
  ## 2.1.7
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/provider-utils",
3
- "version": "2.1.7",
3
+ "version": "2.1.8",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -30,6 +30,10 @@ declare class JsonTestServer {
30
30
  setupTestEnvironment(): void;
31
31
  }
32
32
 
33
+ declare function mockId({ prefix, }?: {
34
+ prefix?: string;
35
+ }): () => string;
36
+
33
37
  /**
34
38
  * @deprecated Use createTestServer instead
35
39
  */
@@ -155,4 +159,4 @@ declare function createTestServer<URLS extends {
155
159
  calls: TestServerCall[];
156
160
  };
157
161
 
158
- export { type FullHandlers, type FullUrlHandler, JsonTestServer, StreamingTestServer, type TestServerJsonBodyType, type TestServerResponse, type UrlHandler, convertArrayToAsyncIterable, convertArrayToReadableStream, convertAsyncIterableToArray, convertReadableStreamToArray, convertResponseStreamToArray, createTestServer, describeWithTestServer, withTestServer };
162
+ export { type FullHandlers, type FullUrlHandler, JsonTestServer, StreamingTestServer, type TestServerJsonBodyType, type TestServerResponse, type UrlHandler, convertArrayToAsyncIterable, convertArrayToReadableStream, convertAsyncIterableToArray, convertReadableStreamToArray, convertResponseStreamToArray, createTestServer, describeWithTestServer, mockId, withTestServer };
@@ -30,6 +30,10 @@ declare class JsonTestServer {
30
30
  setupTestEnvironment(): void;
31
31
  }
32
32
 
33
+ declare function mockId({ prefix, }?: {
34
+ prefix?: string;
35
+ }): () => string;
36
+
33
37
  /**
34
38
  * @deprecated Use createTestServer instead
35
39
  */
@@ -155,4 +159,4 @@ declare function createTestServer<URLS extends {
155
159
  calls: TestServerCall[];
156
160
  };
157
161
 
158
- export { type FullHandlers, type FullUrlHandler, JsonTestServer, StreamingTestServer, type TestServerJsonBodyType, type TestServerResponse, type UrlHandler, convertArrayToAsyncIterable, convertArrayToReadableStream, convertAsyncIterableToArray, convertReadableStreamToArray, convertResponseStreamToArray, createTestServer, describeWithTestServer, withTestServer };
162
+ export { type FullHandlers, type FullUrlHandler, JsonTestServer, StreamingTestServer, type TestServerJsonBodyType, type TestServerResponse, type UrlHandler, convertArrayToAsyncIterable, convertArrayToReadableStream, convertAsyncIterableToArray, convertReadableStreamToArray, convertResponseStreamToArray, createTestServer, describeWithTestServer, mockId, withTestServer };
@@ -66,6 +66,7 @@ __export(test_exports, {
66
66
  convertResponseStreamToArray: () => convertResponseStreamToArray,
67
67
  createTestServer: () => createTestServer,
68
68
  describeWithTestServer: () => describeWithTestServer,
69
+ mockId: () => mockId,
69
70
  withTestServer: () => withTestServer
70
71
  });
71
72
  module.exports = __toCommonJS(test_exports);
@@ -18540,6 +18541,14 @@ var JsonTestServer = class {
18540
18541
  }
18541
18542
  };
18542
18543
 
18544
+ // src/test/mock-id.ts
18545
+ function mockId({
18546
+ prefix = "id"
18547
+ } = {}) {
18548
+ let counter = 0;
18549
+ return () => `${prefix}-${counter++}`;
18550
+ }
18551
+
18543
18552
  // src/test/streaming-test-server.ts
18544
18553
  var StreamingTestServer = class {
18545
18554
  /**
@@ -18896,6 +18905,7 @@ function createTestServer(routes) {
18896
18905
  convertResponseStreamToArray,
18897
18906
  createTestServer,
18898
18907
  describeWithTestServer,
18908
+ mockId,
18899
18909
  withTestServer
18900
18910
  });
18901
18911
  /*! Bundled license information: