@mastra/server-adapters-test-suite 0.2.1 → 0.3.0-alpha.1
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 +38 -0
- package/dist/durable-disconnect-test-suite.d.ts +5 -0
- package/dist/durable-disconnect-test-suite.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1217 -11
- package/dist/index.js.map +1 -1
- package/dist/legacy-sse-fixture.d.ts +52 -0
- package/dist/legacy-sse-fixture.d.ts.map +1 -0
- package/dist/mcp-transport-test-suite.d.ts.map +1 -1
- package/dist/observability-signal-write-test-suite.d.ts +10 -0
- package/dist/observability-signal-write-test-suite.d.ts.map +1 -0
- package/dist/stream-disconnect-test-suite.d.ts +24 -0
- package/dist/stream-disconnect-test-suite.d.ts.map +1 -0
- package/dist/test-helpers.d.ts +1 -1
- package/dist/test-helpers.d.ts.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @mastra/server-adapters-test-suite
|
|
2
2
|
|
|
3
|
+
## 0.3.0-alpha.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added `createStreamDisconnectTestSuite`, which checks over real HTTP that an adapter stops reading a route's stream when the client disconnects and pauses reading while the client is not reading. ([#29669](https://github.com/mastra-ai/mastra/pull/29669))
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { createStreamDisconnectTestSuite } from '@mastra/server-adapters-test-suite';
|
|
11
|
+
|
|
12
|
+
createStreamDisconnectTestSuite({
|
|
13
|
+
// Serve `route` with your adapter and return its URL. Run `beforeContext` before the adapter's context middleware.
|
|
14
|
+
startServer: async (route, { beforeContext } = {}) => {
|
|
15
|
+
const { url, close } = await startMyAdapterServer(route, beforeContext);
|
|
16
|
+
return { url, close };
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [[`58a66b0`](https://github.com/mastra-ai/mastra/commit/58a66b01d9b08e7b59c27fc3ab68eb90be13c0ed), [`ac2a640`](https://github.com/mastra-ai/mastra/commit/ac2a6401a09e2177555369cff2f7ad15f2cc7286), [`94b1641`](https://github.com/mastra-ai/mastra/commit/94b1641919dd90455131b16cd0572ce28008781b), [`8279c30`](https://github.com/mastra-ai/mastra/commit/8279c3073737dd1c228b5df15416ca4ce7e0c00c), [`bc9d8d4`](https://github.com/mastra-ai/mastra/commit/bc9d8d482cec626ef2107f1cbd5a05febceaa491), [`8a10dfe`](https://github.com/mastra-ai/mastra/commit/8a10dfe648610a6687d1e4ecc10a0a81e3d80c4c), [`d77893a`](https://github.com/mastra-ai/mastra/commit/d77893aed38eefe2dbac21e9fffd872137ee6b92), [`791cf60`](https://github.com/mastra-ai/mastra/commit/791cf606e91badea097b883949dc717689caa49d), [`b31cbe2`](https://github.com/mastra-ai/mastra/commit/b31cbe2888f890383629d20c853e21f870dee5a6), [`bfedbfe`](https://github.com/mastra-ai/mastra/commit/bfedbfe5a8e5721cba782efb4652be84e9fecc04), [`c9140d2`](https://github.com/mastra-ai/mastra/commit/c9140d2d4d16dfd674f163cd0a83e28593969c04), [`a836d09`](https://github.com/mastra-ai/mastra/commit/a836d09a43c3c471b5bfced711731355bf26db26), [`4854e36`](https://github.com/mastra-ai/mastra/commit/4854e3641931c984a5b3941371a4f0fa58eafd0e), [`7358ad7`](https://github.com/mastra-ai/mastra/commit/7358ad73a381765572858d520f8170ab59e88514), [`efa3999`](https://github.com/mastra-ai/mastra/commit/efa3999a21fea5bfaa455325f9a548b3daf358e9), [`b93d804`](https://github.com/mastra-ai/mastra/commit/b93d804a7a406d834389e686687b06d22ea2e4f1), [`ed1cecb`](https://github.com/mastra-ai/mastra/commit/ed1cecba5c26a73600640f74e9a1c9d322271b23), [`4cd4c46`](https://github.com/mastra-ai/mastra/commit/4cd4c46e546d44c556fce4d731cac03cad4f88c4), [`9e5b108`](https://github.com/mastra-ai/mastra/commit/9e5b1082cbe2454c377b3328cd8a0085e7452d1a), [`b31cbe2`](https://github.com/mastra-ai/mastra/commit/b31cbe2888f890383629d20c853e21f870dee5a6), [`28ddc16`](https://github.com/mastra-ai/mastra/commit/28ddc161a441fdc3ecbdcc1168dee773f1f25243), [`0f496bd`](https://github.com/mastra-ai/mastra/commit/0f496bd3c1cc7f07d2e4ecb3005d480406b3d342), [`de005a4`](https://github.com/mastra-ai/mastra/commit/de005a43d8703d36c5dd25d7ddd1f618ea98bf55)]:
|
|
24
|
+
- @mastra/core@1.83.0-alpha.3
|
|
25
|
+
- @mastra/server@1.83.0-alpha.3
|
|
26
|
+
- @mastra/mcp@2.9.0-alpha.1
|
|
27
|
+
|
|
28
|
+
## 0.2.2-alpha.0
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- Removed the `skipUntilIdleDisconnectReplay` option from the durable-disconnect suite. The untilIdle disconnect-then-replay cases now always run. ([#29636](https://github.com/mastra-ai/mastra/pull/29636))
|
|
33
|
+
|
|
34
|
+
- Added shared HTTP conformance tests for single score and feedback reads, including missing records and denied access. ([#29529](https://github.com/mastra-ai/mastra/pull/29529))
|
|
35
|
+
|
|
36
|
+
- Updated dependencies [[`c75c9b4`](https://github.com/mastra-ai/mastra/commit/c75c9b41bee7f56f88d162671b241e8731f38dc1), [`a0068a9`](https://github.com/mastra-ai/mastra/commit/a0068a9ad1fb0a31ae60a07ecbeae41a32ea4081), [`bb0fcd6`](https://github.com/mastra-ai/mastra/commit/bb0fcd6211a416cece10c20e11f6f3cb70b4c93b), [`459757f`](https://github.com/mastra-ai/mastra/commit/459757f07de6905c6abdfc3b08a7f48a808dcc6b), [`3cf319b`](https://github.com/mastra-ai/mastra/commit/3cf319b5af74aeebb1b70bd29ec539fbd2af4bb8), [`8960f55`](https://github.com/mastra-ai/mastra/commit/8960f55dec7ebf39b460ee8664509d2924065b86), [`1a320c1`](https://github.com/mastra-ai/mastra/commit/1a320c1ba73a756e848ffa324343029492a058b9), [`b518fc9`](https://github.com/mastra-ai/mastra/commit/b518fc9abeb05093aff4b1bb3e74f018e3612078), [`68869db`](https://github.com/mastra-ai/mastra/commit/68869dbb53034aee5868bccef4691af61bf6656e), [`cd369c3`](https://github.com/mastra-ai/mastra/commit/cd369c334cf5af81597d7d61e7419b390f92365b), [`f94beac`](https://github.com/mastra-ai/mastra/commit/f94beac86288cb94e2973c9ed492c8f0d68b919d), [`544224c`](https://github.com/mastra-ai/mastra/commit/544224c38f61d08a0b9952d202366fb3c6cc5bd9), [`a873e2d`](https://github.com/mastra-ai/mastra/commit/a873e2df4335b4cd7d50d4d2d26b166f976af9e3), [`d6a5f98`](https://github.com/mastra-ai/mastra/commit/d6a5f98df3a1f6d11743e0bdf150358d7db4dd40), [`d6a5f98`](https://github.com/mastra-ai/mastra/commit/d6a5f98df3a1f6d11743e0bdf150358d7db4dd40), [`23308f9`](https://github.com/mastra-ai/mastra/commit/23308f9c193ef852c28f6ec1c6e872f75363c5f7), [`36bbc29`](https://github.com/mastra-ai/mastra/commit/36bbc291292170e68774d6e9a7c76b6a5d930dd8), [`23308f9`](https://github.com/mastra-ai/mastra/commit/23308f9c193ef852c28f6ec1c6e872f75363c5f7), [`10c368f`](https://github.com/mastra-ai/mastra/commit/10c368f6047025f4bb3ce6e41b4d9379a29de422), [`2f93851`](https://github.com/mastra-ai/mastra/commit/2f93851c37410a9d9740263a636e802ef9ee2f8d), [`f7320ab`](https://github.com/mastra-ai/mastra/commit/f7320abd205aa865e3ae467b7bf82373af30a6aa), [`d6a5f98`](https://github.com/mastra-ai/mastra/commit/d6a5f98df3a1f6d11743e0bdf150358d7db4dd40), [`459757f`](https://github.com/mastra-ai/mastra/commit/459757f07de6905c6abdfc3b08a7f48a808dcc6b), [`2f93851`](https://github.com/mastra-ai/mastra/commit/2f93851c37410a9d9740263a636e802ef9ee2f8d), [`75983cd`](https://github.com/mastra-ai/mastra/commit/75983cdb05ffa4f70aac528220c7fbe5cfa2baf3)]:
|
|
37
|
+
- @mastra/server@1.83.0-alpha.1
|
|
38
|
+
- @mastra/core@1.83.0-alpha.1
|
|
39
|
+
- @mastra/mcp@2.9.0-alpha.1
|
|
40
|
+
|
|
3
41
|
## 0.2.1
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
|
@@ -16,6 +16,11 @@ export interface DurableDisconnectTestConfig {
|
|
|
16
16
|
close: () => Promise<void>;
|
|
17
17
|
}>;
|
|
18
18
|
observeWithClient?: (baseUrl: string, runId: string, offset?: number) => Promise<ChunkType<unknown>[]>;
|
|
19
|
+
/** Streams through client-js; implement together with observeWithClient. */
|
|
20
|
+
streamWithClient?: (baseUrl: string, body: {
|
|
21
|
+
messages: string;
|
|
22
|
+
runId: string;
|
|
23
|
+
}) => Promise<ChunkType<unknown>[]>;
|
|
19
24
|
startServer: (mastra: Mastra, onDisconnect: (path: string) => void) => Promise<{
|
|
20
25
|
baseUrl: string;
|
|
21
26
|
close: () => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"durable-disconnect-test-suite.d.ts","sourceRoot":"","sources":["../src/durable-disconnect-test-suite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"durable-disconnect-test-suite.d.ts","sourceRoot":"","sources":["../src/durable-disconnect-test-suite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAQ3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAMrD,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,MAAM,OAAO,CAAC;QACxB,KAAK,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QACvD,WAAW,EAAE,CACX,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE;YACR,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,SAAS,CAAC,EAAE;gBAAE,EAAE,EAAE,MAAM,CAAC;gBAAC,IAAI,EAAE,MAAM,CAAC;gBAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;aAAE,EAAE,CAAC;SAChF,KACE,IAAI,CAAC;QACV,eAAe,EAAE,MAAM,MAAM,CAAC;QAC9B,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;KAC5B,CAAC,CAAC;IACH,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACvG,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACjH,WAAW,EAAE,CACX,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,KACjC,OAAO,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;KAC5B,CAAC,CAAC;CACJ;AAmED,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,2BAA2B,QAy7BnF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { createRouteAdapterTestSuite } from './route-adapter-test-suite.js';
|
|
2
2
|
export { createStructuredWakeTestSuite, type StructuredWakeTestConfig } from './structured-wake-test-suite.js';
|
|
3
3
|
export { createDurableDisconnectTestSuite, type DurableDisconnectTestConfig } from './durable-disconnect-test-suite.js';
|
|
4
|
+
export { createStreamDisconnectTestSuite, type StreamDisconnectTestConfig } from './stream-disconnect-test-suite.js';
|
|
4
5
|
export type { AdapterTestSuiteConfig, AdapterTestContext, AdapterSetupOptions, HttpRequest, HttpResponse, } from './test-helpers.js';
|
|
5
6
|
export { createMCPRouteTestSuite } from './mcp-route-test-suite.js';
|
|
6
7
|
export { createMCPTransportTestSuite, type MCPTransportTestConfig } from './mcp-transport-test-suite.js';
|
|
@@ -10,4 +11,5 @@ export { createBodyLimitTestSuite, type BodyLimitTestSuiteConfig } from './body-
|
|
|
10
11
|
export { createCustomRouteFGATestSuite, type CustomRouteFGATestSuiteConfig } from './custom-route-fga-test-suite.js';
|
|
11
12
|
export { createDefaultTestContext, createStreamWithSensitiveData, createStreamWithUnserializableChunk, expectSerializedStreamChunks, consumeSSEStream, } from './test-helpers.js';
|
|
12
13
|
export { createKnowledgeRoutesTestSuite, type KnowledgeRoutesTestSuiteConfig } from './knowledge-routes-test-suite.js';
|
|
14
|
+
export { createObservabilitySignalWriteTestSuite, type ObservabilitySignalWriteTestConfig, } from './observability-signal-write-test-suite.js';
|
|
13
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,KAAK,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC5G,OAAO,EAAE,gCAAgC,EAAE,KAAK,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AACrH,YAAY,EACV,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACX,YAAY,GACb,MAAM,gB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