@steamsets/client-ts 0.33.6 → 0.33.8

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 (116) hide show
  1. package/README.md +7 -0
  2. package/funcs/accountCompareBadges.d.ts +16 -0
  3. package/funcs/accountCompareBadges.d.ts.map +1 -0
  4. package/funcs/accountCompareBadges.js +134 -0
  5. package/funcs/accountCompareBadges.js.map +1 -0
  6. package/funcs/itemFindOwners.d.ts +16 -0
  7. package/funcs/itemFindOwners.d.ts.map +1 -0
  8. package/funcs/itemFindOwners.js +134 -0
  9. package/funcs/itemFindOwners.js.map +1 -0
  10. package/jsr.json +1 -1
  11. package/lib/config.d.ts +2 -2
  12. package/lib/config.js +2 -2
  13. package/models/components/comparedtuple.d.ts +23 -0
  14. package/models/components/comparedtuple.d.ts.map +1 -0
  15. package/models/components/comparedtuple.js +63 -0
  16. package/models/components/comparedtuple.js.map +1 -0
  17. package/models/components/findownersrequestbody.d.ts +25 -0
  18. package/models/components/findownersrequestbody.d.ts.map +1 -0
  19. package/models/components/findownersrequestbody.js +51 -0
  20. package/models/components/findownersrequestbody.js.map +1 -0
  21. package/models/components/findownersresponsebody.d.ts +15 -0
  22. package/models/components/findownersresponsebody.d.ts.map +1 -0
  23. package/models/components/findownersresponsebody.js +57 -0
  24. package/models/components/findownersresponsebody.js.map +1 -0
  25. package/models/components/index.d.ts +11 -0
  26. package/models/components/index.d.ts.map +1 -1
  27. package/models/components/index.js +11 -0
  28. package/models/components/index.js.map +1 -1
  29. package/models/components/itemowners.d.ts +12 -0
  30. package/models/components/itemowners.d.ts.map +1 -0
  31. package/models/components/itemowners.js +52 -0
  32. package/models/components/itemowners.js.map +1 -0
  33. package/models/components/order.d.ts +32 -0
  34. package/models/components/order.d.ts.map +1 -0
  35. package/models/components/order.js +66 -0
  36. package/models/components/order.js.map +1 -0
  37. package/models/components/owner.d.ts +27 -0
  38. package/models/components/owner.d.ts.map +1 -0
  39. package/models/components/owner.js +57 -0
  40. package/models/components/owner.js.map +1 -0
  41. package/models/components/rangefilter.d.ts +23 -0
  42. package/models/components/rangefilter.d.ts.map +1 -0
  43. package/models/components/rangefilter.js +56 -0
  44. package/models/components/rangefilter.js.map +1 -0
  45. package/models/components/resolvedaccount.d.ts +13 -0
  46. package/models/components/resolvedaccount.d.ts.map +1 -0
  47. package/models/components/resolvedaccount.js +53 -0
  48. package/models/components/resolvedaccount.js.map +1 -0
  49. package/models/components/tupleaccount.d.ts +13 -0
  50. package/models/components/tupleaccount.d.ts.map +1 -0
  51. package/models/components/tupleaccount.js +54 -0
  52. package/models/components/tupleaccount.js.map +1 -0
  53. package/models/components/v1accountcomparebadgesrequestbody.d.ts +74 -0
  54. package/models/components/v1accountcomparebadgesrequestbody.d.ts.map +1 -0
  55. package/models/components/v1accountcomparebadgesrequestbody.js +94 -0
  56. package/models/components/v1accountcomparebadgesrequestbody.js.map +1 -0
  57. package/models/components/v1accountcomparebadgesresponsebody.d.ts +25 -0
  58. package/models/components/v1accountcomparebadgesresponsebody.d.ts.map +1 -0
  59. package/models/components/v1accountcomparebadgesresponsebody.js +61 -0
  60. package/models/components/v1accountcomparebadgesresponsebody.js.map +1 -0
  61. package/models/components/v1accountlistbadgesrequestbody.d.ts +4 -4
  62. package/models/components/v1accountlistbadgesrequestbody.d.ts.map +1 -1
  63. package/models/components/v1accountlistbadgesrequestbody.js +4 -5
  64. package/models/components/v1accountlistbadgesrequestbody.js.map +1 -1
  65. package/models/components/v1apporder.d.ts +8 -8
  66. package/models/components/v1apporder.d.ts.map +1 -1
  67. package/models/components/v1apporder.js +7 -8
  68. package/models/components/v1apporder.js.map +1 -1
  69. package/models/operations/comparebadges.d.ts +15 -0
  70. package/models/operations/comparebadges.d.ts.map +1 -0
  71. package/models/operations/comparebadges.js +59 -0
  72. package/models/operations/comparebadges.js.map +1 -0
  73. package/models/operations/index.d.ts +2 -0
  74. package/models/operations/index.d.ts.map +1 -1
  75. package/models/operations/index.js +2 -0
  76. package/models/operations/index.js.map +1 -1
  77. package/models/operations/itemfindowners.d.ts +15 -0
  78. package/models/operations/itemfindowners.d.ts.map +1 -0
  79. package/models/operations/itemfindowners.js +59 -0
  80. package/models/operations/itemfindowners.js.map +1 -0
  81. package/package.json +1 -1
  82. package/sdk/account.d.ts +4 -0
  83. package/sdk/account.d.ts.map +1 -1
  84. package/sdk/account.js +7 -0
  85. package/sdk/account.js.map +1 -1
  86. package/sdk/item.d.ts +10 -0
  87. package/sdk/item.d.ts.map +1 -0
  88. package/sdk/item.js +19 -0
  89. package/sdk/item.js.map +1 -0
  90. package/sdk/sdk.d.ts +3 -0
  91. package/sdk/sdk.d.ts.map +1 -1
  92. package/sdk/sdk.js +4 -0
  93. package/sdk/sdk.js.map +1 -1
  94. package/src/funcs/accountCompareBadges.ts +188 -0
  95. package/src/funcs/itemFindOwners.ts +187 -0
  96. package/src/lib/config.ts +2 -2
  97. package/src/models/components/comparedtuple.ts +56 -0
  98. package/src/models/components/findownersrequestbody.ts +46 -0
  99. package/src/models/components/findownersresponsebody.ts +42 -0
  100. package/src/models/components/index.ts +11 -0
  101. package/src/models/components/itemowners.ts +34 -0
  102. package/src/models/components/order.ts +53 -0
  103. package/src/models/components/owner.ts +53 -0
  104. package/src/models/components/rangefilter.ts +44 -0
  105. package/src/models/components/resolvedaccount.ts +37 -0
  106. package/src/models/components/tupleaccount.ts +38 -0
  107. package/src/models/components/v1accountcomparebadgesrequestbody.ts +128 -0
  108. package/src/models/components/v1accountcomparebadgesresponsebody.ts +59 -0
  109. package/src/models/components/v1accountlistbadgesrequestbody.ts +12 -6
  110. package/src/models/components/v1apporder.ts +13 -11
  111. package/src/models/operations/comparebadges.ts +46 -0
  112. package/src/models/operations/index.ts +2 -0
  113. package/src/models/operations/itemfindowners.ts +44 -0
  114. package/src/sdk/account.ts +15 -0
  115. package/src/sdk/item.ts +25 -0
  116. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,187 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { SteamSetsCore } from "../core.js";
