@steamsets/client-ts 0.30.1 → 0.31.0

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 (121) hide show
  1. package/README.md +5 -5
  2. package/examples/package-lock.json +1 -1
  3. package/funcs/accountAccountListInventorySets.d.ts +18 -0
  4. package/funcs/accountAccountListInventorySets.d.ts.map +1 -0
  5. package/funcs/{badgesListPrices.js → accountAccountListInventorySets.js} +18 -24
  6. package/funcs/accountAccountListInventorySets.js.map +1 -0
  7. package/funcs/accountAccountRefreshInventory.d.ts +18 -0
  8. package/funcs/accountAccountRefreshInventory.d.ts.map +1 -0
  9. package/funcs/accountAccountRefreshInventory.js +125 -0
  10. package/funcs/accountAccountRefreshInventory.js.map +1 -0
  11. package/jsr.json +1 -1
  12. package/lib/config.d.ts +3 -3
  13. package/lib/config.js +3 -3
  14. package/lib/config.js.map +1 -1
  15. package/models/components/card.d.ts +17 -0
  16. package/models/components/card.d.ts.map +1 -0
  17. package/models/components/{v1badgelevel.js → card.js} +8 -8
  18. package/models/components/card.js.map +1 -0
  19. package/models/components/index.d.ts +4 -9
  20. package/models/components/index.d.ts.map +1 -1
  21. package/models/components/index.js +4 -9
  22. package/models/components/index.js.map +1 -1
  23. package/models/components/inventoryset.d.ts +30 -0
  24. package/models/components/inventoryset.d.ts.map +1 -0
  25. package/models/components/{v1badgetypecount.js → inventoryset.js} +12 -9
  26. package/models/components/inventoryset.js.map +1 -0
  27. package/models/components/resource.d.ts +1 -0
  28. package/models/components/resource.d.ts.map +1 -1
  29. package/models/components/resource.js +1 -0
  30. package/models/components/resource.js.map +1 -1
  31. package/models/components/v1accountlistinventorysetsresponsebody.d.ts +26 -0
  32. package/models/components/v1accountlistinventorysetsresponsebody.d.ts.map +1 -0
  33. package/models/components/{v1badgelistbadgepricesresponsebody.js → v1accountlistinventorysetsresponsebody.js} +10 -13
  34. package/models/components/v1accountlistinventorysetsresponsebody.js.map +1 -0
  35. package/models/components/v1accountrefreshinventoryresponsebody.d.ts +17 -0
  36. package/models/components/v1accountrefreshinventoryresponsebody.d.ts.map +1 -0
  37. package/models/components/{errormodel.js → v1accountrefreshinventoryresponsebody.js} +7 -13
  38. package/models/components/v1accountrefreshinventoryresponsebody.js.map +1 -0
  39. package/models/operations/accountlistinventorysets.d.ts +15 -0
  40. package/models/operations/accountlistinventorysets.d.ts.map +1 -0
  41. package/models/operations/{badgelistbadgeprices.js → accountlistinventorysets.js} +9 -11
  42. package/models/operations/accountlistinventorysets.js.map +1 -0
  43. package/models/operations/accountrefreshinventory.d.ts +15 -0
  44. package/models/operations/accountrefreshinventory.d.ts.map +1 -0
  45. package/models/operations/accountrefreshinventory.js +59 -0
  46. package/models/operations/accountrefreshinventory.js.map +1 -0
  47. package/models/operations/index.d.ts +2 -1
  48. package/models/operations/index.d.ts.map +1 -1
  49. package/models/operations/index.js +2 -1
  50. package/models/operations/index.js.map +1 -1
  51. package/package.json +1 -1
  52. package/sdk/account.d.ts +14 -0
  53. package/sdk/account.d.ts.map +1 -1
  54. package/sdk/account.js +20 -0
  55. package/sdk/account.js.map +1 -1
  56. package/sdk/badges.d.ts +0 -11
  57. package/sdk/badges.d.ts.map +1 -1
  58. package/sdk/badges.js +1 -13
  59. package/sdk/badges.js.map +1 -1
  60. package/src/funcs/{badgesListPrices.ts → accountAccountListInventorySets.ts} +24 -29
  61. package/src/funcs/accountAccountRefreshInventory.ts +169 -0
  62. package/src/lib/config.ts +3 -3
  63. package/src/models/components/card.ts +36 -0
  64. package/src/models/components/index.ts +4 -9
  65. package/src/models/components/inventoryset.ts +55 -0
  66. package/src/models/components/resource.ts +1 -0
  67. package/src/models/components/v1accountlistinventorysetsresponsebody.ts +56 -0
  68. package/src/models/components/v1accountrefreshinventoryresponsebody.ts +45 -0
  69. package/src/models/operations/accountlistinventorysets.ts +47 -0
  70. package/src/models/operations/accountrefreshinventory.ts +47 -0
  71. package/src/models/operations/index.ts +2 -1
  72. package/src/sdk/account.ts +32 -0
  73. package/src/sdk/badges.ts +0 -23
  74. package/funcs/badgesListPrices.d.ts +0 -24
  75. package/funcs/badgesListPrices.d.ts.map +0 -1
  76. package/funcs/badgesListPrices.js.map +0 -1
  77. package/models/components/errormodel.d.ts +0 -38
  78. package/models/components/errormodel.d.ts.map +0 -1
  79. package/models/components/errormodel.js.map +0 -1
  80. package/models/components/v1badgeapp.d.ts +0 -15
  81. package/models/components/v1badgeapp.d.ts.map +0 -1
  82. package/models/components/v1badgeapp.js +0 -55
  83. package/models/components/v1badgeapp.js.map +0 -1
  84. package/models/components/v1badgelevel.d.ts +0 -12
  85. package/models/components/v1badgelevel.d.ts.map +0 -1
  86. package/models/components/v1badgelevel.js.map +0 -1
  87. package/models/components/v1badgelistbadgepricesrequestbody.d.ts +0 -8
  88. package/models/components/v1badgelistbadgepricesrequestbody.d.ts.map +0 -1
  89. package/models/components/v1badgelistbadgepricesrequestbody.js +0 -47
  90. package/models/components/v1badgelistbadgepricesrequestbody.js.map +0 -1
  91. package/models/components/v1badgelistbadgepricesresponsebody.d.ts +0 -31
  92. package/models/components/v1badgelistbadgepricesresponsebody.d.ts.map +0 -1
  93. package/models/components/v1badgelistbadgepricesresponsebody.js.map +0 -1
  94. package/models/components/v1badgeset.d.ts +0 -27
  95. package/models/components/v1badgeset.d.ts.map +0 -1
  96. package/models/components/v1badgeset.js +0 -65
  97. package/models/components/v1badgeset.js.map +0 -1
  98. package/models/components/v1badgesetcount.d.ts +0 -11
  99. package/models/components/v1badgesetcount.d.ts.map +0 -1
  100. package/models/components/v1badgesetcount.js +0 -51
  101. package/models/components/v1badgesetcount.js.map +0 -1
  102. package/models/components/v1badgesetcounts.d.ts +0 -13
  103. package/models/components/v1badgesetcounts.d.ts.map +0 -1
  104. package/models/components/v1badgesetcounts.js +0 -53
  105. package/models/components/v1badgesetcounts.js.map +0 -1
  106. package/models/components/v1badgetypecount.d.ts +0 -12
  107. package/models/components/v1badgetypecount.d.ts.map +0 -1
  108. package/models/components/v1badgetypecount.js.map +0 -1
  109. package/models/operations/badgelistbadgeprices.d.ts +0 -19
  110. package/models/operations/badgelistbadgeprices.d.ts.map +0 -1
  111. package/models/operations/badgelistbadgeprices.js.map +0 -1
  112. package/src/models/components/errormodel.ts +0 -70
  113. package/src/models/components/v1badgeapp.ts +0 -41
  114. package/src/models/components/v1badgelevel.ts +0 -35
  115. package/src/models/components/v1badgelistbadgepricesrequestbody.ts +0 -27
  116. package/src/models/components/v1badgelistbadgepricesresponsebody.ts +0 -63
  117. package/src/models/components/v1badgeset.ts +0 -62
  118. package/src/models/components/v1badgesetcount.ts +0 -33
  119. package/src/models/components/v1badgesetcounts.ts +0 -39
  120. package/src/models/components/v1badgetypecount.ts +0 -35
  121. package/src/models/operations/badgelistbadgeprices.ts +0 -52
