@steamsets/client-ts 0.25.4 → 0.25.7

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 (69) hide show
  1. package/README.md +2 -0
  2. package/docs/sdks/leaderboard/README.md +77 -0
  3. package/funcs/accountCreateConnection.js +1 -1
  4. package/funcs/leaderboardLeaderboardPreviewAccountRank.d.ts +12 -0
  5. package/funcs/leaderboardLeaderboardPreviewAccountRank.d.ts.map +1 -0
  6. package/funcs/leaderboardLeaderboardPreviewAccountRank.js +117 -0
  7. package/funcs/leaderboardLeaderboardPreviewAccountRank.js.map +1 -0
  8. package/jsr.json +1 -1
  9. package/lib/config.d.ts +3 -3
  10. package/lib/config.js +3 -3
  11. package/models/components/index.d.ts +3 -0
  12. package/models/components/index.d.ts.map +1 -1
  13. package/models/components/index.js +3 -0
  14. package/models/components/index.js.map +1 -1
  15. package/models/components/leaderboardcity.d.ts +0 -5
  16. package/models/components/leaderboardcity.d.ts.map +1 -1
  17. package/models/components/leaderboardcity.js +0 -2
  18. package/models/components/leaderboardcity.js.map +1 -1
  19. package/models/components/leaderboardcountry.d.ts +0 -5
  20. package/models/components/leaderboardcountry.d.ts.map +1 -1
  21. package/models/components/leaderboardcountry.js +0 -2
  22. package/models/components/leaderboardcountry.js.map +1 -1
  23. package/models/components/leaderboardregion.d.ts +0 -5
  24. package/models/components/leaderboardregion.d.ts.map +1 -1
  25. package/models/components/leaderboardregion.js +0 -2
  26. package/models/components/leaderboardregion.js.map +1 -1
  27. package/models/components/leaderboardstate.d.ts +0 -5
  28. package/models/components/leaderboardstate.d.ts.map +1 -1
  29. package/models/components/leaderboardstate.js +0 -2
  30. package/models/components/leaderboardstate.js.map +1 -1
  31. package/models/components/previewaccount.d.ts +241 -0
  32. package/models/components/previewaccount.d.ts.map +1 -0
  33. package/models/components/previewaccount.js +157 -0
  34. package/models/components/previewaccount.js.map +1 -0
  35. package/models/components/v1leaderboardpreviewaccountrankrequestbody.d.ts +114 -0
  36. package/models/components/v1leaderboardpreviewaccountrankrequestbody.d.ts.map +1 -0
  37. package/models/components/v1leaderboardpreviewaccountrankrequestbody.js +102 -0
  38. package/models/components/v1leaderboardpreviewaccountrankrequestbody.js.map +1 -0
  39. package/models/components/v1leaderboardpreviewaccountrankresponsebody.d.ts +44 -0
  40. package/models/components/v1leaderboardpreviewaccountrankresponsebody.d.ts.map +1 -0
  41. package/models/components/v1leaderboardpreviewaccountrankresponsebody.js +77 -0
  42. package/models/components/v1leaderboardpreviewaccountrankresponsebody.js.map +1 -0
  43. package/models/operations/index.d.ts +1 -0
  44. package/models/operations/index.d.ts.map +1 -1
  45. package/models/operations/index.js +1 -0
  46. package/models/operations/index.js.map +1 -1
  47. package/models/operations/leaderboardpreviewaccountrank.d.ts +35 -0
  48. package/models/operations/leaderboardpreviewaccountrank.d.ts.map +1 -0
  49. package/models/operations/leaderboardpreviewaccountrank.js +75 -0
  50. package/models/operations/leaderboardpreviewaccountrank.js.map +1 -0
  51. package/package.json +1 -1
  52. package/sdk/leaderboard.d.ts +1 -0
  53. package/sdk/leaderboard.d.ts.map +1 -1
  54. package/sdk/leaderboard.js +4 -0
  55. package/sdk/leaderboard.js.map +1 -1
  56. package/src/funcs/accountCreateConnection.ts +1 -1
  57. package/src/funcs/leaderboardLeaderboardPreviewAccountRank.ts +183 -0
  58. package/src/lib/config.ts +3 -3
  59. package/src/models/components/index.ts +3 -0
  60. package/src/models/components/leaderboardcity.ts +0 -7
  61. package/src/models/components/leaderboardcountry.ts +0 -7
  62. package/src/models/components/leaderboardregion.ts +0 -7
  63. package/src/models/components/leaderboardstate.ts +0 -7
  64. package/src/models/components/previewaccount.ts +369 -0
  65. package/src/models/components/v1leaderboardpreviewaccountrankrequestbody.ts +161 -0
  66. package/src/models/components/v1leaderboardpreviewaccountrankresponsebody.ts +116 -0
  67. package/src/models/operations/index.ts +1 -0
  68. package/src/models/operations/leaderboardpreviewaccountrank.ts +98 -0
  69. package/src/sdk/leaderboard.ts +12 -0
