@steamsets/client-ts 0.34.6 → 0.34.8

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 (90) hide show
  1. package/README.md +4 -0
  2. package/funcs/analyticsGetInequality.d.ts +16 -0
  3. package/funcs/analyticsGetInequality.d.ts.map +1 -0
  4. package/funcs/analyticsGetInequality.js +134 -0
  5. package/funcs/analyticsGetInequality.js.map +1 -0
  6. package/funcs/analyticsGetMetricByScope.d.ts +16 -0
  7. package/funcs/analyticsGetMetricByScope.d.ts.map +1 -0
  8. package/funcs/analyticsGetMetricByScope.js +134 -0
  9. package/funcs/analyticsGetMetricByScope.js.map +1 -0
  10. package/jsr.json +1 -1
  11. package/lib/config.d.ts +2 -2
  12. package/lib/config.js +2 -2
  13. package/models/components/analyticsgetbivariaterequestbody.d.ts +5 -2
  14. package/models/components/analyticsgetbivariaterequestbody.d.ts.map +1 -1
  15. package/models/components/analyticsgetbivariaterequestbody.js +1 -1
  16. package/models/components/analyticsgetbivariaterequestbody.js.map +1 -1
  17. package/models/components/analyticsgetdistributionrequestbody.d.ts +3 -3
  18. package/models/components/analyticsgetdistributionrequestbody.js +1 -1
  19. package/models/components/analyticsgetdistributionrequestbody.js.map +1 -1
  20. package/models/components/analyticsgetinequalityrequestbody.d.ts +30 -0
  21. package/models/components/analyticsgetinequalityrequestbody.d.ts.map +1 -0
  22. package/models/components/analyticsgetinequalityrequestbody.js +57 -0
  23. package/models/components/analyticsgetinequalityrequestbody.js.map +1 -0
  24. package/models/components/analyticsgetmetricbyscoperequestbody.d.ts +58 -0
  25. package/models/components/analyticsgetmetricbyscoperequestbody.d.ts.map +1 -0
  26. package/models/components/analyticsgetmetricbyscoperequestbody.js +73 -0
  27. package/models/components/analyticsgetmetricbyscoperequestbody.js.map +1 -0
  28. package/models/components/analyticsgetmypercentilesrequestbody.d.ts +5 -2
  29. package/models/components/analyticsgetmypercentilesrequestbody.d.ts.map +1 -1
  30. package/models/components/analyticsgetmypercentilesrequestbody.js +1 -1
  31. package/models/components/analyticsgetmypercentilesrequestbody.js.map +1 -1
  32. package/models/components/analyticsgettrendrequestbody.d.ts +5 -2
  33. package/models/components/analyticsgettrendrequestbody.d.ts.map +1 -1
  34. package/models/components/analyticsgettrendrequestbody.js +1 -1
  35. package/models/components/analyticsgettrendrequestbody.js.map +1 -1
  36. package/models/components/analyticsinequality.d.ts +42 -0
  37. package/models/components/analyticsinequality.d.ts.map +1 -0
  38. package/models/components/analyticsinequality.js +63 -0
  39. package/models/components/analyticsinequality.js.map +1 -0
  40. package/models/components/analyticsinequalitypoint.d.ts +17 -0
  41. package/models/components/analyticsinequalitypoint.d.ts.map +1 -0
  42. package/models/components/analyticsinequalitypoint.js +51 -0
  43. package/models/components/analyticsinequalitypoint.js.map +1 -0
  44. package/models/components/analyticsmetricbyscope.d.ts +15 -0
  45. package/models/components/analyticsmetricbyscope.d.ts.map +1 -0
  46. package/models/components/analyticsmetricbyscope.js +57 -0
  47. package/models/components/analyticsmetricbyscope.js.map +1 -0
  48. package/models/components/analyticsscopebucket.d.ts +29 -0
  49. package/models/components/analyticsscopebucket.d.ts.map +1 -0
  50. package/models/components/analyticsscopebucket.js +54 -0
  51. package/models/components/analyticsscopebucket.js.map +1 -0
  52. package/models/components/index.d.ts +6 -0
  53. package/models/components/index.d.ts.map +1 -1
  54. package/models/components/index.js +6 -0
  55. package/models/components/index.js.map +1 -1
  56. package/models/operations/analyticsgetinequality.d.ts +15 -0
  57. package/models/operations/analyticsgetinequality.d.ts.map +1 -0
  58. package/models/operations/analyticsgetinequality.js +58 -0
  59. package/models/operations/analyticsgetinequality.js.map +1 -0
  60. package/models/operations/analyticsgetmetricbyscope.d.ts +15 -0
  61. package/models/operations/analyticsgetmetricbyscope.d.ts.map +1 -0
  62. package/models/operations/analyticsgetmetricbyscope.js +59 -0
  63. package/models/operations/analyticsgetmetricbyscope.js.map +1 -0
  64. package/models/operations/index.d.ts +2 -0
  65. package/models/operations/index.d.ts.map +1 -1
  66. package/models/operations/index.js +2 -0
  67. package/models/operations/index.js.map +1 -1
  68. package/package.json +1 -1
  69. package/sdk/analytics.d.ts +8 -0
  70. package/sdk/analytics.d.ts.map +1 -1
  71. package/sdk/analytics.js +14 -0
  72. package/sdk/analytics.js.map +1 -1
  73. package/src/funcs/analyticsGetInequality.ts +188 -0
  74. package/src/funcs/analyticsGetMetricByScope.ts +190 -0
  75. package/src/lib/config.ts +2 -2
  76. package/src/models/components/analyticsgetbivariaterequestbody.ts +6 -3
  77. package/src/models/components/analyticsgetdistributionrequestbody.ts +4 -4
  78. package/src/models/components/analyticsgetinequalityrequestbody.ts +59 -0
  79. package/src/models/components/analyticsgetmetricbyscoperequestbody.ts +91 -0
  80. package/src/models/components/analyticsgetmypercentilesrequestbody.ts +6 -3
  81. package/src/models/components/analyticsgettrendrequestbody.ts +6 -3
  82. package/src/models/components/analyticsinequality.ts +78 -0
  83. package/src/models/components/analyticsinequalitypoint.ts +39 -0
  84. package/src/models/components/analyticsmetricbyscope.ts +45 -0
  85. package/src/models/components/analyticsscopebucket.ts +54 -0
  86. package/src/models/components/index.ts +6 -0
  87. package/src/models/operations/analyticsgetinequality.ts +43 -0
  88. package/src/models/operations/analyticsgetmetricbyscope.ts +44 -0
  89. package/src/models/operations/index.ts +2 -0
  90. package/src/sdk/analytics.ts +30 -0
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.6",
62
+ sdkVersion: "0.34.8",
63
63
  genVersion: "2.882.0",