6
+ import { encodeJSON } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import * as components from "../models/components/index.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import { SteamSetsError } from "../models/errors/steamsetserror.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { APICall, APIPromise } from "../types/async.js";
28
+ import { Result } from "../types/fp.js";
29
+
30
+ /**
31
+ * Find owners of one or more trading cards or booster packs, with friend paths from the requester
32
+ */
33
+ export function itemFindOwners(
34
+ client: SteamSetsCore,
35
+ request: components.FindOwnersRequestBody,
36
+ options?: RequestOptions,
37
+ ): APIPromise<
38
+ Result<
39
+ operations.ItemFindOwnersResponse,
40
+ | errors.ErrorModel
41
+ | SteamSetsError
42
+ | ResponseValidationError
43
+ | ConnectionError
44
+ | RequestAbortedError
45
+ | RequestTimeoutError
46
+ | InvalidRequestError
47
+ | UnexpectedClientError
48
+ | SDKValidationError
49
+ >
50
+ > {
51
+ return new APIPromise($do(
52
+ client,
53
+ request,
54
+ options,
55
+ ));
56
+ }
57
+
58
+ async function $do(
59
+ client: SteamSetsCore,
60
+ request: components.FindOwnersRequestBody,
61
+ options?: RequestOptions,
62
+ ): Promise<
63
+ [
64
+ Result<
65
+ operations.ItemFindOwnersResponse,
66
+ | errors.ErrorModel
67
+ | SteamSetsError
68
+ | ResponseValidationError
69
+ | ConnectionError
70
+ | RequestAbortedError
71
+ | RequestTimeoutError
72
+ | InvalidRequestError
73
+ | UnexpectedClientError
74
+ | SDKValidationError
75
+ >,
76
+ APICall,
77
+ ]
78
+ > {
79
+ const parsed = safeParse(
80
+ request,
81
+ (value) => components.FindOwnersRequestBody$outboundSchema.parse(value),
82
+ "Input validation failed",
83
+ );
84
+ if (!parsed.ok) {
85
+ return [parsed, { status: "invalid" }];
86
+ }
87
+ const payload = parsed.value;
88
+ const body = encodeJSON("body", payload, { explode: true });
89
+
90
+ const path = pathToFunc("/v1/item.findOwners")();
91
+
92
+ const headers = new Headers(compactMap({
93
+ "Content-Type": "application/json",
94
+ Accept: "application/json",
95
+ }));
96
+
97
+ const secConfig = await extractSecurity(client._options.token);
98
+ const securityInput = secConfig == null ? {} : { token: secConfig };
99
+ const requestSecurity = resolveGlobalSecurity(securityInput);
100
+
101
+ const context = {
102
+ options: client._options,
103
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
104
+ operationID: "item.findOwners",
105
+ oAuth2Scopes: null,
106
+
107
+ resolvedSecurity: requestSecurity,
108
+
109
+ securitySource: client._options.token,
110
+ retryConfig: options?.retries
111
+ || client._options.retryConfig
112
+ || {
113
+ strategy: "backoff",
114
+ backoff: {
115
+ initialInterval: 500,
116
+ maxInterval: 5000,
117
+ exponent: 1.5,
118
+ maxElapsedTime: 60000,
119
+ },
120
+ retryConnectionErrors: true,
121
+ }
122
+ || { strategy: "none" },
123
+ retryCodes: options?.retryCodes || ["501", "502", "503", "504"],
124
+ };
125
+
126
+ const requestRes = client._createRequest(context, {
127
+ security: requestSecurity,
128
+ method: "POST",
129
+ baseURL: options?.serverURL,
130
+ path: path,
131
+ headers: headers,
132
+ body: body,
133
+ uaHeader: "x-speakeasy-user-agent",
134
+ userAgent: client._options.userAgent,
135
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
136
+ }, options);
137
+ if (!requestRes.ok) {
138
+ return [requestRes, { status: "invalid" }];
139
+ }
140
+ const req = requestRes.value;
141
+
142
+ const doResult = await client._do(req, {
143
+ context,
144
+ isErrorStatusCode: (statusCode: number) =>
145
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
146
+ retryConfig: context.retryConfig,
147
+ retryCodes: context.retryCodes,
148
+ });
149
+ if (!doResult.ok) {
150
+ return [doResult, { status: "request-error", request: req }];
151
+ }
152
+ const response = doResult.value;
153
+
154
+ const responseFields = {
155
+ HttpMeta: { Response: response, Request: req },
156
+ };
157
+
158
+ const [result] = await M.match<
159
+ operations.ItemFindOwnersResponse,
160
+ | errors.ErrorModel
161
+ | SteamSetsError
162
+ | ResponseValidationError
163
+ | ConnectionError
164
+ | RequestAbortedError
165
+ | RequestTimeoutError
166
+ | InvalidRequestError
167
+ | UnexpectedClientError
168
+ | SDKValidationError
169
+ >(
170
+ M.json(200, operations.ItemFindOwnersResponse$inboundSchema, {
171
+ key: "FindOwnersResponseBody",
172
+ }),
173
+ M.jsonErr([400, 401, 422], errors.ErrorModel$inboundSchema, {
174
+ ctype: "application/problem+json",
175
+ }),
176
+ M.jsonErr([500, 503], errors.ErrorModel$inboundSchema, {
177
+ ctype: "application/problem+json",
178
+ }),
179
+ M.fail("4XX"),
180
+ M.fail("5XX"),
181
+ )(response, req, { extraFields: responseFields });
182
+ if (!result.ok) {
183
+ return [result, { status: "complete", request: req, response }];
184
+ }
185
+
186
+ return [result, { status: "complete", request: req, response }];
187
+ }
package/src/lib/config.ts CHANGED
@@ -59,8 +59,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
59
59
  export const SDK_METADATA = {
60
60
  language: "typescript",
61
61
  openapiDocVersion: "1.0.0",
62
- sdkVersion: "0.33.6",
62
+ sdkVersion: "0.33.8",
63
63
  genVersion: "2.881.4",
64
64
  userAgent:
65
- "speakeasy-sdk/typescript 0.33.6 2.881.4 1.0.0 @steamsets/client-ts",
65
+ "speakeasy-sdk/typescript 0.33.8 2.881.4 1.0.0 @steamsets/client-ts",
66
66
  } as const;
