@katerai/sdk 0.4.0 → 0.6.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 (116) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/client.d.mts +1 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +1 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +8 -2
  7. package/client.js.map +1 -1
  8. package/client.mjs +8 -2
  9. package/client.mjs.map +1 -1
  10. package/internal/parse.d.mts.map +1 -1
  11. package/internal/parse.d.ts.map +1 -1
  12. package/internal/parse.js +5 -0
  13. package/internal/parse.js.map +1 -1
  14. package/internal/parse.mjs +5 -0
  15. package/internal/parse.mjs.map +1 -1
  16. package/package.json +1 -1
  17. package/resources/v1/connections/connections.d.mts +734 -95
  18. package/resources/v1/connections/connections.d.mts.map +1 -1
  19. package/resources/v1/connections/connections.d.ts +734 -95
  20. package/resources/v1/connections/connections.d.ts.map +1 -1
  21. package/resources/v1/connections/connections.js +77 -14
  22. package/resources/v1/connections/connections.js.map +1 -1
  23. package/resources/v1/connections/connections.mjs +78 -15
  24. package/resources/v1/connections/connections.mjs.map +1 -1
  25. package/resources/v1/connections/databases.d.mts +1 -118
  26. package/resources/v1/connections/databases.d.mts.map +1 -1
  27. package/resources/v1/connections/databases.d.ts +1 -118
  28. package/resources/v1/connections/databases.d.ts.map +1 -1
  29. package/resources/v1/connections/databases.js +0 -35
  30. package/resources/v1/connections/databases.js.map +1 -1
  31. package/resources/v1/connections/databases.mjs +0 -35
  32. package/resources/v1/connections/databases.mjs.map +1 -1
  33. package/resources/v1/connections/index.d.mts +4 -2
  34. package/resources/v1/connections/index.d.mts.map +1 -1
  35. package/resources/v1/connections/index.d.ts +4 -2
  36. package/resources/v1/connections/index.d.ts.map +1 -1
  37. package/resources/v1/connections/index.js +5 -1
  38. package/resources/v1/connections/index.js.map +1 -1
  39. package/resources/v1/connections/index.mjs +3 -1
  40. package/resources/v1/connections/index.mjs.map +1 -1
  41. package/resources/v1/connections/views.d.mts +77 -0
  42. package/resources/v1/connections/views.d.mts.map +1 -0
  43. package/resources/v1/connections/views.d.ts +77 -0
  44. package/resources/v1/connections/views.d.ts.map +1 -0
  45. package/resources/v1/connections/views.js +24 -0
  46. package/resources/v1/connections/views.js.map +1 -0
  47. package/resources/v1/connections/views.mjs +20 -0
  48. package/resources/v1/connections/views.mjs.map +1 -0
  49. package/resources/v1/connections/yaml.d.mts +57 -0
  50. package/resources/v1/connections/yaml.d.mts.map +1 -0
  51. package/resources/v1/connections/yaml.d.ts +57 -0
  52. package/resources/v1/connections/yaml.d.ts.map +1 -0
  53. package/resources/v1/connections/yaml.js +22 -0
  54. package/resources/v1/connections/yaml.js.map +1 -0
  55. package/resources/v1/connections/yaml.mjs +18 -0
  56. package/resources/v1/connections/yaml.mjs.map +1 -0
  57. package/resources/v1/github/github.d.mts +4 -0
  58. package/resources/v1/github/github.d.mts.map +1 -1
  59. package/resources/v1/github/github.d.ts +4 -0
  60. package/resources/v1/github/github.d.ts.map +1 -1
  61. package/resources/v1/github/github.js.map +1 -1
  62. package/resources/v1/github/github.mjs.map +1 -1
  63. package/resources/v1/index.d.mts +2 -2
  64. package/resources/v1/index.d.mts.map +1 -1
  65. package/resources/v1/index.d.ts +2 -2
  66. package/resources/v1/index.d.ts.map +1 -1
  67. package/resources/v1/index.js.map +1 -1
  68. package/resources/v1/index.mjs.map +1 -1
  69. package/resources/v1/tenants/groups.d.mts +43 -0
  70. package/resources/v1/tenants/groups.d.mts.map +1 -0
  71. package/resources/v1/tenants/groups.d.ts +43 -0
  72. package/resources/v1/tenants/groups.d.ts.map +1 -0
  73. package/resources/v1/tenants/groups.js +20 -0
  74. package/resources/v1/tenants/groups.js.map +1 -0
  75. package/resources/v1/tenants/groups.mjs +16 -0
  76. package/resources/v1/tenants/groups.mjs.map +1 -0
  77. package/resources/v1/tenants/index.d.mts +2 -1
  78. package/resources/v1/tenants/index.d.mts.map +1 -1
  79. package/resources/v1/tenants/index.d.ts +2 -1
  80. package/resources/v1/tenants/index.d.ts.map +1 -1
  81. package/resources/v1/tenants/index.js +3 -1
  82. package/resources/v1/tenants/index.js.map +1 -1
  83. package/resources/v1/tenants/index.mjs +1 -0
  84. package/resources/v1/tenants/index.mjs.map +1 -1
  85. package/resources/v1/tenants/tenants.d.mts +44 -1
  86. package/resources/v1/tenants/tenants.d.mts.map +1 -1
  87. package/resources/v1/tenants/tenants.d.ts +44 -1
  88. package/resources/v1/tenants/tenants.d.ts.map +1 -1
  89. package/resources/v1/tenants/tenants.js +16 -0
  90. package/resources/v1/tenants/tenants.js.map +1 -1
  91. package/resources/v1/tenants/tenants.mjs +16 -0
  92. package/resources/v1/tenants/tenants.mjs.map +1 -1
  93. package/resources/v1/v1.d.mts +4 -4
  94. package/resources/v1/v1.d.mts.map +1 -1
  95. package/resources/v1/v1.d.ts +4 -4
  96. package/resources/v1/v1.d.ts.map +1 -1
  97. package/resources/v1/v1.js.map +1 -1
  98. package/resources/v1/v1.mjs.map +1 -1
  99. package/src/client.ts +9 -2
  100. package/src/internal/parse.ts +6 -0
  101. package/src/resources/v1/connections/connections.ts +958 -119
  102. package/src/resources/v1/connections/databases.ts +1 -165
  103. package/src/resources/v1/connections/index.ts +20 -7
  104. package/src/resources/v1/connections/views.ts +112 -0
  105. package/src/resources/v1/connections/yaml.ts +81 -0
  106. package/src/resources/v1/github/github.ts +8 -0
  107. package/src/resources/v1/index.ts +13 -0
  108. package/src/resources/v1/tenants/groups.ts +52 -0
  109. package/src/resources/v1/tenants/index.ts +2 -0
  110. package/src/resources/v1/tenants/tenants.ts +54 -0
  111. package/src/resources/v1/v1.ts +26 -0
  112. package/src/version.ts +1 -1
  113. package/version.d.mts +1 -1
  114. package/version.d.ts +1 -1
  115. package/version.js +1 -1
  116. package/version.mjs +1 -1
