@steamsets/client-ts 0.32.1 → 0.32.3
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 +4 -0
- package/funcs/accountAccountGetBadgeHeatmap.d.ts +16 -0
- package/funcs/accountAccountGetBadgeHeatmap.d.ts.map +1 -0
- package/funcs/accountAccountGetBadgeHeatmap.js +133 -0
- package/funcs/accountAccountGetBadgeHeatmap.js.map +1 -0
- package/funcs/adminAdminUpdateRoleOverride.d.ts +16 -0
- package/funcs/adminAdminUpdateRoleOverride.d.ts.map +1 -0
- package/funcs/adminAdminUpdateRoleOverride.js +131 -0
- package/funcs/adminAdminUpdateRoleOverride.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/lib/encodings.d.ts +1 -0
- package/lib/encodings.d.ts.map +1 -1
- package/lib/encodings.js +27 -5
- package/lib/encodings.js.map +1 -1
- package/lib/files.d.ts +13 -0
- package/lib/files.d.ts.map +1 -1
- package/lib/files.js +19 -0
- package/lib/files.js.map +1 -1
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +8 -4
- package/lib/sdks.js.map +1 -1
- package/lib/security.d.ts +1 -1
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js +19 -8
- package/lib/security.js.map +1 -1
- package/lib/url.d.ts.map +1 -1
- package/lib/url.js +4 -2
- package/lib/url.js.map +1 -1
- package/models/components/index.d.ts +1 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -0
- package/models/components/index.js.map +1 -1
- package/models/components/leaderboardaccount.d.ts +21 -0
- package/models/components/leaderboardaccount.d.ts.map +1 -1
- package/models/components/leaderboardaccount.js +6 -0
- package/models/components/leaderboardaccount.js.map +1 -1
- package/models/components/previewaccount.d.ts +21 -0
- package/models/components/previewaccount.d.ts.map +1 -1
- package/models/components/previewaccount.js +6 -0
- package/models/components/previewaccount.js.map +1 -1
- package/models/components/v1accountfriend.d.ts +21 -0
- package/models/components/v1accountfriend.d.ts.map +1 -1
- package/models/components/v1accountfriend.js +6 -0
- package/models/components/v1accountfriend.js.map +1 -1
- package/models/components/v1accountleaderboardaccount.d.ts +21 -0
- package/models/components/v1accountleaderboardaccount.d.ts.map +1 -1
- package/models/components/v1accountleaderboardaccount.js +6 -0
- package/models/components/v1accountleaderboardaccount.js.map +1 -1
- package/models/components/v1adminupdateroleoverriderequestbody.d.ts +43 -0
- package/models/components/v1adminupdateroleoverriderequestbody.d.ts.map +1 -0
- package/models/components/v1adminupdateroleoverriderequestbody.js +66 -0
- package/models/components/v1adminupdateroleoverriderequestbody.js.map +1 -0
- package/models/operations/accountgetbadgeheatmap.d.ts +17 -0
- package/models/operations/accountgetbadgeheatmap.d.ts.map +1 -0
- package/models/operations/accountgetbadgeheatmap.js +57 -0
- package/models/operations/accountgetbadgeheatmap.js.map +1 -0
- package/models/operations/adminupdateroleoverride.d.ts +11 -0
- package/models/operations/adminupdateroleoverride.d.ts.map +1 -0
- package/models/operations/adminupdateroleoverride.js +56 -0
- package/models/operations/adminupdateroleoverride.js.map +1 -0
- package/models/operations/index.d.ts +2 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -0
- package/models/operations/index.js.map +1 -1
- package/package.json +1 -1
- package/sdk/account.d.ts +4 -0
- package/sdk/account.d.ts.map +1 -1
- package/sdk/account.js +7 -0
- package/sdk/account.js.map +1 -1
- package/sdk/admin.d.ts +4 -0
- package/sdk/admin.d.ts.map +1 -1
- package/sdk/admin.js +7 -0
- package/sdk/admin.js.map +1 -1
- package/src/funcs/accountAccountGetBadgeHeatmap.ts +185 -0
- package/src/funcs/adminAdminUpdateRoleOverride.ts +186 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +32 -4
- package/src/lib/files.ts +22 -0
- package/src/lib/sdks.ts +7 -5
- package/src/lib/security.ts +14 -2
- package/src/lib/url.ts +16 -14
- package/src/models/components/index.ts +1 -0
- package/src/models/components/leaderboardaccount.ts +26 -0
- package/src/models/components/previewaccount.ts +26 -0
- package/src/models/components/v1accountfriend.ts +26 -0
- package/src/models/components/v1accountleaderboardaccount.ts +26 -0
- package/src/models/components/v1adminupdateroleoverriderequestbody.ts +79 -0
- package/src/models/operations/accountgetbadgeheatmap.ts +42 -0
- package/src/models/operations/adminupdateroleoverride.ts +37 -0
- package/src/models/operations/index.ts +2 -0
- package/src/sdk/account.ts +15 -0
- package/src/sdk/admin.ts +15 -0
package/sdk/admin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../src/sdk/admin.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,oEAA8D;AAC9D,wEAAkE;AAClE,8EAAwE;AACxE,sEAAgE;AAChE,4CAA2D;AAG3D,0CAA6C;AAE7C,MAAa,KAAM,SAAQ,mBAAS;IAClC;;OAEG;IACH,KAAK,CAAC,UAAU,CACd,OAAiC,EACjC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,oCAAe,EAChC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY,CAChB,OAAiC,EACjC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wCAAiB,EAClC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,eAAe,CACnB,OAAqD,EACrD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,8CAAoB,EACrC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW,CACf,OAAiD,EACjD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,sCAAgB,EACjC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../src/sdk/admin.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,8FAAwF;AACxF,oEAA8D;AAC9D,wEAAkE;AAClE,8EAAwE;AACxE,sEAAgE;AAChE,4CAA2D;AAG3D,0CAA6C;AAE7C,MAAa,KAAM,SAAQ,mBAAS;IAClC;;OAEG;IACH,KAAK,CAAC,UAAU,CACd,OAAiC,EACjC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,oCAAe,EAChC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY,CAChB,OAAiC,EACjC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wCAAiB,EAClC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,eAAe,CACnB,OAAqD,EACrD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,8CAAoB,EACrC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,uBAAuB,CAC3B,OAAwD,EACxD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,8DAA4B,EAC7C,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW,CACf,OAAiD,EACjD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,sCAAgB,EACjC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AAtED,sBAsEC"}
|
|
@@ -0,0 +1,185 @@
|
|
|
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
|
+
/**
|
|
30
|
+
* Get monthly badge crafting counts for an account
|
|
31
|
+
*/
|
|
32
|
+
export function accountAccountGetBadgeHeatmap(
|
|
33
|
+
client: SteamSetsCore,
|
|
34
|
+
request: components.AccountSearch,
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): APIPromise<
|
|
37
|
+
Result<
|
|
38
|
+
operations.AccountGetBadgeHeatmapResponse,
|
|
39
|
+
| errors.ErrorModel
|
|
40
|
+
| SteamSetsError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: SteamSetsCore,
|
|
59
|
+
request: components.AccountSearch,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.AccountGetBadgeHeatmapResponse,
|
|
65
|
+
| errors.ErrorModel
|
|
66
|
+
| SteamSetsError
|
|
67
|
+
| ResponseValidationError
|
|
68
|
+
| ConnectionError
|
|
69
|
+
| RequestAbortedError
|
|
70
|
+
| RequestTimeoutError
|
|
71
|
+
| InvalidRequestError
|
|
72
|
+
| UnexpectedClientError
|
|
73
|
+
| SDKValidationError
|
|
74
|
+
>,
|
|
75
|
+
APICall,
|
|
76
|
+
]
|
|
77
|
+
> {
|
|
78
|
+
const parsed = safeParse(
|
|
79
|
+
request,
|
|
80
|
+
(value) => components.AccountSearch$outboundSchema.parse(value),
|
|
81
|
+
"Input validation failed",
|
|
82
|
+
);
|
|
83
|
+
if (!parsed.ok) {
|
|
84
|
+
return [parsed, { status: "invalid" }];
|
|
85
|
+
}
|
|
86
|
+
const payload = parsed.value;
|
|
87
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
88
|
+
|
|
89
|
+
const path = pathToFunc("/v1/account.getBadgeHeatmap")();
|
|
90
|
+
|
|
91
|
+
const headers = new Headers(compactMap({
|
|
92
|
+
"Content-Type": "application/json",
|
|
93
|
+
Accept: "application/json",
|
|
94
|
+
}));
|
|
95
|
+
|
|
96
|
+
const secConfig = await extractSecurity(client._options.token);
|
|
97
|
+
const securityInput = secConfig == null ? {} : { token: secConfig };
|
|
98
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
99
|
+
|
|
100
|
+
const context = {
|
|
101
|
+
options: client._options,
|
|
102
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
103
|
+
operationID: "account.getBadgeHeatmap",
|
|
104
|
+
oAuth2Scopes: null,
|
|
105
|
+
|
|
106
|
+
resolvedSecurity: requestSecurity,
|
|
107
|
+
|
|
108
|
+
securitySource: client._options.token,
|
|
109
|
+
retryConfig: options?.retries
|
|
110
|
+
|| client._options.retryConfig
|
|
111
|
+
|| {
|
|
112
|
+
strategy: "backoff",
|
|
113
|
+
backoff: {
|
|
114
|
+
initialInterval: 500,
|
|
115
|
+
maxInterval: 5000,
|
|
116
|
+
exponent: 1.5,
|
|
117
|
+
maxElapsedTime: 60000,
|
|
118
|
+
},
|
|
119
|
+
retryConnectionErrors: true,
|
|
120
|
+
}
|
|
121
|
+
|| { strategy: "none" },
|
|
122
|
+
retryCodes: options?.retryCodes || ["501", "502", "503", "504"],
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const requestRes = client._createRequest(context, {
|
|
126
|
+
security: requestSecurity,
|
|
127
|
+
method: "POST",
|
|
128
|
+
baseURL: options?.serverURL,
|
|
129
|
+
path: path,
|
|
130
|
+
headers: headers,
|
|
131
|
+
body: body,
|
|
132
|
+
uaHeader: "x-speakeasy-user-agent",
|
|
133
|
+
userAgent: client._options.userAgent,
|
|
134
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
135
|
+
}, options);
|
|
136
|
+
if (!requestRes.ok) {
|
|
137
|
+
return [requestRes, { status: "invalid" }];
|
|
138
|
+
}
|
|
139
|
+
const req = requestRes.value;
|
|
140
|
+
|
|
141
|
+
const doResult = await client._do(req, {
|
|
142
|
+
context,
|
|
143
|
+
errorCodes: ["400", "401", "404", "422", "4XX", "500", "5XX"],
|
|
144
|
+
retryConfig: context.retryConfig,
|
|
145
|
+
retryCodes: context.retryCodes,
|
|
146
|
+
});
|
|
147
|
+
if (!doResult.ok) {
|
|
148
|
+
return [doResult, { status: "request-error", request: req }];
|
|
149
|
+
}
|
|
150
|
+
const response = doResult.value;
|
|
151
|
+
|
|
152
|
+
const responseFields = {
|
|
153
|
+
HttpMeta: { Response: response, Request: req },
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const [result] = await M.match<
|
|
157
|
+
operations.AccountGetBadgeHeatmapResponse,
|
|
158
|
+
| errors.ErrorModel
|
|
159
|
+
| SteamSetsError
|
|
160
|
+
| ResponseValidationError
|
|
161
|
+
| ConnectionError
|
|
162
|
+
| RequestAbortedError
|
|
163
|
+
| RequestTimeoutError
|
|
164
|
+
| InvalidRequestError
|
|
165
|
+
| UnexpectedClientError
|
|
166
|
+
| SDKValidationError
|
|
167
|
+
>(
|
|
168
|
+
M.json(200, operations.AccountGetBadgeHeatmapResponse$inboundSchema, {
|
|
169
|
+
key: "object",
|
|
170
|
+
}),
|
|
171
|
+
M.jsonErr([400, 401, 404, 422], errors.ErrorModel$inboundSchema, {
|
|
172
|
+
ctype: "application/problem+json",
|
|
173
|
+
}),
|
|
174
|
+
M.jsonErr(500, errors.ErrorModel$inboundSchema, {
|
|
175
|
+
ctype: "application/problem+json",
|
|
176
|
+
}),
|
|
177
|
+
M.fail("4XX"),
|
|
178
|
+
M.fail("5XX"),
|
|
179
|
+
)(response, req, { extraFields: responseFields });
|
|
180
|
+
if (!result.ok) {
|
|
181
|
+
return [result, { status: "complete", request: req, response }];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return [result, { status: "complete", request: req, response }];
|
|
185
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
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
|
+
/**
|
|
30
|
+
* Set or remove a tier role override for an account
|
|
31
|
+
*/
|
|
32
|
+
export function adminAdminUpdateRoleOverride(
|
|
33
|
+
client: SteamSetsCore,
|
|
34
|
+
request: components.V1AdminUpdateRoleOverrideRequestBody,
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): APIPromise<
|
|
37
|
+
Result<
|
|
38
|
+
operations.AdminUpdateRoleOverrideResponse,
|
|
39
|
+
| errors.ErrorModel
|
|
40
|
+
| SteamSetsError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: SteamSetsCore,
|
|
59
|
+
request: components.V1AdminUpdateRoleOverrideRequestBody,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.AdminUpdateRoleOverrideResponse,
|
|
65
|
+
| errors.ErrorModel
|
|
66
|
+
| SteamSetsError
|
|
67
|
+
| ResponseValidationError
|
|
68
|
+
| ConnectionError
|
|
69
|
+
| RequestAbortedError
|
|
70
|
+
| RequestTimeoutError
|
|
71
|
+
| InvalidRequestError
|
|
72
|
+
| UnexpectedClientError
|
|
73
|
+
| SDKValidationError
|
|
74
|
+
>,
|
|
75
|
+
APICall,
|
|
76
|
+
]
|
|
77
|
+
> {
|
|
78
|
+
const parsed = safeParse(
|
|
79
|
+
request,
|
|
80
|
+
(value) =>
|
|
81
|
+
components.V1AdminUpdateRoleOverrideRequestBody$outboundSchema.parse(
|
|
82
|
+
value,
|
|
83
|
+
),
|
|
84
|
+
"Input validation failed",
|
|
85
|
+
);
|
|
86
|
+
if (!parsed.ok) {
|
|
87
|
+
return [parsed, { status: "invalid" }];
|
|
88
|
+
}
|
|
89
|
+
const payload = parsed.value;
|
|
90
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
91
|
+
|
|
92
|
+
const path = pathToFunc("/v1/admin.updateRoleOverride")();
|
|
93
|
+
|
|
94
|
+
const headers = new Headers(compactMap({
|
|
95
|
+
"Content-Type": "application/json",
|
|
96
|
+
Accept: "application/problem+json",
|
|
97
|
+
}));
|
|
98
|
+
|
|
99
|
+
const secConfig = await extractSecurity(client._options.token);
|
|
100
|
+
const securityInput = secConfig == null ? {} : { token: secConfig };
|
|
101
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
102
|
+
|
|
103
|
+
const context = {
|
|
104
|
+
options: client._options,
|
|
105
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
106
|
+
operationID: "admin.updateRoleOverride",
|
|
107
|
+
oAuth2Scopes: null,
|
|
108
|
+
|
|
109
|
+
resolvedSecurity: requestSecurity,
|
|
110
|
+
|
|
111
|
+
securitySource: client._options.token,
|
|
112
|
+
retryConfig: options?.retries
|
|
113
|
+
|| client._options.retryConfig
|
|
114
|
+
|| {
|
|
115
|
+
strategy: "backoff",
|
|
116
|
+
backoff: {
|
|
117
|
+
initialInterval: 500,
|
|
118
|
+
maxInterval: 5000,
|
|
119
|
+
exponent: 1.5,
|
|
120
|
+
maxElapsedTime: 60000,
|
|
121
|
+
},
|
|
122
|
+
retryConnectionErrors: true,
|
|
123
|
+
}
|
|
124
|
+
|| { strategy: "none" },
|
|
125
|
+
retryCodes: options?.retryCodes || ["501", "502", "503", "504"],
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const requestRes = client._createRequest(context, {
|
|
129
|
+
security: requestSecurity,
|
|
130
|
+
method: "POST",
|
|
131
|
+
baseURL: options?.serverURL,
|
|
132
|
+
path: path,
|
|
133
|
+
headers: headers,
|
|
134
|
+
body: body,
|
|
135
|
+
uaHeader: "x-speakeasy-user-agent",
|
|
136
|
+
userAgent: client._options.userAgent,
|
|
137
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
138
|
+
}, options);
|
|
139
|
+
if (!requestRes.ok) {
|
|
140
|
+
return [requestRes, { status: "invalid" }];
|
|
141
|
+
}
|
|
142
|
+
const req = requestRes.value;
|
|
143
|
+
|
|
144
|
+
const doResult = await client._do(req, {
|
|
145
|
+
context,
|
|
146
|
+
errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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.AdminUpdateRoleOverrideResponse,
|
|
161
|
+
| errors.ErrorModel
|
|
162
|
+
| SteamSetsError
|
|
163
|
+
| ResponseValidationError
|
|
164
|
+
| ConnectionError
|
|
165
|
+
| RequestAbortedError
|
|
166
|
+
| RequestTimeoutError
|
|
167
|
+
| InvalidRequestError
|
|
168
|
+
| UnexpectedClientError
|
|
169
|
+
| SDKValidationError
|
|
170
|
+
>(
|
|
171
|
+
M.nil(204, operations.AdminUpdateRoleOverrideResponse$inboundSchema),
|
|
172
|
+
M.jsonErr([400, 401, 403, 404, 422], errors.ErrorModel$inboundSchema, {
|
|
173
|
+
ctype: "application/problem+json",
|
|
174
|
+
}),
|
|
175
|
+
M.jsonErr(500, errors.ErrorModel$inboundSchema, {
|
|
176
|
+
ctype: "application/problem+json",
|
|
177
|
+
}),
|
|
178
|
+
M.fail("4XX"),
|
|
179
|
+
M.fail("5XX"),
|
|
180
|
+
)(response, req, { extraFields: responseFields });
|
|
181
|
+
if (!result.ok) {
|
|
182
|
+
return [result, { status: "complete", request: req, response }];
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return [result, { status: "complete", request: req, response }];
|
|
186
|
+
}
|
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.32.
|
|
63
|
-
genVersion: "2.
|
|
62
|
+
sdkVersion: "0.32.3",
|
|
63
|
+
genVersion: "2.879.11",
|
|
64
64
|
userAgent:
|
|
65
|
-
"speakeasy-sdk/typescript 0.32.
|
|
65
|
+
"speakeasy-sdk/typescript 0.32.3 2.879.11 1.0.0 @steamsets/client-ts",
|
|
66
66
|
} as const;
|
package/src/lib/encodings.ts
CHANGED
|
@@ -479,6 +479,23 @@ export const encodeSpaceDelimitedQuery = queryEncoder(encodeSpaceDelimited);
|
|
|
479
479
|
export const encodePipeDelimitedQuery = queryEncoder(encodePipeDelimited);
|
|
480
480
|
export const encodeDeepObjectQuery = queryEncoder(encodeDeepObject);
|
|
481
481
|
|
|
482
|
+
function isBlobLike(val: unknown): val is Blob {
|
|
483
|
+
if (val instanceof Blob) {
|
|
484
|
+
return true;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) {
|
|
488
|
+
return false;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
const tag = val[Symbol.toStringTag];
|
|
492
|
+
if (tag !== "Blob" && tag !== "File") {
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
return "stream" in val && typeof val.stream === "function";
|
|
497
|
+
}
|
|
498
|
+
|
|
482
499
|
export function appendForm(
|
|
483
500
|
fd: FormData,
|
|
484
501
|
key: string,
|
|
@@ -487,11 +504,22 @@ export function appendForm(
|
|
|
487
504
|
): void {
|
|
488
505
|
if (value == null) {
|
|
489
506
|
return;
|
|
490
|
-
} else if (value
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
507
|
+
} else if (isBlobLike(value)) {
|
|
508
|
+
if (fileName) {
|
|
509
|
+
fd.append(key, value as Blob, fileName);
|
|
510
|
+
} else {
|
|
511
|
+
fd.append(key, value as Blob);
|
|
512
|
+
}
|
|
494
513
|
} else {
|
|
495
514
|
fd.append(key, String(value));
|
|
496
515
|
}
|
|
497
516
|
}
|
|
517
|
+
|
|
518
|
+
export async function normalizeBlob(
|
|
519
|
+
value: Pick<Blob, "arrayBuffer" | "type">,
|
|
520
|
+
): Promise<Blob> {
|
|
521
|
+
if (value instanceof Blob) {
|
|
522
|
+
return value;
|
|
523
|
+
}
|
|
524
|
+
return new Blob([await value.arrayBuffer()], { type: value.type });
|
|
525
|
+
}
|
package/src/lib/files.ts
CHANGED
|
@@ -80,3 +80,25 @@ export function getContentTypeFromFileName(fileName: string): string | null {
|
|
|
80
80
|
|
|
81
81
|
return mimeTypes[ext] || null;
|
|
82
82
|
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Creates a Blob from file content with the given MIME type.
|
|
86
|
+
*
|
|
87
|
+
* Node.js Buffers are Uint8Array subclasses that may share a pooled
|
|
88
|
+
* ArrayBuffer (byteOffset > 0, byteLength < buffer.byteLength). Passing
|
|
89
|
+
* such a Buffer directly to `new Blob([buf])` can include the entire
|
|
90
|
+
* underlying pool on some runtimes, producing a Blob with extra bytes
|
|
91
|
+
* that corrupts multipart uploads.
|
|
92
|
+
*
|
|
93
|
+
* Copying into a standalone Uint8Array ensures the Blob receives only the
|
|
94
|
+
* intended bytes regardless of runtime behaviour.
|
|
95
|
+
*/
|
|
96
|
+
export function bytesToBlob(
|
|
97
|
+
content: Uint8Array<ArrayBufferLike> | ArrayBuffer | Blob | string,
|
|
98
|
+
contentType: string,
|
|
99
|
+
): Blob {
|
|
100
|
+
if (content instanceof Uint8Array) {
|
|
101
|
+
return new Blob([new Uint8Array(content)], { type: contentType });
|
|
102
|
+
}
|
|
103
|
+
return new Blob([content as BlobPart], { type: contentType });
|
|
104
|
+
}
|
package/src/lib/sdks.ts
CHANGED
|
@@ -124,13 +124,15 @@ export class ClientSDK {
|
|
|
124
124
|
if (!base) {
|
|
125
125
|
return ERR(new InvalidRequestError("No base URL provided for operation"));
|
|
126
126
|
}
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
const baseURL = new URL(base);
|
|
128
|
+
let reqURL: URL;
|
|
130
129
|
if (path) {
|
|
131
|
-
|
|
132
|
-
reqURL
|
|
130
|
+
baseURL.pathname = baseURL.pathname.replace(/\/+$/, "") + "/";
|
|
131
|
+
reqURL = new URL(path, baseURL);
|
|
132
|
+
} else {
|
|
133
|
+
reqURL = baseURL;
|
|
133
134
|
}
|
|
135
|
+
reqURL.hash = "";
|
|
134
136
|
|
|
135
137
|
let finalQuery = query || "";
|
|
136
138
|
|
package/src/lib/security.ts
CHANGED
|
@@ -239,8 +239,9 @@ function applyBearer(
|
|
|
239
239
|
|
|
240
240
|
export function resolveGlobalSecurity(
|
|
241
241
|
security: Partial<components.Security> | null | undefined,
|
|
242
|
+
allowedFields?: number[],
|
|
242
243
|
): SecurityState | null {
|
|
243
|
-
|
|
244
|
+
let inputs: SecurityInput[][] = [
|
|
244
245
|
[
|
|
245
246
|
{
|
|
246
247
|
fieldName: "Authorization",
|
|
@@ -248,7 +249,18 @@ export function resolveGlobalSecurity(
|
|
|
248
249
|
value: security?.token,
|
|
249
250
|
},
|
|
250
251
|
],
|
|
251
|
-
|
|
252
|
+
];
|
|
253
|
+
|
|
254
|
+
if (allowedFields) {
|
|
255
|
+
inputs = allowedFields.map((i) => {
|
|
256
|
+
if (i < 0 || i >= inputs.length) {
|
|
257
|
+
throw new RangeError(`invalid allowedFields index ${i}`);
|
|
258
|
+
}
|
|
259
|
+
return inputs[i]!;
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
return resolveSecurity(...inputs);
|
|
252
264
|
}
|
|
253
265
|
|
|
254
266
|
export async function extractSecurity<
|
package/src/lib/url.ts
CHANGED
|
@@ -13,21 +13,23 @@ export function pathToFunc(
|
|
|
13
13
|
const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;
|
|
14
14
|
|
|
15
15
|
return function buildURLPath(params: Record<string, unknown> = {}): string {
|
|
16
|
-
return pathPattern
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
return pathPattern
|
|
17
|
+
.replace(paramRE, function (_, placeholder) {
|
|
18
|
+
if (!hasOwn.call(params, placeholder)) {
|
|
19
|
+
throw new Error(`Parameter '${placeholder}' is required`);
|
|
20
|
+
}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
const value = params[placeholder];
|
|
23
|
+
if (typeof value !== "string" && typeof value !== "number") {
|
|
24
|
+
throw new Error(
|
|
25
|
+
`Parameter '${placeholder}' must be a string or number`,
|
|
26
|
+
);
|
|
27
|
+
}
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
return options?.charEncoding === "percent"
|
|
30
|
+
? encodeURIComponent(`${value}`)
|
|
31
|
+
: `${value}`;
|
|
32
|
+
})
|
|
33
|
+
.replace(/^\/+/, "");
|
|
32
34
|
};
|
|
33
35
|
}
|
|
@@ -116,6 +116,7 @@ export * from "./v1accountverifyemailrequestbody.js";
|
|
|
116
116
|
export * from "./v1admingetaccountresponsebody.js";
|
|
117
117
|
export * from "./v1adminremovevanityresponsebody.js";
|
|
118
118
|
export * from "./v1adminupdateresourcesrequestbody.js";
|
|
119
|
+
export * from "./v1adminupdateroleoverriderequestbody.js";
|
|
119
120
|
export * from "./v1adminupdaterolesrequestbody.js";
|
|
120
121
|
export * from "./v1appbadge.js";
|
|
121
122
|
export * from "./v1appfilters.js";
|
|
@@ -8,6 +8,7 @@ import * as openEnums from "../../types/enums.js";
|
|
|
8
8
|
import { OpenEnum } from "../../types/enums.js";
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import { Image, Image$inboundSchema } from "./image.js";
|
|
11
12
|
import {
|
|
12
13
|
LeaderboardCity,
|
|
13
14
|
LeaderboardCity$inboundSchema,
|
|
@@ -42,6 +43,10 @@ export type LeaderboardAccountPrivacy = OpenEnum<
|
|
|
42
43
|
>;
|
|
43
44
|
|
|
44
45
|
export type LeaderboardAccount = {
|
|
46
|
+
/**
|
|
47
|
+
* The animated avatar of the account
|
|
48
|
+
*/
|
|
49
|
+
animatedAvatar: string;
|
|
45
50
|
/**
|
|
46
51
|
* The cost of an app
|
|
47
52
|
*
|
|
@@ -56,6 +61,10 @@ export type LeaderboardAccount = {
|
|
|
56
61
|
* The avatar hash of the account
|
|
57
62
|
*/
|
|
58
63
|
avatar: string;
|
|
64
|
+
/**
|
|
65
|
+
* The avatar frame of the account
|
|
66
|
+
*/
|
|
67
|
+
avatarFrame: string;
|
|
59
68
|
/**
|
|
60
69
|
* The number of awards the account has
|
|
61
70
|
*/
|
|
@@ -64,6 +73,10 @@ export type LeaderboardAccount = {
|
|
|
64
73
|
* The number of awards the account has
|
|
65
74
|
*/
|
|
66
75
|
awardsReceived: number;
|
|
76
|
+
/**
|
|
77
|
+
* The background of the account
|
|
78
|
+
*/
|
|
79
|
+
background: string;
|
|
67
80
|
/**
|
|
68
81
|
* The number of badges the account has
|
|
69
82
|
*/
|
|
@@ -104,10 +117,18 @@ export type LeaderboardAccount = {
|
|
|
104
117
|
* The number of game bans
|
|
105
118
|
*/
|
|
106
119
|
gameBans: number;
|
|
120
|
+
/**
|
|
121
|
+
* The images of the account
|
|
122
|
+
*/
|
|
123
|
+
images: Array<Image> | null;
|
|
107
124
|
/**
|
|
108
125
|
* The level of the account
|
|
109
126
|
*/
|
|
110
127
|
level: number;
|
|
128
|
+
/**
|
|
129
|
+
* The mini background of the account
|
|
130
|
+
*/
|
|
131
|
+
miniBackground: string;
|
|
111
132
|
/**
|
|
112
133
|
* The name of the account
|
|
113
134
|
*/
|
|
@@ -183,11 +204,14 @@ export const LeaderboardAccount$inboundSchema: z.ZodType<
|
|
|
183
204
|
z.ZodTypeDef,
|
|
184
205
|
unknown
|
|
185
206
|
> = z.object({
|
|
207
|
+
animatedAvatar: z.string(),
|
|
186
208
|
appCost: z.number().int(),
|
|
187
209
|
apps: z.number().int(),
|
|
188
210
|
avatar: z.string(),
|
|
211
|
+
avatarFrame: z.string(),
|
|
189
212
|
awardsGiven: z.number().int(),
|
|
190
213
|
awardsReceived: z.number().int(),
|
|
214
|
+
background: z.string(),
|
|
191
215
|
badges: z.number().int(),
|
|
192
216
|
bans: z.number().int(),
|
|
193
217
|
city: z.nullable(LeaderboardCity$inboundSchema).optional(),
|
|
@@ -199,7 +223,9 @@ export const LeaderboardAccount$inboundSchema: z.ZodType<
|
|
|
199
223
|
foilBadges: z.number().int(),
|
|
200
224
|
friends: z.number().int(),
|
|
201
225
|
gameBans: z.number().int(),
|
|
226
|
+
images: z.nullable(z.array(Image$inboundSchema)),
|
|
202
227
|
level: z.number().int(),
|
|
228
|
+
miniBackground: z.string(),
|
|
203
229
|
name: z.string(),
|
|
204
230
|
normalBadgeCost: z.number().int(),
|
|
205
231
|
normalBadges: z.number().int(),
|