@steamsets/client-ts 0.33.4 → 0.33.5
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 +16 -0
- package/funcs/accountAccountGetTrending.d.ts +16 -0
- package/funcs/accountAccountGetTrending.d.ts.map +1 -0
- package/funcs/accountAccountGetTrending.js +134 -0
- package/funcs/accountAccountGetTrending.js.map +1 -0
- package/funcs/accountAccountGetViewStats.d.ts +16 -0
- package/funcs/accountAccountGetViewStats.d.ts.map +1 -0
- package/funcs/accountAccountGetViewStats.js +134 -0
- package/funcs/accountAccountGetViewStats.js.map +1 -0
- package/funcs/accountGetInfo.d.ts +1 -2
- package/funcs/accountGetInfo.d.ts.map +1 -1
- package/funcs/accountGetInfo.js +11 -3
- package/funcs/accountGetInfo.js.map +1 -1
- package/funcs/analyticsTrackEvent.d.ts +15 -0
- package/funcs/analyticsTrackEvent.d.ts.map +1 -0
- package/funcs/analyticsTrackEvent.js +144 -0
- package/funcs/analyticsTrackEvent.js.map +1 -0
- package/funcs/badgeSearch.js +8 -0
- package/funcs/badgeSearch.js.map +1 -1
- package/funcs/leaderboardLeaderboardGetBucketLeaders.d.ts +16 -0
- package/funcs/leaderboardLeaderboardGetBucketLeaders.d.ts.map +1 -0
- package/funcs/leaderboardLeaderboardGetBucketLeaders.js +134 -0
- package/funcs/leaderboardLeaderboardGetBucketLeaders.js.map +1 -0
- package/funcs/searchSearchGetTrending.d.ts +16 -0
- package/funcs/searchSearchGetTrending.d.ts.map +1 -0
- package/funcs/searchSearchGetTrending.js +134 -0
- package/funcs/searchSearchGetTrending.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/accountgettrendingrequestbody.d.ts +35 -0
- package/models/components/accountgettrendingrequestbody.d.ts.map +1 -0
- package/models/components/accountgettrendingrequestbody.js +61 -0
- package/models/components/accountgettrendingrequestbody.js.map +1 -0
- package/models/components/accountgettrendingresponsebody.d.ts +15 -0
- package/models/components/accountgettrendingresponsebody.d.ts.map +1 -0
- package/models/components/accountgettrendingresponsebody.js +57 -0
- package/models/components/accountgettrendingresponsebody.js.map +1 -0
- package/models/components/accountviewstats.d.ts +37 -0
- package/models/components/accountviewstats.d.ts.map +1 -0
- package/models/components/accountviewstats.js +61 -0
- package/models/components/accountviewstats.js.map +1 -0
- package/models/components/analyticstrackeventrequestbody.d.ts +38 -0
- package/models/components/analyticstrackeventrequestbody.d.ts.map +1 -0
- package/models/components/analyticstrackeventrequestbody.js +59 -0
- package/models/components/analyticstrackeventrequestbody.js.map +1 -0
- package/models/components/analyticstrackeventresponsebody.d.ts +14 -0
- package/models/components/analyticstrackeventresponsebody.d.ts.map +1 -0
- package/models/components/analyticstrackeventresponsebody.js +56 -0
- package/models/components/analyticstrackeventresponsebody.js.map +1 -0
- package/models/components/bucketleader.d.ts +34 -0
- package/models/components/bucketleader.d.ts.map +1 -0
- package/models/components/bucketleader.js +59 -0
- package/models/components/bucketleader.js.map +1 -0
- package/models/components/index.d.ts +11 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +11 -0
- package/models/components/index.js.map +1 -1
- package/models/components/leaderboardgetchangesrequestbody.d.ts +4 -4
- package/models/components/leaderboardgetchangesrequestbody.d.ts.map +1 -1
- package/models/components/leaderboardgetchangesrequestbody.js +4 -5
- package/models/components/leaderboardgetchangesrequestbody.js.map +1 -1
- package/models/components/searchgettrendingrequestbody.d.ts +54 -0
- package/models/components/searchgettrendingrequestbody.d.ts.map +1 -0
- package/models/components/searchgettrendingrequestbody.js +72 -0
- package/models/components/searchgettrendingrequestbody.js.map +1 -0
- package/models/components/searchgettrendingresponsebody.d.ts +15 -0
- package/models/components/searchgettrendingresponsebody.d.ts.map +1 -0
- package/models/components/searchgettrendingresponsebody.js +57 -0
- package/models/components/searchgettrendingresponsebody.js.map +1 -0
- package/models/components/trendingaccount.d.ts +20 -0
- package/models/components/trendingaccount.d.ts.map +1 -0
- package/models/components/trendingaccount.js +54 -0
- package/models/components/trendingaccount.js.map +1 -0
- package/models/components/trendingsearch.d.ts +21 -0
- package/models/components/trendingsearch.d.ts.map +1 -0
- package/models/components/trendingsearch.js +52 -0
- package/models/components/trendingsearch.js.map +1 -0
- package/models/components/v1leaderboardgetbucketleadersrequestbody.d.ts +33 -0
- package/models/components/v1leaderboardgetbucketleadersrequestbody.d.ts.map +1 -0
- package/models/components/v1leaderboardgetbucketleadersrequestbody.js +58 -0
- package/models/components/v1leaderboardgetbucketleadersrequestbody.js.map +1 -0
- package/models/operations/accountgetinfo.d.ts +16 -0
- package/models/operations/accountgetinfo.d.ts.map +1 -1
- package/models/operations/accountgetinfo.js +19 -1
- package/models/operations/accountgetinfo.js.map +1 -1
- package/models/operations/accountgettrending.d.ts +15 -0
- package/models/operations/accountgettrending.d.ts.map +1 -0
- package/models/operations/accountgettrending.js +59 -0
- package/models/operations/accountgettrending.js.map +1 -0
- package/models/operations/accountgetviewstats.d.ts +15 -0
- package/models/operations/accountgetviewstats.d.ts.map +1 -0
- package/models/operations/accountgetviewstats.js +58 -0
- package/models/operations/accountgetviewstats.js.map +1 -0
- package/models/operations/badgesearchbadges.d.ts +4 -0
- package/models/operations/badgesearchbadges.d.ts.map +1 -1
- package/models/operations/badgesearchbadges.js +4 -0
- package/models/operations/badgesearchbadges.js.map +1 -1
- package/models/operations/index.d.ts +5 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +5 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/leaderboardgetbucketleaders.d.ts +15 -0
- package/models/operations/leaderboardgetbucketleaders.d.ts.map +1 -0
- package/models/operations/leaderboardgetbucketleaders.js +59 -0
- package/models/operations/leaderboardgetbucketleaders.js.map +1 -0
- package/models/operations/searchgettrending.d.ts +15 -0
- package/models/operations/searchgettrending.d.ts.map +1 -0
- package/models/operations/searchgettrending.js +59 -0
- package/models/operations/searchgettrending.js.map +1 -0
- package/models/operations/trackevent.d.ts +31 -0
- package/models/operations/trackevent.d.ts.map +1 -0
- package/models/operations/trackevent.js +77 -0
- package/models/operations/trackevent.js.map +1 -0
- package/package.json +1 -1
- package/sdk/account.d.ts +9 -1
- package/sdk/account.d.ts.map +1 -1
- package/sdk/account.js +14 -0
- package/sdk/account.js.map +1 -1
- package/sdk/analytics.d.ts +9 -0
- package/sdk/analytics.d.ts.map +1 -0
- package/sdk/analytics.js +19 -0
- package/sdk/analytics.js.map +1 -0
- package/sdk/leaderboard.d.ts +4 -0
- package/sdk/leaderboard.d.ts.map +1 -1
- package/sdk/leaderboard.js +7 -0
- package/sdk/leaderboard.js.map +1 -1
- package/sdk/sdk.d.ts +6 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +8 -0
- package/sdk/sdk.js.map +1 -1
- package/sdk/search.d.ts +10 -0
- package/sdk/search.d.ts.map +1 -0
- package/sdk/search.js +19 -0
- package/sdk/search.js.map +1 -0
- package/src/funcs/accountAccountGetTrending.ts +188 -0
- package/src/funcs/accountAccountGetViewStats.ts +187 -0
- package/src/funcs/accountGetInfo.ts +18 -6
- package/src/funcs/analyticsTrackEvent.ts +201 -0
- package/src/funcs/badgeSearch.ts +8 -0
- package/src/funcs/leaderboardLeaderboardGetBucketLeaders.ts +190 -0
- package/src/funcs/searchSearchGetTrending.ts +188 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/accountgettrendingrequestbody.ts +60 -0
- package/src/models/components/accountgettrendingresponsebody.ts +45 -0
- package/src/models/components/accountviewstats.ts +69 -0
- package/src/models/components/analyticstrackeventrequestbody.ts +62 -0
- package/src/models/components/analyticstrackeventresponsebody.ts +41 -0
- package/src/models/components/bucketleader.ts +66 -0
- package/src/models/components/index.ts +11 -0
- package/src/models/components/leaderboardgetchangesrequestbody.ts +10 -6
- package/src/models/components/searchgettrendingrequestbody.ts +86 -0
- package/src/models/components/searchgettrendingresponsebody.ts +45 -0
- package/src/models/components/trendingaccount.ts +47 -0
- package/src/models/components/trendingsearch.ts +44 -0
- package/src/models/components/v1leaderboardgetbucketleadersrequestbody.ts +63 -0
- package/src/models/operations/accountgetinfo.ts +42 -0
- package/src/models/operations/accountgettrending.ts +46 -0
- package/src/models/operations/accountgetviewstats.ts +43 -0
- package/src/models/operations/badgesearchbadges.ts +8 -0
- package/src/models/operations/index.ts +5 -0
- package/src/models/operations/leaderboardgetbucketleaders.ts +45 -0
- package/src/models/operations/searchgettrending.ts +46 -0
- package/src/models/operations/trackevent.ts +90 -0
- package/src/sdk/account.ts +31 -1
- package/src/sdk/analytics.ts +24 -0
- package/src/sdk/leaderboard.ts +15 -0
- package/src/sdk/sdk.ts +12 -0
- package/src/sdk/search.ts +25 -0
|
@@ -0,0 +1,190 @@
|
|
|
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
|
+
* Get the top account in each level bucket
|
|
32
|
+
*/
|
|
33
|
+
export function leaderboardLeaderboardGetBucketLeaders(
|
|
34
|
+
client: SteamSetsCore,
|
|
35
|
+
request: components.V1LeaderboardGetBucketLeadersRequestBody,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.LeaderboardGetBucketLeadersResponse,
|
|
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.V1LeaderboardGetBucketLeadersRequestBody,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
operations.LeaderboardGetBucketLeadersResponse,
|
|
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) =>
|
|
82
|
+
components.V1LeaderboardGetBucketLeadersRequestBody$outboundSchema.parse(
|
|
83
|
+
value,
|
|
84
|
+
),
|
|
85
|
+
"Input validation failed",
|
|
86
|
+
);
|
|
87
|
+
if (!parsed.ok) {
|
|
88
|
+
return [parsed, { status: "invalid" }];
|
|
89
|
+
}
|
|
90
|
+
const payload = parsed.value;
|
|
91
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
92
|
+
|
|
93
|
+
const path = pathToFunc("/v1/leaderboard.getBucketLeaders")();
|
|
94
|
+
|
|
95
|
+
const headers = new Headers(compactMap({
|
|
96
|
+
"Content-Type": "application/json",
|
|
97
|
+
Accept: "application/json",
|
|
98
|
+
}));
|
|
99
|
+
|
|
100
|
+
const secConfig = await extractSecurity(client._options.token);
|
|
101
|
+
const securityInput = secConfig == null ? {} : { token: secConfig };
|
|
102
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
103
|
+
|
|
104
|
+
const context = {
|
|
105
|
+
options: client._options,
|
|
106
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
107
|
+
operationID: "leaderboard.getBucketLeaders",
|
|
108
|
+
oAuth2Scopes: null,
|
|
109
|
+
|
|
110
|
+
resolvedSecurity: requestSecurity,
|
|
111
|
+
|
|
112
|
+
securitySource: client._options.token,
|
|
113
|
+
retryConfig: options?.retries
|
|
114
|
+
|| client._options.retryConfig
|
|
115
|
+
|| {
|
|
116
|
+
strategy: "backoff",
|
|
117
|
+
backoff: {
|
|
118
|
+
initialInterval: 500,
|
|
119
|
+
maxInterval: 5000,
|
|
120
|
+
exponent: 1.5,
|
|
121
|
+
maxElapsedTime: 60000,
|
|
122
|
+
},
|
|
123
|
+
retryConnectionErrors: true,
|
|
124
|
+
}
|
|
125
|
+
|| { strategy: "none" },
|
|
126
|
+
retryCodes: options?.retryCodes || ["501", "502", "503", "504"],
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const requestRes = client._createRequest(context, {
|
|
130
|
+
security: requestSecurity,
|
|
131
|
+
method: "POST",
|
|
132
|
+
baseURL: options?.serverURL,
|
|
133
|
+
path: path,
|
|
134
|
+
headers: headers,
|
|
135
|
+
body: body,
|
|
136
|
+
uaHeader: "x-speakeasy-user-agent",
|
|
137
|
+
userAgent: client._options.userAgent,
|
|
138
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
139
|
+
}, options);
|
|
140
|
+
if (!requestRes.ok) {
|
|
141
|
+
return [requestRes, { status: "invalid" }];
|
|
142
|
+
}
|
|
143
|
+
const req = requestRes.value;
|
|
144
|
+
|
|
145
|
+
const doResult = await client._do(req, {
|
|
146
|
+
context,
|
|
147
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
148
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
149
|
+
retryConfig: context.retryConfig,
|
|
150
|
+
retryCodes: context.retryCodes,
|
|
151
|
+
});
|
|
152
|
+
if (!doResult.ok) {
|
|
153
|
+
return [doResult, { status: "request-error", request: req }];
|
|
154
|
+
}
|
|
155
|
+
const response = doResult.value;
|
|
156
|
+
|
|
157
|
+
const responseFields = {
|
|
158
|
+
HttpMeta: { Response: response, Request: req },
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const [result] = await M.match<
|
|
162
|
+
operations.LeaderboardGetBucketLeadersResponse,
|
|
163
|
+
| errors.ErrorModel
|
|
164
|
+
| SteamSetsError
|
|
165
|
+
| ResponseValidationError
|
|
166
|
+
| ConnectionError
|
|
167
|
+
| RequestAbortedError
|
|
168
|
+
| RequestTimeoutError
|
|
169
|
+
| InvalidRequestError
|
|
170
|
+
| UnexpectedClientError
|
|
171
|
+
| SDKValidationError
|
|
172
|
+
>(
|
|
173
|
+
M.json(200, operations.LeaderboardGetBucketLeadersResponse$inboundSchema, {
|
|
174
|
+
key: "BucketLeaders",
|
|
175
|
+
}),
|
|
176
|
+
M.jsonErr([400, 401, 422], errors.ErrorModel$inboundSchema, {
|
|
177
|
+
ctype: "application/problem+json",
|
|
178
|
+
}),
|
|
179
|
+
M.jsonErr([500, 501], errors.ErrorModel$inboundSchema, {
|
|
180
|
+
ctype: "application/problem+json",
|
|
181
|
+
}),
|
|
182
|
+
M.fail("4XX"),
|
|
183
|
+
M.fail("5XX"),
|
|
184
|
+
)(response, req, { extraFields: responseFields });
|
|
185
|
+
if (!result.ok) {
|
|
186
|
+
return [result, { status: "complete", request: req, response }];
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return [result, { status: "complete", request: req, response }];
|
|
190
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
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
|
+
* Top search queries in a window, by unique searcher count
|
|
32
|
+
*/
|
|
33
|
+
export function searchSearchGetTrending(
|
|
34
|
+
client: SteamSetsCore,
|
|
35
|
+
request: components.SearchGetTrendingRequestBody,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.SearchGetTrendingResponse,
|
|
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.SearchGetTrendingRequestBody,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
operations.SearchGetTrendingResponse,
|
|
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) =>
|
|
82
|
+
components.SearchGetTrendingRequestBody$outboundSchema.parse(value),
|
|
83
|
+
"Input validation failed",
|
|
84
|
+
);
|
|
85
|
+
if (!parsed.ok) {
|
|
86
|
+
return [parsed, { status: "invalid" }];
|
|
87
|
+
}
|
|
88
|
+
const payload = parsed.value;
|
|
89
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
90
|
+
|
|
91
|
+
const path = pathToFunc("/v1/search.getTrending")();
|
|
92
|
+
|
|
93
|
+
const headers = new Headers(compactMap({
|
|
94
|
+
"Content-Type": "application/json",
|
|
95
|
+
Accept: "application/json",
|
|
96
|
+
}));
|
|
97
|
+
|
|
98
|
+
const secConfig = await extractSecurity(client._options.token);
|
|
99
|
+
const securityInput = secConfig == null ? {} : { token: secConfig };
|
|
100
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
101
|
+
|
|
102
|
+
const context = {
|
|
103
|
+
options: client._options,
|
|
104
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
105
|
+
operationID: "search.getTrending",
|
|
106
|
+
oAuth2Scopes: null,
|
|
107
|
+
|
|
108
|
+
resolvedSecurity: requestSecurity,
|
|
109
|
+
|
|
110
|
+
securitySource: client._options.token,
|
|
111
|
+
retryConfig: options?.retries
|
|
112
|
+
|| client._options.retryConfig
|
|
113
|
+
|| {
|
|
114
|
+
strategy: "backoff",
|
|
115
|
+
backoff: {
|
|
116
|
+
initialInterval: 500,
|
|
117
|
+
maxInterval: 5000,
|
|
118
|
+
exponent: 1.5,
|
|
119
|
+
maxElapsedTime: 60000,
|
|
120
|
+
},
|
|
121
|
+
retryConnectionErrors: true,
|
|
122
|
+
}
|
|
123
|
+
|| { strategy: "none" },
|
|
124
|
+
retryCodes: options?.retryCodes || ["501", "502", "503", "504"],
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const requestRes = client._createRequest(context, {
|
|
128
|
+
security: requestSecurity,
|
|
129
|
+
method: "POST",
|
|
130
|
+
baseURL: options?.serverURL,
|
|
131
|
+
path: path,
|
|
132
|
+
headers: headers,
|
|
133
|
+
body: body,
|
|
134
|
+
uaHeader: "x-speakeasy-user-agent",
|
|
135
|
+
userAgent: client._options.userAgent,
|
|
136
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
137
|
+
}, options);
|
|
138
|
+
if (!requestRes.ok) {
|
|
139
|
+
return [requestRes, { status: "invalid" }];
|
|
140
|
+
}
|
|
141
|
+
const req = requestRes.value;
|
|
142
|
+
|
|
143
|
+
const doResult = await client._do(req, {
|
|
144
|
+
context,
|
|
145
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
146
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
147
|
+
retryConfig: context.retryConfig,
|
|
148
|
+
retryCodes: context.retryCodes,
|
|
149
|
+
});
|
|
150
|
+
if (!doResult.ok) {
|
|
151
|
+
return [doResult, { status: "request-error", request: req }];
|
|
152
|
+
}
|
|
153
|
+
const response = doResult.value;
|
|
154
|
+
|
|
155
|
+
const responseFields = {
|
|
156
|
+
HttpMeta: { Response: response, Request: req },
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const [result] = await M.match<
|
|
160
|
+
operations.SearchGetTrendingResponse,
|
|
161
|
+
| errors.ErrorModel
|
|
162
|
+
| SteamSetsError
|
|
163
|
+
| ResponseValidationError
|
|
164
|
+
| ConnectionError
|
|
165
|
+
| RequestAbortedError
|
|
166
|
+
| RequestTimeoutError
|
|
167
|
+
| InvalidRequestError
|
|
168
|
+
| UnexpectedClientError
|
|
169
|
+
| SDKValidationError
|
|
170
|
+
>(
|
|
171
|
+
M.json(200, operations.SearchGetTrendingResponse$inboundSchema, {
|
|
172
|
+
key: "SearchGetTrendingResponseBody",
|
|
173
|
+
}),
|
|
174
|
+
M.jsonErr([400, 422], errors.ErrorModel$inboundSchema, {
|
|
175
|
+
ctype: "application/problem+json",
|
|
176
|
+
}),
|
|
177
|
+
M.jsonErr(500, errors.ErrorModel$inboundSchema, {
|
|
178
|
+
ctype: "application/problem+json",
|
|
179
|
+
}),
|
|
180
|
+
M.fail("4XX"),
|
|
181
|
+
M.fail("5XX"),
|
|
182
|
+
)(response, req, { extraFields: responseFields });
|
|
183
|
+
if (!result.ok) {
|
|
184
|
+
return [result, { status: "complete", request: req, response }];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return [result, { status: "complete", request: req, response }];
|
|
188
|
+
}
|
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.
|
|
62
|
+
sdkVersion: "0.33.5",
|
|
63
63
|
genVersion: "2.881.4",
|
|
64
64
|
userAgent:
|
|
65
|
-
"speakeasy-sdk/typescript 0.33.
|
|
65
|
+
"speakeasy-sdk/typescript 0.33.5 2.881.4 1.0.0 @steamsets/client-ts",
|
|
66
66
|
} as const;
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
/**
|
|
9
|
+
* Lookback window for trending compute. 24h is high-volatility (small samples); 7d is the default surface.
|
|
10
|
+
*/
|
|
11
|
+
export const Window = {
|
|
12
|
+
TwentyFourh: "24h",
|
|
13
|
+
Sevend: "7d",
|
|
14
|
+
Thirtyd: "30d",
|
|
15
|
+
} as const;
|
|
16
|
+
/**
|
|
17
|
+
* Lookback window for trending compute. 24h is high-volatility (small samples); 7d is the default surface.
|
|
18
|
+
*/
|
|
19
|
+
export type Window = ClosedEnum<typeof Window>;
|
|
20
|
+
|
|
21
|
+
export type AccountGetTrendingRequestBody = {
|
|
22
|
+
/**
|
|
23
|
+
* Max accounts returned. Default 100.
|
|
24
|
+
*/
|
|
25
|
+
limit?: number | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Lookback window for trending compute. 24h is high-volatility (small samples); 7d is the default surface.
|
|
28
|
+
*/
|
|
29
|
+
window: Window;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export const Window$outboundSchema: z.ZodNativeEnum<typeof Window> = z
|
|
34
|
+
.nativeEnum(Window);
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export type AccountGetTrendingRequestBody$Outbound = {
|
|
38
|
+
limit?: number | undefined;
|
|
39
|
+
window: string;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
export const AccountGetTrendingRequestBody$outboundSchema: z.ZodType<
|
|
44
|
+
AccountGetTrendingRequestBody$Outbound,
|
|
45
|
+
z.ZodTypeDef,
|
|
46
|
+
AccountGetTrendingRequestBody
|
|
47
|
+
> = z.object({
|
|
48
|
+
limit: z.number().int().optional(),
|
|
49
|
+
window: Window$outboundSchema,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export function accountGetTrendingRequestBodyToJSON(
|
|
53
|
+
accountGetTrendingRequestBody: AccountGetTrendingRequestBody,
|
|
54
|
+
): string {
|
|
55
|
+
return JSON.stringify(
|
|
56
|
+
AccountGetTrendingRequestBody$outboundSchema.parse(
|
|
57
|
+
accountGetTrendingRequestBody,
|
|
58
|
+
),
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -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
|
+
import {
|
|
11
|
+
TrendingAccount,
|
|
12
|
+
TrendingAccount$inboundSchema,
|
|
13
|
+
} from "./trendingaccount.js";
|
|
14
|
+
|
|
15
|
+
export type AccountGetTrendingResponseBody = {
|
|
16
|
+
/**
|
|
17
|
+
* A URL to the JSON Schema for this object.
|
|
18
|
+
*/
|
|
19
|
+
dollarSchema?: string | undefined;
|
|
20
|
+
accounts: Array<TrendingAccount> | null;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const AccountGetTrendingResponseBody$inboundSchema: z.ZodType<
|
|
25
|
+
AccountGetTrendingResponseBody,
|
|
26
|
+
z.ZodTypeDef,
|
|
27
|
+
unknown
|
|
28
|
+
> = z.object({
|
|
29
|
+
$schema: z.string().optional(),
|
|
30
|
+
accounts: z.nullable(z.array(TrendingAccount$inboundSchema)),
|
|
31
|
+
}).transform((v) => {
|
|
32
|
+
return remap$(v, {
|
|
33
|
+
"$schema": "dollarSchema",
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export function accountGetTrendingResponseBodyFromJSON(
|
|
38
|
+
jsonString: string,
|
|
39
|
+
): SafeParseResult<AccountGetTrendingResponseBody, SDKValidationError> {
|
|
40
|
+
return safeParse(
|
|
41
|
+
jsonString,
|
|
42
|
+
(x) => AccountGetTrendingResponseBody$inboundSchema.parse(JSON.parse(x)),
|
|
43
|
+
`Failed to parse 'AccountGetTrendingResponseBody' from JSON`,
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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 AccountViewStats = {
|
|
12
|
+
/**
|
|
13
|
+
* A URL to the JSON Schema for this object.
|
|
14
|
+
*/
|
|
15
|
+
dollarSchema?: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Total profile loads in the last 24 hours
|
|
18
|
+
*/
|
|
19
|
+
total24h: number;
|
|
20
|
+
/**
|
|
21
|
+
* Total profile loads in the last 30 days
|
|
22
|
+
*/
|
|
23
|
+
total30d: number;
|
|
24
|
+
/**
|
|
25
|
+
* Total profile loads in the last 7 days
|
|
26
|
+
*/
|
|
27
|
+
total7d: number;
|
|
28
|
+
/**
|
|
29
|
+
* Distinct viewers in the last 24 hours
|
|
30
|
+
*/
|
|
31
|
+
unique24h: number;
|
|
32
|
+
/**
|
|
33
|
+
* Distinct viewers in the last 30 days
|
|
34
|
+
*/
|
|
35
|
+
unique30d: number;
|
|
36
|
+
/**
|
|
37
|
+
* Distinct viewers in the last 7 days
|
|
38
|
+
*/
|
|
39
|
+
unique7d: number;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
export const AccountViewStats$inboundSchema: z.ZodType<
|
|
44
|
+
AccountViewStats,
|
|
45
|
+
z.ZodTypeDef,
|
|
46
|
+
unknown
|
|
47
|
+
> = z.object({
|
|
48
|
+
$schema: z.string().optional(),
|
|
49
|
+
total24h: z.number().int(),
|
|
50
|
+
total30d: z.number().int(),
|
|
51
|
+
total7d: z.number().int(),
|
|
52
|
+
unique24h: z.number().int(),
|
|
53
|
+
unique30d: z.number().int(),
|
|
54
|
+
unique7d: z.number().int(),
|
|
55
|
+
}).transform((v) => {
|
|
56
|
+
return remap$(v, {
|
|
57
|
+
"$schema": "dollarSchema",
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export function accountViewStatsFromJSON(
|
|
62
|
+
jsonString: string,
|
|
63
|
+
): SafeParseResult<AccountViewStats, SDKValidationError> {
|
|
64
|
+
return safeParse(
|
|
65
|
+
jsonString,
|
|
66
|
+
(x) => AccountViewStats$inboundSchema.parse(JSON.parse(x)),
|
|
67
|
+
`Failed to parse 'AccountViewStats' from JSON`,
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
/**
|
|
9
|
+
* Event class. profile_view is normally emitted server-side; this lets the frontend top it up for client-only flows. search captures account/app searches that bypass the backend.
|
|
10
|
+
*/
|
|
11
|
+
export const AnalyticsTrackEventRequestBodyType = {
|
|
12
|
+
ProfileView: "profile_view",
|
|
13
|
+
Search: "search",
|
|
14
|
+
} as const;
|
|
15
|
+
/**
|
|
16
|
+
* Event class. profile_view is normally emitted server-side; this lets the frontend top it up for client-only flows. search captures account/app searches that bypass the backend.
|
|
17
|
+
*/
|
|
18
|
+
export type AnalyticsTrackEventRequestBodyType = ClosedEnum<
|
|
19
|
+
typeof AnalyticsTrackEventRequestBodyType
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
export type AnalyticsTrackEventRequestBody = {
|
|
23
|
+
/**
|
|
24
|
+
* Per-type fields. profile_view: {accountId}. search: {source, query, resultCount}.
|
|
25
|
+
*/
|
|
26
|
+
payload: { [k: string]: any };
|
|
27
|
+
/**
|
|
28
|
+
* Event class. profile_view is normally emitted server-side; this lets the frontend top it up for client-only flows. search captures account/app searches that bypass the backend.
|
|
29
|
+
*/
|
|
30
|
+
type: AnalyticsTrackEventRequestBodyType;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const AnalyticsTrackEventRequestBodyType$outboundSchema: z.ZodNativeEnum<
|
|
35
|
+
typeof AnalyticsTrackEventRequestBodyType
|
|
36
|
+
> = z.nativeEnum(AnalyticsTrackEventRequestBodyType);
|
|
37
|
+
|
|
38
|
+
/** @internal */
|
|
39
|
+
export type AnalyticsTrackEventRequestBody$Outbound = {
|
|
40
|
+
payload: { [k: string]: any };
|
|
41
|
+
type: string;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const AnalyticsTrackEventRequestBody$outboundSchema: z.ZodType<
|
|
46
|
+
AnalyticsTrackEventRequestBody$Outbound,
|
|
47
|
+
z.ZodTypeDef,
|
|
48
|
+
AnalyticsTrackEventRequestBody
|
|
49
|
+
> = z.object({
|
|
50
|
+
payload: z.record(z.any()),
|
|
51
|
+
type: AnalyticsTrackEventRequestBodyType$outboundSchema,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export function analyticsTrackEventRequestBodyToJSON(
|
|
55
|
+
analyticsTrackEventRequestBody: AnalyticsTrackEventRequestBody,
|
|
56
|
+
): string {
|
|
57
|
+
return JSON.stringify(
|
|
58
|
+
AnalyticsTrackEventRequestBody$outboundSchema.parse(
|
|
59
|
+
analyticsTrackEventRequestBody,
|
|
60
|
+
),
|
|
61
|
+
);
|
|
62
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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 AnalyticsTrackEventResponseBody = {
|
|
12
|
+
/**
|
|
13
|
+
* A URL to the JSON Schema for this object.
|
|
14
|
+
*/
|
|
15
|
+
dollarSchema?: string | undefined;
|
|
16
|
+
ok: boolean;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const AnalyticsTrackEventResponseBody$inboundSchema: z.ZodType<
|
|
21
|
+
AnalyticsTrackEventResponseBody,
|
|
22
|
+
z.ZodTypeDef,
|
|
23
|
+
unknown
|
|
24
|
+
> = z.object({
|
|
25
|
+
$schema: z.string().optional(),
|
|
26
|
+
ok: z.boolean(),
|
|
27
|
+
}).transform((v) => {
|
|
28
|
+
return remap$(v, {
|
|
29
|
+
"$schema": "dollarSchema",
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export function analyticsTrackEventResponseBodyFromJSON(
|
|
34
|
+
jsonString: string,
|
|
35
|
+
): SafeParseResult<AnalyticsTrackEventResponseBody, SDKValidationError> {
|
|
36
|
+
return safeParse(
|
|
37
|
+
jsonString,
|
|
38
|
+
(x) => AnalyticsTrackEventResponseBody$inboundSchema.parse(JSON.parse(x)),
|
|
39
|
+
`Failed to parse 'AnalyticsTrackEventResponseBody' from JSON`,
|
|
40
|
+
);
|
|
41
|
+
}
|