@steamsets/client-ts 0.26.0 → 0.26.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.
- package/README.md +6 -4
- package/docs/sdks/account/README.md +6 -6
- package/docs/sdks/badge/README.md +9 -9
- package/docs/sdks/badges/README.md +69 -0
- package/funcs/{accountAccountGetBadgeStats.d.ts → accountGetBadgeStats.d.ts} +2 -2
- package/funcs/accountGetBadgeStats.d.ts.map +1 -0
- package/funcs/{accountAccountGetBadgeStats.js → accountGetBadgeStats.js} +3 -3
- package/funcs/accountGetBadgeStats.js.map +1 -0
- package/funcs/{badgeBadgeListBadgePrices.d.ts → badgeBadgeListAccounts.d.ts} +2 -2
- package/funcs/badgeBadgeListAccounts.d.ts.map +1 -0
- package/funcs/badgeBadgeListAccounts.js +120 -0
- package/funcs/badgeBadgeListAccounts.js.map +1 -0
- package/funcs/badgesListPrices.d.ts +13 -0
- package/funcs/badgesListPrices.d.ts.map +1 -0
- package/funcs/{badgeBadgeListBadgePrices.js → badgesListPrices.js} +3 -3
- package/funcs/badgesListPrices.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/files.d.ts +5 -0
- package/lib/files.d.ts.map +1 -1
- package/lib/files.js +41 -0
- package/lib/files.js.map +1 -1
- package/models/components/index.d.ts +4 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +4 -0
- package/models/components/index.js.map +1 -1
- package/models/components/v1accountgetsessionbody.d.ts +1 -1
- package/models/components/v1accountleaderboardbadgesearch.d.ts +1 -1
- package/models/components/v1badgeaccount.d.ts +229 -0
- package/models/components/v1badgeaccount.d.ts.map +1 -0
- package/models/components/v1badgeaccount.js +154 -0
- package/models/components/v1badgeaccount.js.map +1 -0
- package/models/components/v1badgelistaccountsrequestbody.d.ts +32 -0
- package/models/components/v1badgelistaccountsrequestbody.d.ts.map +1 -0
- package/models/components/v1badgelistaccountsrequestbody.js +62 -0
- package/models/components/v1badgelistaccountsrequestbody.js.map +1 -0
- package/models/components/v1badgelistaccountsresponsebody.d.ts +40 -0
- package/models/components/v1badgelistaccountsresponsebody.d.ts.map +1 -0
- package/models/components/v1badgelistaccountsresponsebody.js +76 -0
- package/models/components/v1badgelistaccountsresponsebody.js.map +1 -0
- package/models/components/v1badgelookup.d.ts +33 -0
- package/models/components/v1badgelookup.d.ts.map +1 -0
- package/models/components/v1badgelookup.js +63 -0
- package/models/components/v1badgelookup.js.map +1 -0
- package/models/operations/badgelistaccounts.d.ts +35 -0
- package/models/operations/badgelistaccounts.d.ts.map +1 -0
- package/models/operations/badgelistaccounts.js +75 -0
- package/models/operations/badgelistaccounts.js.map +1 -0
- package/models/operations/index.d.ts +1 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -0
- package/models/operations/index.js.map +1 -1
- package/package.json +1 -1
- package/sdk/account.d.ts +1 -1
- package/sdk/account.d.ts.map +1 -1
- package/sdk/account.js +3 -3
- package/sdk/account.js.map +1 -1
- package/sdk/badge.d.ts +1 -1
- package/sdk/badge.d.ts.map +1 -1
- package/sdk/badge.js +3 -3
- package/sdk/badge.js.map +1 -1
- package/sdk/badges.d.ts +1 -0
- package/sdk/badges.d.ts.map +1 -1
- package/sdk/badges.js +4 -0
- package/sdk/badges.js.map +1 -1
- package/src/funcs/{accountAccountGetBadgeStats.ts → accountGetBadgeStats.ts} +1 -1
- package/src/funcs/badgeBadgeListAccounts.ts +183 -0
- package/src/funcs/{badgeBadgeListBadgePrices.ts → badgesListPrices.ts} +1 -1
- package/src/lib/config.ts +3 -3
- package/src/lib/files.ts +42 -0
- package/src/models/components/index.ts +4 -0
- package/src/models/components/v1accountgetsessionbody.ts +1 -1
- package/src/models/components/v1accountleaderboardbadgesearch.ts +1 -1
- package/src/models/components/v1badgeaccount.ts +358 -0
- package/src/models/components/v1badgelistaccountsrequestbody.ts +78 -0
- package/src/models/components/v1badgelistaccountsresponsebody.ts +104 -0
- package/src/models/components/v1badgelookup.ts +70 -0
- package/src/models/operations/badgelistaccounts.ts +91 -0
- package/src/models/operations/index.ts +1 -0
- package/src/sdk/account.ts +3 -3
- package/src/sdk/badge.ts +5 -5
- package/src/sdk/badges.ts +12 -0
- package/funcs/accountAccountGetBadgeStats.d.ts.map +0 -1
- package/funcs/accountAccountGetBadgeStats.js.map +0 -1
- package/funcs/badgeBadgeListBadgePrices.d.ts.map +0 -1
- package/funcs/badgeBadgeListBadgePrices.js.map +0 -1
|
@@ -0,0 +1,183 @@
|
|
|
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 * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as components from "../models/components/index.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import { SteamSetsError } from "../models/errors/steamsetserror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
export function badgeBadgeListAccounts(
|
|
30
|
+
client: SteamSetsCore,
|
|
31
|
+
request: components.V1BadgeListAccountsRequestBody,
|
|
32
|
+
options?: RequestOptions,
|
|
33
|
+
): APIPromise<
|
|
34
|
+
Result<
|
|
35
|
+
operations.BadgeListAccountsResponse,
|
|
36
|
+
| errors.ErrorModel
|
|
37
|
+
| SteamSetsError
|
|
38
|
+
| ResponseValidationError
|
|
39
|
+
| ConnectionError
|
|
40
|
+
| RequestAbortedError
|
|
41
|
+
| RequestTimeoutError
|
|
42
|
+
| InvalidRequestError
|
|
43
|
+
| UnexpectedClientError
|
|
44
|
+
| SDKValidationError
|
|
45
|
+
>
|
|
46
|
+
> {
|
|
47
|
+
return new APIPromise($do(
|
|
48
|
+
client,
|
|
49
|
+
request,
|
|
50
|
+
options,
|
|
51
|
+
));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function $do(
|
|
55
|
+
client: SteamSetsCore,
|
|
56
|
+
request: components.V1BadgeListAccountsRequestBody,
|
|
57
|
+
options?: RequestOptions,
|
|
58
|
+
): Promise<
|
|
59
|
+
[
|
|
60
|
+
Result<
|
|
61
|
+
operations.BadgeListAccountsResponse,
|
|
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 parsed = safeParse(
|
|
76
|
+
request,
|
|
77
|
+
(value) =>
|
|
78
|
+
components.V1BadgeListAccountsRequestBody$outboundSchema.parse(value),
|
|
79
|
+
"Input validation failed",
|
|
80
|
+
);
|
|
81
|
+
if (!parsed.ok) {
|
|
82
|
+
return [parsed, { status: "invalid" }];
|
|
83
|
+
}
|
|
84
|
+
const payload = parsed.value;
|
|
85
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
86
|
+
|
|
87
|
+
const path = pathToFunc("/v1/badge.listAccounts")();
|
|
88
|
+
|
|
89
|
+
const headers = new Headers(compactMap({
|
|
90
|
+
"Content-Type": "application/json",
|
|
91
|
+
Accept: "application/json",
|
|
92
|
+
}));
|
|
93
|
+
|
|
94
|
+
const secConfig = await extractSecurity(client._options.token);
|
|
95
|
+
const securityInput = secConfig == null ? {} : { token: secConfig };
|
|
96
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
97
|
+
|
|
98
|
+
const context = {
|
|
99
|
+
options: client._options,
|
|
100
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
101
|
+
operationID: "badge.listAccounts",
|
|
102
|
+
oAuth2Scopes: [],
|
|
103
|
+
|
|
104
|
+
resolvedSecurity: requestSecurity,
|
|
105
|
+
|
|
106
|
+
securitySource: client._options.token,
|
|
107
|
+
retryConfig: options?.retries
|
|
108
|
+
|| client._options.retryConfig
|
|
109
|
+
|| {
|
|
110
|
+
strategy: "backoff",
|
|
111
|
+
backoff: {
|
|
112
|
+
initialInterval: 500,
|
|
113
|
+
maxInterval: 5000,
|
|
114
|
+
exponent: 1.5,
|
|
115
|
+
maxElapsedTime: 60000,
|
|
116
|
+
},
|
|
117
|
+
retryConnectionErrors: true,
|
|
118
|
+
}
|
|
119
|
+
|| { strategy: "none" },
|
|
120
|
+
retryCodes: options?.retryCodes || ["501", "502", "503", "504"],
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const requestRes = client._createRequest(context, {
|
|
124
|
+
security: requestSecurity,
|
|
125
|
+
method: "POST",
|
|
126
|
+
baseURL: options?.serverURL,
|
|
127
|
+
path: path,
|
|
128
|
+
headers: headers,
|
|
129
|
+
body: body,
|
|
130
|
+
uaHeader: "x-speakeasy-user-agent",
|
|
131
|
+
userAgent: client._options.userAgent,
|
|
132
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
133
|
+
}, options);
|
|
134
|
+
if (!requestRes.ok) {
|
|
135
|
+
return [requestRes, { status: "invalid" }];
|
|
136
|
+
}
|
|
137
|
+
const req = requestRes.value;
|
|
138
|
+
|
|
139
|
+
const doResult = await client._do(req, {
|
|
140
|
+
context,
|
|
141
|
+
errorCodes: ["400", "404", "422", "4XX", "500", "5XX"],
|
|
142
|
+
retryConfig: context.retryConfig,
|
|
143
|
+
retryCodes: context.retryCodes,
|
|
144
|
+
});
|
|
145
|
+
if (!doResult.ok) {
|
|
146
|
+
return [doResult, { status: "request-error", request: req }];
|
|
147
|
+
}
|
|
148
|
+
const response = doResult.value;
|
|
149
|
+
|
|
150
|
+
const responseFields = {
|
|
151
|
+
HttpMeta: { Response: response, Request: req },
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const [result] = await M.match<
|
|
155
|
+
operations.BadgeListAccountsResponse,
|
|
156
|
+
| errors.ErrorModel
|
|
157
|
+
| SteamSetsError
|
|
158
|
+
| ResponseValidationError
|
|
159
|
+
| ConnectionError
|
|
160
|
+
| RequestAbortedError
|
|
161
|
+
| RequestTimeoutError
|
|
162
|
+
| InvalidRequestError
|
|
163
|
+
| UnexpectedClientError
|
|
164
|
+
| SDKValidationError
|
|
165
|
+
>(
|
|
166
|
+
M.json(200, operations.BadgeListAccountsResponse$inboundSchema, {
|
|
167
|
+
key: "V1BadgeListAccountsResponseBody",
|
|
168
|
+
}),
|
|
169
|
+
M.jsonErr([400, 404, 422], errors.ErrorModel$inboundSchema, {
|
|
170
|
+
ctype: "application/problem+json",
|
|
171
|
+
}),
|
|
172
|
+
M.jsonErr(500, errors.ErrorModel$inboundSchema, {
|
|
173
|
+
ctype: "application/problem+json",
|
|
174
|
+
}),
|
|
175
|
+
M.fail("4XX"),
|
|
176
|
+
M.fail("5XX"),
|
|
177
|
+
)(response, req, { extraFields: responseFields });
|
|
178
|
+
if (!result.ok) {
|
|
179
|
+
return [result, { status: "complete", request: req, response }];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return [result, { status: "complete", request: req, response }];
|
|
183
|
+
}
|
|
@@ -26,7 +26,7 @@ import * as operations from "../models/operations/index.js";
|
|
|
26
26
|
import { APICall, APIPromise } from "../types/async.js";
|
|
27
27
|
import { Result } from "../types/fp.js";
|
|
28
28
|
|
|
29
|
-
export function
|
|
29
|
+
export function badgesListPrices(
|
|
30
30
|
client: SteamSetsCore,
|
|
31
31
|
request: components.V1BadgeListBadgePricesRequestBody,
|
|
32
32
|
options?: RequestOptions,
|
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.26.
|
|
63
|
-
genVersion: "2.
|
|
62
|
+
sdkVersion: "0.26.4",
|
|
63
|
+
genVersion: "2.628.0",
|
|
64
64
|
userAgent:
|
|
65
|
-
"speakeasy-sdk/typescript 0.26.
|
|
65
|
+
"speakeasy-sdk/typescript 0.26.4 2.628.0 1.0.0 @steamsets/client-ts",
|
|
66
66
|
} as const;
|
package/src/lib/files.ts
CHANGED
|
@@ -38,3 +38,45 @@ export async function readableStreamToArrayBuffer(
|
|
|
38
38
|
|
|
39
39
|
return concatenatedChunks.buffer as ArrayBuffer;
|
|
40
40
|
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Determines the MIME content type based on a file's extension.
|
|
44
|
+
* Returns null if the extension is not recognized.
|
|
45
|
+
*/
|
|
46
|
+
export function getContentTypeFromFileName(fileName: string): string | null {
|
|
47
|
+
if (!fileName) return null;
|
|
48
|
+
|
|
49
|
+
const ext = fileName.toLowerCase().split(".").pop();
|
|
50
|
+
if (!ext) return null;
|
|
51
|
+
|
|
52
|
+
const mimeTypes: Record<string, string> = {
|
|
53
|
+
json: "application/json",
|
|
54
|
+
xml: "application/xml",
|
|
55
|
+
html: "text/html",
|
|
56
|
+
htm: "text/html",
|
|
57
|
+
txt: "text/plain",
|
|
58
|
+
csv: "text/csv",
|
|
59
|
+
pdf: "application/pdf",
|
|
60
|
+
png: "image/png",
|
|
61
|
+
jpg: "image/jpeg",
|
|
62
|
+
jpeg: "image/jpeg",
|
|
63
|
+
gif: "image/gif",
|
|
64
|
+
svg: "image/svg+xml",
|
|
65
|
+
js: "application/javascript",
|
|
66
|
+
css: "text/css",
|
|
67
|
+
zip: "application/zip",
|
|
68
|
+
tar: "application/x-tar",
|
|
69
|
+
gz: "application/gzip",
|
|
70
|
+
mp4: "video/mp4",
|
|
71
|
+
mp3: "audio/mpeg",
|
|
72
|
+
wav: "audio/wav",
|
|
73
|
+
webp: "image/webp",
|
|
74
|
+
ico: "image/x-icon",
|
|
75
|
+
woff: "font/woff",
|
|
76
|
+
woff2: "font/woff2",
|
|
77
|
+
ttf: "font/ttf",
|
|
78
|
+
otf: "font/otf",
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return mimeTypes[ext] || null;
|
|
82
|
+
}
|
|
@@ -115,11 +115,15 @@ export * from "./v1appbadge.js";
|
|
|
115
115
|
export * from "./v1applistbadgesrequestbody.js";
|
|
116
116
|
export * from "./v1applistbadgesresponsebody.js";
|
|
117
117
|
export * from "./v1apporder.js";
|
|
118
|
+
export * from "./v1badgeaccount.js";
|
|
119
|
+
export * from "./v1badgelistaccountsrequestbody.js";
|
|
120
|
+
export * from "./v1badgelistaccountsresponsebody.js";
|
|
118
121
|
export * from "./v1badgelistbadgepricefilters.js";
|
|
119
122
|
export * from "./v1badgelistbadgepriceorder.js";
|
|
120
123
|
export * from "./v1badgelistbadgepricesrequestbody.js";
|
|
121
124
|
export * from "./v1badgelistbadgepricesresponsebody.js";
|
|
122
125
|
export * from "./v1badgelisttagsresponsebody.js";
|
|
126
|
+
export * from "./v1badgelookup.js";
|
|
123
127
|
export * from "./v1badgeorder.js";
|
|
124
128
|
export * from "./v1badgesearchbadgesresponsebody.js";
|
|
125
129
|
export * from "./v1badgesuggestsearchbody.js";
|
|
@@ -9,7 +9,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
9
9
|
|
|
10
10
|
export type V1AccountLeaderboardBadgeSearch = {
|
|
11
11
|
/**
|
|
12
|
-
* The badge id to get the leaderboard for
|
|
12
|
+
* The badge id to get the leaderboard for (appId) or id 1-64
|
|
13
13
|
*/
|
|
14
14
|
id: number;
|
|
15
15
|
/**
|
|
@@ -0,0 +1,358 @@
|
|
|
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
|
+
AccountBadgeInfo,
|
|
12
|
+
AccountBadgeInfo$inboundSchema,
|
|
13
|
+
AccountBadgeInfo$Outbound,
|
|
14
|
+
AccountBadgeInfo$outboundSchema,
|
|
15
|
+
} from "./accountbadgeinfo.js";
|
|
16
|
+
import {
|
|
17
|
+
LeaderboardCity,
|
|
18
|
+
LeaderboardCity$inboundSchema,
|
|
19
|
+
LeaderboardCity$Outbound,
|
|
20
|
+
LeaderboardCity$outboundSchema,
|
|
21
|
+
} from "./leaderboardcity.js";
|
|
22
|
+
import {
|
|
23
|
+
LeaderboardCountry,
|
|
24
|
+
LeaderboardCountry$inboundSchema,
|
|
25
|
+
LeaderboardCountry$Outbound,
|
|
26
|
+
LeaderboardCountry$outboundSchema,
|
|
27
|
+
} from "./leaderboardcountry.js";
|
|
28
|
+
import {
|
|
29
|
+
LeaderboardRegion,
|
|
30
|
+
LeaderboardRegion$inboundSchema,
|
|
31
|
+
LeaderboardRegion$Outbound,
|
|
32
|
+
LeaderboardRegion$outboundSchema,
|
|
33
|
+
} from "./leaderboardregion.js";
|
|
34
|
+
import {
|
|
35
|
+
LeaderboardState,
|
|
36
|
+
LeaderboardState$inboundSchema,
|
|
37
|
+
LeaderboardState$Outbound,
|
|
38
|
+
LeaderboardState$outboundSchema,
|
|
39
|
+
} from "./leaderboardstate.js";
|
|
40
|
+
import {
|
|
41
|
+
Role,
|
|
42
|
+
Role$inboundSchema,
|
|
43
|
+
Role$Outbound,
|
|
44
|
+
Role$outboundSchema,
|
|
45
|
+
} from "./role.js";
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The privacy of the account
|
|
49
|
+
*/
|
|
50
|
+
export const V1BadgeAccountPrivacy = {
|
|
51
|
+
Public: "public",
|
|
52
|
+
Private: "private",
|
|
53
|
+
FriendsOnly: "friends_only",
|
|
54
|
+
} as const;
|
|
55
|
+
/**
|
|
56
|
+
* The privacy of the account
|
|
57
|
+
*/
|
|
58
|
+
export type V1BadgeAccountPrivacy = ClosedEnum<typeof V1BadgeAccountPrivacy>;
|
|
59
|
+
|
|
60
|
+
export type V1BadgeAccount = {
|
|
61
|
+
/**
|
|
62
|
+
* The cost of an app
|
|
63
|
+
*
|
|
64
|
+
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
65
|
+
*/
|
|
66
|
+
appCost: number;
|
|
67
|
+
/**
|
|
68
|
+
* The number of apps the account has
|
|
69
|
+
*/
|
|
70
|
+
apps: number;
|
|
71
|
+
/**
|
|
72
|
+
* The avatar hash of the account
|
|
73
|
+
*/
|
|
74
|
+
avatar: string;
|
|
75
|
+
/**
|
|
76
|
+
* The number of awards the account has
|
|
77
|
+
*/
|
|
78
|
+
awardsGiven: number;
|
|
79
|
+
/**
|
|
80
|
+
* The number of awards the account has
|
|
81
|
+
*/
|
|
82
|
+
awardsReceived: number;
|
|
83
|
+
badgeInfo?: AccountBadgeInfo | null | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* The number of badges the account has
|
|
86
|
+
*/
|
|
87
|
+
badges: number;
|
|
88
|
+
/**
|
|
89
|
+
* The number of bans
|
|
90
|
+
*/
|
|
91
|
+
bans: number;
|
|
92
|
+
city?: LeaderboardCity | null | undefined;
|
|
93
|
+
country?: LeaderboardCountry | null | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* The time the account was created
|
|
96
|
+
*/
|
|
97
|
+
createdAt: Date;
|
|
98
|
+
/**
|
|
99
|
+
* The total of donations the account has
|
|
100
|
+
*/
|
|
101
|
+
donated: number;
|
|
102
|
+
/**
|
|
103
|
+
* The economy ban of the account
|
|
104
|
+
*/
|
|
105
|
+
economyBan: string;
|
|
106
|
+
/**
|
|
107
|
+
* The cost of a foil badge
|
|
108
|
+
*
|
|
109
|
+
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
110
|
+
*/
|
|
111
|
+
foilBadgeCost: number;
|
|
112
|
+
/**
|
|
113
|
+
* The number of foil badges the account has
|
|
114
|
+
*/
|
|
115
|
+
foilBadges: number;
|
|
116
|
+
/**
|
|
117
|
+
* The number of friends the account has
|
|
118
|
+
*/
|
|
119
|
+
friends: number;
|
|
120
|
+
/**
|
|
121
|
+
* The number of game bans
|
|
122
|
+
*/
|
|
123
|
+
gameBans: number;
|
|
124
|
+
/**
|
|
125
|
+
* The level of the account
|
|
126
|
+
*/
|
|
127
|
+
level: number;
|
|
128
|
+
/**
|
|
129
|
+
* The name of the account
|
|
130
|
+
*/
|
|
131
|
+
name: string;
|
|
132
|
+
/**
|
|
133
|
+
* The cost of a normal badge
|
|
134
|
+
*
|
|
135
|
+
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
136
|
+
*/
|
|
137
|
+
normalBadgeCost: number;
|
|
138
|
+
/**
|
|
139
|
+
* The number of normal badges the account has
|
|
140
|
+
*/
|
|
141
|
+
normalBadges: number;
|
|
142
|
+
/**
|
|
143
|
+
* The playtime of the account
|
|
144
|
+
*/
|
|
145
|
+
playtime: number;
|
|
146
|
+
/**
|
|
147
|
+
* The number of points the account has
|
|
148
|
+
*/
|
|
149
|
+
pointsGiven: number;
|
|
150
|
+
/**
|
|
151
|
+
* The number of points the account has
|
|
152
|
+
*/
|
|
153
|
+
pointsReceived: number;
|
|
154
|
+
/**
|
|
155
|
+
* The privacy of the account
|
|
156
|
+
*/
|
|
157
|
+
privacy: V1BadgeAccountPrivacy;
|
|
158
|
+
region?: LeaderboardRegion | null | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* The roles of the account
|
|
161
|
+
*/
|
|
162
|
+
roles: Array<Role> | null;
|
|
163
|
+
state?: LeaderboardState | null | undefined;
|
|
164
|
+
/**
|
|
165
|
+
* The steam id
|
|
166
|
+
*/
|
|
167
|
+
steamId: string;
|
|
168
|
+
/**
|
|
169
|
+
* The steam sets score
|
|
170
|
+
*/
|
|
171
|
+
steamSetsScore: number;
|
|
172
|
+
/**
|
|
173
|
+
* The vanity of the account
|
|
174
|
+
*/
|
|
175
|
+
steamSetsVanity: string;
|
|
176
|
+
/**
|
|
177
|
+
* The vanity of the account
|
|
178
|
+
*/
|
|
179
|
+
steamVanity: string;
|
|
180
|
+
/**
|
|
181
|
+
* The number of vac bans
|
|
182
|
+
*/
|
|
183
|
+
vacBans: number;
|
|
184
|
+
/**
|
|
185
|
+
* The number of xp the account has
|
|
186
|
+
*/
|
|
187
|
+
xp: number;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
/** @internal */
|
|
191
|
+
export const V1BadgeAccountPrivacy$inboundSchema: z.ZodNativeEnum<
|
|
192
|
+
typeof V1BadgeAccountPrivacy
|
|
193
|
+
> = z.nativeEnum(V1BadgeAccountPrivacy);
|
|
194
|
+
|
|
195
|
+
/** @internal */
|
|
196
|
+
export const V1BadgeAccountPrivacy$outboundSchema: z.ZodNativeEnum<
|
|
197
|
+
typeof V1BadgeAccountPrivacy
|
|
198
|
+
> = V1BadgeAccountPrivacy$inboundSchema;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* @internal
|
|
202
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
203
|
+
*/
|
|
204
|
+
export namespace V1BadgeAccountPrivacy$ {
|
|
205
|
+
/** @deprecated use `V1BadgeAccountPrivacy$inboundSchema` instead. */
|
|
206
|
+
export const inboundSchema = V1BadgeAccountPrivacy$inboundSchema;
|
|
207
|
+
/** @deprecated use `V1BadgeAccountPrivacy$outboundSchema` instead. */
|
|
208
|
+
export const outboundSchema = V1BadgeAccountPrivacy$outboundSchema;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** @internal */
|
|
212
|
+
export const V1BadgeAccount$inboundSchema: z.ZodType<
|
|
213
|
+
V1BadgeAccount,
|
|
214
|
+
z.ZodTypeDef,
|
|
215
|
+
unknown
|
|
216
|
+
> = z.object({
|
|
217
|
+
appCost: z.number().int(),
|
|
218
|
+
apps: z.number().int(),
|
|
219
|
+
avatar: z.string(),
|
|
220
|
+
awardsGiven: z.number().int(),
|
|
221
|
+
awardsReceived: z.number().int(),
|
|
222
|
+
badgeInfo: z.nullable(AccountBadgeInfo$inboundSchema).optional(),
|
|
223
|
+
badges: z.number().int(),
|
|
224
|
+
bans: z.number().int(),
|
|
225
|
+
city: z.nullable(LeaderboardCity$inboundSchema).optional(),
|
|
226
|
+
country: z.nullable(LeaderboardCountry$inboundSchema).optional(),
|
|
227
|
+
createdAt: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
228
|
+
donated: z.number().int(),
|
|
229
|
+
economyBan: z.string(),
|
|
230
|
+
foilBadgeCost: z.number().int(),
|
|
231
|
+
foilBadges: z.number().int(),
|
|
232
|
+
friends: z.number().int(),
|
|
233
|
+
gameBans: z.number().int(),
|
|
234
|
+
level: z.number().int(),
|
|
235
|
+
name: z.string(),
|
|
236
|
+
normalBadgeCost: z.number().int(),
|
|
237
|
+
normalBadges: z.number().int(),
|
|
238
|
+
playtime: z.number().int(),
|
|
239
|
+
pointsGiven: z.number().int(),
|
|
240
|
+
pointsReceived: z.number().int(),
|
|
241
|
+
privacy: V1BadgeAccountPrivacy$inboundSchema,
|
|
242
|
+
region: z.nullable(LeaderboardRegion$inboundSchema).optional(),
|
|
243
|
+
roles: z.nullable(z.array(Role$inboundSchema)),
|
|
244
|
+
state: z.nullable(LeaderboardState$inboundSchema).optional(),
|
|
245
|
+
steamId: z.string(),
|
|
246
|
+
steamSetsScore: z.number().int(),
|
|
247
|
+
steamSetsVanity: z.string(),
|
|
248
|
+
steamVanity: z.string(),
|
|
249
|
+
vacBans: z.number().int(),
|
|
250
|
+
xp: z.number().int(),
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
/** @internal */
|
|
254
|
+
export type V1BadgeAccount$Outbound = {
|
|
255
|
+
appCost: number;
|
|
256
|
+
apps: number;
|
|
257
|
+
avatar: string;
|
|
258
|
+
awardsGiven: number;
|
|
259
|
+
awardsReceived: number;
|
|
260
|
+
badgeInfo?: AccountBadgeInfo$Outbound | null | undefined;
|
|
261
|
+
badges: number;
|
|
262
|
+
bans: number;
|
|
263
|
+
city?: LeaderboardCity$Outbound | null | undefined;
|
|
264
|
+
country?: LeaderboardCountry$Outbound | null | undefined;
|
|
265
|
+
createdAt: string;
|
|
266
|
+
donated: number;
|
|
267
|
+
economyBan: string;
|
|
268
|
+
foilBadgeCost: number;
|
|
269
|
+
foilBadges: number;
|
|
270
|
+
friends: number;
|
|
271
|
+
gameBans: number;
|
|
272
|
+
level: number;
|
|
273
|
+
name: string;
|
|
274
|
+
normalBadgeCost: number;
|
|
275
|
+
normalBadges: number;
|
|
276
|
+
playtime: number;
|
|
277
|
+
pointsGiven: number;
|
|
278
|
+
pointsReceived: number;
|
|
279
|
+
privacy: string;
|
|
280
|
+
region?: LeaderboardRegion$Outbound | null | undefined;
|
|
281
|
+
roles: Array<Role$Outbound> | null;
|
|
282
|
+
state?: LeaderboardState$Outbound | null | undefined;
|
|
283
|
+
steamId: string;
|
|
284
|
+
steamSetsScore: number;
|
|
285
|
+
steamSetsVanity: string;
|
|
286
|
+
steamVanity: string;
|
|
287
|
+
vacBans: number;
|
|
288
|
+
xp: number;
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
/** @internal */
|
|
292
|
+
export const V1BadgeAccount$outboundSchema: z.ZodType<
|
|
293
|
+
V1BadgeAccount$Outbound,
|
|
294
|
+
z.ZodTypeDef,
|
|
295
|
+
V1BadgeAccount
|
|
296
|
+
> = z.object({
|
|
297
|
+
appCost: z.number().int(),
|
|
298
|
+
apps: z.number().int(),
|
|
299
|
+
avatar: z.string(),
|
|
300
|
+
awardsGiven: z.number().int(),
|
|
301
|
+
awardsReceived: z.number().int(),
|
|
302
|
+
badgeInfo: z.nullable(AccountBadgeInfo$outboundSchema).optional(),
|
|
303
|
+
badges: z.number().int(),
|
|
304
|
+
bans: z.number().int(),
|
|
305
|
+
city: z.nullable(LeaderboardCity$outboundSchema).optional(),
|
|
306
|
+
country: z.nullable(LeaderboardCountry$outboundSchema).optional(),
|
|
307
|
+
createdAt: z.date().transform(v => v.toISOString()),
|
|
308
|
+
donated: z.number().int(),
|
|
309
|
+
economyBan: z.string(),
|
|
310
|
+
foilBadgeCost: z.number().int(),
|
|
311
|
+
foilBadges: z.number().int(),
|
|
312
|
+
friends: z.number().int(),
|
|
313
|
+
gameBans: z.number().int(),
|
|
314
|
+
level: z.number().int(),
|
|
315
|
+
name: z.string(),
|
|
316
|
+
normalBadgeCost: z.number().int(),
|
|
317
|
+
normalBadges: z.number().int(),
|
|
318
|
+
playtime: z.number().int(),
|
|
319
|
+
pointsGiven: z.number().int(),
|
|
320
|
+
pointsReceived: z.number().int(),
|
|
321
|
+
privacy: V1BadgeAccountPrivacy$outboundSchema,
|
|
322
|
+
region: z.nullable(LeaderboardRegion$outboundSchema).optional(),
|
|
323
|
+
roles: z.nullable(z.array(Role$outboundSchema)),
|
|
324
|
+
state: z.nullable(LeaderboardState$outboundSchema).optional(),
|
|
325
|
+
steamId: z.string(),
|
|
326
|
+
steamSetsScore: z.number().int(),
|
|
327
|
+
steamSetsVanity: z.string(),
|
|
328
|
+
steamVanity: z.string(),
|
|
329
|
+
vacBans: z.number().int(),
|
|
330
|
+
xp: z.number().int(),
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* @internal
|
|
335
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
336
|
+
*/
|
|
337
|
+
export namespace V1BadgeAccount$ {
|
|
338
|
+
/** @deprecated use `V1BadgeAccount$inboundSchema` instead. */
|
|
339
|
+
export const inboundSchema = V1BadgeAccount$inboundSchema;
|
|
340
|
+
/** @deprecated use `V1BadgeAccount$outboundSchema` instead. */
|
|
341
|
+
export const outboundSchema = V1BadgeAccount$outboundSchema;
|
|
342
|
+
/** @deprecated use `V1BadgeAccount$Outbound` instead. */
|
|
343
|
+
export type Outbound = V1BadgeAccount$Outbound;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export function v1BadgeAccountToJSON(v1BadgeAccount: V1BadgeAccount): string {
|
|
347
|
+
return JSON.stringify(V1BadgeAccount$outboundSchema.parse(v1BadgeAccount));
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export function v1BadgeAccountFromJSON(
|
|
351
|
+
jsonString: string,
|
|
352
|
+
): SafeParseResult<V1BadgeAccount, SDKValidationError> {
|
|
353
|
+
return safeParse(
|
|
354
|
+
jsonString,
|
|
355
|
+
(x) => V1BadgeAccount$inboundSchema.parse(JSON.parse(x)),
|
|
356
|
+
`Failed to parse 'V1BadgeAccount' from JSON`,
|
|
357
|
+
);
|
|
358
|
+
}
|