@steamsets/client-ts 0.34.5 → 0.34.6

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 (156) hide show
  1. package/README.md +10 -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/analyticsGetMyPercentiles.d.ts +16 -0
  11. package/funcs/analyticsGetMyPercentiles.d.ts.map +1 -0
  12. package/funcs/analyticsGetMyPercentiles.js +134 -0
  13. package/funcs/analyticsGetMyPercentiles.js.map +1 -0
  14. package/funcs/analyticsGetTrend.d.ts +16 -0
  15. package/funcs/analyticsGetTrend.d.ts.map +1 -0
  16. package/funcs/analyticsGetTrend.js +134 -0
  17. package/funcs/analyticsGetTrend.js.map +1 -0
  18. package/funcs/analyticsListMetrics.d.ts +15 -0
  19. package/funcs/analyticsListMetrics.d.ts.map +1 -0
  20. package/funcs/analyticsListMetrics.js +121 -0
  21. package/funcs/analyticsListMetrics.js.map +1 -0
  22. package/jsr.json +1 -1
  23. package/lib/config.d.ts +2 -2
  24. package/lib/config.js +2 -2
  25. package/models/components/analyticsbin.d.ts +12 -0
  26. package/models/components/analyticsbin.d.ts.map +1 -0
  27. package/models/components/analyticsbin.js +58 -0
  28. package/models/components/analyticsbin.js.map +1 -0
  29. package/models/components/analyticsbivariate.d.ts +15 -0
  30. package/models/components/analyticsbivariate.d.ts.map +1 -0
  31. package/models/components/analyticsbivariate.js +57 -0
  32. package/models/components/analyticsbivariate.js.map +1 -0
  33. package/models/components/analyticsbivariatebucket.d.ts +12 -0
  34. package/models/components/analyticsbivariatebucket.d.ts.map +1 -0
  35. package/models/components/analyticsbivariatebucket.js +58 -0
  36. package/models/components/analyticsbivariatebucket.js.map +1 -0
  37. package/models/components/analyticsdistribution.d.ts +17 -0
  38. package/models/components/analyticsdistribution.d.ts.map +1 -0
  39. package/models/components/analyticsdistribution.js +59 -0
  40. package/models/components/analyticsdistribution.js.map +1 -0
  41. package/models/components/analyticsdomainentry.d.ts +14 -0
  42. package/models/components/analyticsdomainentry.d.ts.map +1 -0
  43. package/models/components/analyticsdomainentry.js +54 -0
  44. package/models/components/analyticsdomainentry.js.map +1 -0
  45. package/models/components/analyticsgetbivariaterequestbody.d.ts +46 -0
  46. package/models/components/analyticsgetbivariaterequestbody.d.ts.map +1 -0
  47. package/models/components/analyticsgetbivariaterequestbody.js +69 -0
  48. package/models/components/analyticsgetbivariaterequestbody.js.map +1 -0
  49. package/models/components/analyticsgetdistributionrequestbody.d.ts +30 -0
  50. package/models/components/analyticsgetdistributionrequestbody.d.ts.map +1 -0
  51. package/models/components/analyticsgetdistributionrequestbody.js +57 -0
  52. package/models/components/analyticsgetdistributionrequestbody.js.map +1 -0
  53. package/models/components/analyticsgetmypercentilesrequestbody.d.ts +16 -0
  54. package/models/components/analyticsgetmypercentilesrequestbody.d.ts.map +1 -0
  55. package/models/components/analyticsgetmypercentilesrequestbody.js +56 -0
  56. package/models/components/analyticsgetmypercentilesrequestbody.js.map +1 -0
  57. package/models/components/analyticsgettrendrequestbody.d.ts +47 -0
  58. package/models/components/analyticsgettrendrequestbody.d.ts.map +1 -0
  59. package/models/components/analyticsgettrendrequestbody.js +68 -0
  60. package/models/components/analyticsgettrendrequestbody.js.map +1 -0
  61. package/models/components/analyticslistmetricsresponsebody.d.ts +15 -0
  62. package/models/components/analyticslistmetricsresponsebody.d.ts.map +1 -0
  63. package/models/components/analyticslistmetricsresponsebody.js +57 -0
  64. package/models/components/analyticslistmetricsresponsebody.js.map +1 -0
  65. package/models/components/analyticsmetricentry.d.ts +12 -0
  66. package/models/components/analyticsmetricentry.d.ts.map +1 -0
  67. package/models/components/analyticsmetricentry.js +52 -0
  68. package/models/components/analyticsmetricentry.js.map +1 -0
  69. package/models/components/analyticsmypercentiles.d.ts +16 -0
  70. package/models/components/analyticsmypercentiles.d.ts.map +1 -0
  71. package/models/components/analyticsmypercentiles.js +58 -0
  72. package/models/components/analyticsmypercentiles.js.map +1 -0
  73. package/models/components/analyticspercentile.d.ts +12 -0
  74. package/models/components/analyticspercentile.d.ts.map +1 -0
  75. package/models/components/analyticspercentile.js +52 -0
  76. package/models/components/analyticspercentile.js.map +1 -0
  77. package/models/components/analyticsscopeentry.d.ts +12 -0
  78. package/models/components/analyticsscopeentry.d.ts.map +1 -0
  79. package/models/components/analyticsscopeentry.js +57 -0
  80. package/models/components/analyticsscopeentry.js.map +1 -0
  81. package/models/components/analyticssummary.d.ts +16 -0
  82. package/models/components/analyticssummary.d.ts.map +1 -0
  83. package/models/components/analyticssummary.js +56 -0
  84. package/models/components/analyticssummary.js.map +1 -0
  85. package/models/components/analyticstrend.d.ts +15 -0
  86. package/models/components/analyticstrend.d.ts.map +1 -0
  87. package/models/components/analyticstrend.js +57 -0
  88. package/models/components/analyticstrend.js.map +1 -0
  89. package/models/components/analyticstrendpoint.d.ts +14 -0
  90. package/models/components/analyticstrendpoint.d.ts.map +1 -0
  91. package/models/components/analyticstrendpoint.js +54 -0
  92. package/models/components/analyticstrendpoint.js.map +1 -0
  93. package/models/components/index.d.ts +17 -0
  94. package/models/components/index.d.ts.map +1 -1
  95. package/models/components/index.js +17 -0
  96. package/models/components/index.js.map +1 -1
  97. package/models/operations/analyticsgetbivariate.d.ts +15 -0
  98. package/models/operations/analyticsgetbivariate.d.ts.map +1 -0
  99. package/models/operations/analyticsgetbivariate.js +58 -0
  100. package/models/operations/analyticsgetbivariate.js.map +1 -0
  101. package/models/operations/analyticsgetdistribution.d.ts +15 -0
  102. package/models/operations/analyticsgetdistribution.d.ts.map +1 -0
  103. package/models/operations/analyticsgetdistribution.js +59 -0
  104. package/models/operations/analyticsgetdistribution.js.map +1 -0
  105. package/models/operations/analyticsgetmypercentiles.d.ts +15 -0
  106. package/models/operations/analyticsgetmypercentiles.d.ts.map +1 -0
  107. package/models/operations/analyticsgetmypercentiles.js +59 -0
  108. package/models/operations/analyticsgetmypercentiles.js.map +1 -0
  109. package/models/operations/analyticsgettrend.d.ts +15 -0
  110. package/models/operations/analyticsgettrend.d.ts.map +1 -0
  111. package/models/operations/analyticsgettrend.js +58 -0
  112. package/models/operations/analyticsgettrend.js.map +1 -0
  113. package/models/operations/analyticslistmetrics.d.ts +15 -0
  114. package/models/operations/analyticslistmetrics.d.ts.map +1 -0
  115. package/models/operations/analyticslistmetrics.js +59 -0
  116. package/models/operations/analyticslistmetrics.js.map +1 -0
  117. package/models/operations/index.d.ts +5 -0
  118. package/models/operations/index.d.ts.map +1 -1
  119. package/models/operations/index.js +5 -0
  120. package/models/operations/index.js.map +1 -1
  121. package/package.json +1 -1
  122. package/sdk/analytics.d.ts +21 -0
  123. package/sdk/analytics.d.ts.map +1 -1
  124. package/sdk/analytics.js +35 -0
  125. package/sdk/analytics.js.map +1 -1
  126. package/src/funcs/analyticsGetBivariate.ts +188 -0
  127. package/src/funcs/analyticsGetDistribution.ts +190 -0
  128. package/src/funcs/analyticsGetMyPercentiles.ts +190 -0
  129. package/src/funcs/analyticsGetTrend.ts +188 -0
  130. package/src/funcs/analyticsListMetrics.ts +165 -0
  131. package/src/lib/config.ts +2 -2
  132. package/src/models/components/analyticsbin.ts +41 -0
  133. package/src/models/components/analyticsbivariate.ts +45 -0
  134. package/src/models/components/analyticsbivariatebucket.ts +41 -0
  135. package/src/models/components/analyticsdistribution.ts +48 -0
  136. package/src/models/components/analyticsdomainentry.ts +43 -0
  137. package/src/models/components/analyticsgetbivariaterequestbody.ts +81 -0
  138. package/src/models/components/analyticsgetdistributionrequestbody.ts +59 -0
  139. package/src/models/components/analyticsgetmypercentilesrequestbody.ts +44 -0
  140. package/src/models/components/analyticsgettrendrequestbody.ts +83 -0
  141. package/src/models/components/analyticslistmetricsresponsebody.ts +45 -0
  142. package/src/models/components/analyticsmetricentry.ts +35 -0
  143. package/src/models/components/analyticsmypercentiles.ts +47 -0
  144. package/src/models/components/analyticspercentile.ts +35 -0
  145. package/src/models/components/analyticsscopeentry.ts +40 -0
  146. package/src/models/components/analyticssummary.ts +43 -0
  147. package/src/models/components/analyticstrend.ts +45 -0
  148. package/src/models/components/analyticstrendpoint.ts +39 -0
  149. package/src/models/components/index.ts +17 -0
  150. package/src/models/operations/analyticsgetbivariate.ts +43 -0
  151. package/src/models/operations/analyticsgetdistribution.ts +44 -0
  152. package/src/models/operations/analyticsgetmypercentiles.ts +44 -0
  153. package/src/models/operations/analyticsgettrend.ts +43 -0
  154. package/src/models/operations/analyticslistmetrics.ts +46 -0
  155. package/src/models/operations/index.ts +5 -0
  156. package/src/sdk/analytics.ts +74 -0
