@steamsets/client-ts 0.11.16 → 0.11.17

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.
Files changed (101) hide show
  1. package/README.md +0 -4
  2. package/docs/sdks/account/README.md +0 -80
  3. package/docs/sdks/leaderboard/README.md +0 -80
  4. package/lib/config.d.ts +2 -2
  5. package/lib/config.js +2 -2
  6. package/models/components/accountinfobody.d.ts +12 -9
  7. package/models/components/accountinfobody.d.ts.map +1 -1
  8. package/models/components/accountinfobody.js +12 -9
  9. package/models/components/accountinfobody.js.map +1 -1
  10. package/models/components/index.d.ts +4 -3
  11. package/models/components/index.d.ts.map +1 -1
  12. package/models/components/index.js +4 -3
  13. package/models/components/index.js.map +1 -1
  14. package/models/components/leaderboardaccount.d.ts +12 -9
  15. package/models/components/leaderboardaccount.d.ts.map +1 -1
  16. package/models/components/leaderboardaccount.js +12 -9
  17. package/models/components/leaderboardaccount.js.map +1 -1
  18. package/models/components/leaderboardcity.d.ts +33 -0
  19. package/models/components/leaderboardcity.d.ts.map +1 -0
  20. package/models/components/{location.js → leaderboardcity.js} +11 -13
  21. package/models/components/leaderboardcity.js.map +1 -0
  22. package/models/components/leaderboardcountry.d.ts +38 -0
  23. package/models/components/leaderboardcountry.d.ts.map +1 -0
  24. package/models/components/leaderboardcountry.js +54 -0
  25. package/models/components/leaderboardcountry.js.map +1 -0
  26. package/models/components/leaderboardregion.d.ts +33 -0
  27. package/models/components/leaderboardregion.d.ts.map +1 -0
  28. package/models/components/leaderboardregion.js +52 -0
  29. package/models/components/leaderboardregion.js.map +1 -0
  30. package/models/components/leaderboardstate.d.ts +33 -0
  31. package/models/components/leaderboardstate.d.ts.map +1 -0
  32. package/models/components/leaderboardstate.js +52 -0
  33. package/models/components/leaderboardstate.js.map +1 -0
  34. package/models/components/v1accountfriend.d.ts +12 -9
  35. package/models/components/v1accountfriend.d.ts.map +1 -1
  36. package/models/components/v1accountfriend.js +12 -9
  37. package/models/components/v1accountfriend.js.map +1 -1
  38. package/models/components/v1accountleaderboardaccount.d.ts +12 -9
  39. package/models/components/v1accountleaderboardaccount.d.ts.map +1 -1
  40. package/models/components/v1accountleaderboardaccount.js +12 -9
  41. package/models/components/v1accountleaderboardaccount.js.map +1 -1
  42. package/models/operations/index.d.ts +0 -1
  43. package/models/operations/index.d.ts.map +1 -1
  44. package/models/operations/index.js +0 -1
  45. package/models/operations/index.js.map +1 -1
  46. package/package.json +1 -1
  47. package/sdk/account.d.ts +0 -4
  48. package/sdk/account.d.ts.map +1 -1
  49. package/sdk/account.js +0 -7
  50. package/sdk/account.js.map +1 -1
  51. package/sdk/leaderboard.d.ts +0 -4
  52. package/sdk/leaderboard.d.ts.map +1 -1
  53. package/sdk/leaderboard.js +0 -7
  54. package/sdk/leaderboard.js.map +1 -1
  55. package/sdk/sdk.d.ts +2 -2
  56. package/sdk/sdk.d.ts.map +1 -1
  57. package/sdk/sdk.js +4 -4
  58. package/sdk/sdk.js.map +1 -1
  59. package/src/lib/config.ts +2 -2
  60. package/src/models/components/accountinfobody.ts +39 -21
  61. package/src/models/components/index.ts +4 -3
  62. package/src/models/components/leaderboardaccount.ts +39 -21
  63. package/src/models/components/leaderboardcity.ts +55 -0
  64. package/src/models/components/leaderboardcountry.ts +62 -0
  65. package/src/models/components/leaderboardregion.ts +55 -0
  66. package/src/models/components/leaderboardstate.ts +55 -0
  67. package/src/models/components/v1accountfriend.ts +39 -21
  68. package/src/models/components/v1accountleaderboardaccount.ts +39 -21
  69. package/src/models/operations/index.ts +0 -1
  70. package/src/sdk/account.ts +0 -15
  71. package/src/sdk/leaderboard.ts +0 -15
  72. package/src/sdk/sdk.ts +5 -5
  73. package/funcs/accountAccountV1LeaderboardPreview.d.ts +0 -14
  74. package/funcs/accountAccountV1LeaderboardPreview.d.ts.map +0 -1
  75. package/funcs/accountAccountV1LeaderboardPreview.js +0 -98
  76. package/funcs/accountAccountV1LeaderboardPreview.js.map +0 -1
  77. package/funcs/leaderboardAccountV1LeaderboardPreview.d.ts +0 -14
  78. package/funcs/leaderboardAccountV1LeaderboardPreview.d.ts.map +0 -1
  79. package/funcs/leaderboardAccountV1LeaderboardPreview.js +0 -98
  80. package/funcs/leaderboardAccountV1LeaderboardPreview.js.map +0 -1
  81. package/models/components/location.d.ts +0 -38
  82. package/models/components/location.d.ts.map +0 -1
  83. package/models/components/location.js.map +0 -1
  84. package/models/components/v1accountleaderboardpreviewrequestbody.d.ts +0 -110
  85. package/models/components/v1accountleaderboardpreviewrequestbody.d.ts.map +0 -1
  86. package/models/components/v1accountleaderboardpreviewrequestbody.js +0 -90
  87. package/models/components/v1accountleaderboardpreviewrequestbody.js.map +0 -1
  88. package/models/components/v1accountleaderboardpreviewresponsebody.d.ts +0 -38
  89. package/models/components/v1accountleaderboardpreviewresponsebody.d.ts.map +0 -1
  90. package/models/components/v1accountleaderboardpreviewresponsebody.js +0 -63
  91. package/models/components/v1accountleaderboardpreviewresponsebody.js.map +0 -1
  92. package/models/operations/accountv1leaderboardpreview.d.ts +0 -31
  93. package/models/operations/accountv1leaderboardpreview.d.ts.map +0 -1
  94. package/models/operations/accountv1leaderboardpreview.js +0 -66
  95. package/models/operations/accountv1leaderboardpreview.js.map +0 -1
  96. package/src/funcs/accountAccountV1LeaderboardPreview.ts +0 -130
  97. package/src/funcs/leaderboardAccountV1LeaderboardPreview.ts +0 -130
  98. package/src/models/components/location.ts +0 -62
  99. package/src/models/components/v1accountleaderboardpreviewrequestbody.ts +0 -110
  100. package/src/models/components/v1accountleaderboardpreviewresponsebody.ts +0 -73
  101. package/src/models/operations/accountv1leaderboardpreview.ts +0 -74
