@katerai/sdk 0.10.0 → 0.11.0

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 (82) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/client.d.mts.map +1 -1
  3. package/client.d.ts.map +1 -1
  4. package/client.js +7 -0
  5. package/client.js.map +1 -1
  6. package/client.mjs +7 -0
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/v1/compiler/cache.d.mts +0 -35
  10. package/resources/v1/compiler/cache.d.mts.map +1 -1
  11. package/resources/v1/compiler/cache.d.ts +0 -35
  12. package/resources/v1/compiler/cache.d.ts.map +1 -1
  13. package/resources/v1/compiler/cache.js +0 -9
  14. package/resources/v1/compiler/cache.js.map +1 -1
  15. package/resources/v1/compiler/cache.mjs +0 -9
  16. package/resources/v1/compiler/cache.mjs.map +1 -1
  17. package/resources/v1/compiler/combination.d.mts +120 -0
  18. package/resources/v1/compiler/combination.d.mts.map +1 -0
  19. package/resources/v1/compiler/combination.d.ts +120 -0
  20. package/resources/v1/compiler/combination.d.ts.map +1 -0
  21. package/resources/v1/compiler/combination.js +30 -0
  22. package/resources/v1/compiler/combination.js.map +1 -0
  23. package/resources/v1/compiler/combination.mjs +26 -0
  24. package/resources/v1/compiler/combination.mjs.map +1 -0
  25. package/resources/v1/compiler/compiler.d.mts +482 -84
  26. package/resources/v1/compiler/compiler.d.mts.map +1 -1
  27. package/resources/v1/compiler/compiler.d.ts +482 -84
  28. package/resources/v1/compiler/compiler.d.ts.map +1 -1
  29. package/resources/v1/compiler/compiler.js +26 -0
  30. package/resources/v1/compiler/compiler.js.map +1 -1
  31. package/resources/v1/compiler/compiler.mjs +26 -0
  32. package/resources/v1/compiler/compiler.mjs.map +1 -1
  33. package/resources/v1/compiler/index.d.mts +4 -2
  34. package/resources/v1/compiler/index.d.mts.map +1 -1
  35. package/resources/v1/compiler/index.d.ts +4 -2
  36. package/resources/v1/compiler/index.d.ts.map +1 -1
  37. package/resources/v1/compiler/index.js +3 -1
  38. package/resources/v1/compiler/index.js.map +1 -1
  39. package/resources/v1/compiler/index.mjs +1 -0
  40. package/resources/v1/compiler/index.mjs.map +1 -1
  41. package/resources/v1/compiler/manifest.d.mts +52 -0
  42. package/resources/v1/compiler/manifest.d.mts.map +1 -0
  43. package/resources/v1/compiler/manifest.d.ts +52 -0
  44. package/resources/v1/compiler/manifest.d.ts.map +1 -0
  45. package/resources/v1/compiler/manifest.js +29 -0
  46. package/resources/v1/compiler/manifest.js.map +1 -0
  47. package/resources/v1/compiler/manifest.mjs +25 -0
  48. package/resources/v1/compiler/manifest.mjs.map +1 -0
  49. package/resources/v1/index.d.mts +1 -1
  50. package/resources/v1/index.d.mts.map +1 -1
  51. package/resources/v1/index.d.ts +1 -1
  52. package/resources/v1/index.d.ts.map +1 -1
  53. package/resources/v1/index.js.map +1 -1
  54. package/resources/v1/index.mjs.map +1 -1
  55. package/resources/v1/tenants/tenants.d.mts +66 -10
  56. package/resources/v1/tenants/tenants.d.mts.map +1 -1
  57. package/resources/v1/tenants/tenants.d.ts +66 -10
  58. package/resources/v1/tenants/tenants.d.ts.map +1 -1
  59. package/resources/v1/tenants/tenants.js +27 -4
  60. package/resources/v1/tenants/tenants.js.map +1 -1
  61. package/resources/v1/tenants/tenants.mjs +27 -4
  62. package/resources/v1/tenants/tenants.mjs.map +1 -1
  63. package/resources/v1/v1.d.mts +2 -2
  64. package/resources/v1/v1.d.mts.map +1 -1
  65. package/resources/v1/v1.d.ts +2 -2
  66. package/resources/v1/v1.d.ts.map +1 -1
  67. package/resources/v1/v1.js.map +1 -1
  68. package/resources/v1/v1.mjs.map +1 -1
  69. package/src/client.ts +8 -0
  70. package/src/resources/v1/compiler/cache.ts +1 -47
  71. package/src/resources/v1/compiler/combination.ts +157 -0
  72. package/src/resources/v1/compiler/compiler.ts +633 -190
  73. package/src/resources/v1/compiler/index.ts +8 -1
  74. package/src/resources/v1/compiler/manifest.ts +80 -0
  75. package/src/resources/v1/index.ts +2 -0
  76. package/src/resources/v1/tenants/tenants.ts +99 -12
  77. package/src/resources/v1/v1.ts +4 -0
  78. package/src/version.ts +1 -1
  79. package/version.d.mts +1 -1
  80. package/version.d.ts +1 -1
  81. package/version.js +1 -1
  82. package/version.mjs +1 -1
