@katerai/sdk 0.6.0 → 0.7.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.
- package/CHANGELOG.md +23 -0
- package/README.md +23 -16
- package/client.d.mts +10 -13
- package/client.d.mts.map +1 -1
- package/client.d.ts +10 -13
- package/client.d.ts.map +1 -1
- package/client.js +37 -15
- package/client.js.map +1 -1
- package/client.mjs +37 -15
- package/client.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +2 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +2 -1
- package/internal/utils/log.mjs.map +1 -1
- package/package.json +2 -2
- package/resources/index.d.mts +0 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +0 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -5
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +0 -2
- package/resources/index.mjs.map +1 -1
- package/resources/v1/connections.d.mts +216 -1
- package/resources/v1/connections.d.mts.map +1 -1
- package/resources/v1/connections.d.ts +216 -1
- package/resources/v1/connections.d.ts.map +1 -1
- package/resources/v1/connections.js +22 -2
- package/resources/v1/connections.js.map +1 -1
- package/resources/v1/connections.mjs +20 -1
- package/resources/v1/connections.mjs.map +1 -1
- package/resources/v1/index.d.mts +2 -6
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +2 -6
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +5 -13
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +2 -6
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/tenants.d.mts +125 -1
- package/resources/v1/tenants.d.mts.map +1 -1
- package/resources/v1/tenants.d.ts +125 -1
- package/resources/v1/tenants.d.ts.map +1 -1
- package/resources/v1/tenants.js +46 -2
- package/resources/v1/tenants.js.map +1 -1
- package/resources/v1/tenants.mjs +44 -1
- package/resources/v1/tenants.mjs.map +1 -1
- package/resources/v1/v1.d.mts +6 -22
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +6 -22
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +4 -20
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +4 -20
- package/resources/v1/v1.mjs.map +1 -1
- package/src/client.ts +48 -23
- package/src/internal/utils/log.ts +1 -0
- package/src/resources/index.ts +0 -2
- package/src/resources/v1/connections.ts +277 -1
- package/src/resources/v1/index.ts +7 -44
- package/src/resources/v1/tenants.ts +162 -1
- package/src/resources/v1/v1.ts +14 -104
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/healthz.d.mts +0 -16
- package/resources/healthz.d.mts.map +0 -1
- package/resources/healthz.d.ts +0 -16
- package/resources/healthz.d.ts.map +0 -1
- package/resources/healthz.js +0 -15
- package/resources/healthz.js.map +0 -1
- package/resources/healthz.mjs +0 -11
- package/resources/healthz.mjs.map +0 -1
- package/resources/readyz.d.mts +0 -16
- package/resources/readyz.d.mts.map +0 -1
- package/resources/readyz.d.ts +0 -16
- package/resources/readyz.d.ts.map +0 -1
- package/resources/readyz.js +0 -15
- package/resources/readyz.js.map +0 -1
- package/resources/readyz.mjs +0 -11
- package/resources/readyz.mjs.map +0 -1
- package/resources/v1/connections/connections.d.mts +0 -1470
- package/resources/v1/connections/connections.d.mts.map +0 -1
- package/resources/v1/connections/connections.d.ts +0 -1470
- package/resources/v1/connections/connections.d.ts.map +0 -1
- package/resources/v1/connections/connections.js +0 -163
- package/resources/v1/connections/connections.js.map +0 -1
- package/resources/v1/connections/connections.mjs +0 -158
- package/resources/v1/connections/connections.mjs.map +0 -1
- package/resources/v1/connections/databases.d.mts +0 -25
- package/resources/v1/connections/databases.d.mts.map +0 -1
- package/resources/v1/connections/databases.d.ts +0 -25
- package/resources/v1/connections/databases.d.ts.map +0 -1
- package/resources/v1/connections/databases.js +0 -26
- package/resources/v1/connections/databases.js.map +0 -1
- package/resources/v1/connections/databases.mjs +0 -22
- package/resources/v1/connections/databases.mjs.map +0 -1
- package/resources/v1/connections/index.d.mts +0 -5
- package/resources/v1/connections/index.d.mts.map +0 -1
- package/resources/v1/connections/index.d.ts +0 -5
- package/resources/v1/connections/index.d.ts.map +0 -1
- package/resources/v1/connections/index.js +0 -13
- package/resources/v1/connections/index.js.map +0 -1
- package/resources/v1/connections/index.mjs +0 -6
- package/resources/v1/connections/index.mjs.map +0 -1
- package/resources/v1/connections/views.d.mts +0 -77
- package/resources/v1/connections/views.d.mts.map +0 -1
- package/resources/v1/connections/views.d.ts +0 -77
- package/resources/v1/connections/views.d.ts.map +0 -1
- package/resources/v1/connections/views.js +0 -24
- package/resources/v1/connections/views.js.map +0 -1
- package/resources/v1/connections/views.mjs +0 -20
- package/resources/v1/connections/views.mjs.map +0 -1
- package/resources/v1/connections/yaml.d.mts +0 -57
- package/resources/v1/connections/yaml.d.mts.map +0 -1
- package/resources/v1/connections/yaml.d.ts +0 -57
- package/resources/v1/connections/yaml.d.ts.map +0 -1
- package/resources/v1/connections/yaml.js +0 -22
- package/resources/v1/connections/yaml.js.map +0 -1
- package/resources/v1/connections/yaml.mjs +0 -18
- package/resources/v1/connections/yaml.mjs.map +0 -1
- package/resources/v1/github/github.d.mts +0 -99
- package/resources/v1/github/github.d.mts.map +0 -1
- package/resources/v1/github/github.d.ts +0 -99
- package/resources/v1/github/github.d.ts.map +0 -1
- package/resources/v1/github/github.js +0 -49
- package/resources/v1/github/github.js.map +0 -1
- package/resources/v1/github/github.mjs +0 -44
- package/resources/v1/github/github.mjs.map +0 -1
- package/resources/v1/github/index.d.mts +0 -5
- package/resources/v1/github/index.d.mts.map +0 -1
- package/resources/v1/github/index.d.ts +0 -5
- package/resources/v1/github/index.d.ts.map +0 -1
- package/resources/v1/github/index.js +0 -13
- package/resources/v1/github/index.js.map +0 -1
- package/resources/v1/github/index.mjs +0 -6
- package/resources/v1/github/index.mjs.map +0 -1
- package/resources/v1/github/repos.d.mts +0 -54
- package/resources/v1/github/repos.d.mts.map +0 -1
- package/resources/v1/github/repos.d.ts +0 -54
- package/resources/v1/github/repos.d.ts.map +0 -1
- package/resources/v1/github/repos.js +0 -22
- package/resources/v1/github/repos.js.map +0 -1
- package/resources/v1/github/repos.mjs +0 -18
- package/resources/v1/github/repos.mjs.map +0 -1
- package/resources/v1/github/scaffold.d.mts +0 -29
- package/resources/v1/github/scaffold.d.mts.map +0 -1
- package/resources/v1/github/scaffold.d.ts +0 -29
- package/resources/v1/github/scaffold.d.ts.map +0 -1
- package/resources/v1/github/scaffold.js +0 -21
- package/resources/v1/github/scaffold.js.map +0 -1
- package/resources/v1/github/scaffold.mjs +0 -17
- package/resources/v1/github/scaffold.mjs.map +0 -1
- package/resources/v1/github/webhooks.d.mts +0 -28
- package/resources/v1/github/webhooks.d.mts.map +0 -1
- package/resources/v1/github/webhooks.d.ts +0 -28
- package/resources/v1/github/webhooks.d.ts.map +0 -1
- package/resources/v1/github/webhooks.js +0 -27
- package/resources/v1/github/webhooks.js.map +0 -1
- package/resources/v1/github/webhooks.mjs +0 -23
- package/resources/v1/github/webhooks.mjs.map +0 -1
- package/resources/v1/github.d.mts +0 -2
- package/resources/v1/github.d.mts.map +0 -1
- package/resources/v1/github.d.ts +0 -2
- package/resources/v1/github.d.ts.map +0 -1
- package/resources/v1/github.js +0 -6
- package/resources/v1/github.js.map +0 -1
- package/resources/v1/github.mjs +0 -3
- package/resources/v1/github.mjs.map +0 -1
- package/resources/v1/groups/groups.d.mts +0 -162
- package/resources/v1/groups/groups.d.mts.map +0 -1
- package/resources/v1/groups/groups.d.ts +0 -162
- package/resources/v1/groups/groups.d.ts.map +0 -1
- package/resources/v1/groups/groups.js +0 -81
- package/resources/v1/groups/groups.js.map +0 -1
- package/resources/v1/groups/groups.mjs +0 -76
- package/resources/v1/groups/groups.mjs.map +0 -1
- package/resources/v1/groups/index.d.mts +0 -3
- package/resources/v1/groups/index.d.mts.map +0 -1
- package/resources/v1/groups/index.d.ts +0 -3
- package/resources/v1/groups/index.d.ts.map +0 -1
- package/resources/v1/groups/index.js +0 -9
- package/resources/v1/groups/index.js.map +0 -1
- package/resources/v1/groups/index.mjs +0 -4
- package/resources/v1/groups/index.mjs.map +0 -1
- package/resources/v1/groups/tenants.d.mts +0 -55
- package/resources/v1/groups/tenants.d.mts.map +0 -1
- package/resources/v1/groups/tenants.d.ts +0 -55
- package/resources/v1/groups/tenants.d.ts.map +0 -1
- package/resources/v1/groups/tenants.js +0 -39
- package/resources/v1/groups/tenants.js.map +0 -1
- package/resources/v1/groups/tenants.mjs +0 -35
- package/resources/v1/groups/tenants.mjs.map +0 -1
- package/resources/v1/groups.d.mts +0 -2
- package/resources/v1/groups.d.mts.map +0 -1
- package/resources/v1/groups.d.ts +0 -2
- package/resources/v1/groups.d.ts.map +0 -1
- package/resources/v1/groups.js +0 -6
- package/resources/v1/groups.js.map +0 -1
- package/resources/v1/groups.mjs +0 -3
- package/resources/v1/groups.mjs.map +0 -1
- package/resources/v1/me.d.mts +0 -43
- package/resources/v1/me.d.mts.map +0 -1
- package/resources/v1/me.d.ts +0 -43
- package/resources/v1/me.d.ts.map +0 -1
- package/resources/v1/me.js +0 -20
- package/resources/v1/me.js.map +0 -1
- package/resources/v1/me.mjs +0 -16
- package/resources/v1/me.mjs.map +0 -1
- package/resources/v1/org/client.d.mts +0 -53
- package/resources/v1/org/client.d.mts.map +0 -1
- package/resources/v1/org/client.d.ts +0 -53
- package/resources/v1/org/client.d.ts.map +0 -1
- package/resources/v1/org/client.js +0 -25
- package/resources/v1/org/client.js.map +0 -1
- package/resources/v1/org/client.mjs +0 -21
- package/resources/v1/org/client.mjs.map +0 -1
- package/resources/v1/org/index.d.mts +0 -4
- package/resources/v1/org/index.d.mts.map +0 -1
- package/resources/v1/org/index.d.ts +0 -4
- package/resources/v1/org/index.d.ts.map +0 -1
- package/resources/v1/org/index.js +0 -11
- package/resources/v1/org/index.js.map +0 -1
- package/resources/v1/org/index.mjs +0 -5
- package/resources/v1/org/index.mjs.map +0 -1
- package/resources/v1/org/org.d.mts +0 -14
- package/resources/v1/org/org.d.mts.map +0 -1
- package/resources/v1/org/org.d.ts +0 -14
- package/resources/v1/org/org.d.ts.map +0 -1
- package/resources/v1/org/org.js +0 -21
- package/resources/v1/org/org.js.map +0 -1
- package/resources/v1/org/org.mjs +0 -16
- package/resources/v1/org/org.mjs.map +0 -1
- package/resources/v1/org/users.d.mts +0 -87
- package/resources/v1/org/users.d.mts.map +0 -1
- package/resources/v1/org/users.d.ts +0 -87
- package/resources/v1/org/users.d.ts.map +0 -1
- package/resources/v1/org/users.js +0 -60
- package/resources/v1/org/users.js.map +0 -1
- package/resources/v1/org/users.mjs +0 -56
- package/resources/v1/org/users.mjs.map +0 -1
- package/resources/v1/org.d.mts +0 -2
- package/resources/v1/org.d.mts.map +0 -1
- package/resources/v1/org.d.ts +0 -2
- package/resources/v1/org.d.ts.map +0 -1
- package/resources/v1/org.js +0 -6
- package/resources/v1/org.js.map +0 -1
- package/resources/v1/org.mjs +0 -3
- package/resources/v1/org.mjs.map +0 -1
- package/resources/v1/tenants/batch.d.mts +0 -159
- package/resources/v1/tenants/batch.d.mts.map +0 -1
- package/resources/v1/tenants/batch.d.ts +0 -159
- package/resources/v1/tenants/batch.d.ts.map +0 -1
- package/resources/v1/tenants/batch.js +0 -42
- package/resources/v1/tenants/batch.js.map +0 -1
- package/resources/v1/tenants/batch.mjs +0 -38
- package/resources/v1/tenants/batch.mjs.map +0 -1
- package/resources/v1/tenants/groups.d.mts +0 -43
- package/resources/v1/tenants/groups.d.mts.map +0 -1
- package/resources/v1/tenants/groups.d.ts +0 -43
- package/resources/v1/tenants/groups.d.ts.map +0 -1
- package/resources/v1/tenants/groups.js +0 -20
- package/resources/v1/tenants/groups.js.map +0 -1
- package/resources/v1/tenants/groups.mjs +0 -16
- package/resources/v1/tenants/groups.mjs.map +0 -1
- package/resources/v1/tenants/import.d.mts +0 -126
- package/resources/v1/tenants/import.d.mts.map +0 -1
- package/resources/v1/tenants/import.d.ts +0 -126
- package/resources/v1/tenants/import.d.ts.map +0 -1
- package/resources/v1/tenants/import.js +0 -50
- package/resources/v1/tenants/import.js.map +0 -1
- package/resources/v1/tenants/import.mjs +0 -46
- package/resources/v1/tenants/import.mjs.map +0 -1
- package/resources/v1/tenants/index.d.mts +0 -5
- package/resources/v1/tenants/index.d.mts.map +0 -1
- package/resources/v1/tenants/index.d.ts +0 -5
- package/resources/v1/tenants/index.d.ts.map +0 -1
- package/resources/v1/tenants/index.js +0 -13
- package/resources/v1/tenants/index.js.map +0 -1
- package/resources/v1/tenants/index.mjs +0 -6
- package/resources/v1/tenants/index.mjs.map +0 -1
- package/resources/v1/tenants/tenants.d.mts +0 -248
- package/resources/v1/tenants/tenants.d.mts.map +0 -1
- package/resources/v1/tenants/tenants.d.ts +0 -248
- package/resources/v1/tenants/tenants.d.ts.map +0 -1
- package/resources/v1/tenants/tenants.js +0 -113
- package/resources/v1/tenants/tenants.js.map +0 -1
- package/resources/v1/tenants/tenants.mjs +0 -108
- package/resources/v1/tenants/tenants.mjs.map +0 -1
- package/src/resources/healthz.ts +0 -20
- package/src/resources/readyz.ts +0 -20
- package/src/resources/v1/connections/connections.ts +0 -1905
- package/src/resources/v1/connections/databases.ts +0 -42
- package/src/resources/v1/connections/index.ts +0 -33
- package/src/resources/v1/connections/views.ts +0 -112
- package/src/resources/v1/connections/yaml.ts +0 -81
- package/src/resources/v1/github/github.ts +0 -165
- package/src/resources/v1/github/index.ts +0 -20
- package/src/resources/v1/github/repos.ts +0 -85
- package/src/resources/v1/github/scaffold.ts +0 -44
- package/src/resources/v1/github/webhooks.ts +0 -60
- package/src/resources/v1/github.ts +0 -3
- package/src/resources/v1/groups/groups.ts +0 -218
- package/src/resources/v1/groups/index.ts +0 -10
- package/src/resources/v1/groups/tenants.ts +0 -78
- package/src/resources/v1/groups.ts +0 -3
- package/src/resources/v1/me.ts +0 -62
- package/src/resources/v1/org/client.ts +0 -81
- package/src/resources/v1/org/index.ts +0 -11
- package/src/resources/v1/org/org.ts +0 -32
- package/src/resources/v1/org/users.ts +0 -127
- package/src/resources/v1/org.ts +0 -3
- package/src/resources/v1/tenants/batch.ts +0 -200
- package/src/resources/v1/tenants/groups.ts +0 -52
- package/src/resources/v1/tenants/import.ts +0 -158
- package/src/resources/v1/tenants/index.ts +0 -29
- package/src/resources/v1/tenants/tenants.ts +0 -344
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../../core/resource';
|
|
4
|
-
import * as TenantsAPI from './tenants';
|
|
5
|
-
import { TenantAddParams, TenantAddResponse, TenantRemoveParams, Tenants } from './tenants';
|
|
6
|
-
import { APIPromise } from '../../../core/api-promise';
|
|
7
|
-
import { buildHeaders } from '../../../internal/headers';
|
|
8
|
-
import { RequestOptions } from '../../../internal/request-options';
|
|
9
|
-
import { path } from '../../../internal/utils/path';
|
|
10
|
-
|
|
11
|
-
export class Groups extends APIResource {
|
|
12
|
-
tenants: TenantsAPI.Tenants = new TenantsAPI.Tenants(this._client);
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Create a new group.
|
|
16
|
-
*
|
|
17
|
-
* Group names must be unique within the client.
|
|
18
|
-
*
|
|
19
|
-
* RLS: Filtered to current client (ClientRLSDB).
|
|
20
|
-
*
|
|
21
|
-
* Raises: GroupNameExistsError: If a group with this name already exists (409)
|
|
22
|
-
*/
|
|
23
|
-
create(body: GroupCreateParams, options?: RequestOptions): APIPromise<GroupDetail> {
|
|
24
|
-
return this._client.post('/api/v1/groups', { body, ...options });
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Get a single group by ID.
|
|
29
|
-
*
|
|
30
|
-
* Returns the group with its full tenant list.
|
|
31
|
-
*
|
|
32
|
-
* RLS: Filtered to current client (ClientRLSDB).
|
|
33
|
-
*
|
|
34
|
-
* Raises: GroupNotFoundError: If group doesn't exist (404)
|
|
35
|
-
*/
|
|
36
|
-
retrieve(groupID: string, options?: RequestOptions): APIPromise<GroupDetail> {
|
|
37
|
-
return this._client.get(path`/api/v1/groups/${groupID}`, options);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Update a group.
|
|
42
|
-
*
|
|
43
|
-
* Update group name and/or description. Name must remain unique within client.
|
|
44
|
-
*
|
|
45
|
-
* RLS: Filtered to current client (ClientRLSDB).
|
|
46
|
-
*
|
|
47
|
-
* Raises: GroupNotFoundError: If group doesn't exist (404) GroupNameExistsError:
|
|
48
|
-
* If new name conflicts with existing group (409)
|
|
49
|
-
*/
|
|
50
|
-
update(groupID: string, body: GroupUpdateParams, options?: RequestOptions): APIPromise<GroupDetail> {
|
|
51
|
-
return this._client.patch(path`/api/v1/groups/${groupID}`, { body, ...options });
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* List all groups for the client.
|
|
56
|
-
*
|
|
57
|
-
* Returns groups with their tenant counts for efficient display.
|
|
58
|
-
*
|
|
59
|
-
* RLS: Filtered to current client (ClientRLSDB).
|
|
60
|
-
*/
|
|
61
|
-
list(options?: RequestOptions): APIPromise<GroupListResponse> {
|
|
62
|
-
return this._client.get('/api/v1/groups', options);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Delete a group.
|
|
67
|
-
*
|
|
68
|
-
* Soft-deletes the group and removes all tenant associations.
|
|
69
|
-
*
|
|
70
|
-
* RLS: Filtered to current client (ClientRLSDB).
|
|
71
|
-
*
|
|
72
|
-
* Raises: GroupNotFoundError: If group doesn't exist (404)
|
|
73
|
-
*/
|
|
74
|
-
delete(groupID: string, options?: RequestOptions): APIPromise<void> {
|
|
75
|
-
return this._client.delete(path`/api/v1/groups/${groupID}`, {
|
|
76
|
-
...options,
|
|
77
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Response model for a single group (with full tenant list).
|
|
84
|
-
*/
|
|
85
|
-
export interface GroupDetail {
|
|
86
|
-
/**
|
|
87
|
-
* Group ID
|
|
88
|
-
*/
|
|
89
|
-
id: string;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Creation timestamp
|
|
93
|
-
*/
|
|
94
|
-
created_at: string;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Group description
|
|
98
|
-
*/
|
|
99
|
-
description: string | null;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Group name
|
|
103
|
-
*/
|
|
104
|
-
name: string;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Tenants in this group
|
|
108
|
-
*/
|
|
109
|
-
tenants: Array<GroupDetail.Tenant>;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Last update timestamp
|
|
113
|
-
*/
|
|
114
|
-
updated_at: string;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export namespace GroupDetail {
|
|
118
|
-
/**
|
|
119
|
-
* Tenant information in group responses.
|
|
120
|
-
*/
|
|
121
|
-
export interface Tenant {
|
|
122
|
-
/**
|
|
123
|
-
* Tenant ID
|
|
124
|
-
*/
|
|
125
|
-
id: string;
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Human-readable tenant name
|
|
129
|
-
*/
|
|
130
|
-
name: string | null;
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Unique tenant identifier
|
|
134
|
-
*/
|
|
135
|
-
tenant_key: string;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export type GroupListResponse = Array<GroupListResponse.GroupListResponseItem>;
|
|
140
|
-
|
|
141
|
-
export namespace GroupListResponse {
|
|
142
|
-
/**
|
|
143
|
-
* Response model for a group in list responses (with tenant count).
|
|
144
|
-
*/
|
|
145
|
-
export interface GroupListResponseItem {
|
|
146
|
-
/**
|
|
147
|
-
* Group ID
|
|
148
|
-
*/
|
|
149
|
-
id: string;
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Creation timestamp
|
|
153
|
-
*/
|
|
154
|
-
created_at: string;
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Group description
|
|
158
|
-
*/
|
|
159
|
-
description: string | null;
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Group name
|
|
163
|
-
*/
|
|
164
|
-
name: string;
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Number of tenants in this group
|
|
168
|
-
*/
|
|
169
|
-
tenant_count: number;
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Last update timestamp
|
|
173
|
-
*/
|
|
174
|
-
updated_at: string;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export interface GroupCreateParams {
|
|
179
|
-
/**
|
|
180
|
-
* Unique group name within the client
|
|
181
|
-
*/
|
|
182
|
-
name: string;
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Human-readable group description
|
|
186
|
-
*/
|
|
187
|
-
description?: string | null;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export interface GroupUpdateParams {
|
|
191
|
-
/**
|
|
192
|
-
* New group description
|
|
193
|
-
*/
|
|
194
|
-
description?: string | null;
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* New group name
|
|
198
|
-
*/
|
|
199
|
-
name?: string | null;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
Groups.Tenants = Tenants;
|
|
203
|
-
|
|
204
|
-
export declare namespace Groups {
|
|
205
|
-
export {
|
|
206
|
-
type GroupDetail as GroupDetail,
|
|
207
|
-
type GroupListResponse as GroupListResponse,
|
|
208
|
-
type GroupCreateParams as GroupCreateParams,
|
|
209
|
-
type GroupUpdateParams as GroupUpdateParams,
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
export {
|
|
213
|
-
Tenants as Tenants,
|
|
214
|
-
type TenantAddResponse as TenantAddResponse,
|
|
215
|
-
type TenantAddParams as TenantAddParams,
|
|
216
|
-
type TenantRemoveParams as TenantRemoveParams,
|
|
217
|
-
};
|
|
218
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
Groups,
|
|
5
|
-
type GroupDetail,
|
|
6
|
-
type GroupListResponse,
|
|
7
|
-
type GroupCreateParams,
|
|
8
|
-
type GroupUpdateParams,
|
|
9
|
-
} from './groups';
|
|
10
|
-
export { Tenants, type TenantAddResponse, type TenantAddParams, type TenantRemoveParams } from './tenants';
|
|
@@ -1,78 +0,0 @@
|
|
|
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 { buildHeaders } from '../../../internal/headers';
|
|
6
|
-
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
-
import { path } from '../../../internal/utils/path';
|
|
8
|
-
|
|
9
|
-
export class Tenants extends APIResource {
|
|
10
|
-
/**
|
|
11
|
-
* Add tenants to a group.
|
|
12
|
-
*
|
|
13
|
-
* Accepts a list of tenant IDs. Returns detailed results showing which tenants
|
|
14
|
-
* were added, which were already members, and which don't exist.
|
|
15
|
-
*
|
|
16
|
-
* RLS: Filtered to current client (ClientRLSDB).
|
|
17
|
-
*
|
|
18
|
-
* Raises: GroupNotFoundError: If group doesn't exist (404)
|
|
19
|
-
*/
|
|
20
|
-
add(groupID: string, body: TenantAddParams, options?: RequestOptions): APIPromise<TenantAddResponse> {
|
|
21
|
-
return this._client.post(path`/api/v1/groups/${groupID}/tenants`, { body, ...options });
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Remove a tenant from a group.
|
|
26
|
-
*
|
|
27
|
-
* RLS: Filtered to current client (ClientRLSDB).
|
|
28
|
-
*
|
|
29
|
-
* Raises: GroupNotFoundError: If group doesn't exist (404) TenantNotFoundError: If
|
|
30
|
-
* tenant is not a member of the group (404)
|
|
31
|
-
*/
|
|
32
|
-
remove(tenantID: string, params: TenantRemoveParams, options?: RequestOptions): APIPromise<void> {
|
|
33
|
-
const { group_id } = params;
|
|
34
|
-
return this._client.delete(path`/api/v1/groups/${group_id}/tenants/${tenantID}`, {
|
|
35
|
-
...options,
|
|
36
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Response model for add tenants operation.
|
|
43
|
-
*/
|
|
44
|
-
export interface TenantAddResponse {
|
|
45
|
-
/**
|
|
46
|
-
* Tenant IDs that were successfully added
|
|
47
|
-
*/
|
|
48
|
-
added: Array<string>;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Tenant IDs that were already members
|
|
52
|
-
*/
|
|
53
|
-
already_in_group: Array<string>;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Tenant IDs that don't exist
|
|
57
|
-
*/
|
|
58
|
-
not_found: Array<string>;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface TenantAddParams {
|
|
62
|
-
/**
|
|
63
|
-
* List of tenant IDs to add to the group
|
|
64
|
-
*/
|
|
65
|
-
tenant_ids: Array<string>;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export interface TenantRemoveParams {
|
|
69
|
-
group_id: string;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export declare namespace Tenants {
|
|
73
|
-
export {
|
|
74
|
-
type TenantAddResponse as TenantAddResponse,
|
|
75
|
-
type TenantAddParams as TenantAddParams,
|
|
76
|
-
type TenantRemoveParams as TenantRemoveParams,
|
|
77
|
-
};
|
|
78
|
-
}
|
package/src/resources/v1/me.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
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 Me extends APIResource {
|
|
8
|
-
/**
|
|
9
|
-
* Get the current authenticated user's information.
|
|
10
|
-
*
|
|
11
|
-
* Returns the user's profile within their active organization. This endpoint only
|
|
12
|
-
* requires authentication - no special permissions needed.
|
|
13
|
-
*
|
|
14
|
-
* RLS: Filtered to current user's data only (RLSDB).
|
|
15
|
-
*/
|
|
16
|
-
retrieve(options?: RequestOptions): APIPromise<ClientUser> {
|
|
17
|
-
return this._client.get('/api/v1/me', options);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Response schema for a client user.
|
|
23
|
-
*/
|
|
24
|
-
export interface ClientUser {
|
|
25
|
-
id: string;
|
|
26
|
-
|
|
27
|
-
client_id: string;
|
|
28
|
-
|
|
29
|
-
created_at: string;
|
|
30
|
-
|
|
31
|
-
email: string;
|
|
32
|
-
|
|
33
|
-
email_confirmed: boolean;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Role of a user within a client organization.
|
|
37
|
-
*/
|
|
38
|
-
role: ClientUserRole;
|
|
39
|
-
|
|
40
|
-
updated_at: string;
|
|
41
|
-
|
|
42
|
-
first_name?: string | null;
|
|
43
|
-
|
|
44
|
-
last_name?: string | null;
|
|
45
|
-
|
|
46
|
-
picture_url?: string | null;
|
|
47
|
-
|
|
48
|
-
propel_auth_created_at?: string | null;
|
|
49
|
-
|
|
50
|
-
propel_auth_last_active_at?: string | null;
|
|
51
|
-
|
|
52
|
-
username?: string | null;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Role of a user within a client organization.
|
|
57
|
-
*/
|
|
58
|
-
export type ClientUserRole = 'Admin' | 'Developer' | 'Viewer';
|
|
59
|
-
|
|
60
|
-
export declare namespace Me {
|
|
61
|
-
export { type ClientUser as ClientUser, type ClientUserRole as ClientUserRole };
|
|
62
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
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 ClientResource extends APIResource {
|
|
8
|
-
/**
|
|
9
|
-
* Get the current user's organization details.
|
|
10
|
-
*
|
|
11
|
-
* RLS: Filtered to current client (ClientRLSDB).
|
|
12
|
-
*/
|
|
13
|
-
retrieve(options?: RequestOptions): APIPromise<Client> {
|
|
14
|
-
return this._client.get('/api/v1/org/client', options);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Update the current user's organization details.
|
|
19
|
-
*
|
|
20
|
-
* RLS: Filtered to current client (ClientRLSDB).
|
|
21
|
-
*/
|
|
22
|
-
update(body: ClientUpdateParams, options?: RequestOptions): APIPromise<Client> {
|
|
23
|
-
return this._client.patch('/api/v1/org/client', { body, ...options });
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Response schema for a client/organization.
|
|
29
|
-
*/
|
|
30
|
-
export interface Client {
|
|
31
|
-
id: string;
|
|
32
|
-
|
|
33
|
-
can_auto_join_by_domain: boolean;
|
|
34
|
-
|
|
35
|
-
created_at: string;
|
|
36
|
-
|
|
37
|
-
members_must_have_matching_domain: boolean;
|
|
38
|
-
|
|
39
|
-
name: string;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Type of tenancy for a client.
|
|
43
|
-
*/
|
|
44
|
-
tenancy_type: TenancyType;
|
|
45
|
-
|
|
46
|
-
updated_at: string;
|
|
47
|
-
|
|
48
|
-
domain?: string | null;
|
|
49
|
-
|
|
50
|
-
logo_url?: string | null;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Type of tenancy for a client.
|
|
55
|
-
*/
|
|
56
|
-
export type TenancyType = 'row' | 'database' | 'none';
|
|
57
|
-
|
|
58
|
-
export interface ClientUpdateParams {
|
|
59
|
-
can_auto_join_by_domain?: boolean | null;
|
|
60
|
-
|
|
61
|
-
domain?: string | null;
|
|
62
|
-
|
|
63
|
-
logo_url?: string | null;
|
|
64
|
-
|
|
65
|
-
members_must_have_matching_domain?: boolean | null;
|
|
66
|
-
|
|
67
|
-
name?: string | null;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Type of tenancy for a client.
|
|
71
|
-
*/
|
|
72
|
-
tenancy_type?: TenancyType | null;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export declare namespace ClientResource {
|
|
76
|
-
export {
|
|
77
|
-
type Client as Client,
|
|
78
|
-
type TenancyType as TenancyType,
|
|
79
|
-
type ClientUpdateParams as ClientUpdateParams,
|
|
80
|
-
};
|
|
81
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
export { ClientResource, type Client, type TenancyType, type ClientUpdateParams } from './client';
|
|
4
|
-
export { Org } from './org';
|
|
5
|
-
export {
|
|
6
|
-
Users,
|
|
7
|
-
type UserListResponse,
|
|
8
|
-
type UserDeleteResponse,
|
|
9
|
-
type UserCreateParams,
|
|
10
|
-
type UserUpdateParams,
|
|
11
|
-
} from './users';
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../../core/resource';
|
|
4
|
-
import * as ClientAPI from './client';
|
|
5
|
-
import { Client, ClientResource, ClientUpdateParams, TenancyType } from './client';
|
|
6
|
-
import * as UsersAPI from './users';
|
|
7
|
-
import { UserCreateParams, UserDeleteResponse, UserListResponse, UserUpdateParams, Users } from './users';
|
|
8
|
-
|
|
9
|
-
export class Org extends APIResource {
|
|
10
|
-
client: ClientAPI.ClientResource = new ClientAPI.ClientResource(this._client);
|
|
11
|
-
users: UsersAPI.Users = new UsersAPI.Users(this._client);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
Org.ClientResource = ClientResource;
|
|
15
|
-
Org.Users = Users;
|
|
16
|
-
|
|
17
|
-
export declare namespace Org {
|
|
18
|
-
export {
|
|
19
|
-
ClientResource as ClientResource,
|
|
20
|
-
type Client as Client,
|
|
21
|
-
type TenancyType as TenancyType,
|
|
22
|
-
type ClientUpdateParams as ClientUpdateParams,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export {
|
|
26
|
-
Users as Users,
|
|
27
|
-
type UserListResponse as UserListResponse,
|
|
28
|
-
type UserDeleteResponse as UserDeleteResponse,
|
|
29
|
-
type UserCreateParams as UserCreateParams,
|
|
30
|
-
type UserUpdateParams as UserUpdateParams,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../../core/resource';
|
|
4
|
-
import * as MeAPI from '../me';
|
|
5
|
-
import { APIPromise } from '../../../core/api-promise';
|
|
6
|
-
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
-
import { path } from '../../../internal/utils/path';
|
|
8
|
-
|
|
9
|
-
export class Users extends APIResource {
|
|
10
|
-
/**
|
|
11
|
-
* Create a new user in the current organization.
|
|
12
|
-
*
|
|
13
|
-
* Creates the user in PropelAuth and adds them to this organization. The user will
|
|
14
|
-
* receive an email to confirm their email address.
|
|
15
|
-
*
|
|
16
|
-
* RLS: Filtered to current client (ClientRLSDB).
|
|
17
|
-
*/
|
|
18
|
-
create(body: UserCreateParams, options?: RequestOptions): APIPromise<MeAPI.ClientUser> {
|
|
19
|
-
return this._client.post('/api/v1/org/users', { body, ...options });
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Get a specific user in the current organization.
|
|
24
|
-
*
|
|
25
|
-
* RLS: Filtered to current client, can see any user (ClientRLSDB).
|
|
26
|
-
*/
|
|
27
|
-
retrieve(userID: string, options?: RequestOptions): APIPromise<MeAPI.ClientUser> {
|
|
28
|
-
return this._client.get(path`/api/v1/org/users/${userID}`, options);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Update a user in the current organization.
|
|
33
|
-
*
|
|
34
|
-
* Different PropelAuth methods are called depending on what's being updated:
|
|
35
|
-
*
|
|
36
|
-
* - Email changes require re-confirmation
|
|
37
|
-
* - Password changes take effect immediately
|
|
38
|
-
* - Profile fields (name, username, picture) are updated together
|
|
39
|
-
* - Role changes affect organization permissions
|
|
40
|
-
*
|
|
41
|
-
* RLS: Filtered to current client, can update any user (ClientRLSDB).
|
|
42
|
-
*/
|
|
43
|
-
update(userID: string, body: UserUpdateParams, options?: RequestOptions): APIPromise<MeAPI.ClientUser> {
|
|
44
|
-
return this._client.patch(path`/api/v1/org/users/${userID}`, { body, ...options });
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* List all users in the current organization.
|
|
49
|
-
*
|
|
50
|
-
* RLS: Filtered to current client, sees all users (ClientRLSDB).
|
|
51
|
-
*/
|
|
52
|
-
list(options?: RequestOptions): APIPromise<UserListResponse> {
|
|
53
|
-
return this._client.get('/api/v1/org/users', options);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Soft delete a user from the current organization.
|
|
58
|
-
*
|
|
59
|
-
* RLS: Filtered to current client (ClientRLSDB).
|
|
60
|
-
*/
|
|
61
|
-
delete(userID: string, options?: RequestOptions): APIPromise<UserDeleteResponse> {
|
|
62
|
-
return this._client.delete(path`/api/v1/org/users/${userID}`, options);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Response schema for listing client users.
|
|
68
|
-
*/
|
|
69
|
-
export interface UserListResponse {
|
|
70
|
-
total: number;
|
|
71
|
-
|
|
72
|
-
users: Array<MeAPI.ClientUser>;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Response schema for delete operations.
|
|
77
|
-
*/
|
|
78
|
-
export interface UserDeleteResponse {
|
|
79
|
-
message: string;
|
|
80
|
-
|
|
81
|
-
success: boolean;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export interface UserCreateParams {
|
|
85
|
-
email: string;
|
|
86
|
-
|
|
87
|
-
password: string;
|
|
88
|
-
|
|
89
|
-
first_name?: string | null;
|
|
90
|
-
|
|
91
|
-
last_name?: string | null;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Role of a user within a client organization.
|
|
95
|
-
*/
|
|
96
|
-
role?: MeAPI.ClientUserRole;
|
|
97
|
-
|
|
98
|
-
username?: string | null;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export interface UserUpdateParams {
|
|
102
|
-
email?: string | null;
|
|
103
|
-
|
|
104
|
-
first_name?: string | null;
|
|
105
|
-
|
|
106
|
-
last_name?: string | null;
|
|
107
|
-
|
|
108
|
-
password?: string | null;
|
|
109
|
-
|
|
110
|
-
picture_url?: string | null;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Role of a user within a client organization.
|
|
114
|
-
*/
|
|
115
|
-
role?: MeAPI.ClientUserRole | null;
|
|
116
|
-
|
|
117
|
-
username?: string | null;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export declare namespace Users {
|
|
121
|
-
export {
|
|
122
|
-
type UserListResponse as UserListResponse,
|
|
123
|
-
type UserDeleteResponse as UserDeleteResponse,
|
|
124
|
-
type UserCreateParams as UserCreateParams,
|
|
125
|
-
type UserUpdateParams as UserUpdateParams,
|
|
126
|
-
};
|
|
127
|
-
}
|
package/src/resources/v1/org.ts
DELETED