@steamsets/client-ts 0.34.3 → 0.34.5
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 +10 -1
- package/funcs/accountSubscribe.d.ts +15 -0
- package/funcs/accountSubscribe.d.ts.map +1 -0
- package/funcs/accountSubscribe.js +136 -0
- package/funcs/accountSubscribe.js.map +1 -0
- package/funcs/siteSubscribe.d.ts +20 -0
- package/funcs/siteSubscribe.d.ts.map +1 -0
- package/funcs/siteSubscribe.js +128 -0
- package/funcs/siteSubscribe.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/models/components/accountsubscribeheartbeat.d.ts +10 -0
- package/models/components/accountsubscribeheartbeat.d.ts.map +1 -0
- package/models/components/accountsubscribeheartbeat.js +50 -0
- package/models/components/accountsubscribeheartbeat.js.map +1 -0
- package/models/components/eventaccountupdateddata.d.ts +11 -0
- package/models/components/eventaccountupdateddata.d.ts.map +1 -0
- package/models/components/eventaccountupdateddata.js +51 -0
- package/models/components/eventaccountupdateddata.js.map +1 -0
- package/models/components/eventaccountviewtickdata.d.ts +11 -0
- package/models/components/eventaccountviewtickdata.d.ts.map +1 -0
- package/models/components/eventaccountviewtickdata.js +51 -0
- package/models/components/eventaccountviewtickdata.js.map +1 -0
- package/models/components/index.d.ts +5 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +5 -0
- package/models/components/index.js.map +1 -1
- package/models/components/maintenancechanged.d.ts +11 -0
- package/models/components/maintenancechanged.d.ts.map +1 -0
- package/models/components/maintenancechanged.js +51 -0
- package/models/components/maintenancechanged.js.map +1 -0
- package/models/components/sitesubscribeheartbeat.d.ts +10 -0
- package/models/components/sitesubscribeheartbeat.d.ts.map +1 -0
- package/models/components/sitesubscribeheartbeat.js +50 -0
- package/models/components/sitesubscribeheartbeat.js.map +1 -0
- package/models/operations/accountsubscribe.d.ts +90 -0
- package/models/operations/accountsubscribe.d.ts.map +1 -0
- package/models/operations/accountsubscribe.js +146 -0
- package/models/operations/accountsubscribe.js.map +1 -0
- package/models/operations/badgepricingsubscribe.d.ts +5 -5
- package/models/operations/badgepricingsubscribe.d.ts.map +1 -1
- package/models/operations/badgepricingsubscribe.js +7 -7
- package/models/operations/badgepricingsubscribe.js.map +1 -1
- package/models/operations/index.d.ts +2 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/sitesubscribe.d.ts +63 -0
- package/models/operations/sitesubscribe.d.ts.map +1 -0
- package/models/operations/sitesubscribe.js +119 -0
- package/models/operations/sitesubscribe.js.map +1 -0
- package/package.json +1 -1
- package/sdk/account.d.ts +4 -0
- package/sdk/account.d.ts.map +1 -1
- package/sdk/account.js +7 -0
- package/sdk/account.js.map +1 -1
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/sdk/site.d.ts +13 -0
- package/sdk/site.d.ts.map +1 -0
- package/sdk/site.js +21 -0
- package/sdk/site.js.map +1 -0
- package/src/funcs/accountSubscribe.ts +190 -0
- package/src/funcs/siteSubscribe.ts +168 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/accountsubscribeheartbeat.ts +31 -0
- package/src/models/components/eventaccountupdateddata.ts +33 -0
- package/src/models/components/eventaccountviewtickdata.ts +33 -0
- package/src/models/components/index.ts +5 -0
- package/src/models/components/maintenancechanged.ts +35 -0
- package/src/models/components/sitesubscribeheartbeat.ts +31 -0
- package/src/models/operations/accountsubscribe.ts +251 -0
- package/src/models/operations/badgepricingsubscribe.ts +11 -11
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/sitesubscribe.ts +191 -0
- package/src/sdk/account.ts +15 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/site.ts +24 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { EventStream } from "../../lib/event-streams.js";
|
|
7
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
8
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import * as components from "../components/index.js";
|
|
11
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
|
+
|
|
13
|
+
export type AccountSubscribeRequest = {
|
|
14
|
+
/**
|
|
15
|
+
* Account ID to subscribe to
|
|
16
|
+
*/
|
|
17
|
+
accountId: number;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type EventHeartbeat = {
|
|
21
|
+
data: components.AccountSubscribeHeartbeat;
|
|
22
|
+
/**
|
|
23
|
+
* The event name.
|
|
24
|
+
*/
|
|
25
|
+
event: "heartbeat";
|
|
26
|
+
/**
|
|
27
|
+
* The event ID.
|
|
28
|
+
*/
|
|
29
|
+
id?: string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* The retry time in milliseconds.
|
|
32
|
+
*/
|
|
33
|
+
retry?: number | undefined;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type EventAccountViewTick = {
|
|
37
|
+
data: components.EventAccountViewTickData;
|
|
38
|
+
/**
|
|
39
|
+
* The event name.
|
|
40
|
+
*/
|
|
41
|
+
event: "account-view-tick";
|
|
42
|
+
/**
|
|
43
|
+
* The event ID.
|
|
44
|
+
*/
|
|
45
|
+
id?: string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* The retry time in milliseconds.
|
|
48
|
+
*/
|
|
49
|
+
retry?: number | undefined;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type EventAccountUpdated = {
|
|
53
|
+
data: components.EventAccountUpdatedData;
|
|
54
|
+
/**
|
|
55
|
+
* The event name.
|
|
56
|
+
*/
|
|
57
|
+
event: "account-updated";
|
|
58
|
+
/**
|
|
59
|
+
* The event ID.
|
|
60
|
+
*/
|
|
61
|
+
id?: string | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* The retry time in milliseconds.
|
|
64
|
+
*/
|
|
65
|
+
retry?: number | undefined;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Each oneOf object in the array represents one possible Server Sent Events (SSE) message, serialized as UTF-8 text according to the SSE specification.
|
|
70
|
+
*/
|
|
71
|
+
export type AccountSubscribeServerSentEvents =
|
|
72
|
+
| EventAccountUpdated
|
|
73
|
+
| EventAccountViewTick
|
|
74
|
+
| EventHeartbeat;
|
|
75
|
+
|
|
76
|
+
export type AccountSubscribeResponse = {
|
|
77
|
+
httpMeta: components.HTTPMetadata;
|
|
78
|
+
/**
|
|
79
|
+
* OK
|
|
80
|
+
*/
|
|
81
|
+
serverSentEvents?:
|
|
82
|
+
| EventStream<EventAccountUpdated | EventAccountViewTick | EventHeartbeat>
|
|
83
|
+
| undefined;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** @internal */
|
|
87
|
+
export type AccountSubscribeRequest$Outbound = {
|
|
88
|
+
accountId: number;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/** @internal */
|
|
92
|
+
export const AccountSubscribeRequest$outboundSchema: z.ZodType<
|
|
93
|
+
AccountSubscribeRequest$Outbound,
|
|
94
|
+
z.ZodTypeDef,
|
|
95
|
+
AccountSubscribeRequest
|
|
96
|
+
> = z.object({
|
|
97
|
+
accountId: z.number().int(),
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
export function accountSubscribeRequestToJSON(
|
|
101
|
+
accountSubscribeRequest: AccountSubscribeRequest,
|
|
102
|
+
): string {
|
|
103
|
+
return JSON.stringify(
|
|
104
|
+
AccountSubscribeRequest$outboundSchema.parse(accountSubscribeRequest),
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** @internal */
|
|
109
|
+
export const EventHeartbeat$inboundSchema: z.ZodType<
|
|
110
|
+
EventHeartbeat,
|
|
111
|
+
z.ZodTypeDef,
|
|
112
|
+
unknown
|
|
113
|
+
> = z.object({
|
|
114
|
+
data: z.string().transform((v, ctx) => {
|
|
115
|
+
try {
|
|
116
|
+
return JSON.parse(v);
|
|
117
|
+
} catch (err) {
|
|
118
|
+
ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
|
|
119
|
+
return z.NEVER;
|
|
120
|
+
}
|
|
121
|
+
}).pipe(components.AccountSubscribeHeartbeat$inboundSchema),
|
|
122
|
+
event: z.literal("heartbeat"),
|
|
123
|
+
id: z.string().optional(),
|
|
124
|
+
retry: z.number().int().optional(),
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
export function eventHeartbeatFromJSON(
|
|
128
|
+
jsonString: string,
|
|
129
|
+
): SafeParseResult<EventHeartbeat, SDKValidationError> {
|
|
130
|
+
return safeParse(
|
|
131
|
+
jsonString,
|
|
132
|
+
(x) => EventHeartbeat$inboundSchema.parse(JSON.parse(x)),
|
|
133
|
+
`Failed to parse 'EventHeartbeat' from JSON`,
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** @internal */
|
|
138
|
+
export const EventAccountViewTick$inboundSchema: z.ZodType<
|
|
139
|
+
EventAccountViewTick,
|
|
140
|
+
z.ZodTypeDef,
|
|
141
|
+
unknown
|
|
142
|
+
> = z.object({
|
|
143
|
+
data: z.string().transform((v, ctx) => {
|
|
144
|
+
try {
|
|
145
|
+
return JSON.parse(v);
|
|
146
|
+
} catch (err) {
|
|
147
|
+
ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
|
|
148
|
+
return z.NEVER;
|
|
149
|
+
}
|
|
150
|
+
}).pipe(components.EventAccountViewTickData$inboundSchema),
|
|
151
|
+
event: z.literal("account-view-tick"),
|
|
152
|
+
id: z.string().optional(),
|
|
153
|
+
retry: z.number().int().optional(),
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
export function eventAccountViewTickFromJSON(
|
|
157
|
+
jsonString: string,
|
|
158
|
+
): SafeParseResult<EventAccountViewTick, SDKValidationError> {
|
|
159
|
+
return safeParse(
|
|
160
|
+
jsonString,
|
|
161
|
+
(x) => EventAccountViewTick$inboundSchema.parse(JSON.parse(x)),
|
|
162
|
+
`Failed to parse 'EventAccountViewTick' from JSON`,
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** @internal */
|
|
167
|
+
export const EventAccountUpdated$inboundSchema: z.ZodType<
|
|
168
|
+
EventAccountUpdated,
|
|
169
|
+
z.ZodTypeDef,
|
|
170
|
+
unknown
|
|
171
|
+
> = z.object({
|
|
172
|
+
data: z.string().transform((v, ctx) => {
|
|
173
|
+
try {
|
|
174
|
+
return JSON.parse(v);
|
|
175
|
+
} catch (err) {
|
|
176
|
+
ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
|
|
177
|
+
return z.NEVER;
|
|
178
|
+
}
|
|
179
|
+
}).pipe(components.EventAccountUpdatedData$inboundSchema),
|
|
180
|
+
event: z.literal("account-updated"),
|
|
181
|
+
id: z.string().optional(),
|
|
182
|
+
retry: z.number().int().optional(),
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
export function eventAccountUpdatedFromJSON(
|
|
186
|
+
jsonString: string,
|
|
187
|
+
): SafeParseResult<EventAccountUpdated, SDKValidationError> {
|
|
188
|
+
return safeParse(
|
|
189
|
+
jsonString,
|
|
190
|
+
(x) => EventAccountUpdated$inboundSchema.parse(JSON.parse(x)),
|
|
191
|
+
`Failed to parse 'EventAccountUpdated' from JSON`,
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** @internal */
|
|
196
|
+
export const AccountSubscribeServerSentEvents$inboundSchema: z.ZodType<
|
|
197
|
+
AccountSubscribeServerSentEvents,
|
|
198
|
+
z.ZodTypeDef,
|
|
199
|
+
unknown
|
|
200
|
+
> = z.union([
|
|
201
|
+
z.lazy(() => EventAccountUpdated$inboundSchema),
|
|
202
|
+
z.lazy(() => EventAccountViewTick$inboundSchema),
|
|
203
|
+
z.lazy(() => EventHeartbeat$inboundSchema),
|
|
204
|
+
]);
|
|
205
|
+
|
|
206
|
+
export function accountSubscribeServerSentEventsFromJSON(
|
|
207
|
+
jsonString: string,
|
|
208
|
+
): SafeParseResult<AccountSubscribeServerSentEvents, SDKValidationError> {
|
|
209
|
+
return safeParse(
|
|
210
|
+
jsonString,
|
|
211
|
+
(x) => AccountSubscribeServerSentEvents$inboundSchema.parse(JSON.parse(x)),
|
|
212
|
+
`Failed to parse 'AccountSubscribeServerSentEvents' from JSON`,
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/** @internal */
|
|
217
|
+
export const AccountSubscribeResponse$inboundSchema: z.ZodType<
|
|
218
|
+
AccountSubscribeResponse,
|
|
219
|
+
z.ZodTypeDef,
|
|
220
|
+
unknown
|
|
221
|
+
> = z.object({
|
|
222
|
+
HttpMeta: components.HTTPMetadata$inboundSchema,
|
|
223
|
+
"Server Sent Events": z.instanceof(ReadableStream<Uint8Array>)
|
|
224
|
+
.transform(stream => {
|
|
225
|
+
return new EventStream(stream, rawEvent => {
|
|
226
|
+
return {
|
|
227
|
+
done: false,
|
|
228
|
+
value: z.union([
|
|
229
|
+
z.lazy(() => EventAccountUpdated$inboundSchema),
|
|
230
|
+
z.lazy(() => EventAccountViewTick$inboundSchema),
|
|
231
|
+
z.lazy(() => EventHeartbeat$inboundSchema),
|
|
232
|
+
]).parse(rawEvent),
|
|
233
|
+
};
|
|
234
|
+
});
|
|
235
|
+
}).optional(),
|
|
236
|
+
}).transform((v) => {
|
|
237
|
+
return remap$(v, {
|
|
238
|
+
"HttpMeta": "httpMeta",
|
|
239
|
+
"Server Sent Events": "serverSentEvents",
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
export function accountSubscribeResponseFromJSON(
|
|
244
|
+
jsonString: string,
|
|
245
|
+
): SafeParseResult<AccountSubscribeResponse, SDKValidationError> {
|
|
246
|
+
return safeParse(
|
|
247
|
+
jsonString,
|
|
248
|
+
(x) => AccountSubscribeResponse$inboundSchema.parse(JSON.parse(x)),
|
|
249
|
+
`Failed to parse 'AccountSubscribeResponse' from JSON`,
|
|
250
|
+
);
|
|
251
|
+
}
|
|
@@ -26,7 +26,7 @@ export type EventMarketPriceTick = {
|
|
|
26
26
|
retry?: number | undefined;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
export type
|
|
29
|
+
export type ServerSentEventsEventHeartbeat = {
|
|
30
30
|
data: components.PricingHeartbeat;
|
|
31
31
|
/**
|
|
32
32
|
* The event name.
|
|
@@ -46,7 +46,7 @@ export type EventHeartbeat = {
|
|
|
46
46
|
* Each oneOf object in the array represents one possible Server Sent Events (SSE) message, serialized as UTF-8 text according to the SSE specification.
|
|
47
47
|
*/
|
|
48
48
|
export type BadgePricingSubscribeServerSentEvents =
|
|
49
|
-
|
|
|
49
|
+
| ServerSentEventsEventHeartbeat
|
|
50
50
|
| EventMarketPriceTick;
|
|
51
51
|
|
|
52
52
|
export type BadgePricingSubscribeResponse = {
|
|
@@ -55,7 +55,7 @@ export type BadgePricingSubscribeResponse = {
|
|
|
55
55
|
* OK
|
|
56
56
|
*/
|
|
57
57
|
serverSentEvents?:
|
|
58
|
-
| EventStream<
|
|
58
|
+
| EventStream<ServerSentEventsEventHeartbeat | EventMarketPriceTick>
|
|
59
59
|
| undefined;
|
|
60
60
|
/**
|
|
61
61
|
* Error
|
|
@@ -93,8 +93,8 @@ export function eventMarketPriceTickFromJSON(
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
/** @internal */
|
|
96
|
-
export const
|
|
97
|
-
|
|
96
|
+
export const ServerSentEventsEventHeartbeat$inboundSchema: z.ZodType<
|
|
97
|
+
ServerSentEventsEventHeartbeat,
|
|
98
98
|
z.ZodTypeDef,
|
|
99
99
|
unknown
|
|
100
100
|
> = z.object({
|
|
@@ -111,13 +111,13 @@ export const EventHeartbeat$inboundSchema: z.ZodType<
|
|
|
111
111
|
retry: z.number().int().optional(),
|
|
112
112
|
});
|
|
113
113
|
|
|
114
|
-
export function
|
|
114
|
+
export function serverSentEventsEventHeartbeatFromJSON(
|
|
115
115
|
jsonString: string,
|
|
116
|
-
): SafeParseResult<
|
|
116
|
+
): SafeParseResult<ServerSentEventsEventHeartbeat, SDKValidationError> {
|
|
117
117
|
return safeParse(
|
|
118
118
|
jsonString,
|
|
119
|
-
(x) =>
|
|
120
|
-
`Failed to parse '
|
|
119
|
+
(x) => ServerSentEventsEventHeartbeat$inboundSchema.parse(JSON.parse(x)),
|
|
120
|
+
`Failed to parse 'ServerSentEventsEventHeartbeat' from JSON`,
|
|
121
121
|
);
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -127,7 +127,7 @@ export const BadgePricingSubscribeServerSentEvents$inboundSchema: z.ZodType<
|
|
|
127
127
|
z.ZodTypeDef,
|
|
128
128
|
unknown
|
|
129
129
|
> = z.union([
|
|
130
|
-
z.lazy(() =>
|
|
130
|
+
z.lazy(() => ServerSentEventsEventHeartbeat$inboundSchema),
|
|
131
131
|
z.lazy(() => EventMarketPriceTick$inboundSchema),
|
|
132
132
|
]);
|
|
133
133
|
|
|
@@ -155,7 +155,7 @@ export const BadgePricingSubscribeResponse$inboundSchema: z.ZodType<
|
|
|
155
155
|
return {
|
|
156
156
|
done: false,
|
|
157
157
|
value: z.union([
|
|
158
|
-
z.lazy(() =>
|
|
158
|
+
z.lazy(() => ServerSentEventsEventHeartbeat$inboundSchema),
|
|
159
159
|
z.lazy(() => EventMarketPriceTick$inboundSchema),
|
|
160
160
|
]).parse(rawEvent),
|
|
161
161
|
};
|
|
@@ -34,6 +34,7 @@ export * from "./accountreconnectconnection.js";
|
|
|
34
34
|
export * from "./accountrefreshinventory.js";
|
|
35
35
|
export * from "./accountrefreshsession.js";
|
|
36
36
|
export * from "./accountsendemailverification.js";
|
|
37
|
+
export * from "./accountsubscribe.js";
|
|
37
38
|
export * from "./accountsubscribeemail.js";
|
|
38
39
|
export * from "./accountupdateconnection.js";
|
|
39
40
|
export * from "./accountupdatedeveloperapp.js";
|
|
@@ -95,6 +96,7 @@ export * from "./listglobalfeed.js";
|
|
|
95
96
|
export * from "./locationgetlocations.js";
|
|
96
97
|
export * from "./maintenancelist.js";
|
|
97
98
|
export * from "./searchgettrending.js";
|
|
99
|
+
export * from "./sitesubscribe.js";
|
|
98
100
|
export * from "./staffliststaff.js";
|
|
99
101
|
export * from "./statsgetstats.js";
|
|
100
102
|
export * from "./statssubscribe.js";
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { EventStream } from "../../lib/event-streams.js";
|
|
7
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
8
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import * as components from "../components/index.js";
|
|
11
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
|
+
|
|
13
|
+
export type EventMaintenanceChanged = {
|
|
14
|
+
data: components.MaintenanceChanged;
|
|
15
|
+
/**
|
|
16
|
+
* The event name.
|
|
17
|
+
*/
|
|
18
|
+
event: "maintenance-changed";
|
|
19
|
+
/**
|
|
20
|
+
* The event ID.
|
|
21
|
+
*/
|
|
22
|
+
id?: string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* The retry time in milliseconds.
|
|
25
|
+
*/
|
|
26
|
+
retry?: number | undefined;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type SiteSubscribeServerSentEventsEventHeartbeat = {
|
|
30
|
+
data: components.SiteSubscribeHeartbeat;
|
|
31
|
+
/**
|
|
32
|
+
* The event name.
|
|
33
|
+
*/
|
|
34
|
+
event: "heartbeat";
|
|
35
|
+
/**
|
|
36
|
+
* The event ID.
|
|
37
|
+
*/
|
|
38
|
+
id?: string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* The retry time in milliseconds.
|
|
41
|
+
*/
|
|
42
|
+
retry?: number | undefined;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Each oneOf object in the array represents one possible Server Sent Events (SSE) message, serialized as UTF-8 text according to the SSE specification.
|
|
47
|
+
*/
|
|
48
|
+
export type SiteSubscribeServerSentEvents =
|
|
49
|
+
| SiteSubscribeServerSentEventsEventHeartbeat
|
|
50
|
+
| EventMaintenanceChanged;
|
|
51
|
+
|
|
52
|
+
export type SiteSubscribeResponse = {
|
|
53
|
+
httpMeta: components.HTTPMetadata;
|
|
54
|
+
/**
|
|
55
|
+
* OK
|
|
56
|
+
*/
|
|
57
|
+
serverSentEvents?:
|
|
58
|
+
| EventStream<
|
|
59
|
+
SiteSubscribeServerSentEventsEventHeartbeat | EventMaintenanceChanged
|
|
60
|
+
>
|
|
61
|
+
| undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Error
|
|
64
|
+
*/
|
|
65
|
+
errorModel?: components.ErrorModel | undefined;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** @internal */
|
|
69
|
+
export const EventMaintenanceChanged$inboundSchema: z.ZodType<
|
|
70
|
+
EventMaintenanceChanged,
|
|
71
|
+
z.ZodTypeDef,
|
|
72
|
+
unknown
|
|
73
|
+
> = z.object({
|
|
74
|
+
data: z.string().transform((v, ctx) => {
|
|
75
|
+
try {
|
|
76
|
+
return JSON.parse(v);
|
|
77
|
+
} catch (err) {
|
|
78
|
+
ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
|
|
79
|
+
return z.NEVER;
|
|
80
|
+
}
|
|
81
|
+
}).pipe(components.MaintenanceChanged$inboundSchema),
|
|
82
|
+
event: z.literal("maintenance-changed"),
|
|
83
|
+
id: z.string().optional(),
|
|
84
|
+
retry: z.number().int().optional(),
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export function eventMaintenanceChangedFromJSON(
|
|
88
|
+
jsonString: string,
|
|
89
|
+
): SafeParseResult<EventMaintenanceChanged, SDKValidationError> {
|
|
90
|
+
return safeParse(
|
|
91
|
+
jsonString,
|
|
92
|
+
(x) => EventMaintenanceChanged$inboundSchema.parse(JSON.parse(x)),
|
|
93
|
+
`Failed to parse 'EventMaintenanceChanged' from JSON`,
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** @internal */
|
|
98
|
+
export const SiteSubscribeServerSentEventsEventHeartbeat$inboundSchema:
|
|
99
|
+
z.ZodType<
|
|
100
|
+
SiteSubscribeServerSentEventsEventHeartbeat,
|
|
101
|
+
z.ZodTypeDef,
|
|
102
|
+
unknown
|
|
103
|
+
> = z.object({
|
|
104
|
+
data: z.string().transform((v, ctx) => {
|
|
105
|
+
try {
|
|
106
|
+
return JSON.parse(v);
|
|
107
|
+
} catch (err) {
|
|
108
|
+
ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
|
|
109
|
+
return z.NEVER;
|
|
110
|
+
}
|
|
111
|
+
}).pipe(components.SiteSubscribeHeartbeat$inboundSchema),
|
|
112
|
+
event: z.literal("heartbeat"),
|
|
113
|
+
id: z.string().optional(),
|
|
114
|
+
retry: z.number().int().optional(),
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
export function siteSubscribeServerSentEventsEventHeartbeatFromJSON(
|
|
118
|
+
jsonString: string,
|
|
119
|
+
): SafeParseResult<
|
|
120
|
+
SiteSubscribeServerSentEventsEventHeartbeat,
|
|
121
|
+
SDKValidationError
|
|
122
|
+
> {
|
|
123
|
+
return safeParse(
|
|
124
|
+
jsonString,
|
|
125
|
+
(x) =>
|
|
126
|
+
SiteSubscribeServerSentEventsEventHeartbeat$inboundSchema.parse(
|
|
127
|
+
JSON.parse(x),
|
|
128
|
+
),
|
|
129
|
+
`Failed to parse 'SiteSubscribeServerSentEventsEventHeartbeat' from JSON`,
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** @internal */
|
|
134
|
+
export const SiteSubscribeServerSentEvents$inboundSchema: z.ZodType<
|
|
135
|
+
SiteSubscribeServerSentEvents,
|
|
136
|
+
z.ZodTypeDef,
|
|
137
|
+
unknown
|
|
138
|
+
> = z.union([
|
|
139
|
+
z.lazy(() => SiteSubscribeServerSentEventsEventHeartbeat$inboundSchema),
|
|
140
|
+
z.lazy(() => EventMaintenanceChanged$inboundSchema),
|
|
141
|
+
]);
|
|
142
|
+
|
|
143
|
+
export function siteSubscribeServerSentEventsFromJSON(
|
|
144
|
+
jsonString: string,
|
|
145
|
+
): SafeParseResult<SiteSubscribeServerSentEvents, SDKValidationError> {
|
|
146
|
+
return safeParse(
|
|
147
|
+
jsonString,
|
|
148
|
+
(x) => SiteSubscribeServerSentEvents$inboundSchema.parse(JSON.parse(x)),
|
|
149
|
+
`Failed to parse 'SiteSubscribeServerSentEvents' from JSON`,
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** @internal */
|
|
154
|
+
export const SiteSubscribeResponse$inboundSchema: z.ZodType<
|
|
155
|
+
SiteSubscribeResponse,
|
|
156
|
+
z.ZodTypeDef,
|
|
157
|
+
unknown
|
|
158
|
+
> = z.object({
|
|
159
|
+
HttpMeta: components.HTTPMetadata$inboundSchema,
|
|
160
|
+
"Server Sent Events": z.instanceof(ReadableStream<Uint8Array>)
|
|
161
|
+
.transform(stream => {
|
|
162
|
+
return new EventStream(stream, rawEvent => {
|
|
163
|
+
return {
|
|
164
|
+
done: false,
|
|
165
|
+
value: z.union([
|
|
166
|
+
z.lazy(() =>
|
|
167
|
+
SiteSubscribeServerSentEventsEventHeartbeat$inboundSchema
|
|
168
|
+
),
|
|
169
|
+
z.lazy(() => EventMaintenanceChanged$inboundSchema),
|
|
170
|
+
]).parse(rawEvent),
|
|
171
|
+
};
|
|
172
|
+
});
|
|
173
|
+
}).optional(),
|
|
174
|
+
ErrorModel: components.ErrorModel$inboundSchema.optional(),
|
|
175
|
+
}).transform((v) => {
|
|
176
|
+
return remap$(v, {
|
|
177
|
+
"HttpMeta": "httpMeta",
|
|
178
|
+
"Server Sent Events": "serverSentEvents",
|
|
179
|
+
"ErrorModel": "errorModel",
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
export function siteSubscribeResponseFromJSON(
|
|
184
|
+
jsonString: string,
|
|
185
|
+
): SafeParseResult<SiteSubscribeResponse, SDKValidationError> {
|
|
186
|
+
return safeParse(
|
|
187
|
+
jsonString,
|
|
188
|
+
(x) => SiteSubscribeResponse$inboundSchema.parse(JSON.parse(x)),
|
|
189
|
+
`Failed to parse 'SiteSubscribeResponse' from JSON`,
|
|
190
|
+
);
|
|
191
|
+
}
|
package/src/sdk/account.ts
CHANGED
|
@@ -36,6 +36,7 @@ import { accountReconnectConnection } from "../funcs/accountReconnectConnection.
|
|
|
36
36
|
import { accountRefreshInventory } from "../funcs/accountRefreshInventory.js";
|
|
37
37
|
import { accountRefreshSession } from "../funcs/accountRefreshSession.js";
|
|
38
38
|
import { accountSendEmailVerification } from "../funcs/accountSendEmailVerification.js";
|
|
39
|
+
import { accountSubscribe } from "../funcs/accountSubscribe.js";
|
|
39
40
|
import { accountSubscribeEmail } from "../funcs/accountSubscribeEmail.js";
|
|
40
41
|
import { accountUpdateConnection } from "../funcs/accountUpdateConnection.js";
|
|
41
42
|
import { accountUpdateDeveloperApp } from "../funcs/accountUpdateDeveloperApp.js";
|
|
@@ -518,6 +519,20 @@ export class Account extends ClientSDK {
|
|
|
518
519
|
));
|
|
519
520
|
}
|
|
520
521
|
|
|
522
|
+
/**
|
|
523
|
+
* Server-sent-events stream of per-account updates (queue status, view ticks).
|
|
524
|
+
*/
|
|
525
|
+
async subscribe(
|
|
526
|
+
request: operations.AccountSubscribeRequest,
|
|
527
|
+
options?: RequestOptions,
|
|
528
|
+
): Promise<operations.AccountSubscribeResponse> {
|
|
529
|
+
return unwrapAsync(accountSubscribe(
|
|
530
|
+
this,
|
|
531
|
+
request,
|
|
532
|
+
options,
|
|
533
|
+
));
|
|
534
|
+
}
|
|
535
|
+
|
|
521
536
|
/**
|
|
522
537
|
* Subscribe to email notifications
|
|
523
538
|
*/
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { Leaderboards } from "./leaderboards.js";
|
|
|
18
18
|
import { Location } from "./location.js";
|
|
19
19
|
import { Maintenance } from "./maintenance.js";
|
|
20
20
|
import { Search } from "./search.js";
|
|
21
|
+
import { Site } from "./site.js";
|
|
21
22
|
import { Staff } from "./staff.js";
|
|
22
23
|
import { Stats } from "./stats.js";
|
|
23
24
|
|
|
@@ -97,6 +98,11 @@ export class SteamSets extends ClientSDK {
|
|
|
97
98
|
return (this._search ??= new Search(this._options));
|
|
98
99
|
}
|
|
99
100
|
|
|
101
|
+
private _site?: Site;
|
|
102
|
+
get site(): Site {
|
|
103
|
+
return (this._site ??= new Site(this._options));
|
|
104
|
+
}
|
|
105
|
+
|
|
100
106
|
private _staff?: Staff;
|
|
101
107
|
get staff(): Staff {
|
|
102
108
|
return (this._staff ??= new Staff(this._options));
|
package/src/sdk/site.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { siteSubscribe, SubscribeAcceptEnum } from "../funcs/siteSubscribe.js";
|
|
6
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
7
|
+
import * as operations from "../models/operations/index.js";
|
|
8
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
9
|
+
|
|
10
|
+
export { SubscribeAcceptEnum } from "../funcs/siteSubscribe.js";
|
|
11
|
+
|
|
12
|
+
export class Site extends ClientSDK {
|
|
13
|
+
/**
|
|
14
|
+
* Server-sent-events stream of site-wide broadcasts (maintenance, announcements, etc).
|
|
15
|
+
*/
|
|
16
|
+
async subscribe(
|
|
17
|
+
options?: RequestOptions & { acceptHeaderOverride?: SubscribeAcceptEnum },
|
|
18
|
+
): Promise<operations.SiteSubscribeResponse> {
|
|
19
|
+
return unwrapAsync(siteSubscribe(
|
|
20
|
+
this,
|
|
21
|
+
options,
|
|
22
|
+
));
|
|
23
|
+
}
|
|
24
|
+
}
|