@wireapp/api-client 27.87.1 → 27.89.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/userGroups/UserGroup.d.ts +3 -0
- package/lib/userGroups/UserGroup.d.ts.map +1 -1
- package/lib/userGroups/UserGroupAPI.d.ts +2 -2
- package/lib/userGroups/UserGroupAPI.d.ts.map +1 -1
- package/lib/userGroups/UserGroupAPI.js +11 -15
- package/lib/userGroups/UserGroupSearchOptions.d.ts +1 -0
- package/lib/userGroups/UserGroupSearchOptions.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { UserGroupManagedBy } from './UserGroupManagedBy';
|
|
2
|
+
import { QualifiedId } from '../user/QualifiedId';
|
|
2
3
|
export interface UserGroup {
|
|
3
4
|
createdAt: string;
|
|
4
5
|
id: string;
|
|
5
6
|
managedBy: UserGroupManagedBy;
|
|
6
7
|
members: string[];
|
|
7
8
|
membersCount?: number;
|
|
9
|
+
channelsCount?: number;
|
|
8
10
|
name: string;
|
|
11
|
+
channels?: QualifiedId[];
|
|
9
12
|
}
|
|
10
13
|
//# sourceMappingURL=UserGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserGroup.d.ts","sourceRoot":"","sources":["../../src/userGroups/UserGroup.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAExD,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,kBAAkB,CAAC;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"UserGroup.d.ts","sourceRoot":"","sources":["../../src/userGroups/UserGroup.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAEhD,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,kBAAkB,CAAC;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;CAC1B"}
|
|
@@ -6,7 +6,6 @@ import { HttpClient, RequestCancelable } from '../http';
|
|
|
6
6
|
export declare class UserGroupAPI {
|
|
7
7
|
private readonly client;
|
|
8
8
|
constructor(client: HttpClient);
|
|
9
|
-
private static readonly ENDPOINTS;
|
|
10
9
|
/**
|
|
11
10
|
* Search for user groups (cancelable).
|
|
12
11
|
*/
|
|
@@ -17,8 +16,9 @@ export declare class UserGroupAPI {
|
|
|
17
16
|
createUserGroup(body: UserGroupCreateRequest): Promise<UserGroup>;
|
|
18
17
|
/**
|
|
19
18
|
* Get a user group by ID.
|
|
19
|
+
* @param includeChannels Whether to include the channels in the response (default: true).
|
|
20
20
|
*/
|
|
21
|
-
getUserGroup(gid: string): Promise<UserGroup>;
|
|
21
|
+
getUserGroup(gid: string, includeChannels?: boolean): Promise<UserGroup>;
|
|
22
22
|
/**
|
|
23
23
|
* Update a user group by ID.
|
|
24
24
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserGroupAPI.d.ts","sourceRoot":"","sources":["../../src/userGroups/UserGroupAPI.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,sBAAsB,EAAC,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAC,sBAAsB,EAAC,MAAM,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AI,EAAE;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAUtF;;OAEG;IACU,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAS3F"}
|
|
@@ -26,19 +26,13 @@ class UserGroupAPI {
|
|
|
26
26
|
constructor(client) {
|
|
27
27
|
this.client = client;
|
|
28
28
|
}
|
|
29
|
-
static ENDPOINTS = {
|
|
30
|
-
base: '/user-groups',
|
|
31
|
-
byId: (gid) => `/user-groups/${gid}`,
|
|
32
|
-
users: (gid) => `/user-groups/${gid}/users`,
|
|
33
|
-
channels: (gid) => `/user-groups/${gid}/channels`,
|
|
34
|
-
};
|
|
35
29
|
/**
|
|
36
30
|
* Search for user groups (cancelable).
|
|
37
31
|
*/
|
|
38
32
|
async searchUserGroups({ query, ...options } = {}) {
|
|
39
33
|
const controller = new AbortController();
|
|
40
34
|
const config = {
|
|
41
|
-
url:
|
|
35
|
+
url: '/user-groups',
|
|
42
36
|
method: 'get',
|
|
43
37
|
params: { q: query, ...options },
|
|
44
38
|
signal: controller.signal,
|
|
@@ -66,7 +60,7 @@ class UserGroupAPI {
|
|
|
66
60
|
*/
|
|
67
61
|
async createUserGroup(body) {
|
|
68
62
|
const config = {
|
|
69
|
-
url:
|
|
63
|
+
url: '/user-groups',
|
|
70
64
|
method: 'post',
|
|
71
65
|
data: body,
|
|
72
66
|
};
|
|
@@ -75,11 +69,13 @@ class UserGroupAPI {
|
|
|
75
69
|
}
|
|
76
70
|
/**
|
|
77
71
|
* Get a user group by ID.
|
|
72
|
+
* @param includeChannels Whether to include the channels in the response (default: true).
|
|
78
73
|
*/
|
|
79
|
-
async getUserGroup(gid) {
|
|
74
|
+
async getUserGroup(gid, includeChannels = true) {
|
|
80
75
|
const config = {
|
|
81
|
-
url:
|
|
76
|
+
url: `/user-groups/${gid}`,
|
|
82
77
|
method: 'get',
|
|
78
|
+
params: { include_channels: includeChannels },
|
|
83
79
|
};
|
|
84
80
|
const { data } = await this.client.sendJSON(config);
|
|
85
81
|
return data;
|
|
@@ -89,7 +85,7 @@ class UserGroupAPI {
|
|
|
89
85
|
*/
|
|
90
86
|
async updateUserGroup(gid, name) {
|
|
91
87
|
const config = {
|
|
92
|
-
url:
|
|
88
|
+
url: `/user-groups/${gid}`,
|
|
93
89
|
method: 'put',
|
|
94
90
|
data: { name },
|
|
95
91
|
};
|
|
@@ -100,7 +96,7 @@ class UserGroupAPI {
|
|
|
100
96
|
*/
|
|
101
97
|
async deleteUserGroup(gid) {
|
|
102
98
|
const config = {
|
|
103
|
-
url:
|
|
99
|
+
url: `/user-groups/${gid}`,
|
|
104
100
|
method: 'delete',
|
|
105
101
|
};
|
|
106
102
|
await this.client.sendJSON(config);
|
|
@@ -110,8 +106,8 @@ class UserGroupAPI {
|
|
|
110
106
|
*/
|
|
111
107
|
async updateUsersInGroup(gid, body) {
|
|
112
108
|
const config = {
|
|
113
|
-
url:
|
|
114
|
-
method: '
|
|
109
|
+
url: `/user-groups/${gid}/users`,
|
|
110
|
+
method: 'put',
|
|
115
111
|
data: body,
|
|
116
112
|
};
|
|
117
113
|
await this.client.sendJSON(config);
|
|
@@ -121,7 +117,7 @@ class UserGroupAPI {
|
|
|
121
117
|
*/
|
|
122
118
|
async updateChannelsInGroup(gid, body) {
|
|
123
119
|
const config = {
|
|
124
|
-
url:
|
|
120
|
+
url: `/user-groups/${gid}/channels`,
|
|
125
121
|
method: 'post',
|
|
126
122
|
data: body,
|
|
127
123
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserGroupSearchOptions.d.ts","sourceRoot":"","sources":["../../src/userGroups/UserGroupSearchOptions.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAChC,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"UserGroupSearchOptions.d.ts","sourceRoot":"","sources":["../../src/userGroups/UserGroupSearchOptions.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAChC,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B"}
|
package/package.json
CHANGED