@steamsets/client-ts 0.22.2 → 0.22.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/docs/sdks/account/README.md +153 -0
- package/docs/sdks/leaderboard/README.md +4 -28
- package/funcs/accountAccountV1SessionLogout.d.ts +11 -0
- package/funcs/accountAccountV1SessionLogout.d.ts.map +1 -0
- package/funcs/accountAccountV1SessionLogout.js +105 -0
- package/funcs/accountAccountV1SessionLogout.js.map +1 -0
- package/funcs/accountAccountV1SessionRefresh.d.ts +11 -0
- package/funcs/accountAccountV1SessionRefresh.d.ts.map +1 -0
- package/funcs/accountAccountV1SessionRefresh.js +124 -0
- package/funcs/accountAccountV1SessionRefresh.js.map +1 -0
- package/funcs/leaderboardGetAccount.d.ts +1 -1
- package/funcs/leaderboardGetAccount.d.ts.map +1 -1
- package/funcs/leaderboardGetAccount.js +2 -4
- package/funcs/leaderboardGetAccount.js.map +1 -1
- package/funcs/leaderboardGetAccountMeta.d.ts +1 -1
- package/funcs/leaderboardGetAccountMeta.js +2 -2
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +2 -8
- package/lib/sdks.js.map +1 -1
- package/models/components/index.d.ts +2 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +2 -0
- package/models/components/index.js.map +1 -1
- package/models/components/session.d.ts +5 -0
- package/models/components/session.d.ts.map +1 -1
- package/models/components/session.js +2 -0
- package/models/components/session.js.map +1 -1
- package/models/components/v1getsessionbody.d.ts +11 -1
- package/models/components/v1getsessionbody.d.ts.map +1 -1
- package/models/components/v1getsessionbody.js +4 -0
- package/models/components/v1getsessionbody.js.map +1 -1
- package/models/components/v1loginresponsebody.d.ts +15 -0
- package/models/components/v1loginresponsebody.d.ts.map +1 -1
- package/models/components/v1loginresponsebody.js +6 -0
- package/models/components/v1loginresponsebody.js.map +1 -1
- package/models/components/v1refreshsessionbody.d.ts +52 -0
- package/models/components/v1refreshsessionbody.d.ts.map +1 -0
- package/models/components/v1refreshsessionbody.js +76 -0
- package/models/components/v1refreshsessionbody.js.map +1 -0
- package/models/components/v1refreshsessionrequestbody.d.ts +32 -0
- package/models/components/v1refreshsessionrequestbody.d.ts.map +1 -0
- package/models/components/v1refreshsessionrequestbody.js +59 -0
- package/models/components/v1refreshsessionrequestbody.js.map +1 -0
- package/models/components/v1uploadedimage.d.ts +8 -8
- package/models/components/v1uploadedimage.d.ts.map +1 -1
- package/models/components/v1uploadedimage.js +13 -13
- package/models/components/v1uploadedimage.js.map +1 -1
- package/models/components/vanitystruct.d.ts +8 -8
- package/models/components/vanitystruct.d.ts.map +1 -1
- package/models/components/vanitystruct.js +13 -13
- package/models/components/vanitystruct.js.map +1 -1
- package/models/operations/accountv1sessionlogout.d.ts +30 -0
- package/models/operations/accountv1sessionlogout.d.ts.map +1 -0
- package/models/operations/accountv1sessionlogout.js +69 -0
- package/models/operations/accountv1sessionlogout.js.map +1 -0
- package/models/operations/accountv1sessionrefresh.d.ts +64 -0
- package/models/operations/accountv1sessionrefresh.d.ts.map +1 -0
- package/models/operations/accountv1sessionrefresh.js +118 -0
- package/models/operations/accountv1sessionrefresh.js.map +1 -0
- package/models/operations/index.d.ts +4 -2
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +4 -2
- package/models/operations/index.js.map +1 -1
- package/models/operations/leaderboardv1getaccountleaderboard.d.ts +35 -0
- package/models/operations/leaderboardv1getaccountleaderboard.d.ts.map +1 -0
- package/models/operations/{leaderboardv1getaccount.js → leaderboardv1getaccountleaderboard.js} +17 -17
- package/models/operations/leaderboardv1getaccountleaderboard.js.map +1 -0
- package/models/operations/leaderboardv1getaccountleaderboardmeta.d.ts +35 -0
- package/models/operations/{leaderboardv1getleaderboardaccountmeta.d.ts.map → leaderboardv1getaccountleaderboardmeta.d.ts.map} +1 -1
- package/models/operations/{leaderboardv1getleaderboardaccountmeta.js → leaderboardv1getaccountleaderboardmeta.js} +17 -17
- package/models/operations/{leaderboardv1getleaderboardaccountmeta.js.map → leaderboardv1getaccountleaderboardmeta.js.map} +1 -1
- package/package.json +1 -1
- package/sdk/account.d.ts +2 -0
- package/sdk/account.d.ts.map +1 -1
- package/sdk/account.js +8 -0
- package/sdk/account.js.map +1 -1
- package/sdk/leaderboard.d.ts +2 -2
- package/sdk/leaderboard.d.ts.map +1 -1
- package/src/funcs/accountAccountV1SessionLogout.ts +158 -0
- package/src/funcs/accountAccountV1SessionRefresh.ts +190 -0
- package/src/funcs/leaderboardGetAccount.ts +9 -7
- package/src/funcs/leaderboardGetAccountMeta.ts +5 -5
- package/src/lib/config.ts +3 -3
- package/src/lib/sdks.ts +2 -7
- package/src/models/components/index.ts +2 -0
- package/src/models/components/session.ts +7 -0
- package/src/models/components/v1getsessionbody.ts +15 -1
- package/src/models/components/v1loginresponsebody.ts +25 -0
- package/src/models/components/v1refreshsessionbody.ts +110 -0
- package/src/models/components/v1refreshsessionrequestbody.ts +71 -0
- package/src/models/components/v1uploadedimage.ts +16 -15
- package/src/models/components/vanitystruct.ts +15 -16
- package/src/models/operations/accountv1sessionlogout.ts +78 -0
- package/src/models/operations/accountv1sessionrefresh.ts +171 -0
- package/src/models/operations/index.ts +4 -2
- package/src/models/operations/leaderboardv1getaccountleaderboard.ts +101 -0
- package/src/models/operations/{leaderboardv1getleaderboardaccountmeta.ts → leaderboardv1getaccountleaderboardmeta.ts} +23 -23
- package/src/sdk/account.ts +22 -0
- package/src/sdk/leaderboard.ts +2 -2
- package/models/operations/leaderboardv1getaccount.d.ts +0 -35
- package/models/operations/leaderboardv1getaccount.d.ts.map +0 -1
- package/models/operations/leaderboardv1getaccount.js.map +0 -1
- package/models/operations/leaderboardv1getleaderboardaccountmeta.d.ts +0 -35
- package/src/models/operations/leaderboardv1getaccount.ts +0 -93
|
@@ -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, encodeSimple } 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 {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import * as errors from "../models/errors/index.js";
|
|
21
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
export function accountAccountV1SessionRefresh(
|
|
28
|
+
client: SteamSetsCore,
|
|
29
|
+
request: operations.AccountV1SessionRefreshRequest,
|
|
30
|
+
options?: RequestOptions,
|
|
31
|
+
): APIPromise<
|
|
32
|
+
Result<
|
|
33
|
+
operations.AccountV1SessionRefreshResponse,
|
|
34
|
+
| errors.ErrorModel
|
|
35
|
+
| errors.ErrorModel
|
|
36
|
+
| SDKError
|
|
37
|
+
| SDKValidationError
|
|
38
|
+
| UnexpectedClientError
|
|
39
|
+
| InvalidRequestError
|
|
40
|
+
| RequestAbortedError
|
|
41
|
+
| RequestTimeoutError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
>
|
|
44
|
+
> {
|
|
45
|
+
return new APIPromise($do(
|
|
46
|
+
client,
|
|
47
|
+
request,
|
|
48
|
+
options,
|
|
49
|
+
));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function $do(
|
|
53
|
+
client: SteamSetsCore,
|
|
54
|
+
request: operations.AccountV1SessionRefreshRequest,
|
|
55
|
+
options?: RequestOptions,
|
|
56
|
+
): Promise<
|
|
57
|
+
[
|
|
58
|
+
Result<
|
|
59
|
+
operations.AccountV1SessionRefreshResponse,
|
|
60
|
+
| errors.ErrorModel
|
|
61
|
+
| errors.ErrorModel
|
|
62
|
+
| SDKError
|
|
63
|
+
| SDKValidationError
|
|
64
|
+
| UnexpectedClientError
|
|
65
|
+
| InvalidRequestError
|
|
66
|
+
| RequestAbortedError
|
|
67
|
+
| RequestTimeoutError
|
|
68
|
+
| ConnectionError
|
|
69
|
+
>,
|
|
70
|
+
APICall,
|
|
71
|
+
]
|
|
72
|
+
> {
|
|
73
|
+
const parsed = safeParse(
|
|
74
|
+
request,
|
|
75
|
+
(value) =>
|
|
76
|
+
operations.AccountV1SessionRefreshRequest$outboundSchema.parse(value),
|
|
77
|
+
"Input validation failed",
|
|
78
|
+
);
|
|
79
|
+
if (!parsed.ok) {
|
|
80
|
+
return [parsed, { status: "invalid" }];
|
|
81
|
+
}
|
|
82
|
+
const payload = parsed.value;
|
|
83
|
+
const body = encodeJSON("body", payload.V1RefreshSessionRequestBody, {
|
|
84
|
+
explode: true,
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
const path = pathToFunc("/account.v1.AccountService/RefreshSession")();
|
|
88
|
+
|
|
89
|
+
const headers = new Headers(compactMap({
|
|
90
|
+
"Content-Type": "application/json",
|
|
91
|
+
Accept: "application/json",
|
|
92
|
+
"User-Agent": encodeSimple("User-Agent", payload["User-Agent"], {
|
|
93
|
+
explode: false,
|
|
94
|
+
charEncoding: "none",
|
|
95
|
+
}),
|
|
96
|
+
"X-Forwarded-For": encodeSimple(
|
|
97
|
+
"X-Forwarded-For",
|
|
98
|
+
payload["X-Forwarded-For"],
|
|
99
|
+
{ explode: false, charEncoding: "none" },
|
|
100
|
+
),
|
|
101
|
+
}));
|
|
102
|
+
|
|
103
|
+
const secConfig = await extractSecurity(client._options.token);
|
|
104
|
+
const securityInput = secConfig == null ? {} : { token: secConfig };
|
|
105
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
106
|
+
|
|
107
|
+
const context = {
|
|
108
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
109
|
+
operationID: "account.v1.session.refresh",
|
|
110
|
+
oAuth2Scopes: [],
|
|
111
|
+
|
|
112
|
+
resolvedSecurity: requestSecurity,
|
|
113
|
+
|
|
114
|
+
securitySource: client._options.token,
|
|
115
|
+
retryConfig: options?.retries
|
|
116
|
+
|| client._options.retryConfig
|
|
117
|
+
|| {
|
|
118
|
+
strategy: "backoff",
|
|
119
|
+
backoff: {
|
|
120
|
+
initialInterval: 500,
|
|
121
|
+
maxInterval: 5000,
|
|
122
|
+
exponent: 1.5,
|
|
123
|
+
maxElapsedTime: 60000,
|
|
124
|
+
},
|
|
125
|
+
retryConnectionErrors: true,
|
|
126
|
+
}
|
|
127
|
+
|| { strategy: "none" },
|
|
128
|
+
retryCodes: options?.retryCodes || ["501", "502", "503", "504"],
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const requestRes = client._createRequest(context, {
|
|
132
|
+
security: requestSecurity,
|
|
133
|
+
method: "POST",
|
|
134
|
+
baseURL: options?.serverURL,
|
|
135
|
+
path: path,
|
|
136
|
+
headers: headers,
|
|
137
|
+
body: body,
|
|
138
|
+
uaHeader: "x-speakeasy-user-agent",
|
|
139
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
140
|
+
}, options);
|
|
141
|
+
if (!requestRes.ok) {
|
|
142
|
+
return [requestRes, { status: "invalid" }];
|
|
143
|
+
}
|
|
144
|
+
const req = requestRes.value;
|
|
145
|
+
|
|
146
|
+
const doResult = await client._do(req, {
|
|
147
|
+
context,
|
|
148
|
+
errorCodes: ["422", "4XX", "500", "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.AccountV1SessionRefreshResponse,
|
|
163
|
+
| errors.ErrorModel
|
|
164
|
+
| errors.ErrorModel
|
|
165
|
+
| SDKError
|
|
166
|
+
| SDKValidationError
|
|
167
|
+
| UnexpectedClientError
|
|
168
|
+
| InvalidRequestError
|
|
169
|
+
| RequestAbortedError
|
|
170
|
+
| RequestTimeoutError
|
|
171
|
+
| ConnectionError
|
|
172
|
+
>(
|
|
173
|
+
M.json(200, operations.AccountV1SessionRefreshResponse$inboundSchema, {
|
|
174
|
+
key: "V1RefreshSessionBody",
|
|
175
|
+
}),
|
|
176
|
+
M.jsonErr(422, errors.ErrorModel$inboundSchema, {
|
|
177
|
+
ctype: "application/problem+json",
|
|
178
|
+
}),
|
|
179
|
+
M.jsonErr(500, 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
|
+
}
|
|
@@ -31,7 +31,7 @@ export function leaderboardGetAccount(
|
|
|
31
31
|
options?: RequestOptions,
|
|
32
32
|
): APIPromise<
|
|
33
33
|
Result<
|
|
34
|
-
operations.
|
|
34
|
+
operations.LeaderboardV1GetAccountLeaderboardResponse,
|
|
35
35
|
| errors.ErrorModel
|
|
36
36
|
| errors.ErrorModel
|
|
37
37
|
| SDKError
|
|
@@ -57,7 +57,7 @@ async function $do(
|
|
|
57
57
|
): Promise<
|
|
58
58
|
[
|
|
59
59
|
Result<
|
|
60
|
-
operations.
|
|
60
|
+
operations.LeaderboardV1GetAccountLeaderboardResponse,
|
|
61
61
|
| errors.ErrorModel
|
|
62
62
|
| errors.ErrorModel
|
|
63
63
|
| SDKError
|
|
@@ -98,7 +98,7 @@ async function $do(
|
|
|
98
98
|
|
|
99
99
|
const context = {
|
|
100
100
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
101
|
-
operationID: "leaderboard.v1.
|
|
101
|
+
operationID: "leaderboard.v1.getAccountLeaderboard",
|
|
102
102
|
oAuth2Scopes: [],
|
|
103
103
|
|
|
104
104
|
resolvedSecurity: requestSecurity,
|
|
@@ -151,7 +151,7 @@ async function $do(
|
|
|
151
151
|
};
|
|
152
152
|
|
|
153
153
|
const [result] = await M.match<
|
|
154
|
-
operations.
|
|
154
|
+
operations.LeaderboardV1GetAccountLeaderboardResponse,
|
|
155
155
|
| errors.ErrorModel
|
|
156
156
|
| errors.ErrorModel
|
|
157
157
|
| SDKError
|
|
@@ -162,9 +162,11 @@ async function $do(
|
|
|
162
162
|
| RequestTimeoutError
|
|
163
163
|
| ConnectionError
|
|
164
164
|
>(
|
|
165
|
-
M.json(
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
M.json(
|
|
166
|
+
200,
|
|
167
|
+
operations.LeaderboardV1GetAccountLeaderboardResponse$inboundSchema,
|
|
168
|
+
{ key: "V1AccountLeaderboardResponseBody" },
|
|
169
|
+
),
|
|
168
170
|
M.jsonErr([404, 422], errors.ErrorModel$inboundSchema, {
|
|
169
171
|
ctype: "application/problem+json",
|
|
170
172
|
}),
|
|
@@ -31,7 +31,7 @@ export function leaderboardGetAccountMeta(
|
|
|
31
31
|
options?: RequestOptions,
|
|
32
32
|
): APIPromise<
|
|
33
33
|
Result<
|
|
34
|
-
operations.
|
|
34
|
+
operations.LeaderboardV1GetAccountLeaderboardMetaResponse,
|
|
35
35
|
| errors.ErrorModel
|
|
36
36
|
| errors.ErrorModel
|
|
37
37
|
| SDKError
|
|
@@ -57,7 +57,7 @@ async function $do(
|
|
|
57
57
|
): Promise<
|
|
58
58
|
[
|
|
59
59
|
Result<
|
|
60
|
-
operations.
|
|
60
|
+
operations.LeaderboardV1GetAccountLeaderboardMetaResponse,
|
|
61
61
|
| errors.ErrorModel
|
|
62
62
|
| errors.ErrorModel
|
|
63
63
|
| SDKError
|
|
@@ -100,7 +100,7 @@ async function $do(
|
|
|
100
100
|
|
|
101
101
|
const context = {
|
|
102
102
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
103
|
-
operationID: "leaderboard.v1.
|
|
103
|
+
operationID: "leaderboard.v1.getAccountLeaderboardMeta",
|
|
104
104
|
oAuth2Scopes: [],
|
|
105
105
|
|
|
106
106
|
resolvedSecurity: requestSecurity,
|
|
@@ -153,7 +153,7 @@ async function $do(
|
|
|
153
153
|
};
|
|
154
154
|
|
|
155
155
|
const [result] = await M.match<
|
|
156
|
-
operations.
|
|
156
|
+
operations.LeaderboardV1GetAccountLeaderboardMetaResponse,
|
|
157
157
|
| errors.ErrorModel
|
|
158
158
|
| errors.ErrorModel
|
|
159
159
|
| SDKError
|
|
@@ -166,7 +166,7 @@ async function $do(
|
|
|
166
166
|
>(
|
|
167
167
|
M.json(
|
|
168
168
|
200,
|
|
169
|
-
operations.
|
|
169
|
+
operations.LeaderboardV1GetAccountLeaderboardMetaResponse$inboundSchema,
|
|
170
170
|
{ key: "V1LeaderboardAccountMetaResponseBody" },
|
|
171
171
|
),
|
|
172
172
|
M.jsonErr([404, 422], errors.ErrorModel$inboundSchema, {
|
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.22.
|
|
59
|
-
genVersion: "2.
|
|
58
|
+
sdkVersion: "0.22.4",
|
|
59
|
+
genVersion: "2.556.1",
|
|
60
60
|
userAgent:
|
|
61
|
-
"speakeasy-sdk/typescript 0.22.
|
|
61
|
+
"speakeasy-sdk/typescript 0.22.4 2.556.1 1.0.0 @steamsets/client-ts",
|
|
62
62
|
} as const;
|
package/src/lib/sdks.ts
CHANGED
|
@@ -191,14 +191,9 @@ export class ClientSDK {
|
|
|
191
191
|
|
|
192
192
|
if (conf.body instanceof ReadableStream) {
|
|
193
193
|
if (!fetchOptions) {
|
|
194
|
-
fetchOptions = {
|
|
195
|
-
// @ts-expect-error see https://github.com/node-fetch/node-fetch/issues/1769
|
|
196
|
-
duplex: "half",
|
|
197
|
-
};
|
|
198
|
-
} else {
|
|
199
|
-
// @ts-expect-error see https://github.com/node-fetch/node-fetch/issues/1769
|
|
200
|
-
fetchOptions.duplex = "half";
|
|
194
|
+
fetchOptions = {};
|
|
201
195
|
}
|
|
196
|
+
Object.assign(fetchOptions, { duplex: "half" });
|
|
202
197
|
}
|
|
203
198
|
|
|
204
199
|
let input;
|
|
@@ -120,6 +120,8 @@ export * from "./v1livenessresponsebody.js";
|
|
|
120
120
|
export * from "./v1loginresponsebody.js";
|
|
121
121
|
export * from "./v1reconnectrequestbody.js";
|
|
122
122
|
export * from "./v1reconnectresponsebody.js";
|
|
123
|
+
export * from "./v1refreshsessionbody.js";
|
|
124
|
+
export * from "./v1refreshsessionrequestbody.js";
|
|
123
125
|
export * from "./v1searchrequest.js";
|
|
124
126
|
export * from "./v1stats.js";
|
|
125
127
|
export * from "./v1updateconnectionrequestbody.js";
|
|
@@ -24,6 +24,10 @@ export type Session = {
|
|
|
24
24
|
* The time the session was last seen
|
|
25
25
|
*/
|
|
26
26
|
lastSeen: Date;
|
|
27
|
+
/**
|
|
28
|
+
* The level of the logged in account on steam
|
|
29
|
+
*/
|
|
30
|
+
level: number;
|
|
27
31
|
/**
|
|
28
32
|
* The session id
|
|
29
33
|
*/
|
|
@@ -45,6 +49,7 @@ export const Session$inboundSchema: z.ZodType<Session, z.ZodTypeDef, unknown> =
|
|
|
45
49
|
),
|
|
46
50
|
ip: z.string(),
|
|
47
51
|
lastSeen: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
52
|
+
level: z.number().int(),
|
|
48
53
|
sessionId: z.string(),
|
|
49
54
|
userAgent: z.string(),
|
|
50
55
|
});
|
|
@@ -55,6 +60,7 @@ export type Session$Outbound = {
|
|
|
55
60
|
expiresAt: string;
|
|
56
61
|
ip: string;
|
|
57
62
|
lastSeen: string;
|
|
63
|
+
level: number;
|
|
58
64
|
sessionId: string;
|
|
59
65
|
userAgent: string;
|
|
60
66
|
};
|
|
@@ -69,6 +75,7 @@ export const Session$outboundSchema: z.ZodType<
|
|
|
69
75
|
expiresAt: z.date().transform(v => v.toISOString()),
|
|
70
76
|
ip: z.string(),
|
|
71
77
|
lastSeen: z.date().transform(v => v.toISOString()),
|
|
78
|
+
level: z.number().int(),
|
|
72
79
|
sessionId: z.string(),
|
|
73
80
|
userAgent: z.string(),
|
|
74
81
|
});
|
|
@@ -40,7 +40,15 @@ export type V1GetSessionBody = {
|
|
|
40
40
|
*/
|
|
41
41
|
avatar: string;
|
|
42
42
|
/**
|
|
43
|
-
* The
|
|
43
|
+
* The email of the account
|
|
44
|
+
*/
|
|
45
|
+
email?: string | null | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* The level of the account
|
|
48
|
+
*/
|
|
49
|
+
level: number;
|
|
50
|
+
/**
|
|
51
|
+
* The name of the account
|
|
44
52
|
*/
|
|
45
53
|
name: string;
|
|
46
54
|
/**
|
|
@@ -67,6 +75,8 @@ export const V1GetSessionBody$inboundSchema: z.ZodType<
|
|
|
67
75
|
$schema: z.string().optional(),
|
|
68
76
|
accountId: z.number().int(),
|
|
69
77
|
avatar: z.string(),
|
|
78
|
+
email: z.nullable(z.string()).optional(),
|
|
79
|
+
level: z.number().int(),
|
|
70
80
|
name: z.string(),
|
|
71
81
|
resources: z.nullable(z.array(Resource$inboundSchema)),
|
|
72
82
|
roles: z.nullable(z.array(Role$inboundSchema)),
|
|
@@ -83,6 +93,8 @@ export type V1GetSessionBody$Outbound = {
|
|
|
83
93
|
$schema?: string | undefined;
|
|
84
94
|
accountId: number;
|
|
85
95
|
avatar: string;
|
|
96
|
+
email?: string | null | undefined;
|
|
97
|
+
level: number;
|
|
86
98
|
name: string;
|
|
87
99
|
resources: Array<Resource$Outbound> | null;
|
|
88
100
|
roles: Array<Role$Outbound> | null;
|
|
@@ -99,6 +111,8 @@ export const V1GetSessionBody$outboundSchema: z.ZodType<
|
|
|
99
111
|
dollarSchema: z.string().optional(),
|
|
100
112
|
accountId: z.number().int(),
|
|
101
113
|
avatar: z.string(),
|
|
114
|
+
email: z.nullable(z.string()).optional(),
|
|
115
|
+
level: z.number().int(),
|
|
102
116
|
name: z.string(),
|
|
103
117
|
resources: z.nullable(z.array(Resource$outboundSchema)),
|
|
104
118
|
roles: z.nullable(z.array(Role$outboundSchema)),
|
|
@@ -21,6 +21,18 @@ export type V1LoginResponseBody = {
|
|
|
21
21
|
* The name of the account
|
|
22
22
|
*/
|
|
23
23
|
name: string;
|
|
24
|
+
/**
|
|
25
|
+
* The expiration time of the refresh token
|
|
26
|
+
*/
|
|
27
|
+
refreshExpiresAt: Date;
|
|
28
|
+
/**
|
|
29
|
+
* The refresh token
|
|
30
|
+
*/
|
|
31
|
+
refreshToken: string;
|
|
32
|
+
/**
|
|
33
|
+
* The expiration time of the session token
|
|
34
|
+
*/
|
|
35
|
+
sessionExpiresAt: Date;
|
|
24
36
|
/**
|
|
25
37
|
* The session token
|
|
26
38
|
*/
|
|
@@ -40,6 +52,13 @@ export const V1LoginResponseBody$inboundSchema: z.ZodType<
|
|
|
40
52
|
$schema: z.string().optional(),
|
|
41
53
|
avatar: z.string(),
|
|
42
54
|
name: z.string(),
|
|
55
|
+
refreshExpiresAt: z.string().datetime({ offset: true }).transform(v =>
|
|
56
|
+
new Date(v)
|
|
57
|
+
),
|
|
58
|
+
refreshToken: z.string(),
|
|
59
|
+
sessionExpiresAt: z.string().datetime({ offset: true }).transform(v =>
|
|
60
|
+
new Date(v)
|
|
61
|
+
),
|
|
43
62
|
sessionToken: z.string(),
|
|
44
63
|
steamId: z.string(),
|
|
45
64
|
}).transform((v) => {
|
|
@@ -53,6 +72,9 @@ export type V1LoginResponseBody$Outbound = {
|
|
|
53
72
|
$schema?: string | undefined;
|
|
54
73
|
avatar: string;
|
|
55
74
|
name: string;
|
|
75
|
+
refreshExpiresAt: string;
|
|
76
|
+
refreshToken: string;
|
|
77
|
+
sessionExpiresAt: string;
|
|
56
78
|
sessionToken: string;
|
|
57
79
|
steamId: string;
|
|
58
80
|
};
|
|
@@ -66,6 +88,9 @@ export const V1LoginResponseBody$outboundSchema: z.ZodType<
|
|
|
66
88
|
dollarSchema: z.string().optional(),
|
|
67
89
|
avatar: z.string(),
|
|
68
90
|
name: z.string(),
|
|
91
|
+
refreshExpiresAt: z.date().transform(v => v.toISOString()),
|
|
92
|
+
refreshToken: z.string(),
|
|
93
|
+
sessionExpiresAt: z.date().transform(v => v.toISOString()),
|
|
69
94
|
sessionToken: z.string(),
|
|
70
95
|
steamId: z.string(),
|
|
71
96
|
}).transform((v) => {
|
|
@@ -0,0 +1,110 @@
|
|
|
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type V1RefreshSessionBody = {
|
|
12
|
+
/**
|
|
13
|
+
* A URL to the JSON Schema for this object.
|
|
14
|
+
*/
|
|
15
|
+
dollarSchema?: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* The expiration time of the refresh token
|
|
18
|
+
*/
|
|
19
|
+
refreshExpiresAt: Date;
|
|
20
|
+
/**
|
|
21
|
+
* The refresh token
|
|
22
|
+
*/
|
|
23
|
+
refreshToken: string;
|
|
24
|
+
/**
|
|
25
|
+
* The expiration time of the session token
|
|
26
|
+
*/
|
|
27
|
+
sessionExpiresAt: Date;
|
|
28
|
+
/**
|
|
29
|
+
* The session token
|
|
30
|
+
*/
|
|
31
|
+
sessionToken: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const V1RefreshSessionBody$inboundSchema: z.ZodType<
|
|
36
|
+
V1RefreshSessionBody,
|
|
37
|
+
z.ZodTypeDef,
|
|
38
|
+
unknown
|
|
39
|
+
> = z.object({
|
|
40
|
+
$schema: z.string().optional(),
|
|
41
|
+
refreshExpiresAt: z.string().datetime({ offset: true }).transform(v =>
|
|
42
|
+
new Date(v)
|
|
43
|
+
),
|
|
44
|
+
refreshToken: z.string(),
|
|
45
|
+
sessionExpiresAt: z.string().datetime({ offset: true }).transform(v =>
|
|
46
|
+
new Date(v)
|
|
47
|
+
),
|
|
48
|
+
sessionToken: z.string(),
|
|
49
|
+
}).transform((v) => {
|
|
50
|
+
return remap$(v, {
|
|
51
|
+
"$schema": "dollarSchema",
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
/** @internal */
|
|
56
|
+
export type V1RefreshSessionBody$Outbound = {
|
|
57
|
+
$schema?: string | undefined;
|
|
58
|
+
refreshExpiresAt: string;
|
|
59
|
+
refreshToken: string;
|
|
60
|
+
sessionExpiresAt: string;
|
|
61
|
+
sessionToken: string;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/** @internal */
|
|
65
|
+
export const V1RefreshSessionBody$outboundSchema: z.ZodType<
|
|
66
|
+
V1RefreshSessionBody$Outbound,
|
|
67
|
+
z.ZodTypeDef,
|
|
68
|
+
V1RefreshSessionBody
|
|
69
|
+
> = z.object({
|
|
70
|
+
dollarSchema: z.string().optional(),
|
|
71
|
+
refreshExpiresAt: z.date().transform(v => v.toISOString()),
|
|
72
|
+
refreshToken: z.string(),
|
|
73
|
+
sessionExpiresAt: z.date().transform(v => v.toISOString()),
|
|
74
|
+
sessionToken: z.string(),
|
|
75
|
+
}).transform((v) => {
|
|
76
|
+
return remap$(v, {
|
|
77
|
+
dollarSchema: "$schema",
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @internal
|
|
83
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
84
|
+
*/
|
|
85
|
+
export namespace V1RefreshSessionBody$ {
|
|
86
|
+
/** @deprecated use `V1RefreshSessionBody$inboundSchema` instead. */
|
|
87
|
+
export const inboundSchema = V1RefreshSessionBody$inboundSchema;
|
|
88
|
+
/** @deprecated use `V1RefreshSessionBody$outboundSchema` instead. */
|
|
89
|
+
export const outboundSchema = V1RefreshSessionBody$outboundSchema;
|
|
90
|
+
/** @deprecated use `V1RefreshSessionBody$Outbound` instead. */
|
|
91
|
+
export type Outbound = V1RefreshSessionBody$Outbound;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function v1RefreshSessionBodyToJSON(
|
|
95
|
+
v1RefreshSessionBody: V1RefreshSessionBody,
|
|
96
|
+
): string {
|
|
97
|
+
return JSON.stringify(
|
|
98
|
+
V1RefreshSessionBody$outboundSchema.parse(v1RefreshSessionBody),
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function v1RefreshSessionBodyFromJSON(
|
|
103
|
+
jsonString: string,
|
|
104
|
+
): SafeParseResult<V1RefreshSessionBody, SDKValidationError> {
|
|
105
|
+
return safeParse(
|
|
106
|
+
jsonString,
|
|
107
|
+
(x) => V1RefreshSessionBody$inboundSchema.parse(JSON.parse(x)),
|
|
108
|
+
`Failed to parse 'V1RefreshSessionBody' from JSON`,
|
|
109
|
+
);
|
|
110
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
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 { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type V1RefreshSessionRequestBody = {
|
|
11
|
+
/**
|
|
12
|
+
* The refresh token
|
|
13
|
+
*/
|
|
14
|
+
refreshToken: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const V1RefreshSessionRequestBody$inboundSchema: z.ZodType<
|
|
19
|
+
V1RefreshSessionRequestBody,
|
|
20
|
+
z.ZodTypeDef,
|
|
21
|
+
unknown
|
|
22
|
+
> = z.object({
|
|
23
|
+
refreshToken: z.string(),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
/** @internal */
|
|
27
|
+
export type V1RefreshSessionRequestBody$Outbound = {
|
|
28
|
+
refreshToken: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const V1RefreshSessionRequestBody$outboundSchema: z.ZodType<
|
|
33
|
+
V1RefreshSessionRequestBody$Outbound,
|
|
34
|
+
z.ZodTypeDef,
|
|
35
|
+
V1RefreshSessionRequestBody
|
|
36
|
+
> = z.object({
|
|
37
|
+
refreshToken: z.string(),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
43
|
+
*/
|
|
44
|
+
export namespace V1RefreshSessionRequestBody$ {
|
|
45
|
+
/** @deprecated use `V1RefreshSessionRequestBody$inboundSchema` instead. */
|
|
46
|
+
export const inboundSchema = V1RefreshSessionRequestBody$inboundSchema;
|
|
47
|
+
/** @deprecated use `V1RefreshSessionRequestBody$outboundSchema` instead. */
|
|
48
|
+
export const outboundSchema = V1RefreshSessionRequestBody$outboundSchema;
|
|
49
|
+
/** @deprecated use `V1RefreshSessionRequestBody$Outbound` instead. */
|
|
50
|
+
export type Outbound = V1RefreshSessionRequestBody$Outbound;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function v1RefreshSessionRequestBodyToJSON(
|
|
54
|
+
v1RefreshSessionRequestBody: V1RefreshSessionRequestBody,
|
|
55
|
+
): string {
|
|
56
|
+
return JSON.stringify(
|
|
57
|
+
V1RefreshSessionRequestBody$outboundSchema.parse(
|
|
58
|
+
v1RefreshSessionRequestBody,
|
|
59
|
+
),
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function v1RefreshSessionRequestBodyFromJSON(
|
|
64
|
+
jsonString: string,
|
|
65
|
+
): SafeParseResult<V1RefreshSessionRequestBody, SDKValidationError> {
|
|
66
|
+
return safeParse(
|
|
67
|
+
jsonString,
|
|
68
|
+
(x) => V1RefreshSessionRequestBody$inboundSchema.parse(JSON.parse(x)),
|
|
69
|
+
`Failed to parse 'V1RefreshSessionRequestBody' from JSON`,
|
|
70
|
+
);
|
|
71
|
+
}
|