64
64
  userAgent:
65
- "speakeasy-sdk/typescript 0.34.6 2.882.0 1.0.0 @steamsets/client-ts",
65
+ "speakeasy-sdk/typescript 0.34.8 2.882.0 1.0.0 @steamsets/client-ts",
66
66
  } as const;
@@ -26,7 +26,10 @@ export type AnalyticsGetBivariateRequestBody = {
26
26
  agg: Agg;
27
27
  domain: string;
28
28
  scope: string;
29
- scopeValue?: number | undefined;
29
+ /**
30
+ * Country name/code or region name. Required for non-global scopes.
31
+ */
32
+ scopeValue?: string | undefined;
30
33
  /**
31
34
  * Metric ID for the X axis (bucketed).
32
35
  */
@@ -47,7 +50,7 @@ export type AnalyticsGetBivariateRequestBody$Outbound = {
47
50
  agg: string;
48
51
  domain: string;
49
52
  scope: string;
50
- scope_value?: number | undefined;
53
+ scope_value?: string | undefined;
51
54
  x: string;
52
55
  y: string;
53
56
  };
@@ -61,7 +64,7 @@ export const AnalyticsGetBivariateRequestBody$outboundSchema: z.ZodType<
61
64
  agg: Agg$outboundSchema,
62
65
  domain: z.string(),
63
66
  scope: z.string(),
64
- scopeValue: z.number().int().optional(),
67
+ scopeValue: z.string().optional(),
65
68
  x: z.string(),
66
69
  y: z.string(),
67
70
  }).transform((v) => {
@@ -19,9 +19,9 @@ export type AnalyticsGetDistributionRequestBody = {
19
19
  */
20
20
  scope: string;
21
21
  /**
22
- * Scope value (e.g. country_id). Required for non-global scopes.
22
+ * Scope value — country name or ISO code ("Germany" / "DE"), region name ("Europe"). Required for non-global scopes.
23
23
  */
24
- scopeValue?: number | undefined;
24
+ scopeValue?: string | undefined;
25
25
  };
26
26
 
27
27
  /** @internal */
@@ -29,7 +29,7 @@ export type AnalyticsGetDistributionRequestBody$Outbound = {
29
29
  domain: string;
30
30
  metric: string;
31
31
  scope: string;
32
- scope_value?: number | undefined;
32
+ scope_value?: string | undefined;
33
33
  };
34
34
 
35
35
  /** @internal */
@@ -41,7 +41,7 @@ export const AnalyticsGetDistributionRequestBody$outboundSchema: z.ZodType<
41
41
  domain: z.string(),
42
42
  metric: z.string(),
43
43
  scope: z.string(),
44
- scopeValue: z.number().int().optional(),
44
+ scopeValue: z.string().optional(),
45
45
  }).transform((v) => {
46
46
  return remap$(v, {
47
47
  scopeValue: "scope_value",
@@ -0,0 +1,59 @@
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
+
8
+ export type AnalyticsGetInequalityRequestBody = {
9
+ /**
10
+ * Analytics domain ID. See analytics.listMetrics.
11
+ */
12
+ domain: string;
13
+ /**
14
+ * Metric ID within the domain.
15
+ */
16
+ metric: string;
17
+ /**
18
+ * Scope ID within the domain.
19
+ */
20
+ scope: string;
21
+ /**
22
+ * Country name/code or region name. Required for non-global scopes.
23
+ */
24
+ scopeValue?: string | undefined;
25
+ };
26
+
27
+ /** @internal */
28
+ export type AnalyticsGetInequalityRequestBody$Outbound = {
29
+ domain: string;
30
+ metric: string;
31
+ scope: string;
32
+ scope_value?: string | undefined;
33
+ };
34
+
35
+ /** @internal */
36
+ export const AnalyticsGetInequalityRequestBody$outboundSchema: z.ZodType<
37
+ AnalyticsGetInequalityRequestBody$Outbound,
38
+ z.ZodTypeDef,
39
+ AnalyticsGetInequalityRequestBody
40
+ > = z.object({
41
+ domain: z.string(),
42
+ metric: z.string(),
43
+ scope: z.string(),
44
+ scopeValue: z.string().optional(),
45
+ }).transform((v) => {
46
+ return remap$(v, {
47
+ scopeValue: "scope_value",
48
+ });
49
+ });
50
+
51
+ export function analyticsGetInequalityRequestBodyToJSON(
52
+ analyticsGetInequalityRequestBody: AnalyticsGetInequalityRequestBody,
53
+ ): string {
54
+ return JSON.stringify(
55
+ AnalyticsGetInequalityRequestBody$outboundSchema.parse(
56
+ analyticsGetInequalityRequestBody,
57
+ ),
58
+ );
59
+ }
@@ -0,0 +1,91 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ /**
9
+ * Aggregation applied within each dimension bucket.
10
+ */
11
+ export const AnalyticsGetMetricByScopeRequestBodyAgg = {
12
+ Avg: "avg",
13
+ Median: "median",
14
+ Count: "count",
15
+ } as const;
16
+ /**
17
+ * Aggregation applied within each dimension bucket.
18
+ */
19
+ export type AnalyticsGetMetricByScopeRequestBodyAgg = ClosedEnum<
20
+ typeof AnalyticsGetMetricByScopeRequestBodyAgg
21
+ >;
22
+
23
+ /**
24
+ * Group rows by this dimension. One bucket per distinct value.
25
+ */
26
+ export const Dimension = {
27
+ Country: "country",
28
+ Region: "region",
29
+ } as const;
30
+ /**
31
+ * Group rows by this dimension. One bucket per distinct value.
32
+ */
33
+ export type Dimension = ClosedEnum<typeof Dimension>;
34
+
35
+ export type AnalyticsGetMetricByScopeRequestBody = {
36
+ /**
37
+ * Aggregation applied within each dimension bucket.
38
+ */
39
+ agg: AnalyticsGetMetricByScopeRequestBodyAgg;
40
+ /**
41
+ * Group rows by this dimension. One bucket per distinct value.
42
+ */
43
+ dimension: Dimension;
44
+ /**
45
+ * Analytics domain ID. See analytics.listMetrics.
46
+ */
47
+ domain: string;
48
+ /**
49
+ * Metric ID within the domain.
50
+ */
51
+ metric: string;
52
+ };
53
+
54
+ /** @internal */
55
+ export const AnalyticsGetMetricByScopeRequestBodyAgg$outboundSchema:
56
+ z.ZodNativeEnum<typeof AnalyticsGetMetricByScopeRequestBodyAgg> = z
57
+ .nativeEnum(AnalyticsGetMetricByScopeRequestBodyAgg);
58
+
59
+ /** @internal */
60
+ export const Dimension$outboundSchema: z.ZodNativeEnum<typeof Dimension> = z
61
+ .nativeEnum(Dimension);
62
+
63
+ /** @internal */
64
+ export type AnalyticsGetMetricByScopeRequestBody$Outbound = {
65
+ agg: string;
66
+ dimension: string;
67
+ domain: string;
68
+ metric: string;
69
+ };
70
+
71
+ /** @internal */
72
+ export const AnalyticsGetMetricByScopeRequestBody$outboundSchema: z.ZodType<
73
+ AnalyticsGetMetricByScopeRequestBody$Outbound,
74
+ z.ZodTypeDef,
75
+ AnalyticsGetMetricByScopeRequestBody
76
+ > = z.object({
77
+ agg: AnalyticsGetMetricByScopeRequestBodyAgg$outboundSchema,
78
+ dimension: Dimension$outboundSchema,
79
+ domain: z.string(),
80
+ metric: z.string(),
81
+ });
82
+
83
+ export function analyticsGetMetricByScopeRequestBodyToJSON(
84
+ analyticsGetMetricByScopeRequestBody: AnalyticsGetMetricByScopeRequestBody,
85
+ ): string {
86
+ return JSON.stringify(
87
+ AnalyticsGetMetricByScopeRequestBody$outboundSchema.parse(
88
+ analyticsGetMetricByScopeRequestBody,
89
+ ),
90
+ );
91
+ }
@@ -8,14 +8,17 @@ import { remap as remap$ } from "../../lib/primitives.js";
8
8
  export type AnalyticsGetMyPercentilesRequestBody = {
9
9
  domain: string;
10
10
  scope: string;
11
- scopeValue?: number | undefined;
11
+ /**
12
+ * Country name/code or region name. Required for non-global scopes.
13
+ */
14
+ scopeValue?: string | undefined;
12
15
  };
13
16
 
14
17
  /** @internal */
15
18
  export type AnalyticsGetMyPercentilesRequestBody$Outbound = {
16
19
  domain: string;
17
20
  scope: string;
18
- scope_value?: number | undefined;
21
+ scope_value?: string | undefined;
19
22
  };
20
23
 
21
24
  /** @internal */
@@ -26,7 +29,7 @@ export const AnalyticsGetMyPercentilesRequestBody$outboundSchema: z.ZodType<
26
29
  > = z.object({
27
30
  domain: z.string(),
28
31
  scope: z.string(),
29
- scopeValue: z.number().int().optional(),
32
+ scopeValue: z.string().optional(),
30
33
  }).transform((v) => {
31
34
  return remap$(v, {
32
35
  scopeValue: "scope_value",
@@ -34,7 +34,10 @@ export type AnalyticsGetTrendRequestBody = {
34
34
  * Scope ID within the domain.
35
35
  */
36
36
  scope: string;
37
- scopeValue?: number | undefined;
37
+ /**
38
+ * Country name/code or region name. Required for non-global scopes.
39
+ */
40
+ scopeValue?: string | undefined;
38
41
  /**
39
42
  * Lookback window.
40
43
  */
@@ -51,7 +54,7 @@ export type AnalyticsGetTrendRequestBody$Outbound = {
51
54
  domain: string;
52
55
  metric: string;
53
56
  scope: string;
54
- scope_value?: number | undefined;
57
+ scope_value?: string | undefined;
55
58
  window: string;
56
59
  };
57
60
 
@@ -64,7 +67,7 @@ export const AnalyticsGetTrendRequestBody$outboundSchema: z.ZodType<
64
67
  domain: z.string(),
65
68
  metric: z.string(),
66
69
  scope: z.string(),
67
- scopeValue: z.number().int().optional(),
70
+ scopeValue: z.string().optional(),
68
71
  window: AnalyticsGetTrendRequestBodyWindow$outboundSchema,
69
72
  }).transform((v) => {
70
73
  return remap$(v, {
@@ -0,0 +1,78 @@
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
+ AnalyticsInequalityPoint,
12
+ AnalyticsInequalityPoint$inboundSchema,
13
+ } from "./analyticsinequalitypoint.js";
14
+
15
+ export type AnalyticsInequality = {
16
+ /**
17
+ * A URL to the JSON Schema for this object.
18
+ */
19
+ dollarSchema?: string | undefined;
20
+ /**
21
+ * Number of non-zero contributors.
22
+ */
23
+ count: number;
24
+ /**
25
+ * Gini coefficient. 0 = perfect equality, 1 = maximum inequality.
26
+ */
27
+ gini: number;
28
+ /**
29
+ * Lorenz curve sample points, sorted by popShare ascending. Includes (0,0) and (1,1) endpoints.
30
+ */
31
+ points: Array<AnalyticsInequalityPoint> | null;
32
+ /**
33
+ * Fraction of the metric owned by the top 10% (0–1).
34
+ */
35
+ top10PercentShare: number;
36
+ /**
37
+ * Fraction of the metric owned by the top 1% of contributors (0–1).
38
+ */
39
+ top1PercentShare: number;
40
+ /**
41
+ * Fraction of the metric owned by the top 50% (0–1).
42
+ */
43
+ top50PercentShare: number;
44
+ /**
45
+ * Sum of the metric across all non-zero contributors.
46
+ */
47
+ totalValue: number;
48
+ };
49
+
50
+ /** @internal */
51
+ export const AnalyticsInequality$inboundSchema: z.ZodType<
52
+ AnalyticsInequality,
53
+ z.ZodTypeDef,
54
+ unknown
55
+ > = z.object({
56
+ $schema: z.string().optional(),
57
+ count: z.number().int(),
58
+ gini: z.number(),
59
+ points: z.nullable(z.array(AnalyticsInequalityPoint$inboundSchema)),
60
+ top10PercentShare: z.number(),
61
+ top1PercentShare: z.number(),
62
+ top50PercentShare: z.number(),
63
+ totalValue: z.number(),
64
+ }).transform((v) => {
65
+ return remap$(v, {
66
+ "$schema": "dollarSchema",
67
+ });
68
+ });
69
+
70
+ export function analyticsInequalityFromJSON(
71
+ jsonString: string,
72
+ ): SafeParseResult<AnalyticsInequality, SDKValidationError> {
73
+ return safeParse(
74
+ jsonString,
75
+ (x) => AnalyticsInequality$inboundSchema.parse(JSON.parse(x)),
76
+ `Failed to parse 'AnalyticsInequality' from JSON`,
77
+ );
78
+ }
@@ -0,0 +1,39 @@
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
+
10
+ export type AnalyticsInequalityPoint = {
11
+ /**
12
+ * Cumulative share of the population, taken from the bottom (0–1).
13
+ */
14
+ popShare: number;
15
+ /**
16
+ * Cumulative share of the metric owned by that bottom slice (0–1).
17
+ */
18
+ valueShare: number;
19
+ };
20
+
21
+ /** @internal */
22
+ export const AnalyticsInequalityPoint$inboundSchema: z.ZodType<
23
+ AnalyticsInequalityPoint,
24
+ z.ZodTypeDef,
25
+ unknown
26
+ > = z.object({
27
+ popShare: z.number(),
28
+ valueShare: z.number(),
29
+ });
30
+
31
+ export function analyticsInequalityPointFromJSON(
32
+ jsonString: string,
33
+ ): SafeParseResult<AnalyticsInequalityPoint, SDKValidationError> {
34
+ return safeParse(
35
+ jsonString,
36
+ (x) => AnalyticsInequalityPoint$inboundSchema.parse(JSON.parse(x)),
37
+ `Failed to parse 'AnalyticsInequalityPoint' from JSON`,
38
+ );
39
+ }
@@ -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
+ AnalyticsScopeBucket,
12
+ AnalyticsScopeBucket$inboundSchema,
13
+ } from "./analyticsscopebucket.js";
14
+
15
+ export type AnalyticsMetricByScope = {
16
+ /**
17
+ * A URL to the JSON Schema for this object.
18
+ */
19
+ dollarSchema?: string | undefined;
20
+ buckets: Array<AnalyticsScopeBucket> | null;
21
+ };
22
+
23
+ /** @internal */
24
+ export const AnalyticsMetricByScope$inboundSchema: z.ZodType<
25
+ AnalyticsMetricByScope,
26
+ z.ZodTypeDef,
27
+ unknown
28
+ > = z.object({
29
+ $schema: z.string().optional(),
30
+ buckets: z.nullable(z.array(AnalyticsScopeBucket$inboundSchema)),
31
+ }).transform((v) => {
32
+ return remap$(v, {
33
+ "$schema": "dollarSchema",
34
+ });
35
+ });
36
+
37
+ export function analyticsMetricByScopeFromJSON(
38
+ jsonString: string,
39
+ ): SafeParseResult<AnalyticsMetricByScope, SDKValidationError> {
40
+ return safeParse(
41
+ jsonString,
42
+ (x) => AnalyticsMetricByScope$inboundSchema.parse(JSON.parse(x)),
43
+ `Failed to parse 'AnalyticsMetricByScope' from JSON`,
44
+ );
45
+ }
@@ -0,0 +1,54 @@
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
+
10
+ export type AnalyticsScopeBucket = {
11
+ /**
12
+ * Sample size — accounts contributing to this bucket.
13
+ */
14
+ count: number;
15
+ /**
16
+ * Country ISO alpha-2 code, e.g. "DE". Stable join key for map data.
17
+ */
18
+ countryCode?: string | undefined;
19
+ /**
20
+ * Country name, e.g. "Germany"
21
+ */
22
+ countryName?: string | undefined;
23
+ /**
24
+ * Region name, e.g. "Europe"
25
+ */
26
+ region?: string | undefined;
27
+ /**
28
+ * The metric's aggregated value for this bucket.
29
+ */
30
+ value: number;
31
+ };
32
+
33
+ /** @internal */
34
+ export const AnalyticsScopeBucket$inboundSchema: z.ZodType<
35
+ AnalyticsScopeBucket,
36
+ z.ZodTypeDef,
37
+ unknown
38
+ > = z.object({
39
+ count: z.number().int(),
40
+ countryCode: z.string().optional(),
41
+ countryName: z.string().optional(),
42
+ region: z.string().optional(),
43
+ value: z.number(),
44
+ });
45
+
46
+ export function analyticsScopeBucketFromJSON(
47
+ jsonString: string,
48
+ ): SafeParseResult<AnalyticsScopeBucket, SDKValidationError> {
49
+ return safeParse(
50
+ jsonString,
51
+ (x) => AnalyticsScopeBucket$inboundSchema.parse(JSON.parse(x)),
52
+ `Failed to parse 'AnalyticsScopeBucket' from JSON`,
53
+ );
54
+ }
@@ -17,12 +17,18 @@ export * from "./analyticsdistribution.js";
17
17
  export * from "./analyticsdomainentry.js";
18
18
  export * from "./analyticsgetbivariaterequestbody.js";
19
19
  export * from "./analyticsgetdistributionrequestbody.js";
20
+ export * from "./analyticsgetinequalityrequestbody.js";
21
+ export * from "./analyticsgetmetricbyscoperequestbody.js";
20
22
  export * from "./analyticsgetmypercentilesrequestbody.js";
21
23
  export * from "./analyticsgettrendrequestbody.js";
24
+ export * from "./analyticsinequality.js";
25
+ export * from "./analyticsinequalitypoint.js";
22
26
  export * from "./analyticslistmetricsresponsebody.js";
27
+ export * from "./analyticsmetricbyscope.js";
23
28
  export * from "./analyticsmetricentry.js";
24
29
  export * from "./analyticsmypercentiles.js";
25
30
  export * from "./analyticspercentile.js";
31
+ export * from "./analyticsscopebucket.js";
26
32
  export * from "./analyticsscopeentry.js";
27
33
  export * from "./analyticssummary.js";
28
34
  export * from "./analyticstrackeventrequestbody.js";
@@ -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 { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type AnalyticsGetInequalityResponse = {
13
+ httpMeta: components.HTTPMetadata;
14
+ /**
15
+ * OK
16
+ */
17
+ analyticsInequality?: components.AnalyticsInequality | undefined;
18
+ };
19
+
20
+ /** @internal */
21
+ export const AnalyticsGetInequalityResponse$inboundSchema: z.ZodType<
22
+ AnalyticsGetInequalityResponse,
23
+ z.ZodTypeDef,
24
+ unknown
25
+ > = z.object({
26
+ HttpMeta: components.HTTPMetadata$inboundSchema,
27
+ AnalyticsInequality: components.AnalyticsInequality$inboundSchema.optional(),
28
+ }).transform((v) => {
29
+ return remap$(v, {
30
+ "HttpMeta": "httpMeta",
31
+ "AnalyticsInequality": "analyticsInequality",
32
+ });
33
+ });
34
+
35
+ export function analyticsGetInequalityResponseFromJSON(
36
+ jsonString: string,
37
+ ): SafeParseResult<AnalyticsGetInequalityResponse, SDKValidationError> {
38
+ return safeParse(
39
+ jsonString,
40
+ (x) => AnalyticsGetInequalityResponse$inboundSchema.parse(JSON.parse(x)),
41
+ `Failed to parse 'AnalyticsGetInequalityResponse' from JSON`,
42
+ );
43
+ }
@@ -0,0 +1,44 @@
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 * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type AnalyticsGetMetricByScopeResponse = {
13
+ httpMeta: components.HTTPMetadata;
14
+ /**
15
+ * OK
16
+ */
17
+ analyticsMetricByScope?: components.AnalyticsMetricByScope | undefined;
18
+ };
19
+
20
+ /** @internal */
21
+ export const AnalyticsGetMetricByScopeResponse$inboundSchema: z.ZodType<
22
+ AnalyticsGetMetricByScopeResponse,
23
+ z.ZodTypeDef,
24
+ unknown
25
+ > = z.object({
26
+ HttpMeta: components.HTTPMetadata$inboundSchema,
27
+ AnalyticsMetricByScope: components.AnalyticsMetricByScope$inboundSchema
28
+ .optional(),
29
+ }).transform((v) => {
30
+ return remap$(v, {
31
+ "HttpMeta": "httpMeta",
32
+ "AnalyticsMetricByScope": "analyticsMetricByScope",
33
+ });
34
+ });
35
+
36
+ export function analyticsGetMetricByScopeResponseFromJSON(
37
+ jsonString: string,
38
+ ): SafeParseResult<AnalyticsGetMetricByScopeResponse, SDKValidationError> {
39
+ return safeParse(
40
+ jsonString,
41
+ (x) => AnalyticsGetMetricByScopeResponse$inboundSchema.parse(JSON.parse(x)),
42
+ `Failed to parse 'AnalyticsGetMetricByScopeResponse' from JSON`,
43
+ );
44
+ }
@@ -60,6 +60,8 @@ export * from "./adminupdateroleoverride.js";
60
60
  export * from "./adminupdateroles.js";
61
61
  export * from "./analyticsgetbivariate.js";
62
62
  export * from "./analyticsgetdistribution.js";
63
+ export * from "./analyticsgetinequality.js";
64
+ export * from "./analyticsgetmetricbyscope.js";
63
65
  export * from "./analyticsgetmypercentiles.js";
64
66
  export * from "./analyticsgettrend.js";
65
67
  export * from "./analyticslistmetrics.js";
@@ -4,6 +4,8 @@
4
4
 
5
5
  import { analyticsGetBivariate } from "../funcs/analyticsGetBivariate.js";
6
6
  import { analyticsGetDistribution } from "../funcs/analyticsGetDistribution.js";
7
+ import { analyticsGetInequality } from "../funcs/analyticsGetInequality.js";
8
+ import { analyticsGetMetricByScope } from "../funcs/analyticsGetMetricByScope.js";
7
9
  import { analyticsGetMyPercentiles } from "../funcs/analyticsGetMyPercentiles.js";
8
10
  import { analyticsGetTrend } from "../funcs/analyticsGetTrend.js";
9
11
  import { analyticsListMetrics } from "../funcs/analyticsListMetrics.js";
@@ -42,6 +44,34 @@ export class Analytics extends ClientSDK {
42
44
  ));
43
45
  }
44
46
 
47
+ /**
48
+ * Lorenz curve + Gini + top-X%-own-Y% headlines for one metric in a scope
49
+ */
50
+ async getInequality(
51
+ request: components.AnalyticsGetInequalityRequestBody,
52
+ options?: RequestOptions,
53
+ ): Promise<operations.AnalyticsGetInequalityResponse> {
54
+ return unwrapAsync(analyticsGetInequality(
55
+ this,
56
+ request,
57
+ options,
58
+ ));
59
+ }
60
+
61
+ /**
62
+ * One metric aggregated per country (or region) — worldmap source
63
+ */
64
+ async getMetricByScope(
65
+ request: components.AnalyticsGetMetricByScopeRequestBody,
66
+ options?: RequestOptions,
67
+ ): Promise<operations.AnalyticsGetMetricByScopeResponse> {
68
+ return unwrapAsync(analyticsGetMetricByScope(
69
+ this,
70
+ request,
71
+ options,
72
+ ));
73
+ }
74
+
45
75
  /**
46
76
  * Per-metric percentile rank for the logged-in user in the chosen scope
47
77
  */