@@ -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.6",
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.6 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
+ }
@@ -0,0 +1,48 @@
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 { AnalyticsBin, AnalyticsBin$inboundSchema } from "./analyticsbin.js";
11
+ import {
12
+ AnalyticsSummary,
13
+ AnalyticsSummary$inboundSchema,
14
+ } from "./analyticssummary.js";
15
+
16
+ export type AnalyticsDistribution = {
17
+ /**
18
+ * A URL to the JSON Schema for this object.
19
+ */
20
+ dollarSchema?: string | undefined;
21
+ bins: Array<AnalyticsBin> | null;
22
+ summary: AnalyticsSummary;
23
+ };
24
+
25
+ /** @internal */
26
+ export const AnalyticsDistribution$inboundSchema: z.ZodType<
27
+ AnalyticsDistribution,
28
+ z.ZodTypeDef,
29
+ unknown
30
+ > = z.object({
31
+ $schema: z.string().optional(),
32
+ bins: z.nullable(z.array(AnalyticsBin$inboundSchema)),
33
+ summary: AnalyticsSummary$inboundSchema,
34
+ }).transform((v) => {
35
+ return remap$(v, {
36
+ "$schema": "dollarSchema",
37
+ });
38
+ });
39
+
40
+ export function analyticsDistributionFromJSON(
41
+ jsonString: string,
42
+ ): SafeParseResult<AnalyticsDistribution, SDKValidationError> {
43
+ return safeParse(
44
+ jsonString,
45
+ (x) => AnalyticsDistribution$inboundSchema.parse(JSON.parse(x)),
46
+ `Failed to parse 'AnalyticsDistribution' from JSON`,
47
+ );
48
+ }
@@ -0,0 +1,43 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ AnalyticsMetricEntry,
11
+ AnalyticsMetricEntry$inboundSchema,
12
+ } from "./analyticsmetricentry.js";
13
+ import {
14
+ AnalyticsScopeEntry,
15
+ AnalyticsScopeEntry$inboundSchema,
16
+ } from "./analyticsscopeentry.js";
17
+
18
+ export type AnalyticsDomainEntry = {
19
+ id: string;
20
+ metrics: Array<AnalyticsMetricEntry> | null;
21
+ scopes: Array<AnalyticsScopeEntry> | null;
22
+ };
23
+
24
+ /** @internal */
25
+ export const AnalyticsDomainEntry$inboundSchema: z.ZodType<
26
+ AnalyticsDomainEntry,
27
+ z.ZodTypeDef,
28
+ unknown
29
+ > = z.object({
30
+ id: z.string(),
31
+ metrics: z.nullable(z.array(AnalyticsMetricEntry$inboundSchema)),
32
+ scopes: z.nullable(z.array(AnalyticsScopeEntry$inboundSchema)),
33
+ });
34
+
35
+ export function analyticsDomainEntryFromJSON(
36
+ jsonString: string,
37
+ ): SafeParseResult<AnalyticsDomainEntry, SDKValidationError> {
38
+ return safeParse(
39
+ jsonString,
40
+ (x) => AnalyticsDomainEntry$inboundSchema.parse(JSON.parse(x)),
41
+ `Failed to parse 'AnalyticsDomainEntry' from JSON`,
42
+ );
43
+ }
@@ -0,0 +1,81 @@
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 { ClosedEnum } from "../../types/enums.js";
8
+
9
+ /**
10
+ * How to aggregate Y inside each X bucket.
11
+ */
12
+ export const Agg = {
13
+ Avg: "avg",
14
+ Median: "median",
15
+ Count: "count",
16
+ } as const;
17
+ /**
18
+ * How to aggregate Y inside each X bucket.
19
+ */
20
+ export type Agg = ClosedEnum<typeof Agg>;
21
+
22
+ export type AnalyticsGetBivariateRequestBody = {
23
+ /**
24
+ * How to aggregate Y inside each X bucket.
25
+ */
26
+ agg: Agg;
27
+ domain: string;
28
+ scope: string;
29
+ scopeValue?: number | undefined;
30
+ /**
31
+ * Metric ID for the X axis (bucketed).
32
+ */
33
+ x: string;
34
+ /**
35
+ * Metric ID for the Y axis (aggregated within each X bucket).
36
+ */
37
+ y: string;
38
+ };
39
+
40
+ /** @internal */
41
+ export const Agg$outboundSchema: z.ZodNativeEnum<typeof Agg> = z.nativeEnum(
42
+ Agg,
43
+ );
44
+
45
+ /** @internal */
46
+ export type AnalyticsGetBivariateRequestBody$Outbound = {
47
+ agg: string;
48
+ domain: string;
49
+ scope: string;
50
+ scope_value?: number | undefined;
51
+ x: string;
52
+ y: string;
53
+ };
54
+
55
+ /** @internal */
56
+ export const AnalyticsGetBivariateRequestBody$outboundSchema: z.ZodType<
57
+ AnalyticsGetBivariateRequestBody$Outbound,
58
+ z.ZodTypeDef,
59
+ AnalyticsGetBivariateRequestBody
60
+ > = z.object({
61
+ agg: Agg$outboundSchema,
62
+ domain: z.string(),
63
+ scope: z.string(),
64
+ scopeValue: z.number().int().optional(),
65
+ x: z.string(),
66
+ y: z.string(),
67
+ }).transform((v) => {
68
+ return remap$(v, {
69
+ scopeValue: "scope_value",
70
+ });
71
+ });
72
+
73
+ export function analyticsGetBivariateRequestBodyToJSON(
74
+ analyticsGetBivariateRequestBody: AnalyticsGetBivariateRequestBody,
75
+ ): string {
76
+ return JSON.stringify(
77
+ AnalyticsGetBivariateRequestBody$outboundSchema.parse(
78
+ analyticsGetBivariateRequestBody,
79
+ ),
80
+ );
81
+ }