@vertesia/client 0.65.0 → 0.66.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/lib/cjs/GroupsApi.js +78 -0
- package/lib/cjs/GroupsApi.js.map +1 -0
- package/lib/cjs/IamApi.js +2 -0
- package/lib/cjs/IamApi.js.map +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/GroupsApi.js +74 -0
- package/lib/esm/GroupsApi.js.map +1 -0
- package/lib/esm/IamApi.js +2 -0
- package/lib/esm/IamApi.js.map +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/GroupsApi.d.ts +65 -0
- package/lib/types/GroupsApi.d.ts.map +1 -0
- package/lib/types/IamApi.d.ts +2 -0
- package/lib/types/IamApi.d.ts.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/vertesia-client.js +1 -1
- package/lib/vertesia-client.js.map +1 -1
- package/package.json +4 -4
- package/src/GroupsApi.ts +92 -0
- package/src/IamApi.ts +2 -0
- package/src/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertesia/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.66.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./lib/types/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"eventsource": "^3.0.6",
|
|
24
|
-
"@
|
|
25
|
-
"@
|
|
26
|
-
"@vertesia/api-fetch-client": "0.
|
|
24
|
+
"@vertesia/common": "0.66.0",
|
|
25
|
+
"@llumiverse/common": "0.20.0",
|
|
26
|
+
"@vertesia/api-fetch-client": "0.66.0"
|
|
27
27
|
},
|
|
28
28
|
"ts_dual_module": {
|
|
29
29
|
"outDir": "lib"
|
package/src/GroupsApi.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { UserGroup, UserRef } from "@vertesia/common";
|
|
2
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
3
|
+
|
|
4
|
+
export interface GroupsQueryOptions {
|
|
5
|
+
search?: string;
|
|
6
|
+
tags?: string[];
|
|
7
|
+
limit?: number;
|
|
8
|
+
offset?: number;
|
|
9
|
+
[key: string]: string | string[] | number | undefined;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class GroupsApi extends ApiTopic {
|
|
13
|
+
|
|
14
|
+
constructor(parent: ClientBase) {
|
|
15
|
+
super(parent, "/groups");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* List all groups in the current account
|
|
20
|
+
* @param options Query options for filtering and pagination
|
|
21
|
+
* @returns Array of UserGroup objects
|
|
22
|
+
*/
|
|
23
|
+
list(options?: GroupsQueryOptions): Promise<UserGroup[]> {
|
|
24
|
+
return this.get('/', { query: options });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Create a new group
|
|
29
|
+
* @param payload The group data to create
|
|
30
|
+
* @returns The created UserGroup object
|
|
31
|
+
*/
|
|
32
|
+
create(payload: Partial<UserGroup>): Promise<UserGroup> {
|
|
33
|
+
return this.post('/', { payload });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Retrieve a specific group by ID
|
|
38
|
+
* @param groupId The ID of the group to retrieve
|
|
39
|
+
* @returns The UserGroup object
|
|
40
|
+
*/
|
|
41
|
+
retrieve(groupId: string): Promise<UserGroup> {
|
|
42
|
+
return this.get('/' + groupId);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Update a group
|
|
47
|
+
* @param groupId The ID of the group to update
|
|
48
|
+
* @param payload The group data to update
|
|
49
|
+
* @returns The updated UserGroup object
|
|
50
|
+
*/
|
|
51
|
+
update(groupId: string, payload: Partial<UserGroup>): Promise<UserGroup> {
|
|
52
|
+
return this.put('/' + groupId, { payload });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Delete a group
|
|
57
|
+
* @param groupId The ID of the group to delete
|
|
58
|
+
* @returns Object with the deleted group ID
|
|
59
|
+
*/
|
|
60
|
+
delete(groupId: string): Promise<{ id: string }> {
|
|
61
|
+
return this.del('/' + groupId);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* List members of a group
|
|
66
|
+
* @param groupId The ID of the group
|
|
67
|
+
* @returns Array of UserRef objects representing group members
|
|
68
|
+
*/
|
|
69
|
+
listMembers(groupId: string): Promise<UserRef[]> {
|
|
70
|
+
return this.get('/' + groupId + '/members');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Add a member to a group
|
|
75
|
+
* @param groupId The ID of the group
|
|
76
|
+
* @param userId The ID of the user to add
|
|
77
|
+
* @returns The updated UserGroup object
|
|
78
|
+
*/
|
|
79
|
+
addMember(groupId: string, userId: string): Promise<UserGroup> {
|
|
80
|
+
return this.post('/' + groupId + '/members/' + userId);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Remove a member from a group
|
|
85
|
+
* @param groupId The ID of the group
|
|
86
|
+
* @param userId The ID of the user to remove
|
|
87
|
+
* @returns The updated UserGroup object
|
|
88
|
+
*/
|
|
89
|
+
removeMember(groupId: string, userId: string): Promise<UserGroup> {
|
|
90
|
+
return this.del('/' + groupId + '/members/' + userId);
|
|
91
|
+
}
|
|
92
|
+
}
|
package/src/IamApi.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AccessControlEntry, ACECreatePayload, AcesQueryOptions, Permission, ProjectRoles } from "@vertesia/common";
|
|
2
2
|
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
3
|
+
import { GroupsApi } from "./GroupsApi.js";
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
export interface FilterOption {
|
|
@@ -17,6 +18,7 @@ export class IamApi extends ApiTopic {
|
|
|
17
18
|
|
|
18
19
|
aces = new AcesApi(this)
|
|
19
20
|
roles = new RolesApi(this)
|
|
21
|
+
groups = new GroupsApi(this)
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
export class RolesApi extends ApiTopic {
|
package/src/index.ts
CHANGED
|
@@ -3,5 +3,6 @@ export * from './InteractionBase.js';
|
|
|
3
3
|
export type { AsyncExecutionResult, ComputeInteractionFacetsResponse } from './InteractionsApi.js';
|
|
4
4
|
export type { ComputePromptFacetsResponse, ListInteractionsResponse } from './PromptsApi.js';
|
|
5
5
|
export type { ComputeRunFacetsResponse, FilterOption } from './RunsApi.js';
|
|
6
|
+
export type { GroupsQueryOptions } from './GroupsApi.js';
|
|
6
7
|
export * from "./store/index.js";
|
|
7
8
|
export * from "./StreamSource.js";
|