@@ -0,0 +1,56 @@
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
+ import { TupleAccount, TupleAccount$inboundSchema } from "./tupleaccount.js";
10
+
11
+ export type ComparedTuple = {
12
+ accounts: Array<TupleAccount> | null;
13
+ appId: number;
14
+ appImage: string;
15
+ appName: string;
16
+ appType: string;
17
+ badgeImage: string;
18
+ badgeName: string;
19
+ isEvent: boolean;
20
+ isFoil: boolean;
21
+ isSale: boolean;
22
+ maxLevel: number;
23
+ scarcity: number;
24
+ steamId: number;
25
+ };
26
+
27
+ /** @internal */
28
+ export const ComparedTuple$inboundSchema: z.ZodType<
29
+ ComparedTuple,
30
+ z.ZodTypeDef,
31
+ unknown
32
+ > = z.object({
33
+ accounts: z.nullable(z.array(TupleAccount$inboundSchema)),
34
+ appId: z.number().int(),
35
+ appImage: z.string(),
36
+ appName: z.string(),
37
+ appType: z.string(),
38
+ badgeImage: z.string(),
39
+ badgeName: z.string(),
40
+ isEvent: z.boolean(),
41
+ isFoil: z.boolean(),
42
+ isSale: z.boolean(),
43
+ maxLevel: z.number().int(),
44
+ scarcity: z.number().int(),
45
+ steamId: z.number().int(),
46
+ });
47
+
48
+ export function comparedTupleFromJSON(
49
+ jsonString: string,
50
+ ): SafeParseResult<ComparedTuple, SDKValidationError> {
51
+ return safeParse(
52
+ jsonString,
53
+ (x) => ComparedTuple$inboundSchema.parse(JSON.parse(x)),
54
+ `Failed to parse 'ComparedTuple' from JSON`,
55
+ );
56
+ }
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+
7
+ export type FindOwnersRequestBody = {
8
+ /**
9
+ * Trading item class IDs to look up
10
+ */
11
+ itemIds: Array<number> | null;
12
+ /**
13
+ * Friend-path depth limit (default 4, max 6)
14
+ */
15
+ maxDepth?: number | undefined;
16
+ /**
17
+ * Max owners returned per item (default 10, max 25)
18
+ */
19
+ ownersPerItem?: number | undefined;
20
+ };
21
+
22
+ /** @internal */
23
+ export type FindOwnersRequestBody$Outbound = {
24
+ itemIds: Array<number> | null;
25
+ maxDepth?: number | undefined;
26
+ ownersPerItem?: number | undefined;
27
+ };
28
+
29
+ /** @internal */
30
+ export const FindOwnersRequestBody$outboundSchema: z.ZodType<
31
+ FindOwnersRequestBody$Outbound,
32
+ z.ZodTypeDef,
33
+ FindOwnersRequestBody
34
+ > = z.object({
35
+ itemIds: z.nullable(z.array(z.number().int())),
36
+ maxDepth: z.number().int().optional(),
37
+ ownersPerItem: z.number().int().optional(),
38
+ });
39
+
40
+ export function findOwnersRequestBodyToJSON(
41
+ findOwnersRequestBody: FindOwnersRequestBody,
42
+ ): string {
43
+ return JSON.stringify(
44
+ FindOwnersRequestBody$outboundSchema.parse(findOwnersRequestBody),
45
+ );
46
+ }
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
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 { ItemOwners, ItemOwners$inboundSchema } from "./itemowners.js";
11
+
12
+ export type FindOwnersResponseBody = {
13
+ /**
14
+ * A URL to the JSON Schema for this object.
15
+ */
16
+ dollarSchema?: string | undefined;
17
+ items: Array<ItemOwners> | null;
18
+ };
19
+
20
+ /** @internal */
21
+ export const FindOwnersResponseBody$inboundSchema: z.ZodType<
22
+ FindOwnersResponseBody,
23
+ z.ZodTypeDef,
24
+ unknown
25
+ > = z.object({
26
+ $schema: z.string().optional(),
27
+ items: z.nullable(z.array(ItemOwners$inboundSchema)),
28
+ }).transform((v) => {
29
+ return remap$(v, {
30
+ "$schema": "dollarSchema",
31
+ });
32
+ });
33
+
34
+ export function findOwnersResponseBodyFromJSON(
35
+ jsonString: string,
36
+ ): SafeParseResult<FindOwnersResponseBody, SDKValidationError> {
37
+ return safeParse(
38
+ jsonString,
39
+ (x) => FindOwnersResponseBody$inboundSchema.parse(JSON.parse(x)),
40
+ `Failed to parse 'FindOwnersResponseBody' from JSON`,
41
+ );
42
+ }
@@ -23,6 +23,7 @@ export * from "./city.js";
23
23
  export * from "./cmslistitem.js";