@@ -1,37 +1,12 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../../core/resource';
4
- import * as ConnectionsAPI from './connections';
5
4
  import { APIPromise } from '../../../core/api-promise';
6
5
  import { buildHeaders } from '../../../internal/headers';
7
6
  import { RequestOptions } from '../../../internal/request-options';
8
7
  import { path } from '../../../internal/utils/path';
9
8
 
10
9
  export class Databases extends APIResource {
11
- /**
12
- * Update a database's metadata.
13
- *
14
- * Updates label and/or description fields directly. If a name change is requested,
15
- * a GitHub PR is created to update view YAML files. The name change is applied to
16
- * the DB when the PR merges (or immediately if auto_merge is true or no views are
17
- * affected).
18
- *
19
- * RLS: Filtered to current client (DualClientRLSDB).
20
- *
21
- * Raises: DatabaseNotFoundError: If database doesn't exist (404)
22
- */
23
- update(
24
- databaseID: string,
25
- params: DatabaseUpdateParams,
26
- options?: RequestOptions,
27
- ): APIPromise<DatabaseUpdateResponse> {
28
- const { connection_id, ...body } = params;
29
- return this._client.patch(path`/api/v1/connections/${connection_id}/databases/${databaseID}`, {
30
- body,
31
- ...options,
32
- });
33
- }
34
-
35
10
  /**
36
11
  * Delete a schema from a connection.
37
12
  *
@@ -54,107 +29,6 @@ export class Databases extends APIResource {
54
29
  { ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]) },
55
30
  );
56
31
  }
57
-
58
- /**
59
- * Update a schema's metadata.
60
- *
61
- * Updates label and/or description fields directly. If a name change is requested,
62
- * a GitHub PR is created to update view YAML files. The name change is applied to
63
- * the DB when the PR merges (or immediately if auto_merge is true or no views are
64
- * affected).
65
- *
66
- * RLS: Filtered to current client (DualClientRLSDB).
67
- *
68
- * Raises: SchemaNotFoundError: If schema doesn't exist (404)
69
- */
70
- updateSchema(
71
- schemaID: string,
72
- params: DatabaseUpdateSchemaParams,
73
- options?: RequestOptions,
74
- ): APIPromise<DatabaseUpdateSchemaResponse> {
75
- const { connection_id, database_id, ...body } = params;
76
- return this._client.patch(
77
- path`/api/v1/connections/${connection_id}/databases/${database_id}/schemas/${schemaID}`,
78
- { body, ...options },
79
- );
80
- }
81
- }
82
-
83
- /**
84
- * Response for database/schema updates that may involve a rename PR.
85
- */
86
- export interface DatabaseUpdateResponse {
87
- /**
88
- * Updated connection
89
- */
90
- connection: ConnectionsAPI.Connection;
91
-
92
- /**
93
- * GitHub PR number
94
- */
95
- pr_number?: number | null;
96
-
97
- /**
98
- * PR status: 'open' or 'merged'
99
- */
100
- pr_status?: string | null;
101
-
102
- /**
103
- * GitHub PR URL (if rename PR created)
104
- */
105
- pr_url?: string | null;
106
- }
107
-
108
- /**
109
- * Response for database/schema updates that may involve a rename PR.
110
- */
111
- export interface DatabaseUpdateSchemaResponse {
112
- /**
113
- * Updated connection
114
- */
115
- connection: ConnectionsAPI.Connection;
116
-
117
- /**
118
- * GitHub PR number
119
- */
120
- pr_number?: number | null;
121
-
122
- /**
123
- * PR status: 'open' or 'merged'
124
- */
125
- pr_status?: string | null;
126
-
127
- /**
128
- * GitHub PR URL (if rename PR created)
129
- */
130
- pr_url?: string | null;
131
- }
132
-
133
- export interface DatabaseUpdateParams {
134
- /**
135
- * Path param
136
- */
137
- connection_id: string;
138
-
139
- /**
140
- * Body param: If true and a name change requires a PR, auto-merge it
141
- */
142
- auto_merge?: boolean;
143
-
144
- /**
145
- * Body param: Database description
146
- */
147
- description?: string | null;
148
-
149
- /**
150
- * Body param: Human-readable display label
151
- */
152
- label?: string | null;
153
-
154
- /**
155
- * Body param: Database name
156
- */
157
- name?: string | null;
158
32
  }
