@steamsets/client-ts 0.34.3 → 0.34.4

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.
Files changed (52) hide show
  1. package/README.md +5 -1
  2. package/funcs/accountSubscribe.d.ts +15 -0
  3. package/funcs/accountSubscribe.d.ts.map +1 -0
  4. package/funcs/accountSubscribe.js +136 -0
  5. package/funcs/accountSubscribe.js.map +1 -0
  6. package/jsr.json +1 -1
  7. package/lib/config.d.ts +3 -3
  8. package/lib/config.js +3 -3
  9. package/lib/config.js.map +1 -1
  10. package/models/components/eventaccountupdateddata.d.ts +11 -0
  11. package/models/components/eventaccountupdateddata.d.ts.map +1 -0
  12. package/models/components/eventaccountupdateddata.js +51 -0
  13. package/models/components/eventaccountupdateddata.js.map +1 -0
  14. package/models/components/eventaccountviewtickdata.d.ts +11 -0
  15. package/models/components/eventaccountviewtickdata.d.ts.map +1 -0
  16. package/models/components/eventaccountviewtickdata.js +51 -0
  17. package/models/components/eventaccountviewtickdata.js.map +1 -0
  18. package/models/components/heartbeat.d.ts +10 -0
  19. package/models/components/heartbeat.d.ts.map +1 -0
  20. package/models/components/heartbeat.js +50 -0
  21. package/models/components/heartbeat.js.map +1 -0
  22. package/models/components/index.d.ts +3 -0
  23. package/models/components/index.d.ts.map +1 -1
  24. package/models/components/index.js +3 -0
  25. package/models/components/index.js.map +1 -1
  26. package/models/operations/accountsubscribe.d.ts +90 -0
  27. package/models/operations/accountsubscribe.d.ts.map +1 -0
  28. package/models/operations/accountsubscribe.js +146 -0
  29. package/models/operations/accountsubscribe.js.map +1 -0
  30. package/models/operations/badgepricingsubscribe.d.ts +5 -5
  31. package/models/operations/badgepricingsubscribe.d.ts.map +1 -1
  32. package/models/operations/badgepricingsubscribe.js +7 -7
  33. package/models/operations/badgepricingsubscribe.js.map +1 -1
  34. package/models/operations/index.d.ts +1 -0
  35. package/models/operations/index.d.ts.map +1 -1
  36. package/models/operations/index.js +1 -0
  37. package/models/operations/index.js.map +1 -1
  38. package/package.json +1 -1
  39. package/sdk/account.d.ts +4 -0
  40. package/sdk/account.d.ts.map +1 -1
  41. package/sdk/account.js +7 -0
  42. package/sdk/account.js.map +1 -1
  43. package/src/funcs/accountSubscribe.ts +190 -0
  44. package/src/lib/config.ts +3 -3
  45. package/src/models/components/eventaccountupdateddata.ts +33 -0
  46. package/src/models/components/eventaccountviewtickdata.ts +33 -0
  47. package/src/models/components/heartbeat.ts +31 -0
  48. package/src/models/components/index.ts +3 -0
  49. package/src/models/operations/accountsubscribe.ts +251 -0
  50. package/src/models/operations/badgepricingsubscribe.ts +11 -11
  51. package/src/models/operations/index.ts +1 -0
  52. package/src/sdk/account.ts +15 -0