package/sdk/badges.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"badges.js","sourceRoot":"","sources":["../src/sdk/badges.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,sEAGsC;AACtC,kEAA4D;AAC5D,wDAAkD;AAClD,4CAA2D;AAG3D,0CAA6C;AAE7C,oEAAoE;AAA3D,2HAAA,oBAAoB,OAAA;AAE7B,MAAa,MAAO,SAAQ,mBAAS;IACnC;;;;;OAKG;IACH,KAAK,CAAC,UAAU,CACd,OAAqD,EACrD,OAA0E;QAE1E,OAAO,IAAA,mBAAW,EAAC,IAAA,sCAAgB,EACjC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CACZ,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,kCAAc,EAC/B,IAAI,EACJ,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CACP,OAA8C,EAC9C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wBAAS,EAC1B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AA3CD,wBA2CC"}
1
+ {"version":3,"file":"badges.js","sourceRoot":"","sources":["../src/sdk/badges.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,kEAA4D;AAC5D,wDAAkD;AAClD,4CAA2D;AAG3D,0CAA6C;AAE7C,MAAa,MAAO,SAAQ,mBAAS;IACnC;;OAEG;IACH,KAAK,CAAC,QAAQ,CACZ,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,kCAAc,EAC/B,IAAI,EACJ,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CACP,OAA8C,EAC9C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wBAAS,EAC1B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AA1BD,wBA0BC"}
@@ -8,7 +8,6 @@ import { compactMap } from "../lib/primitives.js";
8
8
  import { RequestOptions } from "../lib/sdks.js";
9
9
  import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
10
10
  import { pathToFunc } from "../lib/url.js";
11
- import * as components from "../models/components/index.js";
12
11
  import {
13
12
  ConnectionError,
14
13
  InvalidRequestError,
@@ -16,6 +15,7 @@ import {
16
15
  RequestTimeoutError,
17
16
  UnexpectedClientError,
18
17
  } from "../models/errors/httpclienterrors.js";
18
+ import * as errors from "../models/errors/index.js";
19
19
  import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
20
20
  import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
21
21
  import { SteamSetsError } from "../models/errors/steamsetserror.js";
@@ -23,24 +23,19 @@ import * as operations from "../models/operations/index.js";
23
23
  import { APICall, APIPromise } from "../types/async.js";
24
24
  import { Result } from "../types/fp.js";
25
25
 
26
- export enum ListPricesAcceptEnum {
27
- applicationJson = "application/json",
28
- applicationProblemPlusJson = "application/problem+json",
29
- }
30
-
31
26
  /**
32
- * List badge prices
27
+ * List inventory sets
33
28
  *
34
29
  * @remarks
35
- * Get a list of all badge pricing information
30
+ * Get all trading card sets with ownership information for the authenticated user
36
31
  */
37
- export function badgesListPrices(
32
+ export function accountAccountListInventorySets(
38
33
  client: SteamSetsCore,
39
- _request: components.V1BadgeListBadgePricesRequestBody,
40
- options?: RequestOptions & { acceptHeaderOverride?: ListPricesAcceptEnum },
34
+ options?: RequestOptions,
41
35
  ): APIPromise<
42
36
  Result<
43
- operations.BadgeListBadgePricesResponse,
37
+ operations.AccountListInventorySetsResponse,
38
+ | errors.ErrorModel
44
39
  | SteamSetsError
45
40
  | ResponseValidationError
46
41
  | ConnectionError
@@ -53,19 +48,18 @@ export function badgesListPrices(
53
48
  > {
54
49
  return new APIPromise($do(
55
50
  client,
56
- _request,
57
51
  options,
58
52
  ));
59
53
  }
60
54
 
61
55
  async function $do(
62
56
  client: SteamSetsCore,
63
- _request: components.V1BadgeListBadgePricesRequestBody,
64
- options?: RequestOptions & { acceptHeaderOverride?: ListPricesAcceptEnum },
57
+ options?: RequestOptions,
65
58
  ): Promise<
66
59
  [
67
60
  Result<
68
- operations.BadgeListBadgePricesResponse,
61
+ operations.AccountListInventorySetsResponse,
62
+ | errors.ErrorModel
69
63
  | SteamSetsError
70
64
  | ResponseValidationError
71
65
  | ConnectionError
@@ -78,12 +72,10 @@ async function $do(
78
72
  APICall,
79
73
  ]
80
74
  > {
81
- const path = pathToFunc("/v1/badge.listBadgePrices")();
75
+ const path = pathToFunc("/v1/account.listInventorySets")();
82
76
 
83
77
  const headers = new Headers(compactMap({
84
- "Content-Type": "application/json",
85
- Accept: options?.acceptHeaderOverride
86
- || "application/json;q=1, application/problem+json;q=0",
78
+ Accept: "application/json",
87
79
  }));
88
80
 
89
81
  const secConfig = await extractSecurity(client._options.token);
@@ -93,7 +85,7 @@ async function $do(
93
85
  const context = {
94
86
  options: client._options,
95
87
  baseURL: options?.serverURL ?? client._baseURL ?? "",
96
- operationID: "badge.listBadgePrices",
88
+ operationID: "account.listInventorySets",
97
89
  oAuth2Scopes: null,
98
90
 
99
91
  resolvedSecurity: requestSecurity,
@@ -132,7 +124,7 @@ async function $do(
132
124
 
133
125
  const doResult = await client._do(req, {
134
126
  context,
135
- errorCodes: ["4XX", "5XX"],
127
+ errorCodes: ["400", "401", "404", "4XX", "500", "5XX"],
136
128
  retryConfig: context.retryConfig,
137
129
  retryCodes: context.retryCodes,
138
130
  });
@@ -146,7 +138,8 @@ async function $do(
146
138
  };
147
139
 
148
140
  const [result] = await M.match<
149
- operations.BadgeListBadgePricesResponse,
141
+ operations.AccountListInventorySetsResponse,
142
+ | errors.ErrorModel
150
143
  | SteamSetsError
151
144
  | ResponseValidationError
152
145
  | ConnectionError
@@ -156,15 +149,17 @@ async function $do(
156
149
  | UnexpectedClientError
157
150
  | SDKValidationError
158
151
  >(
159
- M.json(200, operations.BadgeListBadgePricesResponse$inboundSchema, {
160
- key: "V1BadgeListBadgePricesResponseBody",
152
+ M.json(200, operations.AccountListInventorySetsResponse$inboundSchema, {
153
+ key: "V1AccountListInventorySetsResponseBody",
161
154
  }),
162
- M.fail("4XX"),
163
- M.fail("5XX"),
164
- M.json("default", operations.BadgeListBadgePricesResponse$inboundSchema, {
155
+ M.jsonErr([400, 401, 404], errors.ErrorModel$inboundSchema, {
165
156
  ctype: "application/problem+json",
166
- key: "ErrorModel",
167
157
  }),
158
+ M.jsonErr(500, errors.ErrorModel$inboundSchema, {
159
+ ctype: "application/problem+json",
160
+ }),
161
+ M.fail("4XX"),
162
+ M.fail("5XX"),
168
163
  )(response, req, { extraFields: responseFields });
169
164
  if (!result.ok) {
170
165
  return [result, { status: "complete", request: req, response }];
@@ -0,0 +1,169 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { SteamSetsCore } from "../core.js";
6
+ import * as M from "../lib/matchers.js";
7
+ import { compactMap } from "../lib/primitives.js";
8
+ import { RequestOptions } from "../lib/sdks.js";
9
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
10
+ import { pathToFunc } from "../lib/url.js";
11
+ import {
12
+ ConnectionError,
13
+ InvalidRequestError,
14
+ RequestAbortedError,
15
+ RequestTimeoutError,
16
+ UnexpectedClientError,
17
+ } from "../models/errors/httpclienterrors.js";
18
+ import * as errors from "../models/errors/index.js";
19
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
20
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
21
+ import { SteamSetsError } from "../models/errors/steamsetserror.js";
22
+ import * as operations from "../models/operations/index.js";
23
+ import { APICall, APIPromise } from "../types/async.js";
24
+ import { Result } from "../types/fp.js";
25
+
26
+ /**
27
+ * Refresh inventory
28
+ *
29
+ * @remarks
30
+ * Trigger a refresh of the authenticated user's Steam inventory. Rate limited based on account tier.
31
+ */
32
+ export function accountAccountRefreshInventory(
33
+ client: SteamSetsCore,
34
+ options?: RequestOptions,
35
+ ): APIPromise<
36
+ Result<
37
+ operations.AccountRefreshInventoryResponse,
38
+ | errors.ErrorModel
39
+ | SteamSetsError
40
+ | ResponseValidationError
41
+ | ConnectionError
42
+ | RequestAbortedError
43
+ | RequestTimeoutError
44
+ | InvalidRequestError
45
+ | UnexpectedClientError
46
+ | SDKValidationError
47
+ >
48
+ > {
49
+ return new APIPromise($do(
50
+ client,
51
+ options,
52
+ ));
53
+ }
54
+
55
+ async function $do(
56
+ client: SteamSetsCore,
57
+ options?: RequestOptions,
58
+ ): Promise<
59
+ [
60
+ Result<
61
+ operations.AccountRefreshInventoryResponse,
62
+ | errors.ErrorModel
63
+ | SteamSetsError
64
+ | ResponseValidationError
65
+ | ConnectionError
66
+ | RequestAbortedError
67
+ | RequestTimeoutError
68
+ | InvalidRequestError
69
+ | UnexpectedClientError
70
+ | SDKValidationError
71
+ >,
72
+ APICall,
73
+ ]
74
+ > {
75
+ const path = pathToFunc("/v1/account.refreshInventory")();
76
+
77
+ const headers = new Headers(compactMap({
78
+ Accept: "application/json",
79
+ }));
80
+
81
+ const secConfig = await extractSecurity(client._options.token);
82
+ const securityInput = secConfig == null ? {} : { token: secConfig };
83
+ const requestSecurity = resolveGlobalSecurity(securityInput);
84
+
85
+ const context = {
86
+ options: client._options,
87
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
88
+ operationID: "account.refreshInventory",
89
+ oAuth2Scopes: null,
90
+
91
+ resolvedSecurity: requestSecurity,
92
+
93
+ securitySource: client._options.token,
94
+ retryConfig: options?.retries
95
+ || client._options.retryConfig
96
+ || {
97
+ strategy: "backoff",
98
+ backoff: {
99
+ initialInterval: 500,
100
+ maxInterval: 5000,
101
+ exponent: 1.5,
102
+ maxElapsedTime: 60000,
103
+ },
104
+ retryConnectionErrors: true,
105
+ }
106
+ || { strategy: "none" },
107
+ retryCodes: options?.retryCodes || ["501", "502", "503", "504"],
108
+ };
109
+
110
+ const requestRes = client._createRequest(context, {
111
+ security: requestSecurity,
112
+ method: "POST",
113
+ baseURL: options?.serverURL,
114
+ path: path,
115
+ headers: headers,
116
+ uaHeader: "x-speakeasy-user-agent",
117
+ userAgent: client._options.userAgent,
118
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
119
+ }, options);
120
+ if (!requestRes.ok) {
121
+ return [requestRes, { status: "invalid" }];
122
+ }
123
+ const req = requestRes.value;
124
+
125
+ const doResult = await client._do(req, {
126
+ context,
127
+ errorCodes: ["400", "401", "404", "429", "4XX", "500", "5XX"],
128
+ retryConfig: context.retryConfig,
129
+ retryCodes: context.retryCodes,
130
+ });
131
+ if (!doResult.ok) {
132
+ return [doResult, { status: "request-error", request: req }];
133
+ }
134
+ const response = doResult.value;
135
+
136
+ const responseFields = {
137
+ HttpMeta: { Response: response, Request: req },
138
+ };
139
+
140
+ const [result] = await M.match<
141
+ operations.AccountRefreshInventoryResponse,
142
+ | errors.ErrorModel
143
+ | SteamSetsError
144
+ | ResponseValidationError
145
+ | ConnectionError
146
+ | RequestAbortedError
147
+ | RequestTimeoutError
148
+ | InvalidRequestError
149
+ | UnexpectedClientError
150
+ | SDKValidationError
151
+ >(
152
+ M.json(200, operations.AccountRefreshInventoryResponse$inboundSchema, {
153
+ key: "V1AccountRefreshInventoryResponseBody",
154
+ }),
155
+ M.jsonErr([400, 401, 404, 429], errors.ErrorModel$inboundSchema, {
156
+ ctype: "application/problem+json",
157
+ }),
158
+ M.jsonErr(500, errors.ErrorModel$inboundSchema, {
159
+ ctype: "application/problem+json",
160
+ }),
161
+ M.fail("4XX"),
162
+ M.fail("5XX"),
163
+ )(response, req, { extraFields: responseFields });
164
+ if (!result.ok) {
165
+ return [result, { status: "complete", request: req, response }];
166
+ }
167
+
168
+ return [result, { status: "complete", request: req, response }];
169
+ }
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.30.1",
63
- genVersion: "2.788.7",
62
+ sdkVersion: "0.31.0",
63
+ genVersion: "2.788.15",
64
64
  userAgent:
65
- "speakeasy-sdk/typescript 0.30.1 2.788.7 1.0.0 @steamsets/client-ts",
65
+ "speakeasy-sdk/typescript 0.31.0 2.788.15 1.0.0 @steamsets/client-ts",
66
66
  } as const;
@@ -0,0 +1,36 @@
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 Card = {
11
+ /**
12
+ * Owned amount
13
+ */
14
+ amount: number;
15
+ /**
16
+ * Card name
17
+ */
18
+ name: string;
19
+ };
20
+
21
+ /** @internal */
22
+ export const Card$inboundSchema: z.ZodType<Card, z.ZodTypeDef, unknown> = z
23
+ .object({
24
+ amount: z.number().int(),
25
+ name: z.string(),
26
+ });
27
+
28
+ export function cardFromJSON(
29
+ jsonString: string,
30
+ ): SafeParseResult<Card, SDKValidationError> {
31
+ return safeParse(
32
+ jsonString,
33
+ (x) => Card$inboundSchema.parse(JSON.parse(x)),
34
+ `Failed to parse 'Card' from JSON`,
35
+ );
36
+ }
@@ -9,6 +9,7 @@ export * from "./badge.js";
9
9
  export * from "./badgesuggesttags.js";
10
10
  export * from "./badgevaluefilter.js";
11
11
  export * from "./bestleaderboardrank.js";
12
+ export * from "./card.js";
12
13
  export * from "./chosenrole.js";
13
14
  export * from "./city.js";
14
15
  export * from "./colortag.js";
@@ -23,10 +24,10 @@ export * from "./developerappanalyticsoutcome.js";
23
24
  export * from "./developerappanalyticstimeseries.js";
24
25
  export * from "./developerappanalyticstimeseriespoint.js";
25
26
  export * from "./errordetail.js";
26
- export * from "./errormodel.js";
27
27
  export * from "./httpmetadata.js";
28
28
  export * from "./idsearch.js";
29
29
  export * from "./image.js";
30
+ export * from "./inventoryset.js";
30
31
  export * from "./leaderboardaccount.js";
31
32
  export * from "./leaderboardcity.js";
32
33
  export * from "./leaderboardcountry.js";
@@ -82,12 +83,14 @@ export * from "./v1accountlistbadgesrequestbody.js";
82
83
  export * from "./v1accountlistbadgesresponsebody.js";
83
84
  export * from "./v1accountlistfriendsresponsebody.js";
84
85
  export * from "./v1accountlistimagesresponsebody.js";
86
+ export * from "./v1accountlistinventorysetsresponsebody.js";
85
87
  export * from "./v1accountlistleaderboardhistoryresponsebody.js";
86
88
  export * from "./v1accountloginresponsebody.js";
87
89
  export * from "./v1accountplaytimedatapoint.js";
88
90
  export * from "./v1accountqueueupdaterequestbody.js";
89
91
  export * from "./v1accountreconnectrequestbody.js";
90
92
  export * from "./v1accountreconnectresponsebody.js";
93
+ export * from "./v1accountrefreshinventoryresponsebody.js";
91
94
  export * from "./v1accountrefreshsessionbody.js";
92
95
  export * from "./v1accountrefreshsessionrequestbody.js";
93
96
  export * from "./v1accountsubscribeemailrequestbody.js";
@@ -110,21 +113,13 @@ export * from "./v1appfilters.js";
110
113
  export * from "./v1applistbadgesrequestbody.js";
111
114
  export * from "./v1applistbadgesresponsebody.js";
112
115
  export * from "./v1apporder.js";
113
- export * from "./v1badgeapp.js";
114
116
  export * from "./v1badgefilters.js";
115
- export * from "./v1badgelevel.js";
116
- export * from "./v1badgelistbadgepricesrequestbody.js";
117
- export * from "./v1badgelistbadgepricesresponsebody.js";
118
117
  export * from "./v1badgelisttagsresponsebody.js";
119
118
  export * from "./v1badgeorder.js";
120
119
  export * from "./v1badgesearchbadgesresponsebody.js";
121
- export * from "./v1badgeset.js";
122
- export * from "./v1badgesetcount.js";
123
- export * from "./v1badgesetcounts.js";
124
120
  export * from "./v1badgesuggesttagsrequestbody.js";
125
121
  export * from "./v1badgetagbadgerequestbody.js";
126
122
  export * from "./v1badgetagbadgeresponsebody.js";
127
- export * from "./v1badgetypecount.js";
128
123
  export * from "./v1groupleaderboardgroup.js";
129
124
  export * from "./v1leaderboardappinfo.js";
130
125
  export * from "./v1leaderboardbadge.js";
@@ -0,0 +1,55 @@
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 { Card, Card$inboundSchema } from "./card.js";
10
+
11
+ export type InventorySet = {
12
+ /**
13
+ * The app id
14
+ */
15
+ appId: number;
16
+ /**
17
+ * Foil cards with owned amounts
18
+ */
19
+ foil: Array<Card> | null;
20
+ /**
21
+ * Number of complete foil sets
22
+ */
23
+ foilSets: number;
24
+ /**
25
+ * Normal cards with owned amounts
26
+ */
27
+ normal: Array<Card> | null;
28
+ /**
29
+ * Number of complete normal sets
30
+ */
31
+ normalSets: number;
32
+ };
33
+
34
+ /** @internal */
35
+ export const InventorySet$inboundSchema: z.ZodType<
36
+ InventorySet,
37
+ z.ZodTypeDef,
38
+ unknown
39
+ > = z.object({
40
+ appId: z.number().int(),
41
+ foil: z.nullable(z.array(Card$inboundSchema)),
42
+ foilSets: z.number().int(),
43
+ normal: z.nullable(z.array(Card$inboundSchema)),
44
+ normalSets: z.number().int(),
45
+ });
46
+
47
+ export function inventorySetFromJSON(
48
+ jsonString: string,
49
+ ): SafeParseResult<InventorySet, SDKValidationError> {
50
+ return safeParse(
51
+ jsonString,
52
+ (x) => InventorySet$inboundSchema.parse(JSON.parse(x)),
53
+ `Failed to parse 'InventorySet' from JSON`,
54
+ );
55
+ }
@@ -17,6 +17,7 @@ export const ResourceResource = {
17
17
  MaxLeaderboardEntries: "max_leaderboard_entries",
18
18
  MiniBackground: "mini_background",
19
19
  AccountRefreshRate: "account_refresh_rate",
20
+ InventoryRefreshRate: "inventory_refresh_rate",
20
21
  SocialLinks: "social_links",
21
22
  Vanity: "vanity",
22
23
  DeveloperApps: "developer_apps",
@@ -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 { 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 { InventorySet, InventorySet$inboundSchema } from "./inventoryset.js";
11
+
12
+ export type V1AccountListInventorySetsResponseBody = {
13
+ /**
14
+ * A URL to the JSON Schema for this object.
15
+ */
16
+ dollarSchema?: string | undefined;
17
+ /**
18
+ * When inventory was last updated (unix millis)
19
+ */
20
+ inventoryUpdatedAt?: number | undefined;
21
+ /**
22
+ * When next refresh is allowed (unix seconds)
23
+ */
24
+ nextRefreshAt?: number | undefined;
25
+ /**
26
+ * Inventory sets with ownership info
27
+ */
28
+ sets: Array<InventorySet> | null;
29
+ };
30
+
31
+ /** @internal */
32
+ export const V1AccountListInventorySetsResponseBody$inboundSchema: z.ZodType<
33
+ V1AccountListInventorySetsResponseBody,
34
+ z.ZodTypeDef,
35
+ unknown
36
+ > = z.object({
37
+ $schema: z.string().optional(),
38
+ inventoryUpdatedAt: z.number().int().optional(),
39
+ nextRefreshAt: z.number().int().optional(),
40
+ sets: z.nullable(z.array(InventorySet$inboundSchema)),
41
+ }).transform((v) => {
42
+ return remap$(v, {
43
+ "$schema": "dollarSchema",
44
+ });
45
+ });
46
+
47
+ export function v1AccountListInventorySetsResponseBodyFromJSON(
48
+ jsonString: string,
49
+ ): SafeParseResult<V1AccountListInventorySetsResponseBody, SDKValidationError> {
50
+ return safeParse(
51
+ jsonString,
52
+ (x) =>
53
+ V1AccountListInventorySetsResponseBody$inboundSchema.parse(JSON.parse(x)),
54
+ `Failed to parse 'V1AccountListInventorySetsResponseBody' from JSON`,
55
+ );
56
+ }
@@ -0,0 +1,45 @@
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
+
11
+ export type V1AccountRefreshInventoryResponseBody = {
12
+ /**
13
+ * A URL to the JSON Schema for this object.
14
+ */
15
+ dollarSchema?: string | undefined;
16
+ /**
17
+ * Unix timestamp (seconds) when next refresh is allowed
18
+ */
19
+ nextRefreshAt: number;
20
+ };
21
+
22
+ /** @internal */
23
+ export const V1AccountRefreshInventoryResponseBody$inboundSchema: z.ZodType<
24
+ V1AccountRefreshInventoryResponseBody,
25
+ z.ZodTypeDef,
26
+ unknown
27
+ > = z.object({
28
+ $schema: z.string().optional(),
29
+ nextRefreshAt: z.number().int(),
30
+ }).transform((v) => {
31
+ return remap$(v, {
32
+ "$schema": "dollarSchema",
33
+ });
34
+ });
35
+
36
+ export function v1AccountRefreshInventoryResponseBodyFromJSON(
37
+ jsonString: string,
38
+ ): SafeParseResult<V1AccountRefreshInventoryResponseBody, SDKValidationError> {
39
+ return safeParse(
40
+ jsonString,
41
+ (x) =>
42
+ V1AccountRefreshInventoryResponseBody$inboundSchema.parse(JSON.parse(x)),
43
+ `Failed to parse 'V1AccountRefreshInventoryResponseBody' from JSON`,
44
+ );
45
+ }
@@ -0,0 +1,47 @@
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 * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type AccountListInventorySetsResponse = {
13
+ httpMeta: components.HTTPMetadata;
14
+ /**
15
+ * OK
16
+ */
17
+ v1AccountListInventorySetsResponseBody?:
18
+ | components.V1AccountListInventorySetsResponseBody
19
+ | undefined;
20
+ };
21
+
22
+ /** @internal */
23
+ export const AccountListInventorySetsResponse$inboundSchema: z.ZodType<
24
+ AccountListInventorySetsResponse,
25
+ z.ZodTypeDef,
26
+ unknown
27
+ > = z.object({
28
+ HttpMeta: components.HTTPMetadata$inboundSchema,
29
+ V1AccountListInventorySetsResponseBody: components
30
+ .V1AccountListInventorySetsResponseBody$inboundSchema.optional(),
31
+ }).transform((v) => {
32
+ return remap$(v, {
33
+ "HttpMeta": "httpMeta",
34
+ "V1AccountListInventorySetsResponseBody":
35
+ "v1AccountListInventorySetsResponseBody",
36
+ });
37
+ });
38
+
39
+ export function accountListInventorySetsResponseFromJSON(
40
+ jsonString: string,
41
+ ): SafeParseResult<AccountListInventorySetsResponse, SDKValidationError> {
42
+ return safeParse(
43
+ jsonString,
44
+ (x) => AccountListInventorySetsResponse$inboundSchema.parse(JSON.parse(x)),
45
+ `Failed to parse 'AccountListInventorySetsResponse' from JSON`,
46
+ );
47
+ }
@@ -0,0 +1,47 @@
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 * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type AccountRefreshInventoryResponse = {
13
+ httpMeta: components.HTTPMetadata;
14
+ /**
15
+ * OK
16
+ */
17
+ v1AccountRefreshInventoryResponseBody?:
18
+ | components.V1AccountRefreshInventoryResponseBody
19
+ | undefined;
20
+ };
21
+
22
+ /** @internal */
23
+ export const AccountRefreshInventoryResponse$inboundSchema: z.ZodType<
24
+ AccountRefreshInventoryResponse,
25
+ z.ZodTypeDef,
26
+ unknown
27
+ > = z.object({
28
+ HttpMeta: components.HTTPMetadata$inboundSchema,
29
+ V1AccountRefreshInventoryResponseBody: components
30
+ .V1AccountRefreshInventoryResponseBody$inboundSchema.optional(),
31
+ }).transform((v) => {
32
+ return remap$(v, {
33
+ "HttpMeta": "httpMeta",
34
+ "V1AccountRefreshInventoryResponseBody":
35
+ "v1AccountRefreshInventoryResponseBody",
36
+ });
37
+ });
38
+
39
+ export function accountRefreshInventoryResponseFromJSON(
40
+ jsonString: string,
41
+ ): SafeParseResult<AccountRefreshInventoryResponse, SDKValidationError> {
42
+ return safeParse(
43
+ jsonString,
44
+ (x) => AccountRefreshInventoryResponse$inboundSchema.parse(JSON.parse(x)),
45
+ `Failed to parse 'AccountRefreshInventoryResponse' from JSON`,
46
+ );
47
+ }