159
33
 
160
34
  export interface DatabaseDeleteSchemaParams {
@@ -163,44 +37,6 @@ export interface DatabaseDeleteSchemaParams {
163
37
  database_id: string;
164
38
  }
165
39
 
166
- export interface DatabaseUpdateSchemaParams {
167
- /**
168
- * Path param
169
- */
170
- connection_id: string;
171
-
172
- /**
173
- * Path param
174
- */
175
- database_id: string;
176
-
177
- /**
178
- * Body param: If true and a name change requires a PR, auto-merge it
179
- */
180
- auto_merge?: boolean;
181
-
182
- /**
183
- * Body param: Schema description
184
- */
185
- description?: string | null;
186
-
187
- /**
188
- * Body param: Human-readable display label
189
- */
190
- label?: string | null;
191
-
192
- /**
193
- * Body param: Schema name
194
- */
195
- name?: string | null;
196
- }
197
-
198
40
  export declare namespace Databases {
199
- export {
200
- type DatabaseUpdateResponse as DatabaseUpdateResponse,
201
- type DatabaseUpdateSchemaResponse as DatabaseUpdateSchemaResponse,
202
- type DatabaseUpdateParams as DatabaseUpdateParams,
203
- type DatabaseDeleteSchemaParams as DatabaseDeleteSchemaParams,
204
- type DatabaseUpdateSchemaParams as DatabaseUpdateSchemaParams,
205
- };
41
+ export { type DatabaseDeleteSchemaParams as DatabaseDeleteSchemaParams };
206
42
  }
@@ -5,16 +5,29 @@ export {
5
5
  type Connection,
6
6
  type DatabaseConfig,
7
7
  type ConnectionListResponse,
8
+ type ConnectionApproveSyncResponse,
9
+ type ConnectionListSyncsResponse,
8
10
  type ConnectionRetrieveCredentialResponse,
11
+ type ConnectionRetrieveSchemaResponse,
12
+ type ConnectionRetrieveSyncStatusResponse,
13
+ type ConnectionStreamSyncProgressResponse,
9
14
  type ConnectionSyncResponse,
15
+ type ConnectionUpdateCredentialsResponse,
10
16
  type ConnectionCreateParams,
11
17
  type ConnectionUpdateParams,
18
+ type ConnectionListParams,
19
+ type ConnectionApproveSyncParams,
20
+ type ConnectionListSyncsParams,
21
+ type ConnectionRetrieveSyncStatusParams,
22
+ type ConnectionStreamSyncProgressParams,
23
+ type ConnectionUpdateCredentialsParams,
12
24
  } from './connections';
25
+ export { Databases, type DatabaseDeleteSchemaParams } from './databases';
13
26
  export {
14
- Databases,
15
- type DatabaseUpdateResponse,
16
- type DatabaseUpdateSchemaResponse,
17
- type DatabaseUpdateParams,
18
- type DatabaseDeleteSchemaParams,
19
- type DatabaseUpdateSchemaParams,
20
- } from './databases';
27
+ Views,
28
+ type ViewRetrieveResponse,
29
+ type ViewListResponse,
30
+ type ViewRetrieveParams,
31
+ type ViewListParams,
32
+ } from './views';
33
+ export { Yaml, type YamlRetrieveResponse, type YamlCommitResponse, type YamlCommitParams } from './yaml';
@@ -0,0 +1,112 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import { APIPromise } from '../../../core/api-promise';
5
+ import { RequestOptions } from '../../../internal/request-options';
6
+ import { path } from '../../../internal/utils/path';
7
+
8
+ export class Views extends APIResource {
9
+ /**
10
+ * Get the YAML content of a specific view file.
11
+ */
12
+ retrieve(
13
+ fileName: string,
14
+ params: ViewRetrieveParams,
15
+ options?: RequestOptions,
16
+ ): APIPromise<ViewRetrieveResponse> {
17
+ const { connection_id, sync_id } = params;
18
+ return this._client.get(
19
+ path`/api/v1/connections/${connection_id}/sync/${sync_id}/views/${fileName}`,
20
+ options,
21
+ );
22
+ }
23
+
24
+ /**
25
+ * List all view YAML files created by a schema sync.
26
+ */
27
+ list(syncID: string, params: ViewListParams, options?: RequestOptions): APIPromise<ViewListResponse> {
28
+ const { connection_id } = params;
29
+ return this._client.get(path`/api/v1/connections/${connection_id}/sync/${syncID}/views`, options);
30
+ }
31
+ }
32
+
33
+ /**
34
+ * Response for a single view file's content.
35
+ */
36
+ export interface ViewRetrieveResponse {
37
+ /**
38
+ * Branch the file was read from
39
+ */
40
+ branch: string;
41
+
42
+ /**
43
+ * YAML file content
44
+ */
45
+ content: string;
46
+
47
+ /**
48
+ * File name (e.g., 'customers.yaml')
49
+ */
50
+ name: string;
51
+
52
+ /**
53
+ * Full path relative to connection folder
54
+ */
55
+ path: string;
56
+ }
57
+
58
+ /**
59
+ * Response for listing view files in a sync.
60
+ */
61
+ export interface ViewListResponse {
62
+ /**
63
+ * Branch the files were read from
64
+ */
65
+ branch: string;
66
+
67
+ /**
68
+ * List of view files
69
+ */
70
+ files: Array<ViewListResponse.File>;
71
+
72
+ /**
73
+ * True if reading from PR branch, False if from main
74
+ */
75
+ is_pr_branch: boolean;
76
+ }
77
+
78
+ export namespace ViewListResponse {
79
+ /**
80
+ * A single view file in the sync.
81
+ */
82
+ export interface File {
83
+ /**
84
+ * File name (e.g., 'customers.yaml')
85
+ */
86
+ name: string;
87
+
88
+ /**
89
+ * Full path relative to connection folder
90
+ */
91
+ path: string;
92
+ }
93
+ }
94
+
95
+ export interface ViewRetrieveParams {
96
+ connection_id: string;
97
+
98
+ sync_id: string;
99
+ }
100
+
101
+ export interface ViewListParams {
102
+ connection_id: string;
103
+ }
104
+
105
+ export declare namespace Views {
106
+ export {
107
+ type ViewRetrieveResponse as ViewRetrieveResponse,
108
+ type ViewListResponse as ViewListResponse,
109
+ type ViewRetrieveParams as ViewRetrieveParams,
110
+ type ViewListParams as ViewListParams,
111
+ };
112
+ }
@@ -0,0 +1,81 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import { APIPromise } from '../../../core/api-promise';
5
+ import { RequestOptions } from '../../../internal/request-options';
6
+ import { path } from '../../../internal/utils/path';
7
+
8
+ export class Yaml extends APIResource {
9
+ /**
10
+ * Read connection.yaml from the main branch of the repo.
11
+ */
12
+ retrieve(connectionID: string, options?: RequestOptions): APIPromise<YamlRetrieveResponse> {
13
+ return this._client.get(path`/api/v1/connections/${connectionID}/yaml`, options);
14
+ }
15
+
16
+ /**
17
+ * Commit updated YAML to a new branch and create a PR.
18
+ */
19
+ commit(
20
+ connectionID: string,
21
+ body: YamlCommitParams,
22
+ options?: RequestOptions,
23
+ ): APIPromise<YamlCommitResponse> {
24
+ return this._client.post(path`/api/v1/connections/${connectionID}/yaml`, { body, ...options });
25
+ }
26
+ }
27
+
28
+ /**
29
+ * Response for reading connection.yaml from repo.
30
+ */
31
+ export interface YamlRetrieveResponse {
32
+ /**
33
+ * Folder name in the repo (e.g. 'prod_db_connection')
34
+ */
35
+ folder_name: string;
36
+
37
+ /**
38
+ * Raw YAML content of connection.yaml
39
+ */
40
+ yaml_content: string;
41
+ }
42
+
43
+ /**
44
+ * Response for YAML commit endpoint.
45
+ */
46
+ export interface YamlCommitResponse {
47
+ /**
48
+ * Whether the PR was auto-merged
49
+ */
50
+ merged: boolean;
51
+
52
+ /**
53
+ * GitHub PR number
54
+ */
55
+ pr_number: number;
56
+
57
+ /**
58
+ * GitHub PR URL
59
+ */
60
+ pr_url: string;
61
+ }
62
+
63
+ export interface YamlCommitParams {
64
+ /**
65
+ * Updated YAML content
66
+ */
67
+ yaml_content: string;
68
+
69
+ /**
70
+ * If true, auto-merge the PR after creation
71
+ */
72
+ auto_merge?: boolean;
73
+ }
74
+
75
+ export declare namespace Yaml {
76
+ export {
77
+ type YamlRetrieveResponse as YamlRetrieveResponse,
78
+ type YamlCommitResponse as YamlCommitResponse,
79
+ type YamlCommitParams as YamlCommitParams,
80
+ };
81
+ }
@@ -83,6 +83,14 @@ export interface GitHubGetStatusResponse {
83
83
 
84
84
  repository?: string | null;
85
85
 
86
+ scaffolding_pr_author?: string | null;
87
+
88
+ scaffolding_pr_created_at?: string | null;
89
+
90
+ scaffolding_pr_state?: string | null;
91
+
92
+ scaffolding_pr_title?: string | null;
93
+
86
94
  scaffolding_pr_url?: string | null;
87
95
 
88
96
  scaffolding_status?: string | null;
@@ -5,10 +5,22 @@ export {
5
5
  type Connection,
6
6
  type DatabaseConfig,
7
7
  type ConnectionListResponse,
8
+ type ConnectionApproveSyncResponse,
9
+ type ConnectionListSyncsResponse,
8
10
  type ConnectionRetrieveCredentialResponse,
11
+ type ConnectionRetrieveSchemaResponse,
12
+ type ConnectionRetrieveSyncStatusResponse,
13
+ type ConnectionStreamSyncProgressResponse,
9
14
  type ConnectionSyncResponse,
15
+ type ConnectionUpdateCredentialsResponse,
10
16
  type ConnectionCreateParams,
11
17
  type ConnectionUpdateParams,
18
+ type ConnectionListParams,
19
+ type ConnectionApproveSyncParams,
20
+ type ConnectionListSyncsParams,
21
+ type ConnectionRetrieveSyncStatusParams,
22
+ type ConnectionStreamSyncProgressParams,
23
+ type ConnectionUpdateCredentialsParams,
12
24
  } from './connections/index';
13
25
  export {
14
26
  GitHub,
@@ -33,6 +45,7 @@ export {
33
45
  type CreateTenant,
34
46
  type Tenant,
35
47
  type TenantListResponse,
48
+ type TenantRetrieveSchemaResponse,
36
49
  type TenantCreateParams,
37
50
  type TenantUpdateParams,
38
51
  } from './tenants/index';
@@ -0,0 +1,52 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import { APIPromise } from '../../../core/api-promise';
5
+ import { RequestOptions } from '../../../internal/request-options';
6
+
7
+ export class Groups extends APIResource {
8
+ /**
9
+ * Get all tenant groups as a TenantGroupSchema object.
10
+ *
11
+ * Returns tenant groups in the YAML-compatible schema format. Supports content
12
+ * negotiation: JSON by default, YAML with Accept: application/yaml.
13
+ *
14
+ * RLS: Filtered to current client (ClientRLSDB).
15
+ */
16
+ retrieveSchema(options?: RequestOptions): APIPromise<GroupRetrieveSchemaResponse> {
17
+ return this._client.get('/api/v1/tenants/groups/schema', options);
18
+ }
19
+ }
20
+
21
+ /**
22
+ * Schema for tenant group configuration files
23
+ */
24
+ export interface GroupRetrieveSchemaResponse {
25
+ /**
26
+ * Array of tenant group configurations
27
+ */
28
+ tenant_groups: Array<GroupRetrieveSchemaResponse.TenantGroup>;
29
+ }
30
+
31
+ export namespace GroupRetrieveSchemaResponse {
32
+ export interface TenantGroup {
33
+ /**
34
+ * Unique Kater identifier
35
+ */
36
+ kater_id: string;
37
+
38
+ /**
39
+ * Name identifier
40
+ */
41
+ name: string;
42
+
43
+ /**
44
+ * Description text
45
+ */
46
+ description?: string | null;
47
+ }
48
+ }
49
+
50
+ export declare namespace Groups {
51
+ export { type GroupRetrieveSchemaResponse as GroupRetrieveSchemaResponse };
52
+ }
@@ -11,6 +11,7 @@ export {
11
11
  type BatchUpdateParams,
12
12
  type BatchDeleteParams,
13
13
  } from './batch';
14
+ export { Groups, type GroupRetrieveSchemaResponse } from './groups';
14
15
  export {
15
16
  Import,
16
17
  type ImportTenants,
@@ -22,6 +23,7 @@ export {
22
23
  type CreateTenant,
23
24
  type Tenant,
24
25
  type TenantListResponse,
26
+ type TenantRetrieveSchemaResponse,
25
27
  type TenantCreateParams,
26
28
  type TenantUpdateParams,
27
29
  } from './tenants';
@@ -13,6 +13,8 @@ import {
13
13
  BatchUpdateParams,
14
14
  BatchUpdateResponse,
15
15
  } from './batch';
16
+ import * as GroupsAPI from './groups';
17
+ import { GroupRetrieveSchemaResponse, Groups } from './groups';
16
18
  import * as ImportAPI from './import';
17
19
  import { Import, ImportFromCsvParams, ImportFromWarehouseParams, ImportTenants } from './import';
18
20
  import { APIPromise } from '../../../core/api-promise';
@@ -23,6 +25,7 @@ import { path } from '../../../internal/utils/path';
23
25
  export class Tenants extends APIResource {
24
26
  batch: BatchAPI.Batch = new BatchAPI.Batch(this._client);
25
27
  import: ImportAPI.Import = new ImportAPI.Import(this._client);
28
+ groups: GroupsAPI.Groups = new GroupsAPI.Groups(this._client);
26
29
 
27
30
  /**
28
31
  * Create a new tenant.
@@ -102,6 +105,19 @@ export class Tenants extends APIResource {
102
105
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
103
106
  });
104
107
  }
108
+
109
+ /**
110
+ * Get all tenants as a TenantSchema object.
111
+ *
112
+ * Returns tenants in the YAML-compatible schema format with group references.
113
+ * Supports content negotiation: JSON by default, YAML with Accept:
114
+ * application/yaml.
115
+ *
116
+ * RLS: Filtered to current client (ClientRLSDB).
117
+ */
118
+ retrieveSchema(options?: RequestOptions): APIPromise<TenantRetrieveSchemaResponse> {
119
+ return this._client.get('/api/v1/tenants/schema', options);
120
+ }
105
121
  }
106
122
 
107
123
  /**
@@ -208,6 +224,40 @@ export namespace Tenant {
208
224
 
209
225
  export type TenantListResponse = Array<Tenant>;
210
226
 
227
+ /**
228
+ * Schema for tenant configuration files
229
+ */
230
+ export interface TenantRetrieveSchemaResponse {
231
+ /**
232
+ * Array of tenant configurations
233
+ */
234
+ tenants: Array<TenantRetrieveSchemaResponse.Tenant>;
235
+ }
236
+
237
+ export namespace TenantRetrieveSchemaResponse {
238
+ export interface Tenant {
239
+ /**
240
+ * Unique Kater identifier
241
+ */
242
+ kater_id: string;
243
+
244
+ /**
245
+ * Unique key identifier for the tenant (e.g., 'acme_corp')
246
+ */
247
+ tenant_key: string;
248
+
249
+ /**
250
+ * References to tenant groups this tenant belongs to
251
+ */
252
+ groups?: Array<string> | null;
253
+
254
+ /**
255
+ * Human-readable display name for the tenant
256
+ */
257
+ name?: string | null;
258
+ }
259
+ }
260
+
211
261
  export interface TenantCreateParams {
212
262
  /**
213
263
  * Unique tenant identifier within the client
@@ -259,12 +309,14 @@ export interface TenantUpdateParams {
259
309
 
260
310
  Tenants.Batch = Batch;
261
311
  Tenants.Import = Import;
312
+ Tenants.Groups = Groups;
262
313
 
263
314
  export declare namespace Tenants {
264
315
  export {
265
316
  type CreateTenant as CreateTenant,
266
317
  type Tenant as Tenant,
267
318
  type TenantListResponse as TenantListResponse,
319
+ type TenantRetrieveSchemaResponse as TenantRetrieveSchemaResponse,
268
320
  type TenantCreateParams as TenantCreateParams,
269
321
  type TenantUpdateParams as TenantUpdateParams,
270
322
  };
@@ -287,4 +339,6 @@ export declare namespace Tenants {
287
339
  type ImportFromCsvParams as ImportFromCsvParams,
288
340
  type ImportFromWarehouseParams as ImportFromWarehouseParams,
289
341
  };
342
+
343
+ export { Groups as Groups, type GroupRetrieveSchemaResponse as GroupRetrieveSchemaResponse };
290
344
  }
@@ -6,10 +6,22 @@ import { ClientUser, ClientUserRole, Me } from './me';
6
6
  import * as ConnectionsAPI from './connections/connections';
7
7
  import {
8
8
  Connection,
9
+ ConnectionApproveSyncParams,
10
+ ConnectionApproveSyncResponse,
9
11
  ConnectionCreateParams,
12
+ ConnectionListParams,
10
13
  ConnectionListResponse,
14
+ ConnectionListSyncsParams,
15
+ ConnectionListSyncsResponse,
11
16
  ConnectionRetrieveCredentialResponse,
17
+ ConnectionRetrieveSchemaResponse,
18
+ ConnectionRetrieveSyncStatusParams,
19
+ ConnectionRetrieveSyncStatusResponse,
20
+ ConnectionStreamSyncProgressParams,
21
+ ConnectionStreamSyncProgressResponse,
12
22
  ConnectionSyncResponse,
23
+ ConnectionUpdateCredentialsParams,
24
+ ConnectionUpdateCredentialsResponse,
13
25
  ConnectionUpdateParams,
14
26
  Connections,
15
27
  DatabaseConfig,
@@ -40,6 +52,7 @@ import {
40
52
  Tenant,
41
53
  TenantCreateParams,
42
54
  TenantListResponse,
55
+ TenantRetrieveSchemaResponse,
43
56
  TenantUpdateParams,
44
57
  Tenants,
45
58
  } from './tenants/tenants';
@@ -66,10 +79,22 @@ export declare namespace V1 {
66
79
  type Connection as Connection,
67
80
  type DatabaseConfig as DatabaseConfig,
68
81
  type ConnectionListResponse as ConnectionListResponse,
82
+ type ConnectionApproveSyncResponse as ConnectionApproveSyncResponse,
83
+ type ConnectionListSyncsResponse as ConnectionListSyncsResponse,
69
84
  type ConnectionRetrieveCredentialResponse as ConnectionRetrieveCredentialResponse,
85
+ type ConnectionRetrieveSchemaResponse as ConnectionRetrieveSchemaResponse,
86
+ type ConnectionRetrieveSyncStatusResponse as ConnectionRetrieveSyncStatusResponse,
87
+ type ConnectionStreamSyncProgressResponse as ConnectionStreamSyncProgressResponse,
70
88
  type ConnectionSyncResponse as ConnectionSyncResponse,
89
+ type ConnectionUpdateCredentialsResponse as ConnectionUpdateCredentialsResponse,
71
90
  type ConnectionCreateParams as ConnectionCreateParams,
72
91
  type ConnectionUpdateParams as ConnectionUpdateParams,
92
+ type ConnectionListParams as ConnectionListParams,
93
+ type ConnectionApproveSyncParams as ConnectionApproveSyncParams,
94
+ type ConnectionListSyncsParams as ConnectionListSyncsParams,
95
+ type ConnectionRetrieveSyncStatusParams as ConnectionRetrieveSyncStatusParams,
96
+ type ConnectionStreamSyncProgressParams as ConnectionStreamSyncProgressParams,
97
+ type ConnectionUpdateCredentialsParams as ConnectionUpdateCredentialsParams,
73
98
  };
74
99
 
75
100
  export {
@@ -99,6 +124,7 @@ export declare namespace V1 {
99
124
  type CreateTenant as CreateTenant,
100
125
  type Tenant as Tenant,
101
126
  type TenantListResponse as TenantListResponse,
127
+ type TenantRetrieveSchemaResponse as TenantRetrieveSchemaResponse,
102
128
  type TenantCreateParams as TenantCreateParams,
103
129
  type TenantUpdateParams as TenantUpdateParams,
104
130
  };
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.4.0'; // x-release-please-version
1
+ export const VERSION = '0.6.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.4.0";
1
+ export declare const VERSION = "0.6.0";
2
2
  //# sourceMappingURL=version.d.mts.map