@s2-dev/streamstore 0.8.3 → 0.9.0
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/README.md +40 -7
- package/bin/mcp-server.js +38 -8
- package/bin/mcp-server.js.map +13 -12
- package/dist/commonjs/hooks/types.d.ts +1 -1
- package/dist/commonjs/hooks/types.d.ts.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/security.d.ts +4 -3
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/lib/security.js +6 -1
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/mcp-server/extensions.d.ts +2 -0
- package/dist/commonjs/mcp-server/extensions.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/prompts.d.ts +26 -0
- package/dist/commonjs/mcp-server/prompts.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/prompts.js +47 -0
- package/dist/commonjs/mcp-server/prompts.js.map +1 -0
- package/dist/commonjs/mcp-server/resources.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/resources.js +1 -0
- package/dist/commonjs/mcp-server/resources.js.map +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +4 -2
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/tools.js +1 -0
- package/dist/commonjs/mcp-server/tools.js.map +1 -1
- package/dist/commonjs/models/components/output.d.ts +18 -13
- package/dist/commonjs/models/components/output.d.ts.map +1 -1
- package/dist/commonjs/models/components/output.js.map +1 -1
- package/dist/commonjs/models/components/readresponse.d.ts +4 -1
- package/dist/commonjs/models/components/readresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/readresponse.js.map +1 -1
- package/dist/commonjs/models/operations/read.d.ts +10 -2
- package/dist/commonjs/models/operations/read.d.ts.map +1 -1
- package/dist/commonjs/models/operations/read.js.map +1 -1
- package/dist/esm/hooks/types.d.ts +1 -1
- package/dist/esm/hooks/types.d.ts.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/security.d.ts +4 -3
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/lib/security.js +6 -1
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/mcp-server/extensions.d.ts +2 -0
- package/dist/esm/mcp-server/extensions.d.ts.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/prompts.d.ts +26 -0
- package/dist/esm/mcp-server/prompts.d.ts.map +1 -0
- package/dist/esm/mcp-server/prompts.js +43 -0
- package/dist/esm/mcp-server/prompts.js.map +1 -0
- package/dist/esm/mcp-server/resources.d.ts.map +1 -1
- package/dist/esm/mcp-server/resources.js +1 -0
- package/dist/esm/mcp-server/resources.js.map +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +4 -2
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools.d.ts.map +1 -1
- package/dist/esm/mcp-server/tools.js +1 -0
- package/dist/esm/mcp-server/tools.js.map +1 -1
- package/dist/esm/models/components/output.d.ts +18 -13
- package/dist/esm/models/components/output.d.ts.map +1 -1
- package/dist/esm/models/components/output.js.map +1 -1
- package/dist/esm/models/components/readresponse.d.ts +4 -1
- package/dist/esm/models/components/readresponse.d.ts.map +1 -1
- package/dist/esm/models/components/readresponse.js.map +1 -1
- package/dist/esm/models/operations/read.d.ts +10 -2
- package/dist/esm/models/operations/read.d.ts.map +1 -1
- package/dist/esm/models/operations/read.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/hooks/types.ts +1 -1
- package/src/lib/config.ts +3 -3
- package/src/lib/security.ts +11 -3
- package/src/mcp-server/extensions.ts +4 -0
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/prompts.ts +110 -0
- package/src/mcp-server/resources.ts +1 -0
- package/src/mcp-server/server.ts +4 -2
- package/src/mcp-server/tools.ts +1 -0
- package/src/models/components/output.ts +18 -13
- package/src/models/components/readresponse.ts +4 -1
- package/src/models/operations/read.ts +10 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../../src/models/operations/read.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAGzD,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,eAAO,MAAM,cAAc,mDAKjB,CAAC;AAEX
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../../src/models/operations/read.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAGzD,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,eAAO,MAAM,cAAc,mDAKjB,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,MAAM,KAAK,GAAG;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACnC,CAAC;AAEF;;;;;GAKG;A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AO7B;AAED,MAAM,UAAU,kBAAkB,CAAC,YAA0B;IAC3D,OAAO,IAAI,CAAC,SAAS,CAAC,2BAA2B,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,0BAA0B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACtD,0CAA0C,CAC3C,CAAC;AACJ,CAAC"}
|
package/jsr.json
CHANGED
package/package.json
CHANGED
package/src/hooks/types.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { SecurityState } from "../lib/security.js";
|
|
|
9
9
|
export type HookContext = {
|
|
10
10
|
baseURL: string | URL;
|
|
11
11
|
operationID: string;
|
|
12
|
-
oAuth2Scopes
|
|
12
|
+
oAuth2Scopes: string[] | null;
|
|
13
13
|
securitySource?: any | (() => Promise<any>);
|
|
14
14
|
retryConfig: RetryConfig;
|
|
15
15
|
resolvedSecurity: SecurityState | null;
|
package/src/lib/config.ts
CHANGED
|
@@ -54,7 +54,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
54
54
|
export const SDK_METADATA = {
|
|
55
55
|
language: "typescript",
|
|
56
56
|
openapiDocVersion: "1.0.0",
|
|
57
|
-
sdkVersion: "0.
|
|
58
|
-
genVersion: "2.
|
|
59
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
57
|
+
sdkVersion: "0.9.0",
|
|
58
|
+
genVersion: "2.563.0",
|
|
59
|
+
userAgent: "speakeasy-sdk/typescript 0.9.0 2.563.0 1.0.0 @s2-dev/streamstore",
|
|
60
60
|
} as const;
|
package/src/lib/security.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as components from "../models/components/index.js";
|
|
6
6
|
import { env } from "./env.js";
|
|
7
|
+
|
|
7
8
|
type OAuth2PasswordFlow = {
|
|
8
9
|
username: string;
|
|
9
10
|
password?: string | undefined;
|
|
@@ -85,7 +86,9 @@ type SecurityInputOAuth2ClientCredentials = {
|
|
|
85
86
|
value:
|
|
86
87
|
| { clientID?: string | undefined; clientSecret?: string | undefined }
|
|
87
88
|
| null
|
|
89
|
+
| string
|
|
88
90
|
| undefined;
|
|
91
|
+
fieldName?: string;
|
|
89
92
|
};
|
|
90
93
|
|
|
91
94
|
type SecurityInputOAuth2PasswordCredentials = {
|
|
@@ -94,13 +97,13 @@ type SecurityInputOAuth2PasswordCredentials = {
|
|
|
94
97
|
| string
|
|
95
98
|
| null
|
|
96
99
|
| undefined;
|
|
97
|
-
fieldName
|
|
100
|
+
fieldName?: string;
|
|
98
101
|
};
|
|
99
102
|
|
|
100
103
|
type SecurityInputCustom = {
|
|
101
104
|
type: "http:custom";
|
|
102
105
|
value: any | null | undefined;
|
|
103
|
-
fieldName
|
|
106
|
+
fieldName?: string;
|
|
104
107
|
};
|
|
105
108
|
|
|
106
109
|
export type SecurityInput =
|
|
@@ -137,6 +140,9 @@ export function resolveSecurity(
|
|
|
137
140
|
typeof o.value === "string" && !!o.value
|
|
138
141
|
);
|
|
139
142
|
} else if (o.type === "oauth2:client_credentials") {
|
|
143
|
+
if (typeof o.value == "string") {
|
|
144
|
+
return !!o.value;
|
|
145
|
+
}
|
|
140
146
|
return o.value.clientID != null || o.value.clientSecret != null;
|
|
141
147
|
} else if (typeof o.value === "string") {
|
|
142
148
|
return !!o.value;
|
|
@@ -225,7 +231,9 @@ function applyBearer(
|
|
|
225
231
|
value = `Bearer ${value}`;
|
|
226
232
|
}
|
|
227
233
|
|
|
228
|
-
|
|
234
|
+
if (spec.fieldName !== undefined) {
|
|
235
|
+
state.headers[spec.fieldName] = value;
|
|
236
|
+
}
|
|
229
237
|
}
|
|
230
238
|
|
|
231
239
|
export function resolveGlobalSecurity(
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { ZodRawShape } from "zod";
|
|
6
|
+
import { PromptArgsRawShape, PromptDefinition } from "./prompts.js";
|
|
6
7
|
import { ResourceDefinition, ResourceTemplateDefinition } from "./resources.js";
|
|
7
8
|
import { ToolDefinition } from "./tools.js";
|
|
8
9
|
|
|
@@ -10,4 +11,7 @@ export type Register = {
|
|
|
10
11
|
tool: <A extends ZodRawShape | undefined>(def: ToolDefinition<A>) => void;
|
|
11
12
|
resource: (def: ResourceDefinition) => void;
|
|
12
13
|
resourceTemplate: (def: ResourceTemplateDefinition) => void;
|
|
14
|
+
prompt: <A extends PromptArgsRawShape | undefined>(
|
|
15
|
+
prompt: PromptDefinition<A>,
|
|
16
|
+
) => void;
|
|
13
17
|
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
6
|
+
import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
7
|
+
import { GetPromptResult } from "@modelcontextprotocol/sdk/types.js";
|
|
8
|
+
import {
|
|
9
|
+
objectOutputType,
|
|
10
|
+
ZodOptional,
|
|
11
|
+
ZodType,
|
|
12
|
+
ZodTypeAny,
|
|
13
|
+
ZodTypeDef,
|
|
14
|
+
} from "zod";
|
|
15
|
+
import { S2Core } from "../core.js";
|
|
16
|
+
import { ConsoleLogger } from "./console-logger.js";
|
|
17
|
+
import { MCPScope } from "./scopes.js";
|
|
18
|
+
|
|
19
|
+
// '@modelcontextprotocol/sdk' currently does not export this type
|
|
20
|
+
export type PromptArgsRawShape = {
|
|
21
|
+
[k: string]:
|
|
22
|
+
| ZodType<string, ZodTypeDef, string>
|
|
23
|
+
| ZodOptional<ZodType<string, ZodTypeDef, string>>;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type PromptDefinition<
|
|
27
|
+
Args extends undefined | PromptArgsRawShape = undefined,
|
|
28
|
+
> = Args extends PromptArgsRawShape ? {
|
|
29
|
+
name: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
scopes?: MCPScope[];
|
|
32
|
+
args: Args;
|
|
33
|
+
prompt: (
|
|
34
|
+
client: S2Core,
|
|
35
|
+
args: objectOutputType<Args, ZodTypeAny>,
|
|
36
|
+
extra: RequestHandlerExtra,
|
|
37
|
+
) => GetPromptResult | Promise<GetPromptResult>;
|
|
38
|
+
}
|
|
39
|
+
: {
|
|
40
|
+
name: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
scopes?: MCPScope[];
|
|
43
|
+
args?: undefined;
|
|
44
|
+
prompt: (
|
|
45
|
+
client: S2Core,
|
|
46
|
+
extra: RequestHandlerExtra,
|
|
47
|
+
) => GetPromptResult | Promise<GetPromptResult>;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// Optional function to assist with formatting prompt results
|
|
51
|
+
export async function formatResult(value: string): Promise<GetPromptResult> {
|
|
52
|
+
return {
|
|
53
|
+
messages: [
|
|
54
|
+
{
|
|
55
|
+
role: "user",
|
|
56
|
+
content: {
|
|
57
|
+
type: "text",
|
|
58
|
+
text: value,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function createRegisterPrompt(
|
|
66
|
+
logger: ConsoleLogger,
|
|
67
|
+
server: McpServer,
|
|
68
|
+
sdk: S2Core,
|
|
69
|
+
allowedScopes: Set<MCPScope>,
|
|
70
|
+
): <A extends PromptArgsRawShape | undefined>(
|
|
71
|
+
prompt: PromptDefinition<A>,
|
|
72
|
+
) => void {
|
|
73
|
+
return <A extends PromptArgsRawShape | undefined>(
|
|
74
|
+
prompt: PromptDefinition<A>,
|
|
75
|
+
): void => {
|
|
76
|
+
const scopes = prompt.scopes ?? [];
|
|
77
|
+
if (!scopes.every((s: MCPScope) => allowedScopes.has(s))) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (prompt.args) {
|
|
82
|
+
if (prompt.description) {
|
|
83
|
+
server.prompt(
|
|
84
|
+
prompt.name,
|
|
85
|
+
prompt.description,
|
|
86
|
+
prompt.args,
|
|
87
|
+
async (args, ctx) => prompt.prompt(sdk, args, ctx),
|
|
88
|
+
);
|
|
89
|
+
} else {
|
|
90
|
+
server.prompt(
|
|
91
|
+
prompt.name,
|
|
92
|
+
prompt.args,
|
|
93
|
+
async (args, ctx) => prompt.prompt(sdk, args, ctx),
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
} else {
|
|
97
|
+
if (prompt.description) {
|
|
98
|
+
server.prompt(
|
|
99
|
+
prompt.name,
|
|
100
|
+
prompt.description,
|
|
101
|
+
async (ctx) => prompt.prompt(sdk, ctx),
|
|
102
|
+
);
|
|
103
|
+
} else {
|
|
104
|
+
server.prompt(prompt.name, async (ctx) => prompt.prompt(sdk, ctx));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
logger.debug("Registered prompt", { name: prompt.name });
|
|
109
|
+
};
|
|
110
|
+
}
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
6
6
|
import { S2Core } from "../core.js";
|
|
7
7
|
import { SDKOptions } from "../lib/config.js";
|
|
8
8
|
import type { ConsoleLogger } from "./console-logger.js";
|
|
9
|
+
import { createRegisterPrompt } from "./prompts.js";
|
|
9
10
|
import {
|
|
10
11
|
createRegisterResource,
|
|
11
12
|
createRegisterResourceTemplate,
|
|
@@ -36,7 +37,7 @@ export function createMCPServer(deps: {
|
|
|
36
37
|
}) {
|
|
37
38
|
const server = new McpServer({
|
|
38
39
|
name: "S2",
|
|
39
|
-
version: "0.
|
|
40
|
+
version: "0.9.0",
|
|
40
41
|
});
|
|
41
42
|
|
|
42
43
|
const client = new S2Core({
|
|
@@ -62,7 +63,8 @@ export function createMCPServer(deps: {
|
|
|
62
63
|
client,
|
|
63
64
|
scopes,
|
|
64
65
|
);
|
|
65
|
-
const
|
|
66
|
+
const prompt = createRegisterPrompt(deps.logger, server, client, scopes);
|
|
67
|
+
const register = { tool, resource, resourceTemplate, prompt };
|
|
66
68
|
void register; // suppress unused warnings
|
|
67
69
|
|
|
68
70
|
tool(tool$accountListBasins);
|
package/src/mcp-server/tools.ts
CHANGED
|
@@ -34,6 +34,7 @@ export type ToolDefinition<Args extends undefined | ZodRawShape = undefined> =
|
|
|
34
34
|
) => CallToolResult | Promise<CallToolResult>;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
// Optional function to assist with formatting tool results
|
|
37
38
|
export async function formatResult(
|
|
38
39
|
value: unknown,
|
|
39
40
|
init: { response?: Response | undefined },
|
|
@@ -15,35 +15,37 @@ import {
|
|
|
15
15
|
} from "./sequencedrecordbatch.js";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Sequence number
|
|
18
|
+
* Sequence number that will be assigned to the next record on this stream.
|
|
19
19
|
*
|
|
20
20
|
* @remarks
|
|
21
|
-
*
|
|
21
|
+
* This will be returned either because the requested `start_seq_num` was larger,
|
|
22
|
+
* or in case of a limited read, equal to it.
|
|
22
23
|
*/
|
|
23
24
|
export type NextSeqNum = {
|
|
24
25
|
/**
|
|
25
|
-
* Sequence number
|
|
26
|
+
* Sequence number that will be assigned to the next record on this stream.
|
|
26
27
|
*
|
|
27
28
|
* @remarks
|
|
28
|
-
*
|
|
29
|
+
* This will be returned either because the requested `start_seq_num` was larger,
|
|
30
|
+
* or in case of a limited read, equal to it.
|
|
29
31
|
*/
|
|
30
32
|
nextSeqNum: number;
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
/**
|
|
34
|
-
* Sequence number for the first record on this stream
|
|
36
|
+
* Sequence number for the first record on this stream.
|
|
35
37
|
*
|
|
36
38
|
* @remarks
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
+
* Typically this will be returned when the requested `start_seq_num` was smaller.
|
|
40
|
+
* It may also be returned during a session, if the stream gets concurrently trimmed.
|
|
39
41
|
*/
|
|
40
42
|
export type FirstSeqNum = {
|
|
41
43
|
/**
|
|
42
|
-
* Sequence number for the first record on this stream
|
|
44
|
+
* Sequence number for the first record on this stream.
|
|
43
45
|
*
|
|
44
46
|
* @remarks
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
+
* Typically this will be returned when the requested `start_seq_num` was smaller.
|
|
48
|
+
* It may also be returned during a session, if the stream gets concurrently trimmed.
|
|
47
49
|
*/
|
|
48
50
|
firstSeqNum: number;
|
|
49
51
|
};
|
|
@@ -52,8 +54,8 @@ export type FirstSeqNum = {
|
|
|
52
54
|
* Batch of records.
|
|
53
55
|
*
|
|
54
56
|
* @remarks
|
|
55
|
-
*
|
|
56
|
-
* that could have been
|
|
57
|
+
* It can only be empty when not in a session context (which implies a limit),
|
|
58
|
+
* if the first record that could have been retrieved would violate the limit.
|
|
57
59
|
*/
|
|
58
60
|
export type Batch = {
|
|
59
61
|
/**
|
|
@@ -63,7 +65,10 @@ export type Batch = {
|
|
|
63
65
|
};
|
|
64
66
|
|
|
65
67
|
/**
|
|
66
|
-
*
|
|
68
|
+
* Batch of records, or a sequence number if the read could not be satisfied.
|
|
69
|
+
*
|
|
70
|
+
* @remarks
|
|
71
|
+
* An empty batch or a sequence number output will be a terminal message in a session.
|
|
67
72
|
*/
|
|
68
73
|
export type Output = Batch | FirstSeqNum | NextSeqNum;
|
|
69
74
|
|
|
@@ -41,7 +41,10 @@ export type Event = ClosedEnum<typeof Event>;
|
|
|
41
41
|
|
|
42
42
|
export type Message = {
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Batch of records, or a sequence number if the read could not be satisfied.
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* An empty batch or a sequence number output will be a terminal message in a session.
|
|
45
48
|
*/
|
|
46
49
|
data: Output;
|
|
47
50
|
event: Event;
|
|
@@ -18,7 +18,11 @@ export const ReadServerList = [
|
|
|
18
18
|
] as const;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* Limit
|
|
21
|
+
* Limit how many records can be returned.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* This will get capped at the default limit,
|
|
25
|
+
* which is up to 1000 records or 1MiB of metered bytes.
|
|
22
26
|
*/
|
|
23
27
|
export type Limit = {
|
|
24
28
|
/**
|
|
@@ -45,7 +49,11 @@ export type ReadRequest = {
|
|
|
45
49
|
*/
|
|
46
50
|
startSeqNum?: number | undefined;
|
|
47
51
|
/**
|
|
48
|
-
* Limit
|
|
52
|
+
* Limit how many records can be returned.
|
|
53
|
+
*
|
|
54
|
+
* @remarks
|
|
55
|
+
* This will get capped at the default limit,
|
|
56
|
+
* which is up to 1000 records or 1MiB of metered bytes.
|
|
49
57
|
*/
|
|
50
58
|
limit?: Limit | undefined;
|
|
51
59
|
/**
|