@@ -8,10 +8,6 @@ import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
9
 
10
10
  export type LeaderboardRegion = {
11
- /**
12
- * The id of the region
13
- */
14
- id: number;
15
11
  /**
16
12
  * The name of the region
17
13
  */
@@ -24,13 +20,11 @@ export const LeaderboardRegion$inboundSchema: z.ZodType<
24
20
  z.ZodTypeDef,
25
21
  unknown
26
22
  > = z.object({
27
- id: z.number().int(),
28
23
  name: z.string(),
29
24
  });
30
25
 
31
26
  /** @internal */
32
27
  export type LeaderboardRegion$Outbound = {
33
- id: number;
34
28
  name: string;
35
29
  };
36
30
 
@@ -40,7 +34,6 @@ export const LeaderboardRegion$outboundSchema: z.ZodType<
40
34
  z.ZodTypeDef,
41
35
  LeaderboardRegion
42
36
  > = z.object({
43
- id: z.number().int(),
44
37
  name: z.string(),
45
38
  });
46
39
 
@@ -8,10 +8,6 @@ import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
9
 
10
10
  export type LeaderboardState = {
11
- /**
12
- * The id of the state
13
- */
14
- id: number;
15
11
  /**
16
12
  * The name of the state
17
13
  */
@@ -24,13 +20,11 @@ export const LeaderboardState$inboundSchema: z.ZodType<
24
20
  z.ZodTypeDef,
25
21
  unknown
26
22
  > = z.object({
27
- id: z.number().int(),
28
23
  name: z.string(),
29
24
  });
30
25
 
31
26
  /** @internal */
32
27
  export type LeaderboardState$Outbound = {
33
- id: number;
34
28
  name: string;
35
29
  };
36
30
 
@@ -40,7 +34,6 @@ export const LeaderboardState$outboundSchema: z.ZodType<
40
34
  z.ZodTypeDef,
41
35
  LeaderboardState
42
36
  > = z.object({
43
- id: z.number().int(),
44
37
  name: z.string(),
45
38
  });
46
39
 
@@ -0,0 +1,369 @@
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 { ClosedEnum } from "../../types/enums.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ LeaderboardCity,
12
+ LeaderboardCity$inboundSchema,
13
+ LeaderboardCity$Outbound,
14
+ LeaderboardCity$outboundSchema,
15
+ } from "./leaderboardcity.js";
16
+ import {
17
+ LeaderboardCountry,
18
+ LeaderboardCountry$inboundSchema,
19
+ LeaderboardCountry$Outbound,
20
+ LeaderboardCountry$outboundSchema,
21
+ } from "./leaderboardcountry.js";
22
+ import {
23
+ LeaderboardRegion,
24
+ LeaderboardRegion$inboundSchema,
25
+ LeaderboardRegion$Outbound,
26
+ LeaderboardRegion$outboundSchema,
27
+ } from "./leaderboardregion.js";
28
+ import {
29
+ LeaderboardState,
30
+ LeaderboardState$inboundSchema,
31
+ LeaderboardState$Outbound,
32
+ LeaderboardState$outboundSchema,
33
+ } from "./leaderboardstate.js";
34
+ import {
35
+ Role,
36
+ Role$inboundSchema,
37
+ Role$Outbound,
38
+ Role$outboundSchema,
39
+ } from "./role.js";
40
+
41
+ /**
42
+ * The privacy of the account
43
+ */
44
+ export const PreviewAccountPrivacy = {
45
+ Public: "public",
46
+ Private: "private",
47
+ FriendsOnly: "friends_only",
48
+ } as const;
49
+ /**
50
+ * The privacy of the account
51
+ */
52
+ export type PreviewAccountPrivacy = ClosedEnum<typeof PreviewAccountPrivacy>;
53
+
54
+ export type PreviewAccount = {
55
+ /**
56
+ * The cost of an app
57
+ *
58
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
59
+ */
60
+ appCost: number;
61
+ /**
62
+ * The number of apps the account has
63
+ */
64
+ apps: number;
65
+ /**
66
+ * The avatar hash of the account
67
+ */
68
+ avatar: string;
69
+ /**
70
+ * The number of awards the account has
71
+ */
72
+ awardsGiven: number;
73
+ /**
74
+ * The number of awards the account has
75
+ */
76
+ awardsReceived: number;
77
+ /**
78
+ * The number of badges the account has
79
+ */
80
+ badges: number;
81
+ /**
82
+ * The number of bans
83
+ */
84
+ bans: number;
85
+ city?: LeaderboardCity | null | undefined;
86
+ country?: LeaderboardCountry | null | undefined;
87
+ /**
88
+ * The time the account was created
89
+ */
90
+ createdAt: Date;
91
+ /**
92
+ * The difference between the account's score and the user's score
93
+ */
94
+ differenceToUs: number;
95
+ /**
96
+ * The total of donations the account has
97
+ */
98
+ donated: number;
99
+ /**
100
+ * The economy ban of the account
101
+ */
102
+ economyBan: string;
103
+ /**
104
+ * The cost of a foil badge
105
+ *
106
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
107
+ */
108
+ foilBadgeCost: number;
109
+ /**
110
+ * The number of foil badges the account has
111
+ */
112
+ foilBadges: number;
113
+ /**
114
+ * The number of friends the account has
115
+ */
116
+ friends: number;
117
+ /**
118
+ * The number of game bans
119
+ */
120
+ gameBans: number;
121
+ /**
122
+ * The level of the account
123
+ */
124
+ level: number;
125
+ /**
126
+ * The name of the account
127
+ */
128
+ name: string;
129
+ /**
130
+ * The cost of a normal badge
131
+ *
132
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
133
+ */
134
+ normalBadgeCost: number;
135
+ /**
136
+ * The number of normal badges the account has
137
+ */
138
+ normalBadges: number;
139
+ /**
140
+ * The playtime of the account
141
+ */
142
+ playtime: number;
143
+ /**
144
+ * The number of points the account has
145
+ */
146
+ pointsGiven: number;
147
+ /**
148
+ * The number of points the account has
149
+ */
150
+ pointsReceived: number;
151
+ /**
152
+ * The privacy of the account
153
+ */
154
+ privacy: PreviewAccountPrivacy;
155
+ /**
156
+ * The rank of the account
157
+ */
158
+ rank: number;
159
+ region?: LeaderboardRegion | null | undefined;
160
+ /**
161
+ * The roles of the account
162
+ */
163
+ roles: Array<Role> | null;
164
+ /**
165
+ * The score of the account
166
+ */
167
+ score: number;
168
+ state?: LeaderboardState | null | undefined;
169
+ /**
170
+ * The steam id
171
+ */
172
+ steamId: string;
173
+ /**
174
+ * The steam sets score
175
+ */
176
+ steamSetsScore: number;
177
+ /**
178
+ * The vanity of the account
179
+ */
180
+ steamSetsVanity: string;
181
+ /**
182
+ * The vanity of the account
183
+ */
184
+ steamVanity: string;
185
+ /**
186
+ * The number of vac bans
187
+ */
188
+ vacBans: number;
189
+ /**
190
+ * The number of xp the account has
191
+ */
192
+ xp: number;
193
+ };
194
+
195
+ /** @internal */
196
+ export const PreviewAccountPrivacy$inboundSchema: z.ZodNativeEnum<
197
+ typeof PreviewAccountPrivacy
198
+ > = z.nativeEnum(PreviewAccountPrivacy);
199
+
200
+ /** @internal */
201
+ export const PreviewAccountPrivacy$outboundSchema: z.ZodNativeEnum<
202
+ typeof PreviewAccountPrivacy
203
+ > = PreviewAccountPrivacy$inboundSchema;
204
+
205
+ /**
206
+ * @internal
207
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
208
+ */
209
+ export namespace PreviewAccountPrivacy$ {
210
+ /** @deprecated use `PreviewAccountPrivacy$inboundSchema` instead. */
211
+ export const inboundSchema = PreviewAccountPrivacy$inboundSchema;
212
+ /** @deprecated use `PreviewAccountPrivacy$outboundSchema` instead. */
213
+ export const outboundSchema = PreviewAccountPrivacy$outboundSchema;
214
+ }
215
+
216
+ /** @internal */
217
+ export const PreviewAccount$inboundSchema: z.ZodType<
218
+ PreviewAccount,
219
+ z.ZodTypeDef,
220
+ unknown
221
+ > = z.object({
222
+ appCost: z.number().int(),
223
+ apps: z.number().int(),
224
+ avatar: z.string(),
225
+ awardsGiven: z.number().int(),
226
+ awardsReceived: z.number().int(),
227
+ badges: z.number().int(),
228
+ bans: z.number().int(),
229
+ city: z.nullable(LeaderboardCity$inboundSchema).optional(),
230
+ country: z.nullable(LeaderboardCountry$inboundSchema).optional(),
231
+ createdAt: z.string().datetime({ offset: true }).transform(v => new Date(v)),
232
+ differenceToUs: z.number().int(),
233
+ donated: z.number().int(),
234
+ economyBan: z.string(),
235
+ foilBadgeCost: z.number().int(),
236
+ foilBadges: z.number().int(),
237
+ friends: z.number().int(),
238
+ gameBans: z.number().int(),
239
+ level: z.number().int(),
240
+ name: z.string(),
241
+ normalBadgeCost: z.number().int(),
242
+ normalBadges: z.number().int(),
243
+ playtime: z.number().int(),
244
+ pointsGiven: z.number().int(),
245
+ pointsReceived: z.number().int(),
246
+ privacy: PreviewAccountPrivacy$inboundSchema,
247
+ rank: z.number().int(),
248
+ region: z.nullable(LeaderboardRegion$inboundSchema).optional(),
249
+ roles: z.nullable(z.array(Role$inboundSchema)),
250
+ score: z.number().int(),
251
+ state: z.nullable(LeaderboardState$inboundSchema).optional(),
252
+ steamId: z.string(),
253
+ steamSetsScore: z.number().int(),
254
+ steamSetsVanity: z.string(),
255
+ steamVanity: z.string(),
256
+ vacBans: z.number().int(),
257
+ xp: z.number().int(),
258
+ });
259
+
260
+ /** @internal */
261
+ export type PreviewAccount$Outbound = {
262
+ appCost: number;
263
+ apps: number;
264
+ avatar: string;
265
+ awardsGiven: number;
266
+ awardsReceived: number;
267
+ badges: number;
268
+ bans: number;
269
+ city?: LeaderboardCity$Outbound | null | undefined;
270
+ country?: LeaderboardCountry$Outbound | null | undefined;
271
+ createdAt: string;
272
+ differenceToUs: number;
273
+ donated: number;
274
+ economyBan: string;
275
+ foilBadgeCost: number;
276
+ foilBadges: number;
277
+ friends: number;
278
+ gameBans: number;
279
+ level: number;
280
+ name: string;
281
+ normalBadgeCost: number;
282
+ normalBadges: number;
283
+ playtime: number;
284
+ pointsGiven: number;
285
+ pointsReceived: number;
286
+ privacy: string;
287
+ rank: number;
288
+ region?: LeaderboardRegion$Outbound | null | undefined;
289
+ roles: Array<Role$Outbound> | null;
290
+ score: number;
291
+ state?: LeaderboardState$Outbound | null | undefined;
292
+ steamId: string;
293
+ steamSetsScore: number;
294
+ steamSetsVanity: string;
295
+ steamVanity: string;
296
+ vacBans: number;
297
+ xp: number;
298
+ };
299
+
300
+ /** @internal */
301
+ export const PreviewAccount$outboundSchema: z.ZodType<
302
+ PreviewAccount$Outbound,
303
+ z.ZodTypeDef,
304
+ PreviewAccount
305
+ > = z.object({
306
+ appCost: z.number().int(),
307
+ apps: z.number().int(),
308
+ avatar: z.string(),
309
+ awardsGiven: z.number().int(),
310
+ awardsReceived: z.number().int(),
311
+ badges: z.number().int(),
312
+ bans: z.number().int(),
313
+ city: z.nullable(LeaderboardCity$outboundSchema).optional(),
314
+ country: z.nullable(LeaderboardCountry$outboundSchema).optional(),
315
+ createdAt: z.date().transform(v => v.toISOString()),
316
+ differenceToUs: z.number().int(),
317
+ donated: z.number().int(),
318
+ economyBan: z.string(),
319
+ foilBadgeCost: z.number().int(),
320
+ foilBadges: z.number().int(),
321
+ friends: z.number().int(),
322
+ gameBans: z.number().int(),
323
+ level: z.number().int(),
324
+ name: z.string(),
325
+ normalBadgeCost: z.number().int(),
326
+ normalBadges: z.number().int(),
327
+ playtime: z.number().int(),
328
+ pointsGiven: z.number().int(),
329
+ pointsReceived: z.number().int(),
330
+ privacy: PreviewAccountPrivacy$outboundSchema,
331
+ rank: z.number().int(),
332
+ region: z.nullable(LeaderboardRegion$outboundSchema).optional(),
333
+ roles: z.nullable(z.array(Role$outboundSchema)),
334
+ score: z.number().int(),
335
+ state: z.nullable(LeaderboardState$outboundSchema).optional(),
336
+ steamId: z.string(),
337
+ steamSetsScore: z.number().int(),
338
+ steamSetsVanity: z.string(),
339
+ steamVanity: z.string(),
340
+ vacBans: z.number().int(),
341
+ xp: z.number().int(),
342
+ });
343
+
344
+ /**
345
+ * @internal
346
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
347
+ */
348
+ export namespace PreviewAccount$ {
349
+ /** @deprecated use `PreviewAccount$inboundSchema` instead. */
350
+ export const inboundSchema = PreviewAccount$inboundSchema;
351
+ /** @deprecated use `PreviewAccount$outboundSchema` instead. */
352
+ export const outboundSchema = PreviewAccount$outboundSchema;
353
+ /** @deprecated use `PreviewAccount$Outbound` instead. */
354
+ export type Outbound = PreviewAccount$Outbound;
355
+ }
356
+
357
+ export function previewAccountToJSON(previewAccount: PreviewAccount): string {
358
+ return JSON.stringify(PreviewAccount$outboundSchema.parse(previewAccount));
359
+ }
360
+
361
+ export function previewAccountFromJSON(
362
+ jsonString: string,
363
+ ): SafeParseResult<PreviewAccount, SDKValidationError> {
364
+ return safeParse(
365
+ jsonString,
366
+ (x) => PreviewAccount$inboundSchema.parse(JSON.parse(x)),
367
+ `Failed to parse 'PreviewAccount' from JSON`,
368
+ );
369
+ }
@@ -0,0 +1,161 @@
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 { ClosedEnum } from "../../types/enums.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ IDStruct,
12
+ IDStruct$inboundSchema,
13
+ IDStruct$Outbound,
14
+ IDStruct$outboundSchema,
15
+ } from "./idstruct.js";
16
+ import {
17
+ VanityStruct,
18
+ VanityStruct$inboundSchema,
19
+ VanityStruct$Outbound,
20
+ VanityStruct$outboundSchema,
21
+ } from "./vanitystruct.js";
22
+
23
+ /**
24
+ * The leaderboard to get
25
+ */
26
+ export const V1LeaderboardPreviewAccountRankRequestBodyLeaderboard = {
27
+ Apps: "apps",
28
+ AwardsGiven: "awards_given",
29
+ AwardsReceived: "awards_received",
30
+ Bans: "bans",
31
+ GameBans: "game_bans",
32
+ VacBans: "vac_bans",
33
+ Donations: "donations",
34
+ FoilBadges: "foil_badges",
35
+ NormalBadges: "normal_badges",
36
+ Badges: "badges",
37
+ Playtime: "playtime",
38
+ PointsGiven: "points_given",
39
+ PointsReceived: "points_received",
40
+ SteamSets: "steam_sets",
41
+ Xp: "xp",
42
+ } as const;
43
+ /**
44
+ * The leaderboard to get
45
+ */
46
+ export type V1LeaderboardPreviewAccountRankRequestBodyLeaderboard = ClosedEnum<
47
+ typeof V1LeaderboardPreviewAccountRankRequestBodyLeaderboard
48
+ >;
49
+
50
+ export type V1LeaderboardPreviewAccountRankRequestBody = {
51
+ id?: IDStruct | undefined;
52
+ /**
53
+ * The leaderboard to get
54
+ */
55
+ leaderboard: V1LeaderboardPreviewAccountRankRequestBodyLeaderboard;
56
+ /**
57
+ * What their leaderboard score would be
58
+ */
59
+ value?: number | undefined;
60
+ vanity?: VanityStruct | undefined;
61
+ };
62
+
63
+ /** @internal */
64
+ export const V1LeaderboardPreviewAccountRankRequestBodyLeaderboard$inboundSchema:
65
+ z.ZodNativeEnum<
66
+ typeof V1LeaderboardPreviewAccountRankRequestBodyLeaderboard
67
+ > = z.nativeEnum(V1LeaderboardPreviewAccountRankRequestBodyLeaderboard);
68
+
69
+ /** @internal */
70
+ export const V1LeaderboardPreviewAccountRankRequestBodyLeaderboard$outboundSchema:
71
+ z.ZodNativeEnum<
72
+ typeof V1LeaderboardPreviewAccountRankRequestBodyLeaderboard
73
+ > = V1LeaderboardPreviewAccountRankRequestBodyLeaderboard$inboundSchema;
74
+
75
+ /**
76
+ * @internal
77
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
78
+ */
79
+ export namespace V1LeaderboardPreviewAccountRankRequestBodyLeaderboard$ {
80
+ /** @deprecated use `V1LeaderboardPreviewAccountRankRequestBodyLeaderboard$inboundSchema` instead. */
81
+ export const inboundSchema =
82
+ V1LeaderboardPreviewAccountRankRequestBodyLeaderboard$inboundSchema;
83
+ /** @deprecated use `V1LeaderboardPreviewAccountRankRequestBodyLeaderboard$outboundSchema` instead. */
84
+ export const outboundSchema =
85
+ V1LeaderboardPreviewAccountRankRequestBodyLeaderboard$outboundSchema;
86
+ }
87
+
88
+ /** @internal */
89
+ export const V1LeaderboardPreviewAccountRankRequestBody$inboundSchema:
90
+ z.ZodType<V1LeaderboardPreviewAccountRankRequestBody, z.ZodTypeDef, unknown> =
91
+ z.object({
92
+ id: IDStruct$inboundSchema.optional(),
93
+ leaderboard:
94
+ V1LeaderboardPreviewAccountRankRequestBodyLeaderboard$inboundSchema,
95
+ value: z.number().int().optional(),
96
+ vanity: VanityStruct$inboundSchema.optional(),
97
+ });
98
+
99
+ /** @internal */
100
+ export type V1LeaderboardPreviewAccountRankRequestBody$Outbound = {
101
+ id?: IDStruct$Outbound | undefined;
102
+ leaderboard: string;
103
+ value?: number | undefined;
104
+ vanity?: VanityStruct$Outbound | undefined;
105
+ };
106
+
107
+ /** @internal */
108
+ export const V1LeaderboardPreviewAccountRankRequestBody$outboundSchema:
109
+ z.ZodType<
110
+ V1LeaderboardPreviewAccountRankRequestBody$Outbound,
111
+ z.ZodTypeDef,
112
+ V1LeaderboardPreviewAccountRankRequestBody
113
+ > = z.object({
114
+ id: IDStruct$outboundSchema.optional(),
115
+ leaderboard:
116
+ V1LeaderboardPreviewAccountRankRequestBodyLeaderboard$outboundSchema,
117
+ value: z.number().int().optional(),
118
+ vanity: VanityStruct$outboundSchema.optional(),
119
+ });
120
+
121
+ /**
122
+ * @internal
123
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
124
+ */
125
+ export namespace V1LeaderboardPreviewAccountRankRequestBody$ {
126
+ /** @deprecated use `V1LeaderboardPreviewAccountRankRequestBody$inboundSchema` instead. */
127
+ export const inboundSchema =
128
+ V1LeaderboardPreviewAccountRankRequestBody$inboundSchema;
129
+ /** @deprecated use `V1LeaderboardPreviewAccountRankRequestBody$outboundSchema` instead. */
130
+ export const outboundSchema =
131
+ V1LeaderboardPreviewAccountRankRequestBody$outboundSchema;
132
+ /** @deprecated use `V1LeaderboardPreviewAccountRankRequestBody$Outbound` instead. */
133
+ export type Outbound = V1LeaderboardPreviewAccountRankRequestBody$Outbound;
134
+ }
135
+
136
+ export function v1LeaderboardPreviewAccountRankRequestBodyToJSON(
137
+ v1LeaderboardPreviewAccountRankRequestBody:
138
+ V1LeaderboardPreviewAccountRankRequestBody,
139
+ ): string {
140
+ return JSON.stringify(
141
+ V1LeaderboardPreviewAccountRankRequestBody$outboundSchema.parse(
142
+ v1LeaderboardPreviewAccountRankRequestBody,
143
+ ),
144
+ );
145
+ }
146
+
147
+ export function v1LeaderboardPreviewAccountRankRequestBodyFromJSON(
148
+ jsonString: string,
149
+ ): SafeParseResult<
150
+ V1LeaderboardPreviewAccountRankRequestBody,
151
+ SDKValidationError
152
+ > {
153
+ return safeParse(
154
+ jsonString,
155
+ (x) =>
156
+ V1LeaderboardPreviewAccountRankRequestBody$inboundSchema.parse(
157
+ JSON.parse(x),
158
+ ),
159
+ `Failed to parse 'V1LeaderboardPreviewAccountRankRequestBody' from JSON`,
160
+ );
161
+ }
@@ -0,0 +1,116 @@
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
+ import {
11
+ PreviewAccount,
12
+ PreviewAccount$inboundSchema,
13
+ PreviewAccount$Outbound,
14
+ PreviewAccount$outboundSchema,
15
+ } from "./previewaccount.js";
16
+
17
+ export type V1LeaderboardPreviewAccountRankResponseBody = {
18
+ /**
19
+ * A URL to the JSON Schema for this object.
20
+ */
21
+ dollarSchema?: string | undefined;
22
+ ownAccount?: PreviewAccount | null | undefined;
23
+ rankedAbove?: PreviewAccount | null | undefined;
24
+ rankedBelow?: PreviewAccount | null | undefined;
25
+ /**
26
+ * The number of accounts that are ranked in the leaderboard
27
+ */
28
+ rankedOutOf?: number | undefined;
29
+ };
30
+
31
+ /** @internal */
32
+ export const V1LeaderboardPreviewAccountRankResponseBody$inboundSchema:
33
+ z.ZodType<
34
+ V1LeaderboardPreviewAccountRankResponseBody,
35
+ z.ZodTypeDef,
36
+ unknown
37
+ > = z.object({
38
+ $schema: z.string().optional(),
39
+ ownAccount: z.nullable(PreviewAccount$inboundSchema).optional(),
40
+ rankedAbove: z.nullable(PreviewAccount$inboundSchema).optional(),
41
+ rankedBelow: z.nullable(PreviewAccount$inboundSchema).optional(),
42
+ rankedOutOf: z.number().int().default(0),
43
+ }).transform((v) => {
44
+ return remap$(v, {
45
+ "$schema": "dollarSchema",
46
+ });
47
+ });
48
+
49
+ /** @internal */
50
+ export type V1LeaderboardPreviewAccountRankResponseBody$Outbound = {
51
+ $schema?: string | undefined;
52
+ ownAccount?: PreviewAccount$Outbound | null | undefined;
53
+ rankedAbove?: PreviewAccount$Outbound | null | undefined;
54
+ rankedBelow?: PreviewAccount$Outbound | null | undefined;
55
+ rankedOutOf: number;
56
+ };
57
+
58
+ /** @internal */
59
+ export const V1LeaderboardPreviewAccountRankResponseBody$outboundSchema:
60
+ z.ZodType<
61
+ V1LeaderboardPreviewAccountRankResponseBody$Outbound,
62
+ z.ZodTypeDef,
63
+ V1LeaderboardPreviewAccountRankResponseBody
64
+ > = z.object({
65
+ dollarSchema: z.string().optional(),
66
+ ownAccount: z.nullable(PreviewAccount$outboundSchema).optional(),
67
+ rankedAbove: z.nullable(PreviewAccount$outboundSchema).optional(),
68
+ rankedBelow: z.nullable(PreviewAccount$outboundSchema).optional(),
69
+ rankedOutOf: z.number().int().default(0),
70
+ }).transform((v) => {
71
+ return remap$(v, {
72
+ dollarSchema: "$schema",
73
+ });
74
+ });
75
+
76
+ /**
77
+ * @internal
78
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
79
+ */
80
+ export namespace V1LeaderboardPreviewAccountRankResponseBody$ {
81
+ /** @deprecated use `V1LeaderboardPreviewAccountRankResponseBody$inboundSchema` instead. */
82
+ export const inboundSchema =
83
+ V1LeaderboardPreviewAccountRankResponseBody$inboundSchema;
84
+ /** @deprecated use `V1LeaderboardPreviewAccountRankResponseBody$outboundSchema` instead. */
85
+ export const outboundSchema =
86
+ V1LeaderboardPreviewAccountRankResponseBody$outboundSchema;
87
+ /** @deprecated use `V1LeaderboardPreviewAccountRankResponseBody$Outbound` instead. */
88
+ export type Outbound = V1LeaderboardPreviewAccountRankResponseBody$Outbound;
89
+ }
90
+
91
+ export function v1LeaderboardPreviewAccountRankResponseBodyToJSON(
92
+ v1LeaderboardPreviewAccountRankResponseBody:
93
+ V1LeaderboardPreviewAccountRankResponseBody,
94
+ ): string {
95
+ return JSON.stringify(
96
+ V1LeaderboardPreviewAccountRankResponseBody$outboundSchema.parse(
97
+ v1LeaderboardPreviewAccountRankResponseBody,
98
+ ),
99
+ );
100
+ }
101
+
102
+ export function v1LeaderboardPreviewAccountRankResponseBodyFromJSON(
103
+ jsonString: string,
104
+ ): SafeParseResult<
105
+ V1LeaderboardPreviewAccountRankResponseBody,
106
+ SDKValidationError
107
+ > {
108
+ return safeParse(
109
+ jsonString,
110
+ (x) =>
111
+ V1LeaderboardPreviewAccountRankResponseBody$inboundSchema.parse(
112
+ JSON.parse(x),
113
+ ),
114
+ `Failed to parse 'V1LeaderboardPreviewAccountRankResponseBody' from JSON`,
115
+ );
116
+ }