24
24
  export * from "./cmsversionitem.js";
25
25
  export * from "./colortag.js";
26
+ export * from "./comparedtuple.js";
26
27
  export * from "./connection.js";
27
28
  export * from "./country.js";
28
29
  export * from "./currentcolortag.js";
@@ -35,12 +36,15 @@ export * from "./developerappanalyticstimeseries.js";
35
36
  export * from "./developerappanalyticstimeseriespoint.js";
36
37
  export * from "./errordetail.js";
37
38
  export * from "./errormodel.js";
39
+ export * from "./findownersrequestbody.js";
40
+ export * from "./findownersresponsebody.js";
38
41
  export * from "./friendpath.js";
39
42
  export * from "./historyvalue.js";
40
43
  export * from "./httpmetadata.js";
41
44
  export * from "./idsearch.js";
42
45
  export * from "./image.js";
43
46
  export * from "./inventoryset.js";
47
+ export * from "./itemowners.js";
44
48
  export * from "./leaderboardaccount.js";
45
49
  export * from "./leaderboardchange.js";
46
50
  export * from "./leaderboardcity.js";
@@ -50,11 +54,15 @@ export * from "./leaderboardgetchangesresponsebody.js";
50
54
  export * from "./leaderboardregion.js";
51
55
  export * from "./leaderboardstate.js";
