@s2-dev/streamstore 0.11.0 → 0.11.2
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/FUNCTIONS.md +1 -1
- package/README.md +19 -14
- package/bin/mcp-server.js +359 -124
- package/bin/mcp-server.js.map +41 -33
- package/dist/commonjs/funcs/accessTokensIssueAccessToken.js +3 -3
- package/dist/commonjs/funcs/accessTokensIssueAccessToken.js.map +1 -1
- package/dist/commonjs/funcs/accessTokensListAccessTokens.js +3 -3
- package/dist/commonjs/funcs/accessTokensListAccessTokens.js.map +1 -1
- package/dist/commonjs/funcs/accessTokensRevokeAccessToken.js +3 -3
- package/dist/commonjs/funcs/accessTokensRevokeAccessToken.js.map +1 -1
- package/dist/commonjs/funcs/basinsCreateOrReconfigureBasin.js +3 -3
- package/dist/commonjs/funcs/basinsCreateOrReconfigureBasin.js.map +1 -1
- package/dist/commonjs/funcs/basinsDeleteBasin.js +3 -3
- package/dist/commonjs/funcs/basinsDeleteBasin.js.map +1 -1
- package/dist/commonjs/funcs/basinsGetBasinConfig.js +3 -3
- package/dist/commonjs/funcs/basinsGetBasinConfig.js.map +1 -1
- package/dist/commonjs/funcs/basinsListBasins.js +3 -3
- package/dist/commonjs/funcs/basinsListBasins.js.map +1 -1
- package/dist/commonjs/funcs/basinsReconfigureBasin.js +3 -3
- package/dist/commonjs/funcs/basinsReconfigureBasin.js.map +1 -1
- package/dist/commonjs/funcs/recordsCheckTail.d.ts +18 -0
- package/dist/commonjs/funcs/recordsCheckTail.d.ts.map +1 -0
- package/dist/commonjs/funcs/recordsCheckTail.js +127 -0
- package/dist/commonjs/funcs/recordsCheckTail.js.map +1 -0
- package/dist/commonjs/funcs/streamsCreateOrReconfigureStream.js +3 -3
- package/dist/commonjs/funcs/streamsCreateOrReconfigureStream.js.map +1 -1
- package/dist/commonjs/funcs/streamsDeleteStream.js +3 -3
- package/dist/commonjs/funcs/streamsDeleteStream.js.map +1 -1
- package/dist/commonjs/funcs/streamsGetStreamConfig.js +3 -3
- package/dist/commonjs/funcs/streamsGetStreamConfig.js.map +1 -1
- package/dist/commonjs/funcs/streamsListStreams.js +3 -3
- package/dist/commonjs/funcs/streamsListStreams.js.map +1 -1
- package/dist/commonjs/funcs/streamsReconfigureStream.js +3 -3
- package/dist/commonjs/funcs/streamsReconfigureStream.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +4 -4
- package/dist/commonjs/lib/config.d.ts.map +1 -1
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/env.d.ts +1 -1
- package/dist/commonjs/lib/env.d.ts.map +1 -1
- package/dist/commonjs/lib/env.js +1 -1
- package/dist/commonjs/lib/env.js.map +1 -1
- package/dist/commonjs/lib/sdks.d.ts +3 -1
- package/dist/commonjs/lib/sdks.d.ts.map +1 -1
- package/dist/commonjs/lib/sdks.js +6 -11
- package/dist/commonjs/lib/sdks.js.map +1 -1
- package/dist/commonjs/lib/security.js +1 -1
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/mcp-server/cli/start/command.js +2 -2
- package/dist/commonjs/mcp-server/cli/start/command.js.map +1 -1
- package/dist/commonjs/mcp-server/cli/start/impl.d.ts +1 -1
- package/dist/commonjs/mcp-server/cli/start/impl.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/cli/start/impl.js +2 -2
- package/dist/commonjs/mcp-server/cli/start/impl.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts +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/recordsCheckTail.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/recordsCheckTail.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/recordsCheckTail.js +65 -0
- package/dist/commonjs/mcp-server/tools/recordsCheckTail.js.map +1 -0
- package/dist/commonjs/models/components/accesstokeninfo.d.ts +1 -1
- package/dist/commonjs/models/components/checktailresponse.d.ts +33 -0
- package/dist/commonjs/models/components/checktailresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/checktailresponse.js +70 -0
- package/dist/commonjs/models/components/checktailresponse.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +5 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +5 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/listaccesstokensresponse.d.ts +5 -5
- package/dist/commonjs/models/components/listaccesstokensresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/listaccesstokensresponse.js +4 -2
- package/dist/commonjs/models/components/listaccesstokensresponse.js.map +1 -1
- package/dist/commonjs/models/components/security.d.ts +2 -2
- package/dist/commonjs/models/components/security.d.ts.map +1 -1
- package/dist/commonjs/models/components/security.js +11 -2
- package/dist/commonjs/models/components/security.js.map +1 -1
- package/dist/commonjs/models/components/streamconfig.d.ts +3 -18
- package/dist/commonjs/models/components/streamconfig.d.ts.map +1 -1
- package/dist/commonjs/models/components/streamconfig.js +3 -8
- package/dist/commonjs/models/components/streamconfig.js.map +1 -1
- package/dist/commonjs/models/components/streamposition.d.ts +43 -0
- package/dist/commonjs/models/components/streamposition.d.ts.map +1 -0
- package/dist/commonjs/models/components/streamposition.js +80 -0
- package/dist/commonjs/models/components/streamposition.js.map +1 -0
- package/dist/commonjs/models/components/streamreconfiguration.d.ts +3 -18
- package/dist/commonjs/models/components/streamreconfiguration.d.ts.map +1 -1
- package/dist/commonjs/models/components/streamreconfiguration.js +3 -8
- package/dist/commonjs/models/components/streamreconfiguration.js.map +1 -1
- package/dist/commonjs/models/components/timestampingconfig.d.ts +38 -0
- package/dist/commonjs/models/components/timestampingconfig.d.ts.map +1 -0
- package/dist/commonjs/models/components/timestampingconfig.js +72 -0
- package/dist/commonjs/models/components/timestampingconfig.js.map +1 -0
- package/dist/commonjs/models/components/timestampingmode.d.ts +31 -0
- package/dist/commonjs/models/components/timestampingmode.d.ts.map +1 -0
- package/dist/commonjs/models/components/timestampingmode.js +61 -0
- package/dist/commonjs/models/components/timestampingmode.js.map +1 -0
- package/dist/commonjs/models/components/timestampingreconfiguration.d.ts +35 -0
- package/dist/commonjs/models/components/timestampingreconfiguration.d.ts.map +1 -0
- package/dist/commonjs/models/components/timestampingreconfiguration.js +72 -0
- package/dist/commonjs/models/components/timestampingreconfiguration.js.map +1 -0
- package/dist/commonjs/models/operations/checktail.d.ts +37 -0
- package/dist/commonjs/models/operations/checktail.d.ts.map +1 -0
- package/dist/commonjs/models/operations/checktail.js +75 -0
- package/dist/commonjs/models/operations/checktail.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/liststreams.d.ts +1 -1
- package/dist/commonjs/models/operations/liststreams.d.ts.map +1 -1
- package/dist/commonjs/models/operations/liststreams.js +1 -1
- package/dist/commonjs/models/operations/liststreams.js.map +1 -1
- package/dist/commonjs/models/operations/revokeaccesstoken.d.ts +1 -1
- package/dist/commonjs/sdk/records.d.ts +13 -0
- package/dist/commonjs/sdk/records.d.ts.map +1 -0
- package/dist/commonjs/sdk/records.js +22 -0
- package/dist/commonjs/sdk/records.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/accessTokensIssueAccessToken.js +3 -3
- package/dist/esm/funcs/accessTokensIssueAccessToken.js.map +1 -1
- package/dist/esm/funcs/accessTokensListAccessTokens.js +3 -3
- package/dist/esm/funcs/accessTokensListAccessTokens.js.map +1 -1
- package/dist/esm/funcs/accessTokensRevokeAccessToken.js +3 -3
- package/dist/esm/funcs/accessTokensRevokeAccessToken.js.map +1 -1
- package/dist/esm/funcs/basinsCreateOrReconfigureBasin.js +3 -3
- package/dist/esm/funcs/basinsCreateOrReconfigureBasin.js.map +1 -1
- package/dist/esm/funcs/basinsDeleteBasin.js +3 -3
- package/dist/esm/funcs/basinsDeleteBasin.js.map +1 -1
- package/dist/esm/funcs/basinsGetBasinConfig.js +3 -3
- package/dist/esm/funcs/basinsGetBasinConfig.js.map +1 -1
- package/dist/esm/funcs/basinsListBasins.js +3 -3
- package/dist/esm/funcs/basinsListBasins.js.map +1 -1
- package/dist/esm/funcs/basinsReconfigureBasin.js +3 -3
- package/dist/esm/funcs/basinsReconfigureBasin.js.map +1 -1
- package/dist/esm/funcs/recordsCheckTail.d.ts +18 -0
- package/dist/esm/funcs/recordsCheckTail.d.ts.map +1 -0
- package/dist/esm/funcs/recordsCheckTail.js +91 -0
- package/dist/esm/funcs/recordsCheckTail.js.map +1 -0
- package/dist/esm/funcs/streamsCreateOrReconfigureStream.js +3 -3
- package/dist/esm/funcs/streamsCreateOrReconfigureStream.js.map +1 -1
- package/dist/esm/funcs/streamsDeleteStream.js +3 -3
- package/dist/esm/funcs/streamsDeleteStream.js.map +1 -1
- package/dist/esm/funcs/streamsGetStreamConfig.js +3 -3
- package/dist/esm/funcs/streamsGetStreamConfig.js.map +1 -1
- package/dist/esm/funcs/streamsListStreams.js +3 -3
- package/dist/esm/funcs/streamsListStreams.js.map +1 -1
- package/dist/esm/funcs/streamsReconfigureStream.js +3 -3
- package/dist/esm/funcs/streamsReconfigureStream.js.map +1 -1
- package/dist/esm/lib/config.d.ts +4 -4
- package/dist/esm/lib/config.d.ts.map +1 -1
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/env.d.ts +1 -1
- package/dist/esm/lib/env.d.ts.map +1 -1
- package/dist/esm/lib/env.js +1 -1
- package/dist/esm/lib/env.js.map +1 -1
- package/dist/esm/lib/sdks.d.ts +3 -1
- package/dist/esm/lib/sdks.d.ts.map +1 -1
- package/dist/esm/lib/sdks.js +6 -11
- package/dist/esm/lib/sdks.js.map +1 -1
- package/dist/esm/lib/security.js +1 -1
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/mcp-server/cli/start/command.js +2 -2
- package/dist/esm/mcp-server/cli/start/command.js.map +1 -1
- package/dist/esm/mcp-server/cli/start/impl.d.ts +1 -1
- package/dist/esm/mcp-server/cli/start/impl.d.ts.map +1 -1
- package/dist/esm/mcp-server/cli/start/impl.js +2 -2
- package/dist/esm/mcp-server/cli/start/impl.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts +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/recordsCheckTail.d.ts +8 -0
- package/dist/esm/mcp-server/tools/recordsCheckTail.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/recordsCheckTail.js +29 -0
- package/dist/esm/mcp-server/tools/recordsCheckTail.js.map +1 -0
- package/dist/esm/models/components/accesstokeninfo.d.ts +1 -1
- package/dist/esm/models/components/checktailresponse.d.ts +33 -0
- package/dist/esm/models/components/checktailresponse.d.ts.map +1 -0
- package/dist/esm/models/components/checktailresponse.js +32 -0
- package/dist/esm/models/components/checktailresponse.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +5 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +5 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/listaccesstokensresponse.d.ts +5 -5
- package/dist/esm/models/components/listaccesstokensresponse.d.ts.map +1 -1
- package/dist/esm/models/components/listaccesstokensresponse.js +4 -2
- package/dist/esm/models/components/listaccesstokensresponse.js.map +1 -1
- package/dist/esm/models/components/security.d.ts +2 -2
- package/dist/esm/models/components/security.d.ts.map +1 -1
- package/dist/esm/models/components/security.js +11 -2
- package/dist/esm/models/components/security.js.map +1 -1
- package/dist/esm/models/components/streamconfig.d.ts +3 -18
- package/dist/esm/models/components/streamconfig.d.ts.map +1 -1
- package/dist/esm/models/components/streamconfig.js +3 -8
- package/dist/esm/models/components/streamconfig.js.map +1 -1
- package/dist/esm/models/components/streamposition.d.ts +43 -0
- package/dist/esm/models/components/streamposition.d.ts.map +1 -0
- package/dist/esm/models/components/streamposition.js +42 -0
- package/dist/esm/models/components/streamposition.js.map +1 -0
- package/dist/esm/models/components/streamreconfiguration.d.ts +3 -18
- package/dist/esm/models/components/streamreconfiguration.d.ts.map +1 -1
- package/dist/esm/models/components/streamreconfiguration.js +3 -8
- package/dist/esm/models/components/streamreconfiguration.js.map +1 -1
- package/dist/esm/models/components/timestampingconfig.d.ts +38 -0
- package/dist/esm/models/components/timestampingconfig.d.ts.map +1 -0
- package/dist/esm/models/components/timestampingconfig.js +34 -0
- package/dist/esm/models/components/timestampingconfig.js.map +1 -0
- package/dist/esm/models/components/timestampingmode.d.ts +31 -0
- package/dist/esm/models/components/timestampingmode.d.ts.map +1 -0
- package/dist/esm/models/components/timestampingmode.js +25 -0
- package/dist/esm/models/components/timestampingmode.js.map +1 -0
- package/dist/esm/models/components/timestampingreconfiguration.d.ts +35 -0
- package/dist/esm/models/components/timestampingreconfiguration.d.ts.map +1 -0
- package/dist/esm/models/components/timestampingreconfiguration.js +34 -0
- package/dist/esm/models/components/timestampingreconfiguration.js.map +1 -0
- package/dist/esm/models/operations/checktail.d.ts +37 -0
- package/dist/esm/models/operations/checktail.d.ts.map +1 -0
- package/dist/esm/models/operations/checktail.js +37 -0
- package/dist/esm/models/operations/checktail.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/liststreams.d.ts +1 -1
- package/dist/esm/models/operations/liststreams.d.ts.map +1 -1
- package/dist/esm/models/operations/liststreams.js +1 -1
- package/dist/esm/models/operations/liststreams.js.map +1 -1
- package/dist/esm/models/operations/revokeaccesstoken.d.ts +1 -1
- package/dist/esm/sdk/records.d.ts +13 -0
- package/dist/esm/sdk/records.d.ts.map +1 -0
- package/dist/esm/sdk/records.js +18 -0
- package/dist/esm/sdk/records.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/docs/sdks/accesstokens/README.md +6 -6
- package/docs/sdks/basins/README.md +10 -10
- package/docs/sdks/records/README.md +90 -0
- package/docs/sdks/streams/README.md +22 -14
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/accessTokensIssueAccessToken.ts +3 -3
- package/src/funcs/accessTokensListAccessTokens.ts +3 -3
- package/src/funcs/accessTokensRevokeAccessToken.ts +3 -3
- package/src/funcs/basinsCreateOrReconfigureBasin.ts +3 -3
- package/src/funcs/basinsDeleteBasin.ts +3 -3
- package/src/funcs/basinsGetBasinConfig.ts +3 -3
- package/src/funcs/basinsListBasins.ts +3 -3
- package/src/funcs/basinsReconfigureBasin.ts +3 -3
- package/src/funcs/recordsCheckTail.ts +184 -0
- package/src/funcs/streamsCreateOrReconfigureStream.ts +3 -3
- package/src/funcs/streamsDeleteStream.ts +3 -3
- package/src/funcs/streamsGetStreamConfig.ts +3 -3
- package/src/funcs/streamsListStreams.ts +3 -3
- package/src/funcs/streamsReconfigureStream.ts +3 -3
- package/src/lib/config.ts +4 -4
- package/src/lib/env.ts +2 -2
- package/src/lib/sdks.ts +11 -11
- package/src/lib/security.ts +1 -1
- package/src/mcp-server/cli/start/command.ts +2 -2
- package/src/mcp-server/cli/start/impl.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +5 -3
- package/src/mcp-server/tools/recordsCheckTail.ts +38 -0
- package/src/models/components/accesstokeninfo.ts +1 -1
- package/src/models/components/checktailresponse.ts +75 -0
- package/src/models/components/index.ts +5 -0
- package/src/models/components/listaccesstokensresponse.ts +9 -7
- package/src/models/components/security.ts +13 -4
- package/src/models/components/streamconfig.ts +10 -26
- package/src/models/components/streamposition.ts +87 -0
- package/src/models/components/streamreconfiguration.ts +10 -26
- package/src/models/components/timestampingconfig.ts +81 -0
- package/src/models/components/timestampingmode.ts +34 -0
- package/src/models/components/timestampingreconfiguration.ts +80 -0
- package/src/models/operations/checktail.ts +80 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/liststreams.ts +1 -1
- package/src/models/operations/revokeaccesstoken.ts +1 -1
- package/src/sdk/records.ts +28 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -109,8 +109,8 @@ async function $do(
|
|
|
109
109
|
Accept: "application/json",
|
|
110
110
|
}));
|
|
111
111
|
|
|
112
|
-
const secConfig = await extractSecurity(client._options.
|
|
113
|
-
const securityInput = secConfig == null ? {} : {
|
|
112
|
+
const secConfig = await extractSecurity(client._options.accessToken);
|
|
113
|
+
const securityInput = secConfig == null ? {} : { accessToken: secConfig };
|
|
114
114
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
115
115
|
|
|
116
116
|
const context = {
|
|
@@ -120,7 +120,7 @@ async function $do(
|
|
|
120
120
|
|
|
121
121
|
resolvedSecurity: requestSecurity,
|
|
122
122
|
|
|
123
|
-
securitySource: client._options.
|
|
123
|
+
securitySource: client._options.accessToken,
|
|
124
124
|
retryConfig: options?.retries
|
|
125
125
|
|| client._options.retryConfig
|
|
126
126
|
|| { strategy: "none" },
|
package/src/lib/config.ts
CHANGED
|
@@ -15,7 +15,7 @@ export const ServerList = [
|
|
|
15
15
|
] as const;
|
|
16
16
|
|
|
17
17
|
export type SDKOptions = {
|
|
18
|
-
|
|
18
|
+
accessToken?: string | (() => Promise<string>) | undefined;
|
|
19
19
|
|
|
20
20
|
httpClient?: HTTPClient;
|
|
21
21
|
/**
|
|
@@ -54,8 +54,8 @@ 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.11.
|
|
58
|
-
genVersion: "2.
|
|
57
|
+
sdkVersion: "0.11.2",
|
|
58
|
+
genVersion: "2.597.9",
|
|
59
59
|
userAgent:
|
|
60
|
-
"speakeasy-sdk/typescript 0.11.
|
|
60
|
+
"speakeasy-sdk/typescript 0.11.2 2.597.9 1.0.0 @s2-dev/streamstore",
|
|
61
61
|
} as const;
|
package/src/lib/env.ts
CHANGED
|
@@ -7,13 +7,13 @@ import { dlv } from "./dlv.js";
|
|
|
7
7
|
import * as z from "zod";
|
|
8
8
|
|
|
9
9
|
export interface Env {
|
|
10
|
-
|
|
10
|
+
S2_ACCESS_TOKEN?: string | undefined;
|
|
11
11
|
|
|
12
12
|
S2_DEBUG?: boolean | undefined;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export const envSchema: z.ZodType<Env, z.ZodTypeDef, unknown> = z.object({
|
|
16
|
-
|
|
16
|
+
S2_ACCESS_TOKEN: z.string().optional(),
|
|
17
17
|
|
|
18
18
|
S2_DEBUG: z.coerce.boolean().optional(),
|
|
19
19
|
});
|
package/src/lib/sdks.ts
CHANGED
|
@@ -47,12 +47,14 @@ export type RequestOptions = {
|
|
|
47
47
|
*/
|
|
48
48
|
serverURL?: string | URL;
|
|
49
49
|
/**
|
|
50
|
+
* @deprecated `fetchOptions` has been flattened into `RequestOptions`.
|
|
51
|
+
*
|
|
50
52
|
* Sets various request options on the `fetch` call made by an SDK method.
|
|
51
53
|
*
|
|
52
54
|
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options|Request}
|
|
53
55
|
*/
|
|
54
56
|
fetchOptions?: Omit<RequestInit, "method" | "body">;
|
|
55
|
-
}
|
|
57
|
+
} & Omit<RequestInit, "method" | "body">;
|
|
56
58
|
|
|
57
59
|
type RequestConfig = {
|
|
58
60
|
method: string;
|
|
@@ -172,7 +174,9 @@ export class ClientSDK {
|
|
|
172
174
|
cookie = cookie.startsWith("; ") ? cookie.slice(2) : cookie;
|
|
173
175
|
headers.set("cookie", cookie);
|
|
174
176
|
|
|
175
|
-
const userHeaders = new Headers(
|
|
177
|
+
const userHeaders = new Headers(
|
|
178
|
+
options?.headers ?? options?.fetchOptions?.headers,
|
|
179
|
+
);
|
|
176
180
|
for (const [k, v] of userHeaders) {
|
|
177
181
|
headers.set(k, v);
|
|
178
182
|
}
|
|
@@ -183,20 +187,16 @@ export class ClientSDK {
|
|
|
183
187
|
headers.set(conf.uaHeader ?? "user-agent", SDK_METADATA.userAgent);
|
|
184
188
|
}
|
|
185
189
|
|
|
186
|
-
|
|
190
|
+
const fetchOptions: Omit<RequestInit, "method" | "body"> = {
|
|
191
|
+
...options?.fetchOptions,
|
|
192
|
+
...options,
|
|
193
|
+
};
|
|
187
194
|
if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) {
|
|
188
195
|
const timeoutSignal = AbortSignal.timeout(conf.timeoutMs);
|
|
189
|
-
|
|
190
|
-
fetchOptions = { signal: timeoutSignal };
|
|
191
|
-
} else {
|
|
192
|
-
fetchOptions.signal = timeoutSignal;
|
|
193
|
-
}
|
|
196
|
+
fetchOptions.signal = timeoutSignal;
|
|
194
197
|
}
|
|
195
198
|
|
|
196
199
|
if (conf.body instanceof ReadableStream) {
|
|
197
|
-
if (!fetchOptions) {
|
|
198
|
-
fetchOptions = {};
|
|
199
|
-
}
|
|
200
200
|
Object.assign(fetchOptions, { duplex: "half" });
|
|
201
201
|
}
|
|
202
202
|
|
package/src/lib/security.ts
CHANGED
|
@@ -49,9 +49,9 @@ export const startCommand = buildCommand({
|
|
|
49
49
|
},
|
|
50
50
|
}
|
|
51
51
|
: {}),
|
|
52
|
-
"
|
|
52
|
+
"access-token": {
|
|
53
53
|
kind: "parsed",
|
|
54
|
-
brief: "Sets the
|
|
54
|
+
brief: "Sets the accessToken auth field for the API",
|
|
55
55
|
optional: true,
|
|
56
56
|
parse: (value) => {
|
|
57
57
|
return z.string().parse(value);
|
|
@@ -19,7 +19,7 @@ interface StartCommandFlags {
|
|
|
19
19
|
readonly port: number;
|
|
20
20
|
readonly tool?: string[];
|
|
21
21
|
readonly scope?: MCPScope[];
|
|
22
|
-
readonly "
|
|
22
|
+
readonly "access-token"?: string | undefined;
|
|
23
23
|
readonly "server-url"?: string;
|
|
24
24
|
readonly "server-index"?: SDKOptions["serverIdx"];
|
|
25
25
|
readonly "log-level": ConsoleLoggerLevel;
|
|
@@ -50,7 +50,7 @@ async function startStdio(flags: StartCommandFlags) {
|
|
|
50
50
|
logger,
|
|
51
51
|
allowedTools: flags.tool,
|
|
52
52
|
scopes: flags.scope,
|
|
53
|
-
...{
|
|
53
|
+
...{ accessToken: flags["access-token"] },
|
|
54
54
|
serverURL: flags["server-url"],
|
|
55
55
|
serverIdx: flags["server-index"],
|
|
56
56
|
});
|
|
@@ -71,7 +71,7 @@ async function startSSE(flags: StartCommandFlags) {
|
|
|
71
71
|
logger,
|
|
72
72
|
allowedTools: flags.tool,
|
|
73
73
|
scopes: flags.scope,
|
|
74
|
-
...{
|
|
74
|
+
...{ accessToken: flags["access-token"] },
|
|
75
75
|
serverURL: flags["server-url"],
|
|
76
76
|
serverIdx: flags["server-index"],
|
|
77
77
|
});
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -21,6 +21,7 @@ import { tool$basinsDeleteBasin } from "./tools/basinsDeleteBasin.js";
|
|
|
21
21
|
import { tool$basinsGetBasinConfig } from "./tools/basinsGetBasinConfig.js";
|
|
22
22
|
import { tool$basinsListBasins } from "./tools/basinsListBasins.js";
|
|
23
23
|
import { tool$basinsReconfigureBasin } from "./tools/basinsReconfigureBasin.js";
|
|
24
|
+
import { tool$recordsCheckTail } from "./tools/recordsCheckTail.js";
|
|
24
25
|
import { tool$streamsCreateOrReconfigureStream } from "./tools/streamsCreateOrReconfigureStream.js";
|
|
25
26
|
import { tool$streamsDeleteStream } from "./tools/streamsDeleteStream.js";
|
|
26
27
|
import { tool$streamsGetStreamConfig } from "./tools/streamsGetStreamConfig.js";
|
|
@@ -32,16 +33,16 @@ export function createMCPServer(deps: {
|
|
|
32
33
|
allowedTools?: string[] | undefined;
|
|
33
34
|
scopes?: MCPScope[] | undefined;
|
|
34
35
|
serverURL?: string | undefined;
|
|
35
|
-
|
|
36
|
+
accessToken?: SDKOptions["accessToken"] | undefined;
|
|
36
37
|
serverIdx?: SDKOptions["serverIdx"] | undefined;
|
|
37
38
|
}) {
|
|
38
39
|
const server = new McpServer({
|
|
39
40
|
name: "S2",
|
|
40
|
-
version: "0.11.
|
|
41
|
+
version: "0.11.2",
|
|
41
42
|
});
|
|
42
43
|
|
|
43
44
|
const client = new S2Core({
|
|
44
|
-
|
|
45
|
+
accessToken: deps.accessToken,
|
|
45
46
|
serverURL: deps.serverURL,
|
|
46
47
|
serverIdx: deps.serverIdx,
|
|
47
48
|
});
|
|
@@ -80,6 +81,7 @@ export function createMCPServer(deps: {
|
|
|
80
81
|
tool(tool$streamsCreateOrReconfigureStream);
|
|
81
82
|
tool(tool$streamsDeleteStream);
|
|
82
83
|
tool(tool$streamsReconfigureStream);
|
|
84
|
+
tool(tool$recordsCheckTail);
|
|
83
85
|
|
|
84
86
|
return server;
|
|
85
87
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { recordsCheckTail } from "../../funcs/recordsCheckTail.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.CheckTailRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$recordsCheckTail: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "records-check-tail",
|
|
15
|
+
description: `Check the tail.
|
|
16
|
+
|
|
17
|
+
Check the tail of a stream.`,
|
|
18
|
+
scopes: ["read"],
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await recordsCheckTail(
|
|
22
|
+
client,
|
|
23
|
+
args.request,
|
|
24
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
25
|
+
).$inspect();
|
|
26
|
+
|
|
27
|
+
if (!result.ok) {
|
|
28
|
+
return {
|
|
29
|
+
content: [{ type: "text", text: result.error.message }],
|
|
30
|
+
isError: true,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const value = result.value;
|
|
35
|
+
|
|
36
|
+
return formatResult(value, apiCall);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -34,7 +34,7 @@ export type AccessTokenInfo = {
|
|
|
34
34
|
* Access token ID.
|
|
35
35
|
*
|
|
36
36
|
* @remarks
|
|
37
|
-
* It must be unique to the account and between 1 and
|
|
37
|
+
* It must be unique to the account and between 1 and 96 characters.
|
|
38
38
|
*/
|
|
39
39
|
id: string;
|
|
40
40
|
scope: AccessTokenScope;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
StreamPosition,
|
|
11
|
+
StreamPosition$inboundSchema,
|
|
12
|
+
StreamPosition$Outbound,
|
|
13
|
+
StreamPosition$outboundSchema,
|
|
14
|
+
} from "./streamposition.js";
|
|
15
|
+
|
|
16
|
+
export type CheckTailResponse = {
|
|
17
|
+
/**
|
|
18
|
+
* Position of a record in a stream.
|
|
19
|
+
*/
|
|
20
|
+
tail: StreamPosition;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const CheckTailResponse$inboundSchema: z.ZodType<
|
|
25
|
+
CheckTailResponse,
|
|
26
|
+
z.ZodTypeDef,
|
|
27
|
+
unknown
|
|
28
|
+
> = z.object({
|
|
29
|
+
tail: StreamPosition$inboundSchema,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export type CheckTailResponse$Outbound = {
|
|
34
|
+
tail: StreamPosition$Outbound;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const CheckTailResponse$outboundSchema: z.ZodType<
|
|
39
|
+
CheckTailResponse$Outbound,
|
|
40
|
+
z.ZodTypeDef,
|
|
41
|
+
CheckTailResponse
|
|
42
|
+
> = z.object({
|
|
43
|
+
tail: StreamPosition$outboundSchema,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @internal
|
|
48
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
49
|
+
*/
|
|
50
|
+
export namespace CheckTailResponse$ {
|
|
51
|
+
/** @deprecated use `CheckTailResponse$inboundSchema` instead. */
|
|
52
|
+
export const inboundSchema = CheckTailResponse$inboundSchema;
|
|
53
|
+
/** @deprecated use `CheckTailResponse$outboundSchema` instead. */
|
|
54
|
+
export const outboundSchema = CheckTailResponse$outboundSchema;
|
|
55
|
+
/** @deprecated use `CheckTailResponse$Outbound` instead. */
|
|
56
|
+
export type Outbound = CheckTailResponse$Outbound;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function checkTailResponseToJSON(
|
|
60
|
+
checkTailResponse: CheckTailResponse,
|
|
61
|
+
): string {
|
|
62
|
+
return JSON.stringify(
|
|
63
|
+
CheckTailResponse$outboundSchema.parse(checkTailResponse),
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function checkTailResponseFromJSON(
|
|
68
|
+
jsonString: string,
|
|
69
|
+
): SafeParseResult<CheckTailResponse, SDKValidationError> {
|
|
70
|
+
return safeParse(
|
|
71
|
+
jsonString,
|
|
72
|
+
(x) => CheckTailResponse$inboundSchema.parse(JSON.parse(x)),
|
|
73
|
+
`Failed to parse 'CheckTailResponse' from JSON`,
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -9,6 +9,7 @@ export * from "./basininfo.js";
|
|
|
9
9
|
export * from "./basinreconfiguration.js";
|
|
10
10
|
export * from "./basinscope.js";
|
|
11
11
|
export * from "./basinstate.js";
|
|
12
|
+
export * from "./checktailresponse.js";
|
|
12
13
|
export * from "./createbasinrequest.js";
|
|
13
14
|
export * from "./issueaccesstokenresponse.js";
|
|
14
15
|
export * from "./listaccesstokensresponse.js";
|
|
@@ -23,4 +24,8 @@ export * from "./security.js";
|
|
|
23
24
|
export * from "./storageclass.js";
|
|
24
25
|
export * from "./streamconfig.js";
|
|
25
26
|
export * from "./streaminfo.js";
|
|
27
|
+
export * from "./streamposition.js";
|
|
26
28
|
export * from "./streamreconfiguration.js";
|
|
29
|
+
export * from "./timestampingconfig.js";
|
|
30
|
+
export * from "./timestampingmode.js";
|
|
31
|
+
export * from "./timestampingreconfiguration.js";
|
|
@@ -16,13 +16,13 @@ import {
|
|
|
16
16
|
|
|
17
17
|
export type ListAccessTokensResponse = {
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Access tokens information.
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
accessTokens: Array<AccessTokenInfo>;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* If set, indicates there are more results that can be listed with `start_after`.
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
hasMore: boolean;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
/** @internal */
|
|
@@ -31,18 +31,19 @@ export const ListAccessTokensResponse$inboundSchema: z.ZodType<
|
|
|
31
31
|
z.ZodTypeDef,
|
|
32
32
|
unknown
|
|
33
33
|
> = z.object({
|
|
34
|
+
access_tokens: z.array(AccessTokenInfo$inboundSchema),
|
|
34
35
|
has_more: z.boolean(),
|
|
35
|
-
tokens: z.array(AccessTokenInfo$inboundSchema),
|
|
36
36
|
}).transform((v) => {
|
|
37
37
|
return remap$(v, {
|
|
38
|
+
"access_tokens": "accessTokens",
|
|
38
39
|
"has_more": "hasMore",
|
|
39
40
|
});
|
|
40
41
|
});
|
|
41
42
|
|
|
42
43
|
/** @internal */
|
|
43
44
|
export type ListAccessTokensResponse$Outbound = {
|
|
45
|
+
access_tokens: Array<AccessTokenInfo$Outbound>;
|
|
44
46
|
has_more: boolean;
|
|
45
|
-
tokens: Array<AccessTokenInfo$Outbound>;
|
|
46
47
|
};
|
|
47
48
|
|
|
48
49
|
/** @internal */
|
|
@@ -51,10 +52,11 @@ export const ListAccessTokensResponse$outboundSchema: z.ZodType<
|
|
|
51
52
|
z.ZodTypeDef,
|
|
52
53
|
ListAccessTokensResponse
|
|
53
54
|
> = z.object({
|
|
55
|
+
accessTokens: z.array(AccessTokenInfo$outboundSchema),
|
|
54
56
|
hasMore: z.boolean(),
|
|
55
|
-
tokens: z.array(AccessTokenInfo$outboundSchema),
|
|
56
57
|
}).transform((v) => {
|
|
57
58
|
return remap$(v, {
|
|
59
|
+
accessTokens: "access_tokens",
|
|
58
60
|
hasMore: "has_more",
|
|
59
61
|
});
|
|
60
62
|
});
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
10
|
|
|
10
11
|
export type Security = {
|
|
11
|
-
|
|
12
|
+
accessToken?: string | undefined;
|
|
12
13
|
};
|
|
13
14
|
|
|
14
15
|
/** @internal */
|
|
@@ -17,12 +18,16 @@ export const Security$inboundSchema: z.ZodType<
|
|
|
17
18
|
z.ZodTypeDef,
|
|
18
19
|
unknown
|
|
19
20
|
> = z.object({
|
|
20
|
-
|
|
21
|
+
access_token: z.string().optional(),
|
|
22
|
+
}).transform((v) => {
|
|
23
|
+
return remap$(v, {
|
|
24
|
+
"access_token": "accessToken",
|
|
25
|
+
});
|
|
21
26
|
});
|
|
22
27
|
|
|
23
28
|
/** @internal */
|
|
24
29
|
export type Security$Outbound = {
|
|
25
|
-
|
|
30
|
+
access_token?: string | undefined;
|
|
26
31
|
};
|
|
27
32
|
|
|
28
33
|
/** @internal */
|
|
@@ -31,7 +36,11 @@ export const Security$outboundSchema: z.ZodType<
|
|
|
31
36
|
z.ZodTypeDef,
|
|
32
37
|
Security
|
|
33
38
|
> = z.object({
|
|
34
|
-
|
|
39
|
+
accessToken: z.string().optional(),
|
|
40
|
+
}).transform((v) => {
|
|
41
|
+
return remap$(v, {
|
|
42
|
+
accessToken: "access_token",
|
|
43
|
+
});
|
|
35
44
|
});
|
|
36
45
|
|
|
37
46
|
/**
|
|
@@ -18,26 +18,17 @@ import {
|
|
|
18
18
|
StorageClass$inboundSchema,
|
|
19
19
|
StorageClass$outboundSchema,
|
|
20
20
|
} from "./storageclass.js";
|
|
21
|
+
import {
|
|
22
|
+
TimestampingConfig,
|
|
23
|
+
TimestampingConfig$inboundSchema,
|
|
24
|
+
TimestampingConfig$Outbound,
|
|
25
|
+
TimestampingConfig$outboundSchema,
|
|
26
|
+
} from "./timestampingconfig.js";
|
|
21
27
|
|
|
22
28
|
export type StreamConfig = {
|
|
23
|
-
/**
|
|
24
|
-
* Controls how to handle timestamps when they are not provided by the client.
|
|
25
|
-
*
|
|
26
|
-
* @remarks
|
|
27
|
-
* If this is false (or not set), the record's arrival time in milliseconds since Unix epoch
|
|
28
|
-
* will be assigned as its timestamp. If this is true, then any append without a
|
|
29
|
-
* client-specified timestamp will be rejected as invalid.
|
|
30
|
-
*/
|
|
31
|
-
requireClientTimestamps?: boolean | null | undefined;
|
|
32
29
|
retentionPolicy?: RetentionPolicy | null | undefined;
|
|
33
30
|
storageClass?: StorageClass | null | undefined;
|
|
34
|
-
|
|
35
|
-
* Allow client timestamps to exceed the arrival time in milliseconds since Unix epoch.
|
|
36
|
-
*
|
|
37
|
-
* @remarks
|
|
38
|
-
* If this is false (or not set), client timestamps will be capped at the arrival time.
|
|
39
|
-
*/
|
|
40
|
-
uncappedClientTimestamps?: boolean | null | undefined;
|
|
31
|
+
timestamping: TimestampingConfig;
|
|
41
32
|
};
|
|
42
33
|
|
|
43
34
|
/** @internal */
|
|
@@ -46,25 +37,21 @@ export const StreamConfig$inboundSchema: z.ZodType<
|
|
|
46
37
|
z.ZodTypeDef,
|
|
47
38
|
unknown
|
|
48
39
|
> = z.object({
|
|
49
|
-
require_client_timestamps: z.nullable(z.boolean()).optional(),
|
|
50
40
|
retention_policy: z.nullable(RetentionPolicy$inboundSchema).optional(),
|
|
51
41
|
storage_class: z.nullable(StorageClass$inboundSchema).optional(),
|
|
52
|
-
|
|
42
|
+
timestamping: TimestampingConfig$inboundSchema,
|
|
53
43
|
}).transform((v) => {
|
|
54
44
|
return remap$(v, {
|
|
55
|
-
"require_client_timestamps": "requireClientTimestamps",
|
|
56
45
|
"retention_policy": "retentionPolicy",
|
|
57
46
|
"storage_class": "storageClass",
|
|
58
|
-
"uncapped_client_timestamps": "uncappedClientTimestamps",
|
|
59
47
|
});
|
|
60
48
|
});
|
|
61
49
|
|
|
62
50
|
/** @internal */
|
|
63
51
|
export type StreamConfig$Outbound = {
|
|
64
|
-
require_client_timestamps?: boolean | null | undefined;
|
|
65
52
|
retention_policy?: RetentionPolicy$Outbound | null | undefined;
|
|
66
53
|
storage_class?: string | null | undefined;
|
|
67
|
-
|
|
54
|
+
timestamping: TimestampingConfig$Outbound;
|
|
68
55
|
};
|
|
69
56
|
|
|
70
57
|
/** @internal */
|
|
@@ -73,16 +60,13 @@ export const StreamConfig$outboundSchema: z.ZodType<
|
|
|
73
60
|
z.ZodTypeDef,
|
|
74
61
|
StreamConfig
|
|
75
62
|
> = z.object({
|
|
76
|
-
requireClientTimestamps: z.nullable(z.boolean()).optional(),
|
|
77
63
|
retentionPolicy: z.nullable(RetentionPolicy$outboundSchema).optional(),
|
|
78
64
|
storageClass: z.nullable(StorageClass$outboundSchema).optional(),
|
|
79
|
-
|
|
65
|
+
timestamping: TimestampingConfig$outboundSchema,
|
|
80
66
|
}).transform((v) => {
|
|
81
67
|
return remap$(v, {
|
|
82
|
-
requireClientTimestamps: "require_client_timestamps",
|
|
83
68
|
retentionPolicy: "retention_policy",
|
|
84
69
|
storageClass: "storage_class",
|
|
85
|
-
uncappedClientTimestamps: "uncapped_client_timestamps",
|
|
86
70
|
});
|
|
87
71
|
});
|
|
88
72
|
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Position of a record in a stream.
|
|
13
|
+
*/
|
|
14
|
+
export type StreamPosition = {
|
|
15
|
+
/**
|
|
16
|
+
* Sequence number assigned by the service.
|
|
17
|
+
*/
|
|
18
|
+
seqNum: number;
|
|
19
|
+
/**
|
|
20
|
+
* Timestamp, which may be user-specified or assigned by the service.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* If it is assigned by the service, it will represent milliseconds since Unix epoch.
|
|
24
|
+
*/
|
|
25
|
+
timestamp: number;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const StreamPosition$inboundSchema: z.ZodType<
|
|
30
|
+
StreamPosition,
|
|
31
|
+
z.ZodTypeDef,
|
|
32
|
+
unknown
|
|
33
|
+
> = z.object({
|
|
34
|
+
seq_num: z.number().int(),
|
|
35
|
+
timestamp: z.number().int(),
|
|
36
|
+
}).transform((v) => {
|
|
37
|
+
return remap$(v, {
|
|
38
|
+
"seq_num": "seqNum",
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
export type StreamPosition$Outbound = {
|
|
44
|
+
seq_num: number;
|
|
45
|
+
timestamp: number;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/** @internal */
|
|
49
|
+
export const StreamPosition$outboundSchema: z.ZodType<
|
|
50
|
+
StreamPosition$Outbound,
|
|
51
|
+
z.ZodTypeDef,
|
|
52
|
+
StreamPosition
|
|
53
|
+
> = z.object({
|
|
54
|
+
seqNum: z.number().int(),
|
|
55
|
+
timestamp: z.number().int(),
|
|
56
|
+
}).transform((v) => {
|
|
57
|
+
return remap$(v, {
|
|
58
|
+
seqNum: "seq_num",
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @internal
|
|
64
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
65
|
+
*/
|
|
66
|
+
export namespace StreamPosition$ {
|
|
67
|
+
/** @deprecated use `StreamPosition$inboundSchema` instead. */
|
|
68
|
+
export const inboundSchema = StreamPosition$inboundSchema;
|
|
69
|
+
/** @deprecated use `StreamPosition$outboundSchema` instead. */
|
|
70
|
+
export const outboundSchema = StreamPosition$outboundSchema;
|
|
71
|
+
/** @deprecated use `StreamPosition$Outbound` instead. */
|
|
72
|
+
export type Outbound = StreamPosition$Outbound;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function streamPositionToJSON(streamPosition: StreamPosition): string {
|
|
76
|
+
return JSON.stringify(StreamPosition$outboundSchema.parse(streamPosition));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function streamPositionFromJSON(
|
|
80
|
+
jsonString: string,
|
|
81
|
+
): SafeParseResult<StreamPosition, SDKValidationError> {
|
|
82
|
+
return safeParse(
|
|
83
|
+
jsonString,
|
|
84
|
+
(x) => StreamPosition$inboundSchema.parse(JSON.parse(x)),
|
|
85
|
+
`Failed to parse 'StreamPosition' from JSON`,
|
|
86
|
+
);
|
|
87
|
+
}
|