@s2-dev/streamstore 0.15.9 → 0.15.12
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 +3 -9
- package/bin/mcp-server.js +59 -22
- package/bin/mcp-server.js.map +18 -17
- package/dist/commonjs/funcs/basinsListBasins.js +3 -0
- package/dist/commonjs/funcs/basinsListBasins.js.map +1 -1
- package/dist/commonjs/funcs/recordsRead.js +1 -0
- package/dist/commonjs/funcs/recordsRead.js.map +1 -1
- package/dist/commonjs/funcs/streamsListStreams.js +3 -0
- package/dist/commonjs/funcs/streamsListStreams.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/lib/encodings.d.ts.map +1 -1
- package/dist/commonjs/lib/event-streams.d.ts +3 -3
- package/dist/commonjs/lib/event-streams.d.ts.map +1 -1
- package/dist/commonjs/lib/event-streams.js.map +1 -1
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/lib/url.js +1 -1
- package/dist/commonjs/lib/url.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js.map +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +1 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +1 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/infiniteretention.d.ts +25 -0
- package/dist/commonjs/models/components/infiniteretention.d.ts.map +1 -0
- package/dist/commonjs/models/components/infiniteretention.js +65 -0
- package/dist/commonjs/models/components/infiniteretention.js.map +1 -0
- package/dist/commonjs/models/components/metric.d.ts +15 -15
- package/dist/commonjs/models/components/metric.d.ts.map +1 -1
- package/dist/commonjs/models/components/metric.js +18 -20
- package/dist/commonjs/models/components/metric.js.map +1 -1
- package/dist/commonjs/models/components/retentionpolicy.d.ts +37 -6
- package/dist/commonjs/models/components/retentionpolicy.d.ts.map +1 -1
- package/dist/commonjs/models/components/retentionpolicy.js +36 -3
- package/dist/commonjs/models/components/retentionpolicy.js.map +1 -1
- package/dist/commonjs/models/errors/index.d.ts +1 -0
- package/dist/commonjs/models/errors/index.d.ts.map +1 -1
- package/dist/commonjs/models/errors/index.js +1 -0
- package/dist/commonjs/models/errors/index.js.map +1 -1
- package/dist/commonjs/models/operations/read.d.ts +20 -10
- package/dist/commonjs/models/operations/read.d.ts.map +1 -1
- package/dist/commonjs/models/operations/read.js +7 -3
- package/dist/commonjs/models/operations/read.js.map +1 -1
- package/dist/esm/funcs/basinsListBasins.js +3 -0
- package/dist/esm/funcs/basinsListBasins.js.map +1 -1
- package/dist/esm/funcs/recordsRead.js +1 -0
- package/dist/esm/funcs/recordsRead.js.map +1 -1
- package/dist/esm/funcs/streamsListStreams.js +3 -0
- package/dist/esm/funcs/streamsListStreams.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/lib/encodings.d.ts.map +1 -1
- package/dist/esm/lib/event-streams.d.ts +3 -3
- package/dist/esm/lib/event-streams.d.ts.map +1 -1
- package/dist/esm/lib/event-streams.js.map +1 -1
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/lib/url.js +1 -1
- package/dist/esm/lib/url.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/mcp-server.js.map +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +1 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +1 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/infiniteretention.d.ts +25 -0
- package/dist/esm/models/components/infiniteretention.d.ts.map +1 -0
- package/dist/esm/models/components/infiniteretention.js +27 -0
- package/dist/esm/models/components/infiniteretention.js.map +1 -0
- package/dist/esm/models/components/metric.d.ts +15 -15
- package/dist/esm/models/components/metric.d.ts.map +1 -1
- package/dist/esm/models/components/metric.js +15 -17
- package/dist/esm/models/components/metric.js.map +1 -1
- package/dist/esm/models/components/retentionpolicy.d.ts +37 -6
- package/dist/esm/models/components/retentionpolicy.d.ts.map +1 -1
- package/dist/esm/models/components/retentionpolicy.js +33 -2
- package/dist/esm/models/components/retentionpolicy.js.map +1 -1
- package/dist/esm/models/errors/index.d.ts +1 -0
- package/dist/esm/models/errors/index.d.ts.map +1 -1
- package/dist/esm/models/errors/index.js +1 -0
- package/dist/esm/models/errors/index.js.map +1 -1
- package/dist/esm/models/operations/read.d.ts +20 -10
- package/dist/esm/models/operations/read.d.ts.map +1 -1
- package/dist/esm/models/operations/read.js +7 -3
- package/dist/esm/models/operations/read.js.map +1 -1
- package/docs/sdks/records/README.md +2 -8
- package/examples/accessTokensListAccessTokens.example.ts +2 -2
- package/examples/package-lock.json +3 -3
- package/jsr.json +1 -1
- package/package.json +3 -3
- package/src/funcs/basinsListBasins.ts +3 -0
- package/src/funcs/recordsRead.ts +1 -0
- package/src/funcs/streamsListStreams.ts +3 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/event-streams.ts +6 -8
- package/src/lib/security.ts +4 -1
- package/src/lib/url.ts +1 -1
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/components/index.ts +1 -0
- package/src/models/components/infiniteretention.ts +58 -0
- package/src/models/components/metric.ts +28 -25
- package/src/models/components/retentionpolicy.ts +68 -6
- package/src/models/errors/index.ts +1 -0
- package/src/models/operations/read.ts +32 -18
|
@@ -30,30 +30,39 @@ export type ReadRequest = {
|
|
|
30
30
|
*/
|
|
31
31
|
tailOffset?: number | undefined;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Start reading from the tail if the requested position is beyond it.
|
|
34
34
|
*
|
|
35
35
|
* @remarks
|
|
36
|
-
*
|
|
36
|
+
* Otherwise, a `416 Range Not Satisfiable` response is returned.
|
|
37
|
+
*/
|
|
38
|
+
clamp?: boolean | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Record count limit.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* Non-streaming reads are capped by the default limit of 1000 records.
|
|
37
44
|
*/
|
|
38
45
|
count?: number | undefined;
|
|
39
46
|
/**
|
|
40
|
-
*
|
|
47
|
+
* Metered bytes limit.
|
|
41
48
|
*
|
|
42
49
|
* @remarks
|
|
43
|
-
*
|
|
50
|
+
* Non-streaming reads are capped by the default limit of 1 MiB.
|
|
44
51
|
*/
|
|
45
52
|
bytes?: number | undefined;
|
|
46
53
|
/**
|
|
47
54
|
* Exclusive timestamp to read until.
|
|
48
|
-
*
|
|
49
|
-
* @remarks
|
|
50
|
-
* If this is provided, tailing will be disabled.
|
|
51
55
|
*/
|
|
52
56
|
until?: number | undefined;
|
|
53
57
|
/**
|
|
54
|
-
*
|
|
58
|
+
* Duration in seconds to wait for new records.
|
|
59
|
+
*
|
|
60
|
+
* @remarks
|
|
61
|
+
* The default duration is 0 if there is a bound on `count`, `bytes`, or `until`, and otherwise infinite.
|
|
62
|
+
* Non-streaming reads are always bounded on `count` and `bytes`, so you can achieve long poll semantics by specifying a non-zero duration up to 60 seconds.
|
|
63
|
+
* In the context of an SSE or S2S streaming read, the duration will bound how much time can elapse between records throughout the lifetime of the session.
|
|
55
64
|
*/
|
|
56
|
-
|
|
65
|
+
wait?: number | undefined;
|
|
57
66
|
/**
|
|
58
67
|
* Basin name for basin-specific endpoints
|
|
59
68
|
*/
|
|
@@ -69,10 +78,11 @@ export type ReadRequest$Outbound = {
|
|
|
69
78
|
seq_num?: number | undefined;
|
|
70
79
|
timestamp?: number | undefined;
|
|
71
80
|
tail_offset?: number | undefined;
|
|
81
|
+
clamp?: boolean | undefined;
|
|
72
82
|
count?: number | undefined;
|
|
73
83
|
bytes?: number | undefined;
|
|
74
84
|
until?: number | undefined;
|
|
75
|
-
|
|
85
|
+
wait?: number | undefined;
|
|
76
86
|
"s2-basin": string;
|
|
77
87
|
};
|
|
78
88
|
/** @internal */
|
|
@@ -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,8CAKjB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC3C;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,
|
|
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,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,UAAU,EACZ,YAAY,CAC+C,CAAC;AAE9D;;;GAGG;AACH,yBAAiB,aAAa,CAAC;IAC7B,4DAA4D;IACrD,MAAM,aAAa,gDAA6B,CAAC;IACxD,6DAA6D;IACtD,MAAM,cAAc,sEAA8B,CAAC;IAC1D,uDAAuD;IACvD,KAAY,QAAQ,GAAG,qBAAqB,CAAC;CAC9C;AAED,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAErE;AAED,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAMnD"}
|
|
@@ -19,10 +19,11 @@ export const ReadRequest$inboundSchema = z.object({
|
|
|
19
19
|
seq_num: z.number().int().optional(),
|
|
20
20
|
timestamp: z.number().int().optional(),
|
|
21
21
|
tail_offset: z.number().int().optional(),
|
|
22
|
+
clamp: z.boolean().optional(),
|
|
22
23
|
count: z.number().int().optional(),
|
|
23
24
|
bytes: z.number().int().optional(),
|
|
24
25
|
until: z.number().int().optional(),
|
|
25
|
-
|
|
26
|
+
wait: z.number().int().optional(),
|
|
26
27
|
"s2-basin": z.string(),
|
|
27
28
|
}).transform((v) => {
|
|
28
29
|
return remap$(v, {
|
|
@@ -39,10 +40,11 @@ export const ReadRequest$outboundSchema = z.object({
|
|
|
39
40
|
seqNum: z.number().int().optional(),
|
|
40
41
|
timestamp: z.number().int().optional(),
|
|
41
42
|
tailOffset: z.number().int().optional(),
|
|
43
|
+
clamp: z.boolean().optional(),
|
|
42
44
|
count: z.number().int().optional(),
|
|
43
45
|
bytes: z.number().int().optional(),
|
|
44
46
|
until: z.number().int().optional(),
|
|
45
|
-
|
|
47
|
+
wait: z.number().int().optional(),
|
|
46
48
|
s2Basin: z.string(),
|
|
47
49
|
}).transform((v) => {
|
|
48
50
|
return remap$(v, {
|
|
@@ -72,7 +74,9 @@ export function readRequestFromJSON(jsonString) {
|
|
|
72
74
|
/** @internal */
|
|
73
75
|
export const ReadResponse$inboundSchema = z.union([
|
|
74
76
|
components.ReadBatch$inboundSchema,
|
|
75
|
-
z
|
|
77
|
+
z
|
|
78
|
+
.instanceof((ReadableStream))
|
|
79
|
+
.transform(stream => {
|
|
76
80
|
return new EventStream(stream, rawEvent => {
|
|
77
81
|
if (rawEvent.data === "[DONE]")
|
|
78
82
|
return { done: true };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../../src/models/operations/read.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAGrD,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B;;OAEG;IACH,iCAAiC;CACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../../src/models/operations/read.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAGrD,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B;;OAEG;IACH,iCAAiC;CACzB,CAAC;AAuEX,gBAAgB;AAChB,MAAM,CAAC,MAAM,yBAAyB,GAIlC,CAAC,CAAC,MAAM,CAAC;IACX,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,WAAW,EAAE,UAA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AAC,CAAC,CAAC,CAAC,EACtD,0CAA0C,CAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -31,10 +31,7 @@ async function run() {
|
|
|
31
31
|
s2Basin: "<value>",
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
// Handle the event
|
|
36
|
-
console.log(event);
|
|
37
|
-
}
|
|
34
|
+
console.log(result);
|
|
38
35
|
}
|
|
39
36
|
|
|
40
37
|
run();
|
|
@@ -61,10 +58,7 @@ async function run() {
|
|
|
61
58
|
});
|
|
62
59
|
if (res.ok) {
|
|
63
60
|
const { value: result } = res;
|
|
64
|
-
|
|
65
|
-
// Handle the event
|
|
66
|
-
console.log(event);
|
|
67
|
-
}
|
|
61
|
+
console.log(result);
|
|
68
62
|
} else {
|
|
69
63
|
console.log("recordsRead failed:", res.error);
|
|
70
64
|
}
|
|
@@ -8,7 +8,7 @@ dotenv.config();
|
|
|
8
8
|
* Example usage of the @s2-dev/streamstore SDK
|
|
9
9
|
*
|
|
10
10
|
* To run this example from the examples directory:
|
|
11
|
-
* npm run build && npx tsx accessTokensListAccessTokens.ts
|
|
11
|
+
* npm run build && npx tsx accessTokensListAccessTokens.example.ts
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { S2 } from "@s2-dev/streamstore";
|
|
@@ -18,7 +18,7 @@ const s2 = new S2({
|
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
async function main() {
|
|
21
|
-
const result = await s2.listAccessTokens({});
|
|
21
|
+
const result = await s2.accessTokens.listAccessTokens({});
|
|
22
22
|
|
|
23
23
|
console.log(result);
|
|
24
24
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"..": {
|
|
20
20
|
"name": "@s2-dev/streamstore",
|
|
21
|
-
"version": "0.15.
|
|
21
|
+
"version": "0.15.12",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"jsonpath-rfc9535": "1.1.0",
|
|
24
24
|
"uuid": "^9.0.1",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"express": "^4.21.2",
|
|
41
41
|
"globals": "^15.14.0",
|
|
42
42
|
"tshy": "^2.0.0",
|
|
43
|
-
"typescript": "
|
|
44
|
-
"typescript-eslint": "^8.
|
|
43
|
+
"typescript": "~5.8.3",
|
|
44
|
+
"typescript-eslint": "^8.26.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@modelcontextprotocol/sdk": ">=1.5.0 <1.10.0"
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@s2-dev/streamstore",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.12",
|
|
4
4
|
"author": "Speakeasy",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"express": "^4.21.2",
|
|
54
54
|
"globals": "^15.14.0",
|
|
55
55
|
"tshy": "^2.0.0",
|
|
56
|
-
"typescript": "
|
|
57
|
-
"typescript-eslint": "^8.
|
|
56
|
+
"typescript": "~5.8.3",
|
|
57
|
+
"typescript-eslint": "^8.26.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"jsonpath-rfc9535": "1.1.0",
|
package/src/funcs/recordsRead.ts
CHANGED
package/src/lib/config.ts
CHANGED
|
@@ -58,8 +58,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
58
58
|
export const SDK_METADATA = {
|
|
59
59
|
language: "typescript",
|
|
60
60
|
openapiDocVersion: "1.0.0",
|
|
61
|
-
sdkVersion: "0.15.
|
|
62
|
-
genVersion: "2.
|
|
61
|
+
sdkVersion: "0.15.12",
|
|
62
|
+
genVersion: "2.716.10",
|
|
63
63
|
userAgent:
|
|
64
|
-
"speakeasy-sdk/typescript 0.15.
|
|
64
|
+
"speakeasy-sdk/typescript 0.15.12 2.716.10 1.0.0 @s2-dev/streamstore",
|
|
65
65
|
} as const;
|
package/src/lib/event-streams.ts
CHANGED
|
@@ -2,19 +2,18 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
export type
|
|
5
|
+
export type SseMessage<T> = {
|
|
6
6
|
data?: T | undefined;
|
|
7
7
|
event?: string | undefined;
|
|
8
8
|
id?: string | undefined;
|
|
9
9
|
retry?: number | undefined;
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
export class EventStream<T extends ServerEvent<unknown>>
|
|
11
|
+
export class EventStream<T extends SseMessage<unknown>>
|
|
13
12
|
extends ReadableStream<T>
|
|
14
13
|
{
|
|
15
14
|
constructor(
|
|
16
15
|
responseBody: ReadableStream<Uint8Array>,
|
|
17
|
-
parse: (x:
|
|
16
|
+
parse: (x: SseMessage<string>) => IteratorResult<T, undefined>,
|
|
18
17
|
) {
|
|
19
18
|
const upstream = responseBody.getReader();
|
|
20
19
|
let buffer: Uint8Array = new Uint8Array();
|
|
@@ -107,15 +106,14 @@ function findBoundary(
|
|
|
107
106
|
}
|
|
108
107
|
return null;
|
|
109
108
|
}
|
|
110
|
-
|
|
111
|
-
function parseMessage<T extends ServerEvent<unknown>>(
|
|
109
|
+
function parseMessage<T extends SseMessage<unknown>>(
|
|
112
110
|
chunk: Uint8Array,
|
|
113
|
-
parse: (x:
|
|
111
|
+
parse: (x: SseMessage<string>) => IteratorResult<T, undefined>,
|
|
114
112
|
) {
|
|
115
113
|
const text = new TextDecoder().decode(chunk);
|
|
116
114
|
const lines = text.split(/\r\n|\r|\n/);
|
|
117
115
|
const dataLines: string[] = [];
|
|
118
|
-
const ret:
|
|
116
|
+
const ret: SseMessage<string> = {};
|
|
119
117
|
let ignore = true;
|
|
120
118
|
for (const line of lines) {
|
|
121
119
|
if (!line || line.startsWith(":")) continue;
|
package/src/lib/security.ts
CHANGED
|
@@ -84,7 +84,10 @@ type SecurityInputOAuth2 = {
|
|
|
84
84
|
type SecurityInputOAuth2ClientCredentials = {
|
|
85
85
|
type: "oauth2:client_credentials";
|
|
86
86
|
value:
|
|
87
|
-
| {
|
|
87
|
+
| {
|
|
88
|
+
clientID?: string | undefined;
|
|
89
|
+
clientSecret?: string | undefined;
|
|
90
|
+
}
|
|
88
91
|
| null
|
|
89
92
|
| string
|
|
90
93
|
| undefined;
|
package/src/lib/url.ts
CHANGED
|
@@ -10,7 +10,7 @@ export function pathToFunc(
|
|
|
10
10
|
pathPattern: string,
|
|
11
11
|
options?: { charEncoding?: "percent" | "none" },
|
|
12
12
|
): (params?: Params) => string {
|
|
13
|
-
const paramRE = /\{([a-zA-Z0-9_]
|
|
13
|
+
const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;
|
|
14
14
|
|
|
15
15
|
return function buildURLPath(params: Record<string, unknown> = {}): string {
|
|
16
16
|
return pathPattern.replace(paramRE, function (_, placeholder) {
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -21,6 +21,7 @@ export * from "./createstreamrequest.js";
|
|
|
21
21
|
export * from "./deleteonemptyconfig.js";
|
|
22
22
|
export * from "./deleteonemptyreconfiguration.js";
|
|
23
23
|
export * from "./gauge.js";
|
|
24
|
+
export * from "./infiniteretention.js";
|
|
24
25
|
export * from "./issueaccesstokenresponse.js";
|
|
25
26
|
export * from "./label.js";
|
|
26
27
|
export * from "./listaccesstokensresponse.js";
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
|
|
10
|
+
export type InfiniteRetention = {};
|
|
11
|
+
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const InfiniteRetention$inboundSchema: z.ZodType<
|
|
14
|
+
InfiniteRetention,
|
|
15
|
+
z.ZodTypeDef,
|
|
16
|
+
unknown
|
|
17
|
+
> = z.object({});
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export type InfiniteRetention$Outbound = {};
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const InfiniteRetention$outboundSchema: z.ZodType<
|
|
24
|
+
InfiniteRetention$Outbound,
|
|
25
|
+
z.ZodTypeDef,
|
|
26
|
+
InfiniteRetention
|
|
27
|
+
> = z.object({});
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
32
|
+
*/
|
|
33
|
+
export namespace InfiniteRetention$ {
|
|
34
|
+
/** @deprecated use `InfiniteRetention$inboundSchema` instead. */
|
|
35
|
+
export const inboundSchema = InfiniteRetention$inboundSchema;
|
|
36
|
+
/** @deprecated use `InfiniteRetention$outboundSchema` instead. */
|
|
37
|
+
export const outboundSchema = InfiniteRetention$outboundSchema;
|
|
38
|
+
/** @deprecated use `InfiniteRetention$Outbound` instead. */
|
|
39
|
+
export type Outbound = InfiniteRetention$Outbound;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function infiniteRetentionToJSON(
|
|
43
|
+
infiniteRetention: InfiniteRetention,
|
|
44
|
+
): string {
|
|
45
|
+
return JSON.stringify(
|
|
46
|
+
InfiniteRetention$outboundSchema.parse(infiniteRetention),
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function infiniteRetentionFromJSON(
|
|
51
|
+
jsonString: string,
|
|
52
|
+
): SafeParseResult<InfiniteRetention, SDKValidationError> {
|
|
53
|
+
return safeParse(
|
|
54
|
+
jsonString,
|
|
55
|
+
(x) => InfiniteRetention$inboundSchema.parse(JSON.parse(x)),
|
|
56
|
+
`Failed to parse 'InfiniteRetention' from JSON`,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -51,7 +51,7 @@ export type Three = {
|
|
|
51
51
|
* @remarks
|
|
52
52
|
* bucket.
|
|
53
53
|
*/
|
|
54
|
-
export type
|
|
54
|
+
export type Metric2 = {
|
|
55
55
|
accumulation: Accumulation;
|
|
56
56
|
};
|
|
57
57
|
|
|
@@ -62,7 +62,7 @@ export type Metric1 = {
|
|
|
62
62
|
scalar: Scalar;
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
export type Metric = Metric1 |
|
|
65
|
+
export type Metric = Metric1 | Metric2 | Three | Four;
|
|
66
66
|
|
|
67
67
|
/** @internal */
|
|
68
68
|
export const Four$inboundSchema: z.ZodType<Four, z.ZodTypeDef, unknown> = z
|
|
@@ -156,46 +156,49 @@ export function threeFromJSON(
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
/** @internal */
|
|
159
|
-
export const
|
|
160
|
-
.object({
|
|
159
|
+
export const Metric2$inboundSchema: z.ZodType<Metric2, z.ZodTypeDef, unknown> =
|
|
160
|
+
z.object({
|
|
161
161
|
accumulation: Accumulation$inboundSchema,
|
|
162
162
|
});
|
|
163
163
|
|
|
164
164
|
/** @internal */
|
|
165
|
-
export type
|
|
165
|
+
export type Metric2$Outbound = {
|
|
166
166
|
accumulation: Accumulation$Outbound;
|
|
167
167
|
};
|
|
168
168
|
|
|
169
169
|
/** @internal */
|
|
170
|
-
export const
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
170
|
+
export const Metric2$outboundSchema: z.ZodType<
|
|
171
|
+
Metric2$Outbound,
|
|
172
|
+
z.ZodTypeDef,
|
|
173
|
+
Metric2
|
|
174
|
+
> = z.object({
|
|
175
|
+
accumulation: Accumulation$outboundSchema,
|
|
176
|
+
});
|
|
174
177
|
|
|
175
178
|
/**
|
|
176
179
|
* @internal
|
|
177
180
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
178
181
|
*/
|
|
179
|
-
export namespace
|
|
180
|
-
/** @deprecated use `
|
|
181
|
-
export const inboundSchema =
|
|
182
|
-
/** @deprecated use `
|
|
183
|
-
export const outboundSchema =
|
|
184
|
-
/** @deprecated use `
|
|
185
|
-
export type Outbound =
|
|
182
|
+
export namespace Metric2$ {
|
|
183
|
+
/** @deprecated use `Metric2$inboundSchema` instead. */
|
|
184
|
+
export const inboundSchema = Metric2$inboundSchema;
|
|
185
|
+
/** @deprecated use `Metric2$outboundSchema` instead. */
|
|
186
|
+
export const outboundSchema = Metric2$outboundSchema;
|
|
187
|
+
/** @deprecated use `Metric2$Outbound` instead. */
|
|
188
|
+
export type Outbound = Metric2$Outbound;
|
|
186
189
|
}
|
|
187
190
|
|
|
188
|
-
export function
|
|
189
|
-
return JSON.stringify(
|
|
191
|
+
export function metric2ToJSON(metric2: Metric2): string {
|
|
192
|
+
return JSON.stringify(Metric2$outboundSchema.parse(metric2));
|
|
190
193
|
}
|
|
191
194
|
|
|
192
|
-
export function
|
|
195
|
+
export function metric2FromJSON(
|
|
193
196
|
jsonString: string,
|
|
194
|
-
): SafeParseResult<
|
|
197
|
+
): SafeParseResult<Metric2, SDKValidationError> {
|
|
195
198
|
return safeParse(
|
|
196
199
|
jsonString,
|
|
197
|
-
(x) =>
|
|
198
|
-
`Failed to parse '
|
|
200
|
+
(x) => Metric2$inboundSchema.parse(JSON.parse(x)),
|
|
201
|
+
`Failed to parse 'Metric2' from JSON`,
|
|
199
202
|
);
|
|
200
203
|
}
|
|
201
204
|
|
|
@@ -250,7 +253,7 @@ export function metric1FromJSON(
|
|
|
250
253
|
export const Metric$inboundSchema: z.ZodType<Metric, z.ZodTypeDef, unknown> = z
|
|
251
254
|
.union([
|
|
252
255
|
z.lazy(() => Metric1$inboundSchema),
|
|
253
|
-
z.lazy(() =>
|
|
256
|
+
z.lazy(() => Metric2$inboundSchema),
|
|
254
257
|
z.lazy(() => Three$inboundSchema),
|
|
255
258
|
z.lazy(() => Four$inboundSchema),
|
|
256
259
|
]);
|
|
@@ -258,7 +261,7 @@ export const Metric$inboundSchema: z.ZodType<Metric, z.ZodTypeDef, unknown> = z
|
|
|
258
261
|
/** @internal */
|
|
259
262
|
export type Metric$Outbound =
|
|
260
263
|
| Metric1$Outbound
|
|
261
|
-
|
|
|
264
|
+
| Metric2$Outbound
|
|
262
265
|
| Three$Outbound
|
|
263
266
|
| Four$Outbound;
|
|
264
267
|
|
|
@@ -269,7 +272,7 @@ export const Metric$outboundSchema: z.ZodType<
|
|
|
269
272
|
Metric
|
|
270
273
|
> = z.union([
|
|
271
274
|
z.lazy(() => Metric1$outboundSchema),
|
|
272
|
-
z.lazy(() =>
|
|
275
|
+
z.lazy(() => Metric2$outboundSchema),
|
|
273
276
|
z.lazy(() => Three$outboundSchema),
|
|
274
277
|
z.lazy(() => Four$outboundSchema),
|
|
275
278
|
]);
|
|
@@ -6,24 +6,83 @@ import * as z from "zod";
|
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
InfiniteRetention,
|
|
11
|
+
InfiniteRetention$inboundSchema,
|
|
12
|
+
InfiniteRetention$Outbound,
|
|
13
|
+
InfiniteRetention$outboundSchema,
|
|
14
|
+
} from "./infiniteretention.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Retain records unless explicitly trimmed.
|
|
18
|
+
*/
|
|
19
|
+
export type Two = {
|
|
20
|
+
infinite: InfiniteRetention;
|
|
21
|
+
};
|
|
9
22
|
|
|
10
23
|
/**
|
|
11
24
|
* Age in seconds for automatic trimming of records older than this threshold.
|
|
12
25
|
*
|
|
13
26
|
* @remarks
|
|
14
|
-
*
|
|
27
|
+
* This must be set to a value greater than 0 seconds.
|
|
28
|
+
* (While S2 is in public preview, this is capped at 28 days. Let us know if you'd like the cap removed.)
|
|
15
29
|
*/
|
|
16
30
|
export type One = {
|
|
17
31
|
/**
|
|
18
32
|
* Age in seconds for automatic trimming of records older than this threshold.
|
|
19
33
|
*
|
|
20
34
|
* @remarks
|
|
21
|
-
*
|
|
35
|
+
* This must be set to a value greater than 0 seconds.
|
|
36
|
+
* (While S2 is in public preview, this is capped at 28 days. Let us know if you'd like the cap removed.)
|
|
22
37
|
*/
|
|
23
38
|
age: number;
|
|
24
39
|
};
|
|
25
40
|
|
|
26
|
-
export type RetentionPolicy = One;
|
|
41
|
+
export type RetentionPolicy = One | Two;
|
|
42
|
+
|
|
43
|
+
/** @internal */
|
|
44
|
+
export const Two$inboundSchema: z.ZodType<Two, z.ZodTypeDef, unknown> = z
|
|
45
|
+
.object({
|
|
46
|
+
infinite: InfiniteRetention$inboundSchema,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
/** @internal */
|
|
50
|
+
export type Two$Outbound = {
|
|
51
|
+
infinite: InfiniteRetention$Outbound;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** @internal */
|
|
55
|
+
export const Two$outboundSchema: z.ZodType<Two$Outbound, z.ZodTypeDef, Two> = z
|
|
56
|
+
.object({
|
|
57
|
+
infinite: InfiniteRetention$outboundSchema,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @internal
|
|
62
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
63
|
+
*/
|
|
64
|
+
export namespace Two$ {
|
|
65
|
+
/** @deprecated use `Two$inboundSchema` instead. */
|
|
66
|
+
export const inboundSchema = Two$inboundSchema;
|
|
67
|
+
/** @deprecated use `Two$outboundSchema` instead. */
|
|
68
|
+
export const outboundSchema = Two$outboundSchema;
|
|
69
|
+
/** @deprecated use `Two$Outbound` instead. */
|
|
70
|
+
export type Outbound = Two$Outbound;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function twoToJSON(two: Two): string {
|
|
74
|
+
return JSON.stringify(Two$outboundSchema.parse(two));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function twoFromJSON(
|
|
78
|
+
jsonString: string,
|
|
79
|
+
): SafeParseResult<Two, SDKValidationError> {
|
|
80
|
+
return safeParse(
|
|
81
|
+
jsonString,
|
|
82
|
+
(x) => Two$inboundSchema.parse(JSON.parse(x)),
|
|
83
|
+
`Failed to parse 'Two' from JSON`,
|
|
84
|
+
);
|
|
85
|
+
}
|
|
27
86
|
|
|
28
87
|
/** @internal */
|
|
29
88
|
export const One$inboundSchema: z.ZodType<One, z.ZodTypeDef, unknown> = z
|
|
@@ -74,17 +133,20 @@ export const RetentionPolicy$inboundSchema: z.ZodType<
|
|
|
74
133
|
RetentionPolicy,
|
|
75
134
|
z.ZodTypeDef,
|
|
76
135
|
unknown
|
|
77
|
-
> = z.lazy(() => One$inboundSchema);
|
|
136
|
+
> = z.union([z.lazy(() => One$inboundSchema), z.lazy(() => Two$inboundSchema)]);
|
|
78
137
|
|
|
79
138
|
/** @internal */
|
|
80
|
-
export type RetentionPolicy$Outbound = One$Outbound;
|
|
139
|
+
export type RetentionPolicy$Outbound = One$Outbound | Two$Outbound;
|
|
81
140
|
|
|
82
141
|
/** @internal */
|
|
83
142
|
export const RetentionPolicy$outboundSchema: z.ZodType<
|
|
84
143
|
RetentionPolicy$Outbound,
|
|
85
144
|
z.ZodTypeDef,
|
|
86
145
|
RetentionPolicy
|
|
87
|
-
> = z.
|
|
146
|
+
> = z.union([
|
|
147
|
+
z.lazy(() => One$outboundSchema),
|
|
148
|
+
z.lazy(() => Two$outboundSchema),
|
|
149
|
+
]);
|
|
88
150
|
|
|
89
151
|
/**
|
|
90
152
|
* @internal
|
|
@@ -7,5 +7,6 @@ export * from "./appendconditionfailed.js";
|
|
|
7
7
|
export * from "./errorresponse.js";
|
|
8
8
|
export * from "./httpclienterrors.js";
|
|
9
9
|
export * from "./responsevalidationerror.js";
|
|
10
|
+
export * from "./s2error.js";
|
|
10
11
|
export * from "./sdkvalidationerror.js";
|
|
11
12
|
export * from "./tailresponse.js";
|