52
56
  export * from "./loginrequestbody.js";
57
+ export * from "./order.js";
58
+ export * from "./owner.js";
53
59
  export * from "./previewaccount.js";
54
60
  export * from "./range.js";
61
+ export * from "./rangefilter.js";
55
62
  export * from "./region.js";
56
63
  export * from "./reorderitemreq.js";
57
64
  export * from "./requestbody.js";
65
+ export * from "./resolvedaccount.js";
58
66
  export * from "./resource.js";
59
67
  export * from "./responsebody.js";
60
68
  export * from "./role.js";
@@ -67,6 +75,7 @@ export * from "./setremovedesigntag.js";
67
75
  export * from "./state.js";
68
76
  export * from "./trendingaccount.js";
69
77
  export * from "./trendingsearch.js";
78
+ export * from "./tupleaccount.js";
70
79
  export * from "./v1accountapp.js";
71
80
  export * from "./v1accountbadgebookmark.js";
72
81
  export * from "./v1accountbadgebookmarksresponsebody.js";
@@ -77,6 +86,8 @@ export * from "./v1accountbadgestats.js";
77
86
  export * from "./v1accountbadgexpstats.js";
78
87
  export * from "./v1accountbookmarkbadgerequestbody.js";
79
88
  export * from "./v1accountbookmarkbadgeresponsebody.js";
