@steamsets/client-ts 0.34.5 → 0.34.7

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 (181) hide show
  1. package/README.md +12 -0
  2. package/funcs/analyticsGetBivariate.d.ts +16 -0
  3. package/funcs/analyticsGetBivariate.d.ts.map +1 -0
  4. package/funcs/analyticsGetBivariate.js +134 -0
  5. package/funcs/analyticsGetBivariate.js.map +1 -0
  6. package/funcs/analyticsGetDistribution.d.ts +16 -0
  7. package/funcs/analyticsGetDistribution.d.ts.map +1 -0
  8. package/funcs/analyticsGetDistribution.js +134 -0
  9. package/funcs/analyticsGetDistribution.js.map +1 -0
  10. package/funcs/analyticsGetMetricByScope.d.ts +16 -0
  11. package/funcs/analyticsGetMetricByScope.d.ts.map +1 -0
  12. package/funcs/analyticsGetMetricByScope.js +134 -0
  13. package/funcs/analyticsGetMetricByScope.js.map +1 -0
  14. package/funcs/analyticsGetMyPercentiles.d.ts +16 -0
  15. package/funcs/analyticsGetMyPercentiles.d.ts.map +1 -0
  16. package/funcs/analyticsGetMyPercentiles.js +134 -0
  17. package/funcs/analyticsGetMyPercentiles.js.map +1 -0
  18. package/funcs/analyticsGetTrend.d.ts +16 -0
  19. package/funcs/analyticsGetTrend.d.ts.map +1 -0
  20. package/funcs/analyticsGetTrend.js +134 -0
  21. package/funcs/analyticsGetTrend.js.map +1 -0
  22. package/funcs/analyticsListMetrics.d.ts +15 -0
  23. package/funcs/analyticsListMetrics.d.ts.map +1 -0
  24. package/funcs/analyticsListMetrics.js +121 -0
  25. package/funcs/analyticsListMetrics.js.map +1 -0
  26. package/jsr.json +1 -1
  27. package/lib/config.d.ts +2 -2
  28. package/lib/config.js +2 -2
  29. package/models/components/analyticsbin.d.ts +12 -0
  30. package/models/components/analyticsbin.d.ts.map +1 -0
  31. package/models/components/analyticsbin.js +58 -0
  32. package/models/components/analyticsbin.js.map +1 -0
  33. package/models/components/analyticsbivariate.d.ts +15 -0
  34. package/models/components/analyticsbivariate.d.ts.map +1 -0
  35. package/models/components/analyticsbivariate.js +57 -0
  36. package/models/components/analyticsbivariate.js.map +1 -0
  37. package/models/components/analyticsbivariatebucket.d.ts +12 -0
  38. package/models/components/analyticsbivariatebucket.d.ts.map +1 -0
  39. package/models/components/analyticsbivariatebucket.js +58 -0
  40. package/models/components/analyticsbivariatebucket.js.map +1 -0
  41. package/models/components/analyticsdistribution.d.ts +17 -0
  42. package/models/components/analyticsdistribution.d.ts.map +1 -0
  43. package/models/components/analyticsdistribution.js +59 -0
  44. package/models/components/analyticsdistribution.js.map +1 -0
  45. package/models/components/analyticsdomainentry.d.ts +14 -0
  46. package/models/components/analyticsdomainentry.d.ts.map +1 -0
  47. package/models/components/analyticsdomainentry.js +54 -0
  48. package/models/components/analyticsdomainentry.js.map +1 -0
  49. package/models/components/analyticsgetbivariaterequestbody.d.ts +49 -0
  50. package/models/components/analyticsgetbivariaterequestbody.d.ts.map +1 -0
  51. package/models/components/analyticsgetbivariaterequestbody.js +69 -0
  52. package/models/components/analyticsgetbivariaterequestbody.js.map +1 -0
  53. package/models/components/analyticsgetdistributionrequestbody.d.ts +30 -0
  54. package/models/components/analyticsgetdistributionrequestbody.d.ts.map +1 -0
  55. package/models/components/analyticsgetdistributionrequestbody.js +57 -0
  56. package/models/components/analyticsgetdistributionrequestbody.js.map +1 -0
  57. package/models/components/analyticsgetmetricbyscoperequestbody.d.ts +58 -0
  58. package/models/components/analyticsgetmetricbyscoperequestbody.d.ts.map +1 -0
  59. package/models/components/analyticsgetmetricbyscoperequestbody.js +73 -0
  60. package/models/components/analyticsgetmetricbyscoperequestbody.js.map +1 -0
  61. package/models/components/analyticsgetmypercentilesrequestbody.d.ts +19 -0
  62. package/models/components/analyticsgetmypercentilesrequestbody.d.ts.map +1 -0
  63. package/models/components/analyticsgetmypercentilesrequestbody.js +56 -0
  64. package/models/components/analyticsgetmypercentilesrequestbody.js.map +1 -0
  65. package/models/components/analyticsgettrendrequestbody.d.ts +50 -0
  66. package/models/components/analyticsgettrendrequestbody.d.ts.map +1 -0
  67. package/models/components/analyticsgettrendrequestbody.js +68 -0
  68. package/models/components/analyticsgettrendrequestbody.js.map +1 -0
  69. package/models/components/analyticslistmetricsresponsebody.d.ts +15 -0
  70. package/models/components/analyticslistmetricsresponsebody.d.ts.map +1 -0
  71. package/models/components/analyticslistmetricsresponsebody.js +57 -0
  72. package/models/components/analyticslistmetricsresponsebody.js.map +1 -0
  73. package/models/components/analyticsmetricbyscope.d.ts +15 -0
  74. package/models/components/analyticsmetricbyscope.d.ts.map +1 -0
  75. package/models/components/analyticsmetricbyscope.js +57 -0
  76. package/models/components/analyticsmetricbyscope.js.map +1 -0
  77. package/models/components/analyticsmetricentry.d.ts +12 -0
  78. package/models/components/analyticsmetricentry.d.ts.map +1 -0
  79. package/models/components/analyticsmetricentry.js +52 -0
  80. package/models/components/analyticsmetricentry.js.map +1 -0
  81. package/models/components/analyticsmypercentiles.d.ts +16 -0
  82. package/models/components/analyticsmypercentiles.d.ts.map +1 -0
  83. package/models/components/analyticsmypercentiles.js +58 -0
  84. package/models/components/analyticsmypercentiles.js.map +1 -0
  85. package/models/components/analyticspercentile.d.ts +12 -0
  86. package/models/components/analyticspercentile.d.ts.map +1 -0
  87. package/models/components/analyticspercentile.js +52 -0
  88. package/models/components/analyticspercentile.js.map +1 -0
  89. package/models/components/analyticsscopebucket.d.ts +29 -0
  90. package/models/components/analyticsscopebucket.d.ts.map +1 -0
  91. package/models/components/analyticsscopebucket.js +54 -0
  92. package/models/components/analyticsscopebucket.js.map +1 -0
  93. package/models/components/analyticsscopeentry.d.ts +12 -0
  94. package/models/components/analyticsscopeentry.d.ts.map +1 -0
  95. package/models/components/analyticsscopeentry.js +57 -0
  96. package/models/components/analyticsscopeentry.js.map +1 -0
  97. package/models/components/analyticssummary.d.ts +16 -0
  98. package/models/components/analyticssummary.d.ts.map +1 -0
  99. package/models/components/analyticssummary.js +56 -0
  100. package/models/components/analyticssummary.js.map +1 -0
  101. package/models/components/analyticstrend.d.ts +15 -0
  102. package/models/components/analyticstrend.d.ts.map +1 -0
  103. package/models/components/analyticstrend.js +57 -0
  104. package/models/components/analyticstrend.js.map +1 -0
  105. package/models/components/analyticstrendpoint.d.ts +14 -0
  106. package/models/components/analyticstrendpoint.d.ts.map +1 -0
  107. package/models/components/analyticstrendpoint.js +54 -0
  108. package/models/components/analyticstrendpoint.js.map +1 -0
  109. package/models/components/index.d.ts +20 -0
  110. package/models/components/index.d.ts.map +1 -1
  111. package/models/components/index.js +20 -0
  112. package/models/components/index.js.map +1 -1
  113. package/models/operations/analyticsgetbivariate.d.ts +15 -0
  114. package/models/operations/analyticsgetbivariate.d.ts.map +1 -0
  115. package/models/operations/analyticsgetbivariate.js +58 -0
  116. package/models/operations/analyticsgetbivariate.js.map +1 -0
  117. package/models/operations/analyticsgetdistribution.d.ts +15 -0
  118. package/models/operations/analyticsgetdistribution.d.ts.map +1 -0
  119. package/models/operations/analyticsgetdistribution.js +59 -0
  120. package/models/operations/analyticsgetdistribution.js.map +1 -0
  121. package/models/operations/analyticsgetmetricbyscope.d.ts +15 -0
  122. package/models/operations/analyticsgetmetricbyscope.d.ts.map +1 -0
  123. package/models/operations/analyticsgetmetricbyscope.js +59 -0
  124. package/models/operations/analyticsgetmetricbyscope.js.map +1 -0
  125. package/models/operations/analyticsgetmypercentiles.d.ts +15 -0
  126. package/models/operations/analyticsgetmypercentiles.d.ts.map +1 -0
  127. package/models/operations/analyticsgetmypercentiles.js +59 -0
  128. package/models/operations/analyticsgetmypercentiles.js.map +1 -0
  129. package/models/operations/analyticsgettrend.d.ts +15 -0
  130. package/models/operations/analyticsgettrend.d.ts.map +1 -0
  131. package/models/operations/analyticsgettrend.js +58 -0
  132. package/models/operations/analyticsgettrend.js.map +1 -0
  133. package/models/operations/analyticslistmetrics.d.ts +15 -0
  134. package/models/operations/analyticslistmetrics.d.ts.map +1 -0
  135. package/models/operations/analyticslistmetrics.js +59 -0
  136. package/models/operations/analyticslistmetrics.js.map +1 -0
  137. package/models/operations/index.d.ts +6 -0
  138. package/models/operations/index.d.ts.map +1 -1
  139. package/models/operations/index.js +6 -0
  140. package/models/operations/index.js.map +1 -1
  141. package/package.json +1 -1
  142. package/sdk/analytics.d.ts +25 -0
  143. package/sdk/analytics.d.ts.map +1 -1
  144. package/sdk/analytics.js +42 -0
  145. package/sdk/analytics.js.map +1 -1
  146. package/src/funcs/analyticsGetBivariate.ts +188 -0
  147. package/src/funcs/analyticsGetDistribution.ts +190 -0
  148. package/src/funcs/analyticsGetMetricByScope.ts +190 -0
  149. package/src/funcs/analyticsGetMyPercentiles.ts +190 -0
  150. package/src/funcs/analyticsGetTrend.ts +188 -0
  151. package/src/funcs/analyticsListMetrics.ts +165 -0
  152. package/src/lib/config.ts +2 -2
  153. package/src/models/components/analyticsbin.ts +41 -0
  154. package/src/models/components/analyticsbivariate.ts +45 -0
  155. package/src/models/components/analyticsbivariatebucket.ts +41 -0
  156. package/src/models/components/analyticsdistribution.ts +48 -0
  157. package/src/models/components/analyticsdomainentry.ts +43 -0
  158. package/src/models/components/analyticsgetbivariaterequestbody.ts +84 -0
  159. package/src/models/components/analyticsgetdistributionrequestbody.ts +59 -0
  160. package/src/models/components/analyticsgetmetricbyscoperequestbody.ts +91 -0
  161. package/src/models/components/analyticsgetmypercentilesrequestbody.ts +47 -0
  162. package/src/models/components/analyticsgettrendrequestbody.ts +86 -0
  163. package/src/models/components/analyticslistmetricsresponsebody.ts +45 -0
  164. package/src/models/components/analyticsmetricbyscope.ts +45 -0
  165. package/src/models/components/analyticsmetricentry.ts +35 -0
  166. package/src/models/components/analyticsmypercentiles.ts +47 -0
  167. package/src/models/components/analyticspercentile.ts +35 -0
  168. package/src/models/components/analyticsscopebucket.ts +54 -0
  169. package/src/models/components/analyticsscopeentry.ts +40 -0
  170. package/src/models/components/analyticssummary.ts +43 -0
  171. package/src/models/components/analyticstrend.ts +45 -0
  172. package/src/models/components/analyticstrendpoint.ts +39 -0
  173. package/src/models/components/index.ts +20 -0
  174. package/src/models/operations/analyticsgetbivariate.ts +43 -0
  175. package/src/models/operations/analyticsgetdistribution.ts +44 -0
  176. package/src/models/operations/analyticsgetmetricbyscope.ts +44 -0
  177. package/src/models/operations/analyticsgetmypercentiles.ts +44 -0
  178. package/src/models/operations/analyticsgettrend.ts +43 -0
  179. package/src/models/operations/analyticslistmetrics.ts +46 -0
  180. package/src/models/operations/index.ts +6 -0
  181. package/src/sdk/analytics.ts +89 -0