@@ -0,0 +1,120 @@
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import * as CompilerAPI from "./compiler.js";
3
+ import { APIPromise } from "../../../core/api-promise.js";
4
+ import { RequestOptions } from "../../../internal/request-options.js";
5
+ export declare class Combination extends APIResource {
6
+ /**
7
+ * Preview a single combination: resolve, compile, execute, and build config.
8
+ *
9
+ * Chains existing services to provide a single-call preview for the query gallery.
10
+ * Returns data + WidgetConfig for immediate rendering.
11
+ *
12
+ * RLS: Filtered to current client (ClientRLSDB).
13
+ */
14
+ preview(params: CombinationPreviewParams, options?: RequestOptions): APIPromise<CombinationPreviewResponse>;
15
+ }
16
+ /**
17
+ * Response from combination preview with data + resolved config.
18
+ */
19
+ export interface CombinationPreviewResponse {
20
+ /**
21
+ * Whether preview succeeded
22
+ */
23
+ success: boolean;
24
+ /**
25
+ * Auto-generated title
26
+ */
27
+ auto_title?: string | null;
28
+ /**
29
+ * Whether the result was served from cache
30
+ */
31
+ cache_hit?: boolean;
32
+ /**
33
+ * Enriched column metadata
34
+ */
35
+ column_map?: Array<CombinationPreviewResponse.ColumnMap>;
36
+ /**
37
+ * Resolved WidgetConfig (from config builder)
38
+ */
39
+ config?: {
40
+ [key: string]: unknown;
41
+ };
42
+ /**
43
+ * Query result rows
44
+ */
45
+ data?: Array<{
46
+ [key: string]: unknown;
47
+ }>;
48
+ /**
49
+ * Compilation errors (if any)
50
+ */
51
+ errors?: Array<CompilerAPI.CompilerErrorItem>;
52
+ /**
53
+ * Total execution time in milliseconds
54
+ */
55
+ execution_time_ms?: number;
56
+ /**
57
+ * Resolved widget type (e.g. 'axis_metric_by_dimensiondate')
58
+ */
59
+ widget_type?: string | null;
60
+ }
61
+ export declare namespace CombinationPreviewResponse {
62
+ /**
63
+ * Maps a UUID column alias to its human-readable name and type.
64
+ */
65
+ interface ColumnMap {
66
+ /**
67
+ * Field type: dimension, measure, or calculation
68
+ */
69
+ field_type: string;
70
+ /**
71
+ * UUID string used as SQL column alias
72
+ */
73
+ kater_id: string;
74
+ /**
75
+ * Human-readable column name
76
+ */
77
+ name: string;
78
+ /**
79
+ * Aggregation type for measures: sum, count, min, max, avg, unknown. None for
80
+ * non-measures.
81
+ */
82
+ aggregation?: string | null;
83
+ /**
84
+ * Display label
85
+ */
86
+ label?: string | null;
87
+ }
88
+ }
89
+ export interface CombinationPreviewParams {
90
+ /**
91
+ * Body param: Comma-separated slot selections, same format as
92
+ * ResolveRequest.combination. Example:
93
+ * 'dimension=due_month,measure=compliance_rate'
94
+ */
95
+ combination: string;
96
+ /**
97
+ * Body param: Connection to preview against
98
+ */
99
+ connection_id: string;
100
+ /**
101
+ * Body param: Query template reference (e.g. 'q:compliance_trend.\_base')
102
+ */
103
+ query_ref: string;
104
+ /**
105
+ * Query param
106
+ */
107
+ source?: string | null;
108
+ /**
109
+ * Body param: Optional tenant key for multi-tenant execution
110
+ */
111
+ tenant_key?: string | null;
112
+ /**
113
+ * Header param
114
+ */
115
+ 'X-Kater-CLI-ID'?: string;
116
+ }
117
+ export declare namespace Combination {
118
+ export { type CombinationPreviewResponse as CombinationPreviewResponse, type CombinationPreviewParams as CombinationPreviewParams, };
119
+ }
120
+ //# sourceMappingURL=combination.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combination.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/compiler/combination.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAEzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;OAOG;IACH,OAAO,CACL,MAAM,EAAE,wBAAwB,EAChC,OAAO,CAAC,EAAE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MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Combination = void 0;
5
+ const resource_1 = require("../../../core/resource.js");
6
+ const headers_1 = require("../../../internal/headers.js");
7
+ class Combination extends resource_1.APIResource {
8
+ /**
9
+ * Preview a single combination: resolve, compile, execute, and build config.
10
+ *
11
+ * Chains existing services to provide a single-call preview for the query gallery.
12
+ * Returns data + WidgetConfig for immediate rendering.
13
+ *
14
+ * RLS: Filtered to current client (ClientRLSDB).
15
+ */
16
+ preview(params, options) {
17
+ const { source, 'X-Kater-CLI-ID': xKaterCliID, ...body } = params;
18
+ return this._client.post('/api/v1/compiler/combination/preview', {
19
+ query: { source },
20
+ body,
21
+ ...options,
22
+ headers: (0, headers_1.buildHeaders)([
23
+ { ...(xKaterCliID != null ? { 'X-Kater-CLI-ID': xKaterCliID } : undefined) },
24
+ options?.headers,
25
+ ]),
26
+ });
27
+ }
28
+ }
29
+ exports.Combination = Combination;
30
+ //# sourceMappingURL=combination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combination.js","sourceRoot":"","sources":["../../../src/resources/v1/compiler/combination.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,0DAAyD;AAGzD,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;OAOG;IACH,OAAO,CACL,MAAgC,EAChC,OAAwB;QAExB,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAClE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE;YAC/D,KAAK,EAAE,EAAE,MAAM,EAAE;YACjB,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,GAAG,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBAC5E,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF;AAxBD,kCAwBC"}
@@ -0,0 +1,26 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../../core/resource.mjs";
3
+ import { buildHeaders } from "../../../internal/headers.mjs";
4
+ export class Combination extends APIResource {
5
+ /**
6
+ * Preview a single combination: resolve, compile, execute, and build config.
7
+ *
8
+ * Chains existing services to provide a single-call preview for the query gallery.
9
+ * Returns data + WidgetConfig for immediate rendering.
10
+ *
11
+ * RLS: Filtered to current client (ClientRLSDB).
12
+ */
13
+ preview(params, options) {
14
+ const { source, 'X-Kater-CLI-ID': xKaterCliID, ...body } = params;
15
+ return this._client.post('/api/v1/compiler/combination/preview', {
16
+ query: { source },
17
+ body,
18
+ ...options,
19
+ headers: buildHeaders([
20
+ { ...(xKaterCliID != null ? { 'X-Kater-CLI-ID': xKaterCliID } : undefined) },
21
+ options?.headers,
22
+ ]),
23
+ });
24
+ }
25
+ }
26
+ //# sourceMappingURL=combination.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combination.mjs","sourceRoot":"","sources":["../../../src/resources/v1/compiler/combination.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,YAAY,EAAE;AAGvB,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;OAOG;IACH,OAAO,CACL,MAAgC,EAChC,OAAwB;QAExB,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAClE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE;YAC/D,KAAK,EAAE,EAAE,MAAM,EAAE;YACjB,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,GAAG,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBAC5E,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF"}