@@ -0,0 +1,33 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
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 EventAccountUpdatedData = {
11
+ accountId: number;
12
+ status: string;
13
+ };
14
+
15
+ /** @internal */
16
+ export const EventAccountUpdatedData$inboundSchema: z.ZodType<
17
+ EventAccountUpdatedData,
18
+ z.ZodTypeDef,
19
+ unknown
20
+ > = z.object({
21
+ accountId: z.number().int(),
22
+ status: z.string(),
23
+ });
24
+
25
+ export function eventAccountUpdatedDataFromJSON(
26
+ jsonString: string,
27
+ ): SafeParseResult<EventAccountUpdatedData, SDKValidationError> {
28
+ return safeParse(
29
+ jsonString,
30
+ (x) => EventAccountUpdatedData$inboundSchema.parse(JSON.parse(x)),
31
+ `Failed to parse 'EventAccountUpdatedData' from JSON`,
32
+ );
33
+ }
@@ -0,0 +1,33 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
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 EventAccountViewTickData = {
11
+ accountId: number;
12
+ totalDelta: number;
13
+ };
14
+
15
+ /** @internal */
16
+ export const EventAccountViewTickData$inboundSchema: z.ZodType<
17
+ EventAccountViewTickData,
18
+ z.ZodTypeDef,
19
+ unknown
20
+ > = z.object({
21
+ accountId: z.number().int(),
22
+ totalDelta: z.number().int(),
23
+ });
24
+
25
+ export function eventAccountViewTickDataFromJSON(
26
+ jsonString: string,
27
+ ): SafeParseResult<EventAccountViewTickData, SDKValidationError> {
28
+ return safeParse(
29
+ jsonString,
30
+ (x) => EventAccountViewTickData$inboundSchema.parse(JSON.parse(x)),
31
+ `Failed to parse 'EventAccountViewTickData' from JSON`,
32
+ );
33
+ }
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
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 Heartbeat = {
11
+ heartbeat: number;
12
+ };
13
+
14
+ /** @internal */
15
+ export const Heartbeat$inboundSchema: z.ZodType<
16
+ Heartbeat,
17
+ z.ZodTypeDef,
18
+ unknown
19
+ > = z.object({
20
+ heartbeat: z.number().int(),
21
+ });
22
+
23
+ export function heartbeatFromJSON(
24
+ jsonString: string,
25
+ ): SafeParseResult<Heartbeat, SDKValidationError> {
26
+ return safeParse(
27
+ jsonString,
28
+ (x) => Heartbeat$inboundSchema.parse(JSON.parse(x)),
29
+ `Failed to parse 'Heartbeat' from JSON`,
30
+ );
31
+ }
@@ -41,12 +41,15 @@ export * from "./developerappanalyticstimeseries.js";
41
41
  export * from "./developerappanalyticstimeseriespoint.js";
42
42
  export * from "./errordetail.js";
43
43
  export * from "./errormodel.js";
44
+ export * from "./eventaccountupdateddata.js";
45
+ export * from "./eventaccountviewtickdata.js";
44
46
  export * from "./eventmarketpricetickdata.js";
45
47
  export * from "./eventstatsheartbeatdata.js";
46
48
  export * from "./eventstatsupdateddata.js";
47
49
  export * from "./findownersrequestbody.js";
48
50
  export * from "./findownersresponsebody.js";
49
51
  export * from "./friendpath.js";
52
+ export * from "./heartbeat.js";
50
53
  export * from "./historyvalue.js";
51
54
  export * from "./httpmetadata.js";
52
55
  export * from "./idsearch.js";
@@ -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.Heartbeat;
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.Heartbeat$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 EventHeartbeat = {
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
- | EventHeartbeat
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<EventHeartbeat | EventMarketPriceTick>
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 EventHeartbeat$inboundSchema: z.ZodType<
97
- EventHeartbeat,
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 eventHeartbeatFromJSON(
114
+ export function serverSentEventsEventHeartbeatFromJSON(
115
115
  jsonString: string,
116
- ): SafeParseResult<EventHeartbeat, SDKValidationError> {
116
+ ): SafeParseResult<ServerSentEventsEventHeartbeat, SDKValidationError> {
117
117
  return safeParse(
118
118
  jsonString,
119
- (x) => EventHeartbeat$inboundSchema.parse(JSON.parse(x)),
120
- `Failed to parse 'EventHeartbeat' from JSON`,
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(() => EventHeartbeat$inboundSchema),
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(() => EventHeartbeat$inboundSchema),
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";
@@ -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
  */