@ai-sdk/provider-utils 0.0.2 → 0.0.4
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.d.mts +23 -4
- package/dist/index.d.ts +23 -4
- package/dist/index.js +86 -50
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +85 -51
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/test/dist/index.d.mts +2 -0
- package/test/dist/index.d.ts +2 -0
- package/test/dist/index.js +10 -2
- package/test/dist/index.js.map +1 -1
- package/test/dist/index.mjs +10 -2
- package/test/dist/index.mjs.map +1 -1
package/test/dist/index.mjs
CHANGED
@@ -8171,12 +8171,18 @@ var setupServer = (...handlers) => {
|
|
8171
8171
|
// src/test/json-test-server.ts
|
8172
8172
|
var JsonTestServer = class {
|
8173
8173
|
constructor(url) {
|
8174
|
+
this.responseHeaders = {};
|
8174
8175
|
this.responseBodyJson = {};
|
8175
8176
|
const responseBodyJson = () => this.responseBodyJson;
|
8176
8177
|
this.server = setupServer(
|
8177
8178
|
http.post(url, ({ request: request2 }) => {
|
8178
8179
|
this.request = request2;
|
8179
|
-
return HttpResponse.json(responseBodyJson()
|
8180
|
+
return HttpResponse.json(responseBodyJson(), {
|
8181
|
+
headers: {
|
8182
|
+
"Content-Type": "application/json",
|
8183
|
+
...this.responseHeaders
|
8184
|
+
}
|
8185
|
+
});
|
8180
8186
|
})
|
8181
8187
|
);
|
8182
8188
|
}
|
@@ -8202,6 +8208,7 @@ var JsonTestServer = class {
|
|
8202
8208
|
// src/test/streaming-test-server.ts
|
8203
8209
|
var StreamingTestServer = class {
|
8204
8210
|
constructor(url) {
|
8211
|
+
this.responseHeaders = {};
|
8205
8212
|
this.responseChunks = [];
|
8206
8213
|
const responseChunks = () => this.responseChunks;
|
8207
8214
|
this.server = setupServer(
|
@@ -8224,7 +8231,8 @@ var StreamingTestServer = class {
|
|
8224
8231
|
headers: {
|
8225
8232
|
"Content-Type": "text/event-stream",
|
8226
8233
|
"Cache-Control": "no-cache",
|
8227
|
-
Connection: "keep-alive"
|
8234
|
+
Connection: "keep-alive",
|
8235
|
+
...this.responseHeaders
|
8228
8236
|
}
|
8229
8237
|
});
|
8230
8238
|
})
|