89
+ export * from "./v1accountcomparebadgesrequestbody.js";
90
+ export * from "./v1accountcomparebadgesresponsebody.js";
80
91
  export * from "./v1accountcreateconnectionrequestbody.js";
81
92
  export * from "./v1accountcreateconnectionresponsebody.js";
82
93
  export * from "./v1accountcreatedeveloperapprequestbody.js";
@@ -0,0 +1,34 @@
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
+ import { Owner, Owner$inboundSchema } from "./owner.js";
10
+
11
+ export type ItemOwners = {
12
+ classId: number;
13
+ owners: Array<Owner> | null;
14
+ };
15
+
16
+ /** @internal */
17
+ export const ItemOwners$inboundSchema: z.ZodType<
18
+ ItemOwners,
19
+ z.ZodTypeDef,
20
+ unknown
21
+ > = z.object({
22
+ classId: z.number().int(),
23
+ owners: z.nullable(z.array(Owner$inboundSchema)),
24
+ });
25
+
26
+ export function itemOwnersFromJSON(
27
+ jsonString: string,
28
+ ): SafeParseResult<ItemOwners, SDKValidationError> {
29
+ return safeParse(
30
+ jsonString,
31
+ (x) => ItemOwners$inboundSchema.parse(JSON.parse(x)),
32
+ `Failed to parse 'ItemOwners' from JSON`,
33
+ );
34
+ }
@@ -0,0 +1,53 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ export const By = {
9
+ Scarcity: "scarcity",
10
+ Level: "level",
11
+ Name: "name",
12
+ Xp: "xp",
13
+ CompletedAt: "completedAt",
14
+ } as const;
15
+ export type By = ClosedEnum<typeof By>;
16
+
17
+ export const Direction = {
18
+ Asc: "asc",
19
+ Desc: "desc",
20
+ } as const;
21
+ export type Direction = ClosedEnum<typeof Direction>;
22
+
23
+ export type Order = {
24
+ by?: By | undefined;
25
+ direction?: Direction | undefined;
26
+ };
27
+
28
+ /** @internal */
29
+ export const By$outboundSchema: z.ZodNativeEnum<typeof By> = z.nativeEnum(By);
30
+
31
+ /** @internal */
32
+ export const Direction$outboundSchema: z.ZodNativeEnum<typeof Direction> = z
33
+ .nativeEnum(Direction);
34
+
35
+ /** @internal */
36
+ export type Order$Outbound = {
37
+ by: string;
38
+ direction: string;
39
+ };
40
+
41
+ /** @internal */
42
+ export const Order$outboundSchema: z.ZodType<
43
+ Order$Outbound,
44
+ z.ZodTypeDef,
45
+ Order
46
+ > = z.object({
47
+ by: By$outboundSchema.default("scarcity"),
48
+ direction: Direction$outboundSchema.default("desc"),
49
+ });
50
+
51
+ export function orderToJSON(order: Order): string {
52
+ return JSON.stringify(Order$outboundSchema.parse(order));
53
+ }
@@ -0,0 +1,53 @@
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
+ import {
10
+ LeaderboardAccount,
11
+ LeaderboardAccount$inboundSchema,
12
+ } from "./leaderboardaccount.js";
13
+
14
+ export type Owner = {
15
+ account: LeaderboardAccount | null;
16
+ /**
17
+ * Number of copies owned
18
+ */
19
+ amount: number;
20
+ /**
21
+ * Number of hops from requester to owner
22
+ */
23
+ distance?: number | undefined;
24
+ /**
25
+ * Accounts from requester (first) to owner (last), inclusive
26
+ */
27
+ path?: Array<LeaderboardAccount | null> | null | undefined;
28
+ /**
29
+ * Whether a friend path was found within maxDepth
30
+ */
31
+ pathFound: boolean;
32
+ };
33
+
34
+ /** @internal */
35
+ export const Owner$inboundSchema: z.ZodType<Owner, z.ZodTypeDef, unknown> = z
36
+ .object({
37
+ account: z.nullable(LeaderboardAccount$inboundSchema),
38
+ amount: z.number().int(),
39
+ distance: z.number().int().optional(),
40
+ path: z.nullable(z.array(z.nullable(LeaderboardAccount$inboundSchema)))
41
+ .optional(),
42
+ pathFound: z.boolean(),
43
+ });
44
+
45
+ export function ownerFromJSON(
46
+ jsonString: string,
47
+ ): SafeParseResult<Owner, SDKValidationError> {
48
+ return safeParse(
49
+ jsonString,
50
+ (x) => Owner$inboundSchema.parse(JSON.parse(x)),
51
+ `Failed to parse 'Owner' from JSON`,
52
+ );
53
+ }
@@ -0,0 +1,44 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ export const RangeFilterType = {
9
+ Scarcity: "scarcity",
10
+ } as const;
11
+ export type RangeFilterType = ClosedEnum<typeof RangeFilterType>;
12
+
13
+ export type RangeFilter = {
14
+ max?: number | undefined;
15
+ min?: number | undefined;
16
+ type: RangeFilterType;
17
+ };
18
+
19
+ /** @internal */
20
+ export const RangeFilterType$outboundSchema: z.ZodNativeEnum<
21
+ typeof RangeFilterType
22
+ > = z.nativeEnum(RangeFilterType);
23
+
24
+ /** @internal */
25
+ export type RangeFilter$Outbound = {
26
+ max?: number | undefined;
27
+ min?: number | undefined;
28
+ type: string;
29
+ };
30
+
31
+ /** @internal */
32
+ export const RangeFilter$outboundSchema: z.ZodType<
33
+ RangeFilter$Outbound,
34
+ z.ZodTypeDef,
35
+ RangeFilter
36
+ > = z.object({
37
+ max: z.number().int().optional(),
38
+ min: z.number().int().optional(),
39
+ type: RangeFilterType$outboundSchema,
40
+ });
41
+
42
+ export function rangeFilterToJSON(rangeFilter: RangeFilter): string {
43
+ return JSON.stringify(RangeFilter$outboundSchema.parse(rangeFilter));
44
+ }
@@ -0,0 +1,37 @@
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 ResolvedAccount = {
11
+ accountId: number;
12
+ avatar: string;
13
+ steamId: string;
14
+ vanity?: string | undefined;
15
+ };
16
+
17
+ /** @internal */
18
+ export const ResolvedAccount$inboundSchema: z.ZodType<
19
+ ResolvedAccount,
20
+ z.ZodTypeDef,
21
+ unknown
22
+ > = z.object({
23
+ accountId: z.number().int(),
24
+ avatar: z.string(),
25
+ steamId: z.string(),
26
+ vanity: z.string().optional(),
27
+ });
28
+
29
+ export function resolvedAccountFromJSON(
30
+ jsonString: string,
31
+ ): SafeParseResult<ResolvedAccount, SDKValidationError> {
32
+ return safeParse(
33
+ jsonString,
34
+ (x) => ResolvedAccount$inboundSchema.parse(JSON.parse(x)),
35
+ `Failed to parse 'ResolvedAccount' from JSON`,
36
+ );
37
+ }
@@ -0,0 +1,38 @@
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 TupleAccount = {
11
+ completedAt?: Date | undefined;
12
+ level: number;
13
+ steamId: string;
14
+ xp: number;
15
+ };
16
+
17
+ /** @internal */
18
+ export const TupleAccount$inboundSchema: z.ZodType<
19
+ TupleAccount,
20
+ z.ZodTypeDef,
21
+ unknown
22
+ > = z.object({
23
+ completedAt: z.string().datetime({ offset: true }).transform(v => new Date(v))
24
+ .optional(),
25
+ level: z.number().int(),
26
+ steamId: z.string(),
27
+ xp: z.number().int(),
28
+ });
29
+
30
+ export function tupleAccountFromJSON(
31
+ jsonString: string,
32
+ ): SafeParseResult<TupleAccount, SDKValidationError> {
33
+ return safeParse(
34
+ jsonString,
35
+ (x) => TupleAccount$inboundSchema.parse(JSON.parse(x)),
36
+ `Failed to parse 'TupleAccount' from JSON`,
37
+ );
38
+ }