@steamsets/client-ts 0.14.28 → 0.14.29
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 -0
- package/docs/sdks/account/README.md +73 -0
- package/docs/sdks/internal/README.md +73 -0
- package/docs/sdks/settings/README.md +73 -0
- package/funcs/accountAccountV1SettingsUpdateRole.d.ts +11 -0
- package/funcs/accountAccountV1SettingsUpdateRole.d.ts.map +1 -0
- package/funcs/accountAccountV1SettingsUpdateRole.js +113 -0
- package/funcs/accountAccountV1SettingsUpdateRole.js.map +1 -0
- package/funcs/internalAccountV1SettingsUpdateRole.d.ts +11 -0
- package/funcs/internalAccountV1SettingsUpdateRole.d.ts.map +1 -0
- package/funcs/internalAccountV1SettingsUpdateRole.js +113 -0
- package/funcs/internalAccountV1SettingsUpdateRole.js.map +1 -0
- package/funcs/settingsAccountV1SettingsUpdateRole.d.ts +11 -0
- package/funcs/settingsAccountV1SettingsUpdateRole.d.ts.map +1 -0
- package/funcs/settingsAccountV1SettingsUpdateRole.js +113 -0
- package/funcs/settingsAccountV1SettingsUpdateRole.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/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/v1accountinforesponsebody.d.ts +5 -0
- package/models/components/v1accountinforesponsebody.d.ts.map +1 -1
- package/models/components/v1accountinforesponsebody.js +2 -0
- package/models/components/v1accountinforesponsebody.js.map +1 -1
- package/models/components/v1updaterolerequestbody.d.ts +76 -0
- package/models/components/v1updaterolerequestbody.d.ts.map +1 -0
- package/models/components/v1updaterolerequestbody.js +85 -0
- package/models/components/v1updaterolerequestbody.js.map +1 -0
- package/models/components/v1updatesettingsrequestbody.d.ts +0 -49
- package/models/components/v1updatesettingsrequestbody.d.ts.map +1 -1
- package/models/components/v1updatesettingsrequestbody.js +1 -29
- package/models/components/v1updatesettingsrequestbody.js.map +1 -1
- package/models/operations/accountv1settingsupdaterole.d.ts +36 -0
- package/models/operations/accountv1settingsupdaterole.d.ts.map +1 -0
- package/models/operations/accountv1settingsupdaterole.js +73 -0
- package/models/operations/accountv1settingsupdaterole.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 -0
- package/sdk/account.d.ts.map +1 -1
- package/sdk/account.js +4 -0
- package/sdk/account.js.map +1 -1
- package/sdk/internal.d.ts +1 -0
- package/sdk/internal.d.ts.map +1 -1
- package/sdk/internal.js +4 -0
- package/sdk/internal.js.map +1 -1
- package/sdk/settings.d.ts +1 -0
- package/sdk/settings.d.ts.map +1 -1
- package/sdk/settings.js +4 -0
- package/sdk/settings.js.map +1 -1
- package/src/funcs/accountAccountV1SettingsUpdateRole.ts +149 -0
- package/src/funcs/internalAccountV1SettingsUpdateRole.ts +149 -0
- package/src/funcs/settingsAccountV1SettingsUpdateRole.ts +149 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/index.ts +1 -0
- package/src/models/components/v1accountinforesponsebody.ts +9 -0
- package/src/models/components/v1updaterolerequestbody.ts +109 -0
- package/src/models/components/v1updatesettingsrequestbody.ts +0 -47
- package/src/models/operations/accountv1settingsupdaterole.ts +87 -0
- package/src/models/operations/index.ts +1 -0
- package/src/sdk/account.ts +12 -0
- package/src/sdk/internal.ts +12 -0
- package/src/sdk/settings.ts +12 -0
|
@@ -0,0 +1,149 @@
|
|
|
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 { SDKError } from "../models/errors/sdkerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
export async function internalAccountV1SettingsUpdateRole(
|
|
28
|
+
client: SteamSetsCore,
|
|
29
|
+
request: components.V1UpdateRoleRequestBody,
|
|
30
|
+
options?: RequestOptions,
|
|
31
|
+
): Promise<
|
|
32
|
+
Result<
|
|
33
|
+
operations.AccountV1SettingsUpdateRoleResponse,
|
|
34
|
+
| errors.ErrorModel
|
|
35
|
+
| errors.ErrorModel
|
|
36
|
+
| SDKError
|
|
37
|
+
| SDKValidationError
|
|
38
|
+
| UnexpectedClientError
|
|
39
|
+
| InvalidRequestError
|
|
40
|
+
| RequestAbortedError
|
|
41
|
+
| RequestTimeoutError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
>
|
|
44
|
+
> {
|
|
45
|
+
const parsed = safeParse(
|
|
46
|
+
request,
|
|
47
|
+
(value) => components.V1UpdateRoleRequestBody$outboundSchema.parse(value),
|
|
48
|
+
"Input validation failed",
|
|
49
|
+
);
|
|
50
|
+
if (!parsed.ok) {
|
|
51
|
+
return parsed;
|
|
52
|
+
}
|
|
53
|
+
const payload = parsed.value;
|
|
54
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
55
|
+
|
|
56
|
+
const path = pathToFunc("/account.v1.AccountService/UpdateRole")();
|
|
57
|
+
|
|
58
|
+
const headers = new Headers(compactMap({
|
|
59
|
+
"Content-Type": "application/json",
|
|
60
|
+
Accept: "application/problem+json",
|
|
61
|
+
}));
|
|
62
|
+
|
|
63
|
+
const secConfig = await extractSecurity(client._options.token);
|
|
64
|
+
const securityInput = secConfig == null ? {} : { token: secConfig };
|
|
65
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
66
|
+
|
|
67
|
+
const context = {
|
|
68
|
+
operationID: "account.v1.settings.update-role",
|
|
69
|
+
oAuth2Scopes: [],
|
|
70
|
+
|
|
71
|
+
resolvedSecurity: requestSecurity,
|
|
72
|
+
|
|
73
|
+
securitySource: client._options.token,
|
|
74
|
+
retryConfig: options?.retries
|
|
75
|
+
|| client._options.retryConfig
|
|
76
|
+
|| {
|
|
77
|
+
strategy: "backoff",
|
|
78
|
+
backoff: {
|
|
79
|
+
initialInterval: 500,
|
|
80
|
+
maxInterval: 5000,
|
|
81
|
+
exponent: 1.5,
|
|
82
|
+
maxElapsedTime: 60000,
|
|
83
|
+
},
|
|
84
|
+
retryConnectionErrors: true,
|
|
85
|
+
}
|
|
86
|
+
|| { strategy: "none" },
|
|
87
|
+
retryCodes: options?.retryCodes || ["501", "502", "503", "504"],
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const requestRes = client._createRequest(context, {
|
|
91
|
+
security: requestSecurity,
|
|
92
|
+
method: "POST",
|
|
93
|
+
baseURL: options?.serverURL,
|
|
94
|
+
path: path,
|
|
95
|
+
headers: headers,
|
|
96
|
+
body: body,
|
|
97
|
+
uaHeader: "x-speakeasy-user-agent",
|
|
98
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
99
|
+
}, options);
|
|
100
|
+
if (!requestRes.ok) {
|
|
101
|
+
return requestRes;
|
|
102
|
+
}
|
|
103
|
+
const req = requestRes.value;
|
|
104
|
+
|
|
105
|
+
const doResult = await client._do(req, {
|
|
106
|
+
context,
|
|
107
|
+
errorCodes: ["422", "429", "4XX", "500", "5XX"],
|
|
108
|
+
retryConfig: context.retryConfig,
|
|
109
|
+
retryCodes: context.retryCodes,
|
|
110
|
+
});
|
|
111
|
+
if (!doResult.ok) {
|
|
112
|
+
return doResult;
|
|
113
|
+
}
|
|
114
|
+
const response = doResult.value;
|
|
115
|
+
|
|
116
|
+
const responseFields = {
|
|
117
|
+
HttpMeta: { Response: response, Request: req },
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const [result] = await M.match<
|
|
121
|
+
operations.AccountV1SettingsUpdateRoleResponse,
|
|
122
|
+
| errors.ErrorModel
|
|
123
|
+
| errors.ErrorModel
|
|
124
|
+
| SDKError
|
|
125
|
+
| SDKValidationError
|
|
126
|
+
| UnexpectedClientError
|
|
127
|
+
| InvalidRequestError
|
|
128
|
+
| RequestAbortedError
|
|
129
|
+
| RequestTimeoutError
|
|
130
|
+
| ConnectionError
|
|
131
|
+
>(
|
|
132
|
+
M.nil(204, operations.AccountV1SettingsUpdateRoleResponse$inboundSchema, {
|
|
133
|
+
hdrs: true,
|
|
134
|
+
}),
|
|
135
|
+
M.jsonErr([422, 429], errors.ErrorModel$inboundSchema, {
|
|
136
|
+
ctype: "application/problem+json",
|
|
137
|
+
}),
|
|
138
|
+
M.jsonErr(500, errors.ErrorModel$inboundSchema, {
|
|
139
|
+
ctype: "application/problem+json",
|
|
140
|
+
}),
|
|
141
|
+
M.fail("4XX"),
|
|
142
|
+
M.fail("5XX"),
|
|
143
|
+
)(response, req, { extraFields: responseFields });
|
|
144
|
+
if (!result.ok) {
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return result;
|
|
149
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
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 { SDKError } from "../models/errors/sdkerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
export async function settingsAccountV1SettingsUpdateRole(
|
|
28
|
+
client: SteamSetsCore,
|
|
29
|
+
request: components.V1UpdateRoleRequestBody,
|
|
30
|
+
options?: RequestOptions,
|
|
31
|
+
): Promise<
|
|
32
|
+
Result<
|
|
33
|
+
operations.AccountV1SettingsUpdateRoleResponse,
|
|
34
|
+
| errors.ErrorModel
|
|
35
|
+
| errors.ErrorModel
|
|
36
|
+
| SDKError
|
|
37
|
+
| SDKValidationError
|
|
38
|
+
| UnexpectedClientError
|
|
39
|
+
| InvalidRequestError
|
|
40
|
+
| RequestAbortedError
|
|
41
|
+
| RequestTimeoutError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
>
|
|
44
|
+
> {
|
|
45
|
+
const parsed = safeParse(
|
|
46
|
+
request,
|
|
47
|
+
(value) => components.V1UpdateRoleRequestBody$outboundSchema.parse(value),
|
|
48
|
+
"Input validation failed",
|
|
49
|
+
);
|
|
50
|
+
if (!parsed.ok) {
|
|
51
|
+
return parsed;
|
|
52
|
+
}
|
|
53
|
+
const payload = parsed.value;
|
|
54
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
55
|
+
|
|
56
|
+
const path = pathToFunc("/account.v1.AccountService/UpdateRole")();
|
|
57
|
+
|
|
58
|
+
const headers = new Headers(compactMap({
|
|
59
|
+
"Content-Type": "application/json",
|
|
60
|
+
Accept: "application/problem+json",
|
|
61
|
+
}));
|
|
62
|
+
|
|
63
|
+
const secConfig = await extractSecurity(client._options.token);
|
|
64
|
+
const securityInput = secConfig == null ? {} : { token: secConfig };
|
|
65
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
66
|
+
|
|
67
|
+
const context = {
|
|
68
|
+
operationID: "account.v1.settings.update-role",
|
|
69
|
+
oAuth2Scopes: [],
|
|
70
|
+
|
|
71
|
+
resolvedSecurity: requestSecurity,
|
|
72
|
+
|
|
73
|
+
securitySource: client._options.token,
|
|
74
|
+
retryConfig: options?.retries
|
|
75
|
+
|| client._options.retryConfig
|
|
76
|
+
|| {
|
|
77
|
+
strategy: "backoff",
|
|
78
|
+
backoff: {
|
|
79
|
+
initialInterval: 500,
|
|
80
|
+
maxInterval: 5000,
|
|
81
|
+
exponent: 1.5,
|
|
82
|
+
maxElapsedTime: 60000,
|
|
83
|
+
},
|
|
84
|
+
retryConnectionErrors: true,
|
|
85
|
+
}
|
|
86
|
+
|| { strategy: "none" },
|
|
87
|
+
retryCodes: options?.retryCodes || ["501", "502", "503", "504"],
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const requestRes = client._createRequest(context, {
|
|
91
|
+
security: requestSecurity,
|
|
92
|
+
method: "POST",
|
|
93
|
+
baseURL: options?.serverURL,
|
|
94
|
+
path: path,
|
|
95
|
+
headers: headers,
|
|
96
|
+
body: body,
|
|
97
|
+
uaHeader: "x-speakeasy-user-agent",
|
|
98
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
99
|
+
}, options);
|
|
100
|
+
if (!requestRes.ok) {
|
|
101
|
+
return requestRes;
|
|
102
|
+
}
|
|
103
|
+
const req = requestRes.value;
|
|
104
|
+
|
|
105
|
+
const doResult = await client._do(req, {
|
|
106
|
+
context,
|
|
107
|
+
errorCodes: ["422", "429", "4XX", "500", "5XX"],
|
|
108
|
+
retryConfig: context.retryConfig,
|
|
109
|
+
retryCodes: context.retryCodes,
|
|
110
|
+
});
|
|
111
|
+
if (!doResult.ok) {
|
|
112
|
+
return doResult;
|
|
113
|
+
}
|
|
114
|
+
const response = doResult.value;
|
|
115
|
+
|
|
116
|
+
const responseFields = {
|
|
117
|
+
HttpMeta: { Response: response, Request: req },
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const [result] = await M.match<
|
|
121
|
+
operations.AccountV1SettingsUpdateRoleResponse,
|
|
122
|
+
| errors.ErrorModel
|
|
123
|
+
| errors.ErrorModel
|
|
124
|
+
| SDKError
|
|
125
|
+
| SDKValidationError
|
|
126
|
+
| UnexpectedClientError
|
|
127
|
+
| InvalidRequestError
|
|
128
|
+
| RequestAbortedError
|
|
129
|
+
| RequestTimeoutError
|
|
130
|
+
| ConnectionError
|
|
131
|
+
>(
|
|
132
|
+
M.nil(204, operations.AccountV1SettingsUpdateRoleResponse$inboundSchema, {
|
|
133
|
+
hdrs: true,
|
|
134
|
+
}),
|
|
135
|
+
M.jsonErr([422, 429], errors.ErrorModel$inboundSchema, {
|
|
136
|
+
ctype: "application/problem+json",
|
|
137
|
+
}),
|
|
138
|
+
M.jsonErr(500, errors.ErrorModel$inboundSchema, {
|
|
139
|
+
ctype: "application/problem+json",
|
|
140
|
+
}),
|
|
141
|
+
M.fail("4XX"),
|
|
142
|
+
M.fail("5XX"),
|
|
143
|
+
)(response, req, { extraFields: responseFields });
|
|
144
|
+
if (!result.ok) {
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return result;
|
|
149
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -55,8 +55,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
55
55
|
export const SDK_METADATA = {
|
|
56
56
|
language: "typescript",
|
|
57
57
|
openapiDocVersion: "1.0.0",
|
|
58
|
-
sdkVersion: "0.14.
|
|
58
|
+
sdkVersion: "0.14.29",
|
|
59
59
|
genVersion: "2.500.5",
|
|
60
60
|
userAgent:
|
|
61
|
-
"speakeasy-sdk/typescript 0.14.
|
|
61
|
+
"speakeasy-sdk/typescript 0.14.29 2.500.5 1.0.0 @steamsets/client-ts",
|
|
62
62
|
} as const;
|
|
@@ -116,6 +116,7 @@ export * from "./v1updateconnectionresponsebody.js";
|
|
|
116
116
|
export * from "./v1updateimage.js";
|
|
117
117
|
export * from "./v1updateimagerequestbody.js";
|
|
118
118
|
export * from "./v1updateimageresponsebody.js";
|
|
119
|
+
export * from "./v1updaterolerequestbody.js";
|
|
119
120
|
export * from "./v1updatesettingsrequestbody.js";
|
|
120
121
|
export * from "./v1uploadedimage.js";
|
|
121
122
|
export * from "./v1uploadimagesrequestbody.js";
|
|
@@ -232,6 +232,10 @@ export type V1AccountInfoResponseBody = {
|
|
|
232
232
|
* The name of the account
|
|
233
233
|
*/
|
|
234
234
|
name: string;
|
|
235
|
+
/**
|
|
236
|
+
* The time the account is allowed to be refreshed
|
|
237
|
+
*/
|
|
238
|
+
nextAllowedTime: Date;
|
|
235
239
|
/**
|
|
236
240
|
* The cost of a normal badge
|
|
237
241
|
*/
|
|
@@ -425,6 +429,9 @@ export const V1AccountInfoResponseBody$inboundSchema: z.ZodType<
|
|
|
425
429
|
level: z.number().int(),
|
|
426
430
|
miniBackground: z.string(),
|
|
427
431
|
name: z.string(),
|
|
432
|
+
nextAllowedTime: z.string().datetime({ offset: true }).transform(v =>
|
|
433
|
+
new Date(v)
|
|
434
|
+
),
|
|
428
435
|
normalBadgeCost: z.number().int(),
|
|
429
436
|
normalBadges: z.number().int(),
|
|
430
437
|
playtime: z.number().int(),
|
|
@@ -486,6 +493,7 @@ export type V1AccountInfoResponseBody$Outbound = {
|
|
|
486
493
|
level: number;
|
|
487
494
|
miniBackground: string;
|
|
488
495
|
name: string;
|
|
496
|
+
nextAllowedTime: string;
|
|
489
497
|
normalBadgeCost: number;
|
|
490
498
|
normalBadges: number;
|
|
491
499
|
playtime: number;
|
|
@@ -545,6 +553,7 @@ export const V1AccountInfoResponseBody$outboundSchema: z.ZodType<
|
|
|
545
553
|
level: z.number().int(),
|
|
546
554
|
miniBackground: z.string(),
|
|
547
555
|
name: z.string(),
|
|
556
|
+
nextAllowedTime: z.date().transform(v => v.toISOString()),
|
|
548
557
|
normalBadgeCost: z.number().int(),
|
|
549
558
|
normalBadges: z.number().int(),
|
|
550
559
|
playtime: z.number().int(),
|
|
@@ -0,0 +1,109 @@
|
|
|
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
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The role the account should have between one of the 6 donation roles
|
|
13
|
+
*/
|
|
14
|
+
export const V1UpdateRoleRequestBodyRole = {
|
|
15
|
+
Amber: "amber",
|
|
16
|
+
Amethyst: "amethyst",
|
|
17
|
+
Emerald: "emerald",
|
|
18
|
+
Sapphire: "sapphire",
|
|
19
|
+
Ruby: "ruby",
|
|
20
|
+
Diamond: "diamond",
|
|
21
|
+
} as const;
|
|
22
|
+
/**
|
|
23
|
+
* The role the account should have between one of the 6 donation roles
|
|
24
|
+
*/
|
|
25
|
+
export type V1UpdateRoleRequestBodyRole = ClosedEnum<
|
|
26
|
+
typeof V1UpdateRoleRequestBodyRole
|
|
27
|
+
>;
|
|
28
|
+
|
|
29
|
+
export type V1UpdateRoleRequestBody = {
|
|
30
|
+
/**
|
|
31
|
+
* The role the account should have between one of the 6 donation roles
|
|
32
|
+
*/
|
|
33
|
+
role?: V1UpdateRoleRequestBodyRole | undefined;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const V1UpdateRoleRequestBodyRole$inboundSchema: z.ZodNativeEnum<
|
|
38
|
+
typeof V1UpdateRoleRequestBodyRole
|
|
39
|
+
> = z.nativeEnum(V1UpdateRoleRequestBodyRole);
|
|
40
|
+
|
|
41
|
+
/** @internal */
|
|
42
|
+
export const V1UpdateRoleRequestBodyRole$outboundSchema: z.ZodNativeEnum<
|
|
43
|
+
typeof V1UpdateRoleRequestBodyRole
|
|
44
|
+
> = V1UpdateRoleRequestBodyRole$inboundSchema;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @internal
|
|
48
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
49
|
+
*/
|
|
50
|
+
export namespace V1UpdateRoleRequestBodyRole$ {
|
|
51
|
+
/** @deprecated use `V1UpdateRoleRequestBodyRole$inboundSchema` instead. */
|
|
52
|
+
export const inboundSchema = V1UpdateRoleRequestBodyRole$inboundSchema;
|
|
53
|
+
/** @deprecated use `V1UpdateRoleRequestBodyRole$outboundSchema` instead. */
|
|
54
|
+
export const outboundSchema = V1UpdateRoleRequestBodyRole$outboundSchema;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** @internal */
|
|
58
|
+
export const V1UpdateRoleRequestBody$inboundSchema: z.ZodType<
|
|
59
|
+
V1UpdateRoleRequestBody,
|
|
60
|
+
z.ZodTypeDef,
|
|
61
|
+
unknown
|
|
62
|
+
> = z.object({
|
|
63
|
+
role: V1UpdateRoleRequestBodyRole$inboundSchema.optional(),
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
/** @internal */
|
|
67
|
+
export type V1UpdateRoleRequestBody$Outbound = {
|
|
68
|
+
role?: string | undefined;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/** @internal */
|
|
72
|
+
export const V1UpdateRoleRequestBody$outboundSchema: z.ZodType<
|
|
73
|
+
V1UpdateRoleRequestBody$Outbound,
|
|
74
|
+
z.ZodTypeDef,
|
|
75
|
+
V1UpdateRoleRequestBody
|
|
76
|
+
> = z.object({
|
|
77
|
+
role: V1UpdateRoleRequestBodyRole$outboundSchema.optional(),
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
83
|
+
*/
|
|
84
|
+
export namespace V1UpdateRoleRequestBody$ {
|
|
85
|
+
/** @deprecated use `V1UpdateRoleRequestBody$inboundSchema` instead. */
|
|
86
|
+
export const inboundSchema = V1UpdateRoleRequestBody$inboundSchema;
|
|
87
|
+
/** @deprecated use `V1UpdateRoleRequestBody$outboundSchema` instead. */
|
|
88
|
+
export const outboundSchema = V1UpdateRoleRequestBody$outboundSchema;
|
|
89
|
+
/** @deprecated use `V1UpdateRoleRequestBody$Outbound` instead. */
|
|
90
|
+
export type Outbound = V1UpdateRoleRequestBody$Outbound;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function v1UpdateRoleRequestBodyToJSON(
|
|
94
|
+
v1UpdateRoleRequestBody: V1UpdateRoleRequestBody,
|
|
95
|
+
): string {
|
|
96
|
+
return JSON.stringify(
|
|
97
|
+
V1UpdateRoleRequestBody$outboundSchema.parse(v1UpdateRoleRequestBody),
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function v1UpdateRoleRequestBodyFromJSON(
|
|
102
|
+
jsonString: string,
|
|
103
|
+
): SafeParseResult<V1UpdateRoleRequestBody, SDKValidationError> {
|
|
104
|
+
return safeParse(
|
|
105
|
+
jsonString,
|
|
106
|
+
(x) => V1UpdateRoleRequestBody$inboundSchema.parse(JSON.parse(x)),
|
|
107
|
+
`Failed to parse 'V1UpdateRoleRequestBody' from JSON`,
|
|
108
|
+
);
|
|
109
|
+
}
|
|
@@ -4,28 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
8
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
9
|
|
|
11
|
-
/**
|
|
12
|
-
* The role the account should have between one of the 6 donation roles
|
|
13
|
-
*/
|
|
14
|
-
export const V1UpdateSettingsRequestBodyRole = {
|
|
15
|
-
Amber: "amber",
|
|
16
|
-
Amethyst: "amethyst",
|
|
17
|
-
Emerald: "emerald",
|
|
18
|
-
Sapphire: "sapphire",
|
|
19
|
-
Ruby: "ruby",
|
|
20
|
-
Diamond: "diamond",
|
|
21
|
-
} as const;
|
|
22
|
-
/**
|
|
23
|
-
* The role the account should have between one of the 6 donation roles
|
|
24
|
-
*/
|
|
25
|
-
export type V1UpdateSettingsRequestBodyRole = ClosedEnum<
|
|
26
|
-
typeof V1UpdateSettingsRequestBodyRole
|
|
27
|
-
>;
|
|
28
|
-
|
|
29
10
|
export type V1UpdateSettingsRequestBody = {
|
|
30
11
|
/**
|
|
31
12
|
* The email the account should use, only if the account is private
|
|
@@ -39,37 +20,12 @@ export type V1UpdateSettingsRequestBody = {
|
|
|
39
20
|
* The language the account should use, only if the account is private
|
|
40
21
|
*/
|
|
41
22
|
language: string;
|
|
42
|
-
/**
|
|
43
|
-
* The role the account should have between one of the 6 donation roles
|
|
44
|
-
*/
|
|
45
|
-
role?: V1UpdateSettingsRequestBodyRole | null | undefined;
|
|
46
23
|
/**
|
|
47
24
|
* The vanity the account should use
|
|
48
25
|
*/
|
|
49
26
|
vanity: string | null;
|
|
50
27
|
};
|
|
51
28
|
|
|
52
|
-
/** @internal */
|
|
53
|
-
export const V1UpdateSettingsRequestBodyRole$inboundSchema: z.ZodNativeEnum<
|
|
54
|
-
typeof V1UpdateSettingsRequestBodyRole
|
|
55
|
-
> = z.nativeEnum(V1UpdateSettingsRequestBodyRole);
|
|
56
|
-
|
|
57
|
-
/** @internal */
|
|
58
|
-
export const V1UpdateSettingsRequestBodyRole$outboundSchema: z.ZodNativeEnum<
|
|
59
|
-
typeof V1UpdateSettingsRequestBodyRole
|
|
60
|
-
> = V1UpdateSettingsRequestBodyRole$inboundSchema;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* @internal
|
|
64
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
65
|
-
*/
|
|
66
|
-
export namespace V1UpdateSettingsRequestBodyRole$ {
|
|
67
|
-
/** @deprecated use `V1UpdateSettingsRequestBodyRole$inboundSchema` instead. */
|
|
68
|
-
export const inboundSchema = V1UpdateSettingsRequestBodyRole$inboundSchema;
|
|
69
|
-
/** @deprecated use `V1UpdateSettingsRequestBodyRole$outboundSchema` instead. */
|
|
70
|
-
export const outboundSchema = V1UpdateSettingsRequestBodyRole$outboundSchema;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
29
|
/** @internal */
|
|
74
30
|
export const V1UpdateSettingsRequestBody$inboundSchema: z.ZodType<
|
|
75
31
|
V1UpdateSettingsRequestBody,
|
|
@@ -79,7 +35,6 @@ export const V1UpdateSettingsRequestBody$inboundSchema: z.ZodType<
|
|
|
79
35
|
email: z.nullable(z.string()),
|
|
80
36
|
hidden: z.boolean(),
|
|
81
37
|
language: z.string(),
|
|
82
|
-
role: z.nullable(V1UpdateSettingsRequestBodyRole$inboundSchema).optional(),
|
|
83
38
|
vanity: z.nullable(z.string()),
|
|
84
39
|
});
|
|
85
40
|
|
|
@@ -88,7 +43,6 @@ export type V1UpdateSettingsRequestBody$Outbound = {
|
|
|
88
43
|
email: string | null;
|
|
89
44
|
hidden: boolean;
|
|
90
45
|
language: string;
|
|
91
|
-
role?: string | null | undefined;
|
|
92
46
|
vanity: string | null;
|
|
93
47
|
};
|
|
94
48
|
|
|
@@ -101,7 +55,6 @@ export const V1UpdateSettingsRequestBody$outboundSchema: z.ZodType<
|
|
|
101
55
|
email: z.nullable(z.string()),
|
|
102
56
|
hidden: z.boolean(),
|
|
103
57
|
language: z.string(),
|
|
104
|
-
role: z.nullable(V1UpdateSettingsRequestBodyRole$outboundSchema).optional(),
|
|
105
58
|
vanity: z.nullable(z.string()),
|
|
106
59
|
});
|
|
107
60
|
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as components from "../components/index.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export type AccountV1SettingsUpdateRoleResponse = {
|
|
13
|
+
httpMeta: components.HTTPMetadata;
|
|
14
|
+
headers: { [k: string]: Array<string> };
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const AccountV1SettingsUpdateRoleResponse$inboundSchema: z.ZodType<
|
|
19
|
+
AccountV1SettingsUpdateRoleResponse,
|
|
20
|
+
z.ZodTypeDef,
|
|
21
|
+
unknown
|
|
22
|
+
> = z.object({
|
|
23
|
+
HttpMeta: components.HTTPMetadata$inboundSchema,
|
|
24
|
+
Headers: z.record(z.array(z.string())),
|
|
25
|
+
}).transform((v) => {
|
|
26
|
+
return remap$(v, {
|
|
27
|
+
"HttpMeta": "httpMeta",
|
|
28
|
+
"Headers": "headers",
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export type AccountV1SettingsUpdateRoleResponse$Outbound = {
|
|
34
|
+
HttpMeta: components.HTTPMetadata$Outbound;
|
|
35
|
+
Headers: { [k: string]: Array<string> };
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const AccountV1SettingsUpdateRoleResponse$outboundSchema: z.ZodType<
|
|
40
|
+
AccountV1SettingsUpdateRoleResponse$Outbound,
|
|
41
|
+
z.ZodTypeDef,
|
|
42
|
+
AccountV1SettingsUpdateRoleResponse
|
|
43
|
+
> = z.object({
|
|
44
|
+
httpMeta: components.HTTPMetadata$outboundSchema,
|
|
45
|
+
headers: z.record(z.array(z.string())),
|
|
46
|
+
}).transform((v) => {
|
|
47
|
+
return remap$(v, {
|
|
48
|
+
httpMeta: "HttpMeta",
|
|
49
|
+
headers: "Headers",
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @internal
|
|
55
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
56
|
+
*/
|
|
57
|
+
export namespace AccountV1SettingsUpdateRoleResponse$ {
|
|
58
|
+
/** @deprecated use `AccountV1SettingsUpdateRoleResponse$inboundSchema` instead. */
|
|
59
|
+
export const inboundSchema =
|
|
60
|
+
AccountV1SettingsUpdateRoleResponse$inboundSchema;
|
|
61
|
+
/** @deprecated use `AccountV1SettingsUpdateRoleResponse$outboundSchema` instead. */
|
|
62
|
+
export const outboundSchema =
|
|
63
|
+
AccountV1SettingsUpdateRoleResponse$outboundSchema;
|
|
64
|
+
/** @deprecated use `AccountV1SettingsUpdateRoleResponse$Outbound` instead. */
|
|
65
|
+
export type Outbound = AccountV1SettingsUpdateRoleResponse$Outbound;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function accountV1SettingsUpdateRoleResponseToJSON(
|
|
69
|
+
accountV1SettingsUpdateRoleResponse: AccountV1SettingsUpdateRoleResponse,
|
|
70
|
+
): string {
|
|
71
|
+
return JSON.stringify(
|
|
72
|
+
AccountV1SettingsUpdateRoleResponse$outboundSchema.parse(
|
|
73
|
+
accountV1SettingsUpdateRoleResponse,
|
|
74
|
+
),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function accountV1SettingsUpdateRoleResponseFromJSON(
|
|
79
|
+
jsonString: string,
|
|
80
|
+
): SafeParseResult<AccountV1SettingsUpdateRoleResponse, SDKValidationError> {
|
|
81
|
+
return safeParse(
|
|
82
|
+
jsonString,
|
|
83
|
+
(x) =>
|
|
84
|
+
AccountV1SettingsUpdateRoleResponse$inboundSchema.parse(JSON.parse(x)),
|
|
85
|
+
`Failed to parse 'AccountV1SettingsUpdateRoleResponse' from JSON`,
|
|
86
|
+
);
|
|
87
|
+
}
|
|
@@ -32,6 +32,7 @@ export * from "./accountv1settingsdeveloperappupdate.js";
|
|
|
32
32
|
export * from "./accountv1settingsget.js";
|
|
33
33
|
export * from "./accountv1settingssendemailverification.js";
|
|
34
34
|
export * from "./accountv1settingsupdate.js";
|
|
35
|
+
export * from "./accountv1settingsupdaterole.js";
|
|
35
36
|
export * from "./accountv1settingsverfyemail.js";
|
|
36
37
|
export * from "./adminv1getaccount.js";
|
|
37
38
|
export * from "./adminv1getevents.js";
|
package/src/sdk/account.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { accountAccountV1GetBadgeBookmarks } from "../funcs/accountAccountV1GetB
|
|
|
7
7
|
import { accountAccountV1GetOwnedBadges } from "../funcs/accountAccountV1GetOwnedBadges.js";
|
|
8
8
|
import { accountAccountV1ImagesGet } from "../funcs/accountAccountV1ImagesGet.js";
|
|
9
9
|
import { accountAccountV1ImagesUpdate } from "../funcs/accountAccountV1ImagesUpdate.js";
|
|
10
|
+
import { accountAccountV1SettingsUpdateRole } from "../funcs/accountAccountV1SettingsUpdateRole.js";
|
|
10
11
|
import { accountAdminV1UpdateResources } from "../funcs/accountAdminV1UpdateResources.js";
|
|
11
12
|
import { accountAdminV1UpdateRoles } from "../funcs/accountAdminV1UpdateRoles.js";
|
|
12
13
|
import { accountCreateDeveloperApp } from "../funcs/accountCreateDeveloperApp.js";
|
|
@@ -209,6 +210,17 @@ export class Account extends ClientSDK {
|
|
|
209
210
|
));
|
|
210
211
|
}
|
|
211
212
|
|
|
213
|
+
async accountV1SettingsUpdateRole(
|
|
214
|
+
request: components.V1UpdateRoleRequestBody,
|
|
215
|
+
options?: RequestOptions,
|
|
216
|
+
): Promise<operations.AccountV1SettingsUpdateRoleResponse> {
|
|
217
|
+
return unwrapAsync(accountAccountV1SettingsUpdateRole(
|
|
218
|
+
this,
|
|
219
|
+
request,
|
|
220
|
+
options,
|
|
221
|
+
));
|
|
222
|
+
}
|
|
223
|
+
|
|
212
224
|
async uploadImages(
|
|
213
225
|
request: components.V1UploadImagesRequestBody,
|
|
214
226
|
options?: RequestOptions,
|