@@ -1 +0,0 @@
1
- {"version":3,"file":"v1accountleaderboardpreviewresponsebody.js","sourceRoot":"","sources":["../../src/models/components/v1accountleaderboardpreviewresponsebody.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2DAA0D;AAiB1D,gBAAgB;AACH,QAAA,qDAAqD,GAI9D,CAAC,CAAC,MAAM,CAAC;IACX,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC7B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;CAC9B,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,SAAS,EAAE,cAAc;KAC1B,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AASH,gBAAgB;AACH,QAAA,sDAAsD,GAI/D,CAAC,CAAC,MAAM,CAAC;IACX,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC7B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;CAC9B,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,YAAY,EAAE,SAAS;KACxB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,IAAiB,wCAAwC,CASxD;AATD,WAAiB,wCAAwC;IACvD,uFAAuF;IAC1E,sDAAa,GACxB,6DAAqD,CAAC;IACxD,wFAAwF;IAC3E,uDAAc,GACzB,8DAAsD,CAAC;AAG3D,CAAC,EATgB,wCAAwC,wDAAxC,wCAAwC,QASxD"}
@@ -1,31 +0,0 @@
1
- import * as z from "zod";
2
- import * as components from "../components/index.js";
3
- export type AccountV1LeaderboardPreviewResponse = {
4
- httpMeta: components.HTTPMetadata;
5
- /**
6
- * OK
7
- */
8
- v1AccountLeaderboardPreviewResponseBody?: components.V1AccountLeaderboardPreviewResponseBody | undefined;
9
- };
10
- /** @internal */
11
- export declare const AccountV1LeaderboardPreviewResponse$inboundSchema: z.ZodType<AccountV1LeaderboardPreviewResponse, z.ZodTypeDef, unknown>;
12
- /** @internal */
13
- export type AccountV1LeaderboardPreviewResponse$Outbound = {
14
- HttpMeta: components.HTTPMetadata$Outbound;
15
- V1AccountLeaderboardPreviewResponseBody?: components.V1AccountLeaderboardPreviewResponseBody$Outbound | undefined;
16
- };
17
- /** @internal */
18
- export declare const AccountV1LeaderboardPreviewResponse$outboundSchema: z.ZodType<AccountV1LeaderboardPreviewResponse$Outbound, z.ZodTypeDef, AccountV1LeaderboardPreviewResponse>;
19
- /**
20
- * @internal
21
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
22
- */
23
- export declare namespace AccountV1LeaderboardPreviewResponse$ {
24
- /** @deprecated use `AccountV1LeaderboardPreviewResponse$inboundSchema` instead. */
25
- const inboundSchema: z.ZodType<AccountV1LeaderboardPreviewResponse, z.ZodTypeDef, unknown>;
26
- /** @deprecated use `AccountV1LeaderboardPreviewResponse$outboundSchema` instead. */
27
- const outboundSchema: z.ZodType<AccountV1LeaderboardPreviewResponse$Outbound, z.ZodTypeDef, AccountV1LeaderboardPreviewResponse>;
28
- /** @deprecated use `AccountV1LeaderboardPreviewResponse$Outbound` instead. */
29
- type Outbound = AccountV1LeaderboardPreviewResponse$Outbound;
30
- }
31
- //# sourceMappingURL=accountv1leaderboardpreview.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"accountv1leaderboardpreview.d.ts","sourceRoot":"","sources":["../../src/models/operations/accountv1leaderboardpreview.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAErD,MAAM,MAAM,mCAAmC,GAAG;IAChD,QAAQ,EAAE,UAAU,CAAC,YAAY,CAAC;IAClC;;OAEG;IACH,uCAAuC,CAAC,EACpC,UAAU,CAAC,uCAAuC,GAClD,SAAS,CAAC;CACf,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,iDAAiD,EAAE,CAAC,CAAC,OAAO,CACvE,mCAAmC,EACnC,CAAC,CAAC,UAAU,EACZ,OAAO,CAWP,CAAC;AAEH,gBAAgB;AAChB,MAAM,MAAM,4CAA4C,GAAG;IACzD,QAAQ,EAAE,UAAU,CAAC,qBAAqB,CAAC;IAC3C,uCAAuC,CAAC,EACpC,UAAU,CAAC,gDAAgD,GAC3D,SAAS,CAAC;CACf,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,kDAAkD,EAAE,CAAC,CAAC,OAAO,CACxE,4CAA4C,EAC5C,CAAC,CAAC,UAAU,EACZ,mCAAmC,CAWnC,CAAC;AAEH;;;GAGG;AACH,yBAAiB,oCAAoC,CAAC;IACpD,mFAAmF;IAC5E,MAAM,aAAa,uEACyB,CAAC;IACpD,oFAAoF;IAC7E,MAAM,cAAc,4GACyB,CAAC;IACrD,8EAA8E;IAC9E,KAAY,QAAQ,GAAG,4CAA4C,CAAC;CACrE"}
@@ -1,66 +0,0 @@
1
- "use strict";
2
- /*
3
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
- */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || function (mod) {
22
- if (mod && mod.__esModule) return mod;
23
- var result = {};
24
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
- __setModuleDefault(result, mod);
26
- return result;
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.AccountV1LeaderboardPreviewResponse$ = exports.AccountV1LeaderboardPreviewResponse$outboundSchema = exports.AccountV1LeaderboardPreviewResponse$inboundSchema = void 0;
30
- const z = __importStar(require("zod"));
31
- const primitives_js_1 = require("../../lib/primitives.js");
32
- const components = __importStar(require("../components/index.js"));
33
- /** @internal */
34
- exports.AccountV1LeaderboardPreviewResponse$inboundSchema = z.object({
35
- HttpMeta: components.HTTPMetadata$inboundSchema,
36
- V1AccountLeaderboardPreviewResponseBody: components
37
- .V1AccountLeaderboardPreviewResponseBody$inboundSchema.optional(),
38
- }).transform((v) => {
39
- return (0, primitives_js_1.remap)(v, {
40
- "HttpMeta": "httpMeta",
41
- "V1AccountLeaderboardPreviewResponseBody": "v1AccountLeaderboardPreviewResponseBody",
42
- });
43
- });
44
- /** @internal */
45
- exports.AccountV1LeaderboardPreviewResponse$outboundSchema = z.object({
46
- httpMeta: components.HTTPMetadata$outboundSchema,
47
- v1AccountLeaderboardPreviewResponseBody: components
48
- .V1AccountLeaderboardPreviewResponseBody$outboundSchema.optional(),
49
- }).transform((v) => {
50
- return (0, primitives_js_1.remap)(v, {
51
- httpMeta: "HttpMeta",
52
- v1AccountLeaderboardPreviewResponseBody: "V1AccountLeaderboardPreviewResponseBody",
53
- });
54
- });
55
- /**
56
- * @internal
57
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
58
- */
59
- var AccountV1LeaderboardPreviewResponse$;
60
- (function (AccountV1LeaderboardPreviewResponse$) {
61
- /** @deprecated use `AccountV1LeaderboardPreviewResponse$inboundSchema` instead. */
62
- AccountV1LeaderboardPreviewResponse$.inboundSchema = exports.AccountV1LeaderboardPreviewResponse$inboundSchema;
63
- /** @deprecated use `AccountV1LeaderboardPreviewResponse$outboundSchema` instead. */
64
- AccountV1LeaderboardPreviewResponse$.outboundSchema = exports.AccountV1LeaderboardPreviewResponse$outboundSchema;
65
- })(AccountV1LeaderboardPreviewResponse$ || (exports.AccountV1LeaderboardPreviewResponse$ = AccountV1LeaderboardPreviewResponse$ = {}));
66
- //# sourceMappingURL=accountv1leaderboardpreview.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"accountv1leaderboardpreview.js","sourceRoot":"","sources":["../../src/models/operations/accountv1leaderboardpreview.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2DAA0D;AAC1D,mEAAqD;AAYrD,gBAAgB;AACH,QAAA,iDAAiD,GAI1D,CAAC,CAAC,MAAM,CAAC;IACX,QAAQ,EAAE,UAAU,CAAC,0BAA0B;IAC/C,uCAAuC,EAAE,UAAU;SAChD,qDAAqD,CAAC,QAAQ,EAAE;CACpE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,UAAU,EAAE,UAAU;QACtB,yCAAyC,EACvC,yCAAyC;KAC5C,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAUH,gBAAgB;AACH,QAAA,kDAAkD,GAI3D,CAAC,CAAC,MAAM,CAAC;IACX,QAAQ,EAAE,UAAU,CAAC,2BAA2B;IAChD,uCAAuC,EAAE,UAAU;SAChD,sDAAsD,CAAC,QAAQ,EAAE;CACrE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,QAAQ,EAAE,UAAU;QACpB,uCAAuC,EACrC,yCAAyC;KAC5C,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,IAAiB,oCAAoC,CASpD;AATD,WAAiB,oCAAoC;IACnD,mFAAmF;IACtE,kDAAa,GACxB,yDAAiD,CAAC;IACpD,oFAAoF;IACvE,mDAAc,GACzB,0DAAkD,CAAC;AAGvD,CAAC,EATgB,oCAAoC,oDAApC,oCAAoC,QASpD"}
@@ -1,130 +0,0 @@
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 { safeParse } from "../lib/schemas.js";
9
- import { RequestOptions } from "../lib/sdks.js";
10
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
- import { pathToFunc } from "../lib/url.js";
12
- import * as components from "../models/components/index.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 { Result } from "../types/fp.js";
25
-
26
- /**
27
- * Preview what a given score would result in
28
- */
29
- export async function accountAccountV1LeaderboardPreview(
30
- client: SteamSetsCore,
31
- request: components.V1AccountLeaderboardPreviewRequestBody,
32
- options?: RequestOptions,
33
- ): Promise<
34
- Result<
35
- operations.AccountV1LeaderboardPreviewResponse,
36
- | errors.ErrorModel
37
- | SDKError
38
- | SDKValidationError
39
- | UnexpectedClientError
40
- | InvalidRequestError
41
- | RequestAbortedError
42
- | RequestTimeoutError
43
- | ConnectionError
44
- >
45
- > {
46
- const parsed = safeParse(
47
- request,
48
- (value) =>
49
- components.V1AccountLeaderboardPreviewRequestBody$outboundSchema.parse(
50
- value,
51
- ),
52
- "Input validation failed",
53
- );
54
- if (!parsed.ok) {
55
- return parsed;
56
- }
57
- const payload = parsed.value;
58
- const body = encodeJSON("body", payload, { explode: true });
59
-
60
- const path = pathToFunc("/account.v1.AccountService/GetLeaderboardPreview")();
61
-
62
- const headers = new Headers({
63
- "Content-Type": "application/json",
64
- Accept: "application/json",
65
- });
66
-
67
- const secConfig = await extractSecurity(client._options.token);
68
- const securityInput = secConfig == null ? {} : { token: secConfig };
69
- const context = {
70
- operationID: "account.v1.leaderboardPreview",
71
- oAuth2Scopes: [],
72
- securitySource: client._options.token,
73
- };
74
- const requestSecurity = resolveGlobalSecurity(securityInput);
75
-
76
- const requestRes = client._createRequest(context, {
77
- security: requestSecurity,
78
- method: "POST",
79
- path: path,
80
- headers: headers,
81
- body: body,
82
- uaHeader: "x-speakeasy-user-agent",
83
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
84
- }, options);
85
- if (!requestRes.ok) {
86
- return requestRes;
87
- }
88
- const req = requestRes.value;
89
-
90
- const doResult = await client._do(req, {
91
- context,
92
- errorCodes: ["404", "422", "4XX", "500", "5XX"],
93
- retryConfig: options?.retries
94
- || client._options.retryConfig,
95
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
96
- });
97
- if (!doResult.ok) {
98
- return doResult;
99
- }
100
- const response = doResult.value;
101
-
102
- const responseFields = {
103
- HttpMeta: { Response: response, Request: req },
104
- };
105
-
106
- const [result] = await M.match<
107
- operations.AccountV1LeaderboardPreviewResponse,
108
- | errors.ErrorModel
109
- | SDKError
110
- | SDKValidationError
111
- | UnexpectedClientError
112
- | InvalidRequestError
113
- | RequestAbortedError
114
- | RequestTimeoutError
115
- | ConnectionError
116
- >(
117
- M.json(200, operations.AccountV1LeaderboardPreviewResponse$inboundSchema, {
118
- key: "V1AccountLeaderboardPreviewResponseBody",
119
- }),
120
- M.jsonErr([404, 422, 500], errors.ErrorModel$inboundSchema, {
121
- ctype: "application/problem+json",
122
- }),
123
- M.fail(["4XX", "5XX"]),
124
- )(response, req, { extraFields: responseFields });
125
- if (!result.ok) {
126
- return result;
127
- }
128
-
129
- return result;
130
- }
@@ -1,130 +0,0 @@
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 { safeParse } from "../lib/schemas.js";
9
- import { RequestOptions } from "../lib/sdks.js";
10
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
- import { pathToFunc } from "../lib/url.js";
12
- import * as components from "../models/components/index.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 { Result } from "../types/fp.js";
25
-
26
- /**
27
- * Preview what a given score would result in
28
- */
29
- export async function leaderboardAccountV1LeaderboardPreview(
30
- client: SteamSetsCore,
31
- request: components.V1AccountLeaderboardPreviewRequestBody,
32
- options?: RequestOptions,
33
- ): Promise<
34
- Result<
35
- operations.AccountV1LeaderboardPreviewResponse,
36
- | errors.ErrorModel
37
- | SDKError
38
- | SDKValidationError
39
- | UnexpectedClientError
40
- | InvalidRequestError
41
- | RequestAbortedError
42
- | RequestTimeoutError
43
- | ConnectionError
44
- >
45
- > {
46
- const parsed = safeParse(
47
- request,
48
- (value) =>
49
- components.V1AccountLeaderboardPreviewRequestBody$outboundSchema.parse(
50
- value,
51
- ),
52
- "Input validation failed",
53
- );
54
- if (!parsed.ok) {
55
- return parsed;
56
- }
57
- const payload = parsed.value;
58
- const body = encodeJSON("body", payload, { explode: true });
59
-
60
- const path = pathToFunc("/account.v1.AccountService/GetLeaderboardPreview")();
61
-
62
- const headers = new Headers({
63
- "Content-Type": "application/json",
64
- Accept: "application/json",
65
- });
66
-
67
- const secConfig = await extractSecurity(client._options.token);
68
- const securityInput = secConfig == null ? {} : { token: secConfig };
69
- const context = {
70
- operationID: "account.v1.leaderboardPreview",
71
- oAuth2Scopes: [],
72
- securitySource: client._options.token,
73
- };
74
- const requestSecurity = resolveGlobalSecurity(securityInput);
75
-
76
- const requestRes = client._createRequest(context, {
77
- security: requestSecurity,
78
- method: "POST",
79
- path: path,
80
- headers: headers,
81
- body: body,
82
- uaHeader: "x-speakeasy-user-agent",
83
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
84
- }, options);
85
- if (!requestRes.ok) {
86
- return requestRes;
87
- }
88
- const req = requestRes.value;
89
-
90
- const doResult = await client._do(req, {
91
- context,
92
- errorCodes: ["404", "422", "4XX", "500", "5XX"],
93
- retryConfig: options?.retries
94
- || client._options.retryConfig,
95
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
96
- });
97
- if (!doResult.ok) {
98
- return doResult;
99
- }
100
- const response = doResult.value;
101
-
102
- const responseFields = {
103
- HttpMeta: { Response: response, Request: req },
104
- };
105
-
106
- const [result] = await M.match<
107
- operations.AccountV1LeaderboardPreviewResponse,
108
- | errors.ErrorModel
109
- | SDKError
110
- | SDKValidationError
111
- | UnexpectedClientError
112
- | InvalidRequestError
113
- | RequestAbortedError
114
- | RequestTimeoutError
115
- | ConnectionError
116
- >(
117
- M.json(200, operations.AccountV1LeaderboardPreviewResponse$inboundSchema, {
118
- key: "V1AccountLeaderboardPreviewResponseBody",
119
- }),
120
- M.jsonErr([404, 422, 500], errors.ErrorModel$inboundSchema, {
121
- ctype: "application/problem+json",
122
- }),
123
- M.fail(["4XX", "5XX"]),
124
- )(response, req, { extraFields: responseFields });
125
- if (!result.ok) {
126
- return result;
127
- }
128
-
129
- return result;
130
- }
@@ -1,62 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
-
7
- export type Location = {
8
- /**
9
- * The code of the location
10
- */
11
- code?: string | null | undefined;
12
- /**
13
- * The id of the location
14
- */
15
- id: number;
16
- /**
17
- * The name of the location
18
- */
19
- name: string;
20
- };
21
-
22
- /** @internal */
23
- export const Location$inboundSchema: z.ZodType<
24
- Location,
25
- z.ZodTypeDef,
26
- unknown
27
- > = z.object({
28
- code: z.nullable(z.string()).optional(),
29
- id: z.number().int(),
30
- name: z.string(),
31
- });
32
-
33
- /** @internal */
34
- export type Location$Outbound = {
35
- code?: string | null | undefined;
36
- id: number;
37
- name: string;
38
- };
39
-
40
- /** @internal */
41
- export const Location$outboundSchema: z.ZodType<
42
- Location$Outbound,
43
- z.ZodTypeDef,
44
- Location
45
- > = z.object({
46
- code: z.nullable(z.string()).optional(),
47
- id: z.number().int(),
48
- name: z.string(),
49
- });
50
-
51
- /**
52
- * @internal
53
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
54
- */
55
- export namespace Location$ {
56
- /** @deprecated use `Location$inboundSchema` instead. */
57
- export const inboundSchema = Location$inboundSchema;
58
- /** @deprecated use `Location$outboundSchema` instead. */
59
- export const outboundSchema = Location$outboundSchema;
60
- /** @deprecated use `Location$Outbound` instead. */
61
- export type Outbound = Location$Outbound;
62
- }
@@ -1,110 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { ClosedEnum } from "../../types/enums.js";
7
-
8
- /**
9
- * The leaderboard to get
10
- */
11
- export const V1AccountLeaderboardPreviewRequestBodyLeaderboard = {
12
- Apps: "apps",
13
- LimitedApps: "limited_apps",
14
- AppPlaytime: "app_playtime",
15
- AwardsGiven: "awards_given",
16
- AwardsReceived: "awards_received",
17
- Bans: "bans",
18
- GameBans: "game_bans",
19
- VacBans: "vac_bans",
20
- Donations: "donations",
21
- FoilBadges: "foil_badges",
22
- NormalBadges: "normal_badges",
23
- Badges: "badges",
24
- Playtime: "playtime",
25
- PointsGiven: "points_given",
26
- PointsReceived: "points_received",
27
- SteamSets: "steam_sets",
28
- Xp: "xp",
29
- } as const;
30
- /**
31
- * The leaderboard to get
32
- */
33
- export type V1AccountLeaderboardPreviewRequestBodyLeaderboard = ClosedEnum<
34
- typeof V1AccountLeaderboardPreviewRequestBodyLeaderboard
35
- >;
36
-
37
- export type V1AccountLeaderboardPreviewRequestBody = {
38
- /**
39
- * The leaderboard to get
40
- */
41
- leaderboard: V1AccountLeaderboardPreviewRequestBodyLeaderboard;
42
- /**
43
- * The score the account should be
44
- */
45
- score: number;
46
- };
47
-
48
- /** @internal */
49
- export const V1AccountLeaderboardPreviewRequestBodyLeaderboard$inboundSchema:
50
- z.ZodNativeEnum<typeof V1AccountLeaderboardPreviewRequestBodyLeaderboard> = z
51
- .nativeEnum(V1AccountLeaderboardPreviewRequestBodyLeaderboard);
52
-
53
- /** @internal */
54
- export const V1AccountLeaderboardPreviewRequestBodyLeaderboard$outboundSchema:
55
- z.ZodNativeEnum<typeof V1AccountLeaderboardPreviewRequestBodyLeaderboard> =
56
- V1AccountLeaderboardPreviewRequestBodyLeaderboard$inboundSchema;
57
-
58
- /**
59
- * @internal
60
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
61
- */
62
- export namespace V1AccountLeaderboardPreviewRequestBodyLeaderboard$ {
63
- /** @deprecated use `V1AccountLeaderboardPreviewRequestBodyLeaderboard$inboundSchema` instead. */
64
- export const inboundSchema =
65
- V1AccountLeaderboardPreviewRequestBodyLeaderboard$inboundSchema;
66
- /** @deprecated use `V1AccountLeaderboardPreviewRequestBodyLeaderboard$outboundSchema` instead. */
67
- export const outboundSchema =
68
- V1AccountLeaderboardPreviewRequestBodyLeaderboard$outboundSchema;
69
- }
70
-
71
- /** @internal */
72
- export const V1AccountLeaderboardPreviewRequestBody$inboundSchema: z.ZodType<
73
- V1AccountLeaderboardPreviewRequestBody,
74
- z.ZodTypeDef,
75
- unknown
76
- > = z.object({
77
- leaderboard: V1AccountLeaderboardPreviewRequestBodyLeaderboard$inboundSchema,
78
- score: z.number().int(),
79
- });
80
-
81
- /** @internal */
82
- export type V1AccountLeaderboardPreviewRequestBody$Outbound = {
83
- leaderboard: string;
84
- score: number;
85
- };
86
-
87
- /** @internal */
88
- export const V1AccountLeaderboardPreviewRequestBody$outboundSchema: z.ZodType<
89
- V1AccountLeaderboardPreviewRequestBody$Outbound,
90
- z.ZodTypeDef,
91
- V1AccountLeaderboardPreviewRequestBody
92
- > = z.object({
93
- leaderboard: V1AccountLeaderboardPreviewRequestBodyLeaderboard$outboundSchema,
94
- score: z.number().int(),
95
- });
96
-
97
- /**
98
- * @internal
99
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
100
- */
101
- export namespace V1AccountLeaderboardPreviewRequestBody$ {
102
- /** @deprecated use `V1AccountLeaderboardPreviewRequestBody$inboundSchema` instead. */
103
- export const inboundSchema =
104
- V1AccountLeaderboardPreviewRequestBody$inboundSchema;
105
- /** @deprecated use `V1AccountLeaderboardPreviewRequestBody$outboundSchema` instead. */
106
- export const outboundSchema =
107
- V1AccountLeaderboardPreviewRequestBody$outboundSchema;
108
- /** @deprecated use `V1AccountLeaderboardPreviewRequestBody$Outbound` instead. */
109
- export type Outbound = V1AccountLeaderboardPreviewRequestBody$Outbound;
110
- }
@@ -1,73 +0,0 @@
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
-
8
- export type V1AccountLeaderboardPreviewResponseBody = {
9
- /**
10
- * A URL to the JSON Schema for this object.
11
- */
12
- dollarSchema?: string | undefined;
13
- /**
14
- * The current rank of the account
15
- */
16
- currentRank: number;
17
- /**
18
- * The rank the account would be
19
- */
20
- wouldBeRank: number;
21
- };
22
-
23
- /** @internal */
24
- export const V1AccountLeaderboardPreviewResponseBody$inboundSchema: z.ZodType<
25
- V1AccountLeaderboardPreviewResponseBody,
26
- z.ZodTypeDef,
27
- unknown
28
- > = z.object({
29
- $schema: z.string().optional(),
30
- currentRank: z.number().int(),
31
- wouldBeRank: z.number().int(),
32
- }).transform((v) => {
33
- return remap$(v, {
34
- "$schema": "dollarSchema",
35
- });
36
- });
37
-
38
- /** @internal */
39
- export type V1AccountLeaderboardPreviewResponseBody$Outbound = {
40
- $schema?: string | undefined;
41
- currentRank: number;
42
- wouldBeRank: number;
43
- };
44
-
45
- /** @internal */
46
- export const V1AccountLeaderboardPreviewResponseBody$outboundSchema: z.ZodType<
47
- V1AccountLeaderboardPreviewResponseBody$Outbound,
48
- z.ZodTypeDef,
49
- V1AccountLeaderboardPreviewResponseBody
50
- > = z.object({
51
- dollarSchema: z.string().optional(),
52
- currentRank: z.number().int(),
53
- wouldBeRank: z.number().int(),
54
- }).transform((v) => {
55
- return remap$(v, {
56
- dollarSchema: "$schema",
57
- });
58
- });
59
-
60
- /**
61
- * @internal
62
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
63
- */
64
- export namespace V1AccountLeaderboardPreviewResponseBody$ {
65
- /** @deprecated use `V1AccountLeaderboardPreviewResponseBody$inboundSchema` instead. */
66
- export const inboundSchema =
67
- V1AccountLeaderboardPreviewResponseBody$inboundSchema;
68
- /** @deprecated use `V1AccountLeaderboardPreviewResponseBody$outboundSchema` instead. */
69
- export const outboundSchema =
70
- V1AccountLeaderboardPreviewResponseBody$outboundSchema;
71
- /** @deprecated use `V1AccountLeaderboardPreviewResponseBody$Outbound` instead. */
72
- export type Outbound = V1AccountLeaderboardPreviewResponseBody$Outbound;
73
- }