@@ -0,0 +1,190 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { SteamSetsCore } from "../core.js";
6
+ import { encodeJSON } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import * as components from "../models/components/index.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import { SteamSetsError } from "../models/errors/steamsetserror.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { APICall, APIPromise } from "../types/async.js";
28
+ import { Result } from "../types/fp.js";
29
+
30
+ /**
31
+ * Per-metric percentile rank for the logged-in user in the chosen scope
32
+ */
33
+ export function analyticsGetMyPercentiles(
34
+ client: SteamSetsCore,
35
+ request: components.AnalyticsGetMyPercentilesRequestBody,
36
+ options?: RequestOptions,
37
+ ): APIPromise<
38
+ Result<
39
+ operations.AnalyticsGetMyPercentilesResponse,
40
+ | errors.ErrorModel
41
+ | SteamSetsError
42
+ | ResponseValidationError
43
+ | ConnectionError
44
+ | RequestAbortedError
45
+ | RequestTimeoutError
46
+ | InvalidRequestError
47
+ | UnexpectedClientError
48
+ | SDKValidationError
49
+ >
50
+ > {
51
+ return new APIPromise($do(
52
+ client,
53
+ request,
54
+ options,
55
+ ));
56
+ }
57
+
58
+ async function $do(
59
+ client: SteamSetsCore,
60
+ request: components.AnalyticsGetMyPercentilesRequestBody,
61
+ options?: RequestOptions,
62
+ ): Promise<
63
+ [
64
+ Result<
65
+ operations.AnalyticsGetMyPercentilesResponse,
66
+ | errors.ErrorModel
67
+ | SteamSetsError
68
+ | ResponseValidationError
69
+ | ConnectionError
70
+ | RequestAbortedError
71
+ | RequestTimeoutError
72
+ | InvalidRequestError
73
+ | UnexpectedClientError
74
+ | SDKValidationError
75
+ >,
76
+ APICall,
77
+ ]
78
+ > {
79
+ const parsed = safeParse(
80
+ request,
81
+ (value) =>
82
+ components.AnalyticsGetMyPercentilesRequestBody$outboundSchema.parse(
83
+ value,
84
+ ),
85
+ "Input validation failed",
86
+ );
87
+ if (!parsed.ok) {
88
+ return [parsed, { status: "invalid" }];
89
+ }
90
+ const payload = parsed.value;
91
+ const body = encodeJSON("body", payload, { explode: true });
92
+
93
+ const path = pathToFunc("/v1/analytics.getMyPercentiles")();
94
+
95
+ const headers = new Headers(compactMap({
96
+ "Content-Type": "application/json",
97
+ Accept: "application/json",
98
+ }));
99
+
100
+ const secConfig = await extractSecurity(client._options.token);
101
+ const securityInput = secConfig == null ? {} : { token: secConfig };
102
+ const requestSecurity = resolveGlobalSecurity(securityInput);
103
+
104
+ const context = {
105
+ options: client._options,
106
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
107
+ operationID: "analytics.getMyPercentiles",
108
+ oAuth2Scopes: null,
109
+
110
+ resolvedSecurity: requestSecurity,
111
+
112
+ securitySource: client._options.token,
113
+ retryConfig: options?.retries
114
+ || client._options.retryConfig
115
+ || {
116
+ strategy: "backoff",
117
+ backoff: {
118
+ initialInterval: 500,
119
+ maxInterval: 5000,
120
+ exponent: 1.5,
121
+ maxElapsedTime: 60000,
122
+ },
123
+ retryConnectionErrors: true,
124
+ }
125
+ || { strategy: "none" },
126
+ retryCodes: options?.retryCodes || ["501", "502", "503", "504"],
127
+ };
128
+
129
+ const requestRes = client._createRequest(context, {
130
+ security: requestSecurity,
131
+ method: "POST",
132
+ baseURL: options?.serverURL,
133
+ path: path,
134
+ headers: headers,
135
+ body: body,
136
+ uaHeader: "x-speakeasy-user-agent",
137
+ userAgent: client._options.userAgent,
138
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
139
+ }, options);
140
+ if (!requestRes.ok) {
141
+ return [requestRes, { status: "invalid" }];
142
+ }
143
+ const req = requestRes.value;
144
+
145
+ const doResult = await client._do(req, {
146
+ context,
147
+ isErrorStatusCode: (statusCode: number) =>
148
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
149
+ retryConfig: context.retryConfig,
150
+ retryCodes: context.retryCodes,
151
+ });
152
+ if (!doResult.ok) {
153
+ return [doResult, { status: "request-error", request: req }];
154
+ }
155
+ const response = doResult.value;
156
+
157
+ const responseFields = {
158
+ HttpMeta: { Response: response, Request: req },
159
+ };
160
+
161
+ const [result] = await M.match<
162
+ operations.AnalyticsGetMyPercentilesResponse,
163
+ | errors.ErrorModel
164
+ | SteamSetsError
165
+ | ResponseValidationError
166
+ | ConnectionError
167
+ | RequestAbortedError
168
+ | RequestTimeoutError
169
+ | InvalidRequestError
170
+ | UnexpectedClientError
171
+ | SDKValidationError
172
+ >(
173
+ M.json(200, operations.AnalyticsGetMyPercentilesResponse$inboundSchema, {
174
+ key: "AnalyticsMyPercentiles",
175
+ }),
176
+ M.jsonErr([400, 401, 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
+ }
@@ -0,0 +1,188 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { SteamSetsCore } from "../core.js";
6
+ import { encodeJSON } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import * as components from "../models/components/index.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import { SteamSetsError } from "../models/errors/steamsetserror.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { APICall, APIPromise } from "../types/async.js";
28
+ import { Result } from "../types/fp.js";
29
+
30
+ /**
31
+ * Daily quantiles over a window for a metric in a scope
32
+ */
33
+ export function analyticsGetTrend(
34
+ client: SteamSetsCore,
35
+ request: components.AnalyticsGetTrendRequestBody,
36
+ options?: RequestOptions,
37
+ ): APIPromise<
38
+ Result<
39
+ operations.AnalyticsGetTrendResponse,
40
+ | errors.ErrorModel
41
+ | SteamSetsError
42
+ | ResponseValidationError
43
+ | ConnectionError
44
+ | RequestAbortedError
45
+ | RequestTimeoutError
46
+ | InvalidRequestError
47
+ | UnexpectedClientError
48
+ | SDKValidationError
49
+ >
50
+ > {
51
+ return new APIPromise($do(
52
+ client,
53
+ request,
54
+ options,
55
+ ));
56
+ }
57
+
58
+ async function $do(
59
+ client: SteamSetsCore,
60
+ request: components.AnalyticsGetTrendRequestBody,
61
+ options?: RequestOptions,
62
+ ): Promise<
63
+ [
64
+ Result<
65
+ operations.AnalyticsGetTrendResponse,
66
+ | errors.ErrorModel
67
+ | SteamSetsError
68
+ | ResponseValidationError
69
+ | ConnectionError
70
+ | RequestAbortedError
71
+ | RequestTimeoutError
72
+ | InvalidRequestError
73
+ | UnexpectedClientError
74
+ | SDKValidationError
75
+ >,
76
+ APICall,
77
+ ]
78
+ > {
79
+ const parsed = safeParse(
80
+ request,
81
+ (value) =>
82
+ components.AnalyticsGetTrendRequestBody$outboundSchema.parse(value),
83
+ "Input validation failed",
84
+ );
85
+ if (!parsed.ok) {
86
+ return [parsed, { status: "invalid" }];
87
+ }
88
+ const payload = parsed.value;
89
+ const body = encodeJSON("body", payload, { explode: true });
90
+
91
+ const path = pathToFunc("/v1/analytics.getTrend")();
92
+
93
+ const headers = new Headers(compactMap({
94
+ "Content-Type": "application/json",
95
+ Accept: "application/json",
96
+ }));
97
+
98
+ const secConfig = await extractSecurity(client._options.token);
99
+ const securityInput = secConfig == null ? {} : { token: secConfig };
100
+ const requestSecurity = resolveGlobalSecurity(securityInput);
101
+
102
+ const context = {
103
+ options: client._options,
104
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
105
+ operationID: "analytics.getTrend",
106
+ oAuth2Scopes: null,
107
+
108
+ resolvedSecurity: requestSecurity,
109
+
110
+ securitySource: client._options.token,
111
+ retryConfig: options?.retries
112
+ || client._options.retryConfig
113
+ || {
114
+ strategy: "backoff",
115
+ backoff: {
116
+ initialInterval: 500,
117
+ maxInterval: 5000,
118
+ exponent: 1.5,
119
+ maxElapsedTime: 60000,
120
+ },
121
+ retryConnectionErrors: true,
122
+ }
123
+ || { strategy: "none" },
124
+ retryCodes: options?.retryCodes || ["501", "502", "503", "504"],
125
+ };
126
+
127
+ const requestRes = client._createRequest(context, {
128
+ security: requestSecurity,
129
+ method: "POST",
130
+ baseURL: options?.serverURL,
131
+ path: path,
132
+ headers: headers,
133
+ body: body,
134
+ uaHeader: "x-speakeasy-user-agent",
135
+ userAgent: client._options.userAgent,
136
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
137
+ }, options);
138
+ if (!requestRes.ok) {
139
+ return [requestRes, { status: "invalid" }];
140
+ }
141
+ const req = requestRes.value;
142
+
143
+ const doResult = await client._do(req, {
144
+ context,
145
+ isErrorStatusCode: (statusCode: number) =>
146
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
147
+ retryConfig: context.retryConfig,
148
+ retryCodes: context.retryCodes,
149
+ });
150
+ if (!doResult.ok) {
151
+ return [doResult, { status: "request-error", request: req }];
152
+ }
153
+ const response = doResult.value;
154
+
155
+ const responseFields = {
156
+ HttpMeta: { Response: response, Request: req },
157
+ };
158
+
159
+ const [result] = await M.match<
160
+ operations.AnalyticsGetTrendResponse,
161
+ | errors.ErrorModel
162
+ | SteamSetsError
163
+ | ResponseValidationError
164
+ | ConnectionError
165
+ | RequestAbortedError
166
+ | RequestTimeoutError
167
+ | InvalidRequestError
168
+ | UnexpectedClientError
169
+ | SDKValidationError
170
+ >(
171
+ M.json(200, operations.AnalyticsGetTrendResponse$inboundSchema, {
172
+ key: "AnalyticsTrend",
173
+ }),
174
+ M.jsonErr([400, 422], errors.ErrorModel$inboundSchema, {
175
+ ctype: "application/problem+json",
176
+ }),
177
+ M.jsonErr(500, errors.ErrorModel$inboundSchema, {
178
+ ctype: "application/problem+json",
179
+ }),
180
+ M.fail("4XX"),
181
+ M.fail("5XX"),
182
+ )(response, req, { extraFields: responseFields });
183
+ if (!result.ok) {
184
+ return [result, { status: "complete", request: req, response }];
185
+ }
186
+
187
+ return [result, { status: "complete", request: req, response }];
188
+ }
@@ -0,0 +1,165 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { SteamSetsCore } from "../core.js";
6
+ import { matchStatusCode } from "../lib/http.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.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 {
13
+ ConnectionError,
14
+ InvalidRequestError,
15
+ RequestAbortedError,
16
+ RequestTimeoutError,
17
+ UnexpectedClientError,
18
+ } from "../models/errors/httpclienterrors.js";
19
+ import * as errors from "../models/errors/index.js";
20
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
21
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
22
+ import { SteamSetsError } from "../models/errors/steamsetserror.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
+ /**
28
+ * List every analytics domain, metric, and scope the data-library can serve
29
+ */
30
+ export function analyticsListMetrics(
31
+ client: SteamSetsCore,
32
+ options?: RequestOptions,
33
+ ): APIPromise<
34
+ Result<
35
+ operations.AnalyticsListMetricsResponse,
36
+ | errors.ErrorModel
37
+ | SteamSetsError
38
+ | ResponseValidationError
39
+ | ConnectionError
40
+ | RequestAbortedError
41
+ | RequestTimeoutError
42
+ | InvalidRequestError
43
+ | UnexpectedClientError
44
+ | SDKValidationError
45
+ >
46
+ > {
47
+ return new APIPromise($do(
48
+ client,
49
+ options,
50
+ ));
51
+ }
52
+
53
+ async function $do(
54
+ client: SteamSetsCore,
55
+ options?: RequestOptions,
56
+ ): Promise<
57
+ [
58
+ Result<
59
+ operations.AnalyticsListMetricsResponse,
60
+ | errors.ErrorModel
61
+ | SteamSetsError
62
+ | ResponseValidationError
63
+ | ConnectionError
64
+ | RequestAbortedError
65
+ | RequestTimeoutError
66
+ | InvalidRequestError
67
+ | UnexpectedClientError
68
+ | SDKValidationError
69
+ >,
70
+ APICall,
71
+ ]
72
+ > {
73
+ const path = pathToFunc("/v1/analytics.listMetrics")();
74
+
75
+ const headers = new Headers(compactMap({
76
+ Accept: "application/json",
77
+ }));
78
+
79
+ const secConfig = await extractSecurity(client._options.token);
80
+ const securityInput = secConfig == null ? {} : { token: secConfig };
81
+ const requestSecurity = resolveGlobalSecurity(securityInput);
82
+
83
+ const context = {
84
+ options: client._options,
85
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
86
+ operationID: "analytics.listMetrics",
87
+ oAuth2Scopes: null,
88
+
89
+ resolvedSecurity: requestSecurity,
90
+
91
+ securitySource: client._options.token,
92
+ retryConfig: options?.retries
93
+ || client._options.retryConfig
94
+ || {
95
+ strategy: "backoff",
96
+ backoff: {
97
+ initialInterval: 500,
98
+ maxInterval: 5000,
99
+ exponent: 1.5,
100
+ maxElapsedTime: 60000,
101
+ },
102
+ retryConnectionErrors: true,
103
+ }
104
+ || { strategy: "none" },
105
+ retryCodes: options?.retryCodes || ["501", "502", "503", "504"],
106
+ };
107
+
108
+ const requestRes = client._createRequest(context, {
109
+ security: requestSecurity,
110
+ method: "POST",
111
+ baseURL: options?.serverURL,
112
+ path: path,
113
+ headers: headers,
114
+ uaHeader: "x-speakeasy-user-agent",
115
+ userAgent: client._options.userAgent,
116
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
117
+ }, options);
118
+ if (!requestRes.ok) {
119
+ return [requestRes, { status: "invalid" }];
120
+ }
121
+ const req = requestRes.value;
122
+
123
+ const doResult = await client._do(req, {
124
+ context,
125
+ isErrorStatusCode: (statusCode: number) =>
126
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
127
+ retryConfig: context.retryConfig,
128
+ retryCodes: context.retryCodes,
129
+ });
130
+ if (!doResult.ok) {
131
+ return [doResult, { status: "request-error", request: req }];
132
+ }
133
+ const response = doResult.value;
134
+
135
+ const responseFields = {
136
+ HttpMeta: { Response: response, Request: req },
137
+ };
138
+
139
+ const [result] = await M.match<
140
+ operations.AnalyticsListMetricsResponse,
141
+ | errors.ErrorModel
142
+ | SteamSetsError
143
+ | ResponseValidationError
144
+ | ConnectionError
145
+ | RequestAbortedError
146
+ | RequestTimeoutError
147
+ | InvalidRequestError
148
+ | UnexpectedClientError
149
+ | SDKValidationError
150
+ >(
151
+ M.json(200, operations.AnalyticsListMetricsResponse$inboundSchema, {
152
+ key: "AnalyticsListMetricsResponseBody",
153
+ }),
154
+ M.jsonErr(500, errors.ErrorModel$inboundSchema, {
155
+ ctype: "application/problem+json",
156
+ }),
157
+ M.fail("4XX"),
158
+ M.fail("5XX"),
159
+ )(response, req, { extraFields: responseFields });
160
+ if (!result.ok) {
161
+ return [result, { status: "complete", request: req, response }];
162
+ }
163
+
164
+ return [result, { status: "complete", request: req, response }];
165
+ }
package/src/lib/config.ts CHANGED
@@ -59,8 +59,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
59
59
  export const SDK_METADATA = {
60
60
  language: "typescript",
61
61
  openapiDocVersion: "1.0.0",
62
- sdkVersion: "0.34.5",
62
+ sdkVersion: "0.34.7",
63
63
  genVersion: "2.882.0",
64
64
  userAgent:
65
- "speakeasy-sdk/typescript 0.34.5 2.882.0 1.0.0 @steamsets/client-ts",
65
+ "speakeasy-sdk/typescript 0.34.7 2.882.0 1.0.0 @steamsets/client-ts",
66
66
  } as const;
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type AnalyticsBin = {
12
+ count: number;
13
+ xLower: number;
14
+ xUpper: number;
15
+ };
16
+
17
+ /** @internal */
18
+ export const AnalyticsBin$inboundSchema: z.ZodType<
19
+ AnalyticsBin,
20
+ z.ZodTypeDef,
21
+ unknown
22
+ > = z.object({
23
+ count: z.number(),
24
+ x_lower: z.number(),
25
+ x_upper: z.number(),
26
+ }).transform((v) => {
27
+ return remap$(v, {
28
+ "x_lower": "xLower",
29
+ "x_upper": "xUpper",
30
+ });
31
+ });
32
+
33
+ export function analyticsBinFromJSON(
34
+ jsonString: string,
35
+ ): SafeParseResult<AnalyticsBin, SDKValidationError> {
36
+ return safeParse(
37
+ jsonString,
38
+ (x) => AnalyticsBin$inboundSchema.parse(JSON.parse(x)),
39
+ `Failed to parse 'AnalyticsBin' from JSON`,
40
+ );
41
+ }
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ AnalyticsBivariateBucket,
12
+ AnalyticsBivariateBucket$inboundSchema,
13
+ } from "./analyticsbivariatebucket.js";
14
+
15
+ export type AnalyticsBivariate = {
16
+ /**
17
+ * A URL to the JSON Schema for this object.
18
+ */
19
+ dollarSchema?: string | undefined;
20
+ buckets: Array<AnalyticsBivariateBucket> | null;
21
+ };
22
+
23
+ /** @internal */
24
+ export const AnalyticsBivariate$inboundSchema: z.ZodType<
25
+ AnalyticsBivariate,
26
+ z.ZodTypeDef,
27
+ unknown
28
+ > = z.object({
29
+ $schema: z.string().optional(),
30
+ buckets: z.nullable(z.array(AnalyticsBivariateBucket$inboundSchema)),
31
+ }).transform((v) => {
32
+ return remap$(v, {
33
+ "$schema": "dollarSchema",
34
+ });
35
+ });
36
+
37
+ export function analyticsBivariateFromJSON(
38
+ jsonString: string,
39
+ ): SafeParseResult<AnalyticsBivariate, SDKValidationError> {
40
+ return safeParse(
41
+ jsonString,
42
+ (x) => AnalyticsBivariate$inboundSchema.parse(JSON.parse(x)),
43
+ `Failed to parse 'AnalyticsBivariate' from JSON`,
44
+ );
45
+ }
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type AnalyticsBivariateBucket = {
12
+ count: number;
13
+ xBucket: number;
14
+ yValue: number;
15
+ };
16
+
17
+ /** @internal */
18
+ export const AnalyticsBivariateBucket$inboundSchema: z.ZodType<
19
+ AnalyticsBivariateBucket,
20
+ z.ZodTypeDef,
21
+ unknown
22
+ > = z.object({
23
+ count: z.number().int(),
24
+ x_bucket: z.number(),
25
+ y_value: z.number(),
26
+ }).transform((v) => {
27
+ return remap$(v, {
28
+ "x_bucket": "xBucket",
29
+ "y_value": "yValue",
30
+ });
31
+ });
32
+
33
+ export function analyticsBivariateBucketFromJSON(
34
+ jsonString: string,
35
+ ): SafeParseResult<AnalyticsBivariateBucket, SDKValidationError> {
36
+ return safeParse(
37
+ jsonString,
38
+ (x) => AnalyticsBivariateBucket$inboundSchema.parse(JSON.parse(x)),
39
+ `Failed to parse 'AnalyticsBivariateBucket' from JSON`,
40
+ );
41
+ }