mezon-js 2.8.67 → 2.8.69
Sign up to get free protection for your applications and to get access to all the features.
- package/api.gen.ts +245 -54
- package/client.ts +2317 -1160
- package/dist/api.gen.d.ts +29 -32
- package/dist/client.d.ts +6 -1
- package/dist/mezon-js.cjs.js +364 -38
- package/dist/mezon-js.esm.mjs +364 -38
- package/package.json +1 -1
package/api.gen.ts
CHANGED
@@ -196,6 +196,12 @@ export interface MezonUpdateRoleDeleteBody {
|
|
196
196
|
clan_id?: string;
|
197
197
|
}
|
198
198
|
|
199
|
+
/** Request to get system message by clan and channel IDs. */
|
200
|
+
export interface MezonUpdateSystemMessageBody {
|
201
|
+
//
|
202
|
+
channel_id?: string;
|
203
|
+
}
|
204
|
+
|
199
205
|
/** */
|
200
206
|
export interface MezonUpdateUserProfileByClanBody {
|
201
207
|
//
|
@@ -1435,62 +1441,28 @@ export interface ApiSortParam {
|
|
1435
1441
|
order?: string;
|
1436
1442
|
}
|
1437
1443
|
|
1438
|
-
/**
|
1439
|
-
export interface
|
1440
|
-
//
|
1441
|
-
|
1442
|
-
//
|
1443
|
-
|
1444
|
-
//
|
1445
|
-
|
1446
|
-
//The read access permissions for the object.
|
1447
|
-
permission_read?: number;
|
1448
|
-
//The write access permissions for the object.
|
1449
|
-
permission_write?: number;
|
1450
|
-
//The UNIX time (for gRPC clients) or ISO string (for REST clients) when the object was last updated.
|
1451
|
-
update_time?: string;
|
1452
|
-
//The user owner of the object.
|
1453
|
-
user_id?: string;
|
1454
|
-
//The value of the object.
|
1455
|
-
value?: string;
|
1456
|
-
//The version hash of the object.
|
1457
|
-
version?: string;
|
1458
|
-
}
|
1459
|
-
|
1460
|
-
/** A storage acknowledgement. */
|
1461
|
-
export interface ApiStorageObjectAck {
|
1462
|
-
//The collection which stores the object.
|
1463
|
-
collection?: string;
|
1464
|
-
//The UNIX time (for gRPC clients) or ISO string (for REST clients) when the object was created.
|
1465
|
-
create_time?: string;
|
1466
|
-
//The key of the object within the collection.
|
1467
|
-
key?: string;
|
1468
|
-
//The UNIX time (for gRPC clients) or ISO string (for REST clients) when the object was last updated.
|
1469
|
-
update_time?: string;
|
1470
|
-
//The owner of the object.
|
1471
|
-
user_id?: string;
|
1472
|
-
//The version hash of the object.
|
1473
|
-
version?: string;
|
1474
|
-
}
|
1475
|
-
|
1476
|
-
/** Batch of acknowledgements for the storage object write. */
|
1477
|
-
export interface ApiStorageObjectAcks {
|
1478
|
-
//Batch of storage write acknowledgements.
|
1479
|
-
acks?: Array<ApiStorageObjectAck>;
|
1444
|
+
/** System message details. */
|
1445
|
+
export interface ApiSystemMessage {
|
1446
|
+
//
|
1447
|
+
channel_id?: string;
|
1448
|
+
//
|
1449
|
+
clan_id?: string;
|
1450
|
+
//
|
1451
|
+
id?: string;
|
1480
1452
|
}
|
1481
1453
|
|
1482
|
-
/**
|
1483
|
-
export interface
|
1484
|
-
//
|
1485
|
-
|
1486
|
-
//
|
1487
|
-
|
1454
|
+
/** Request to get system message by clan and channel IDs. */
|
1455
|
+
export interface ApiSystemMessageRequest {
|
1456
|
+
//
|
1457
|
+
channel_id?: string;
|
1458
|
+
//
|
1459
|
+
clan_id?: string;
|
1488
1460
|
}
|
1489
1461
|
|
1490
|
-
/**
|
1491
|
-
export interface
|
1492
|
-
//
|
1493
|
-
|
1462
|
+
/** List of system message. */
|
1463
|
+
export interface ApiSystemMessagesList {
|
1464
|
+
//
|
1465
|
+
system_messages_list?: Array<ApiSystemMessage>;
|
1494
1466
|
}
|
1495
1467
|
|
1496
1468
|
/** Update a user's account details. */
|
@@ -5697,11 +5669,51 @@ export class MezonApi {
|
|
5697
5669
|
]);
|
5698
5670
|
}
|
5699
5671
|
|
5672
|
+
/** Update a role when Delete a role by ID. */
|
5673
|
+
updateRoleDelete(bearerToken: string,
|
5674
|
+
roleId:string,
|
5675
|
+
body: MezonUpdateRoleDeleteBody,
|
5676
|
+
options: any = {}): Promise<any> {
|
5677
|
+
|
5678
|
+
if (roleId === null || roleId === undefined) {
|
5679
|
+
throw new Error("'roleId' is a required parameter but is null or undefined.");
|
5680
|
+
}
|
5681
|
+
if (body === null || body === undefined) {
|
5682
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
5683
|
+
}
|
5684
|
+
const urlPath = "/v2/roles/delete/{roleId}"
|
5685
|
+
.replace("{roleId}", encodeURIComponent(String(roleId)));
|
5686
|
+
const queryParams = new Map<string, any>();
|
5687
|
+
|
5688
|
+
let bodyJson : string = "";
|
5689
|
+
bodyJson = JSON.stringify(body || {});
|
5690
|
+
|
5691
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
5692
|
+
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
5693
|
+
if (bearerToken) {
|
5694
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
5695
|
+
}
|
5696
|
+
|
5697
|
+
return Promise.race([
|
5698
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
5699
|
+
if (response.status == 204) {
|
5700
|
+
return response;
|
5701
|
+
} else if (response.status >= 200 && response.status < 300) {
|
5702
|
+
return response.json();
|
5703
|
+
} else {
|
5704
|
+
throw response;
|
5705
|
+
}
|
5706
|
+
}),
|
5707
|
+
new Promise((_, reject) =>
|
5708
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
5709
|
+
),
|
5710
|
+
]);
|
5711
|
+
}
|
5712
|
+
|
5700
5713
|
/** Delete a role by ID. */
|
5701
5714
|
deleteRole(bearerToken: string,
|
5702
5715
|
roleId:string,
|
5703
5716
|
channelId?:string,
|
5704
|
-
clanId?:string,
|
5705
5717
|
options: any = {}): Promise<any> {
|
5706
5718
|
|
5707
5719
|
if (roleId === null || roleId === undefined) {
|
@@ -5711,7 +5723,6 @@ export class MezonApi {
|
|
5711
5723
|
.replace("{roleId}", encodeURIComponent(String(roleId)));
|
5712
5724
|
const queryParams = new Map<string, any>();
|
5713
5725
|
queryParams.set("channel_id", channelId);
|
5714
|
-
queryParams.set("clan_id", clanId);
|
5715
5726
|
|
5716
5727
|
let bodyJson : string = "";
|
5717
5728
|
|
@@ -6096,6 +6107,186 @@ export class MezonApi {
|
|
6096
6107
|
]);
|
6097
6108
|
}
|
6098
6109
|
|
6110
|
+
/** Get the list of system messages. */
|
6111
|
+
getSystemMessagesList(bearerToken: string,
|
6112
|
+
options: any = {}): Promise<ApiSystemMessagesList> {
|
6113
|
+
|
6114
|
+
const urlPath = "/v2/systemmessages";
|
6115
|
+
const queryParams = new Map<string, any>();
|
6116
|
+
|
6117
|
+
let bodyJson : string = "";
|
6118
|
+
|
6119
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6120
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
6121
|
+
if (bearerToken) {
|
6122
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6123
|
+
}
|
6124
|
+
|
6125
|
+
return Promise.race([
|
6126
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6127
|
+
if (response.status == 204) {
|
6128
|
+
return response;
|
6129
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6130
|
+
return response.json();
|
6131
|
+
} else {
|
6132
|
+
throw response;
|
6133
|
+
}
|
6134
|
+
}),
|
6135
|
+
new Promise((_, reject) =>
|
6136
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6137
|
+
),
|
6138
|
+
]);
|
6139
|
+
}
|
6140
|
+
|
6141
|
+
/** Create a system messages. */
|
6142
|
+
createSystemMessage(bearerToken: string,
|
6143
|
+
body:ApiSystemMessageRequest,
|
6144
|
+
options: any = {}): Promise<any> {
|
6145
|
+
|
6146
|
+
if (body === null || body === undefined) {
|
6147
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6148
|
+
}
|
6149
|
+
const urlPath = "/v2/systemmessages";
|
6150
|
+
const queryParams = new Map<string, any>();
|
6151
|
+
|
6152
|
+
let bodyJson : string = "";
|
6153
|
+
bodyJson = JSON.stringify(body || {});
|
6154
|
+
|
6155
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6156
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
6157
|
+
if (bearerToken) {
|
6158
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6159
|
+
}
|
6160
|
+
|
6161
|
+
return Promise.race([
|
6162
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6163
|
+
if (response.status == 204) {
|
6164
|
+
return response;
|
6165
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6166
|
+
return response.json();
|
6167
|
+
} else {
|
6168
|
+
throw response;
|
6169
|
+
}
|
6170
|
+
}),
|
6171
|
+
new Promise((_, reject) =>
|
6172
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6173
|
+
),
|
6174
|
+
]);
|
6175
|
+
}
|
6176
|
+
|
6177
|
+
/** Delete a specific system messages. */
|
6178
|
+
deleteSystemMessage(bearerToken: string,
|
6179
|
+
clanId:string,
|
6180
|
+
options: any = {}): Promise<any> {
|
6181
|
+
|
6182
|
+
if (clanId === null || clanId === undefined) {
|
6183
|
+
throw new Error("'clanId' is a required parameter but is null or undefined.");
|
6184
|
+
}
|
6185
|
+
const urlPath = "/v2/systemmessages/{clanId}"
|
6186
|
+
.replace("{clanId}", encodeURIComponent(String(clanId)));
|
6187
|
+
const queryParams = new Map<string, any>();
|
6188
|
+
|
6189
|
+
let bodyJson : string = "";
|
6190
|
+
|
6191
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6192
|
+
const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
|
6193
|
+
if (bearerToken) {
|
6194
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6195
|
+
}
|
6196
|
+
|
6197
|
+
return Promise.race([
|
6198
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6199
|
+
if (response.status == 204) {
|
6200
|
+
return response;
|
6201
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6202
|
+
return response.json();
|
6203
|
+
} else {
|
6204
|
+
throw response;
|
6205
|
+
}
|
6206
|
+
}),
|
6207
|
+
new Promise((_, reject) =>
|
6208
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6209
|
+
),
|
6210
|
+
]);
|
6211
|
+
}
|
6212
|
+
|
6213
|
+
/** Get details of a specific system messages. */
|
6214
|
+
getSystemMessageByClanId(bearerToken: string,
|
6215
|
+
clanId:string,
|
6216
|
+
options: any = {}): Promise<ApiSystemMessage> {
|
6217
|
+
|
6218
|
+
if (clanId === null || clanId === undefined) {
|
6219
|
+
throw new Error("'clanId' is a required parameter but is null or undefined.");
|
6220
|
+
}
|
6221
|
+
const urlPath = "/v2/systemmessages/{clanId}"
|
6222
|
+
.replace("{clanId}", encodeURIComponent(String(clanId)));
|
6223
|
+
const queryParams = new Map<string, any>();
|
6224
|
+
|
6225
|
+
let bodyJson : string = "";
|
6226
|
+
|
6227
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6228
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
6229
|
+
if (bearerToken) {
|
6230
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6231
|
+
}
|
6232
|
+
|
6233
|
+
return Promise.race([
|
6234
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6235
|
+
if (response.status == 204) {
|
6236
|
+
return response;
|
6237
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6238
|
+
return response.json();
|
6239
|
+
} else {
|
6240
|
+
throw response;
|
6241
|
+
}
|
6242
|
+
}),
|
6243
|
+
new Promise((_, reject) =>
|
6244
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6245
|
+
),
|
6246
|
+
]);
|
6247
|
+
}
|
6248
|
+
|
6249
|
+
/** Update a system messages. */
|
6250
|
+
updateSystemMessage(bearerToken: string,
|
6251
|
+
clanId:string,
|
6252
|
+
body:MezonUpdateSystemMessageBody,
|
6253
|
+
options: any = {}): Promise<any> {
|
6254
|
+
|
6255
|
+
if (clanId === null || clanId === undefined) {
|
6256
|
+
throw new Error("'clanId' is a required parameter but is null or undefined.");
|
6257
|
+
}
|
6258
|
+
if (body === null || body === undefined) {
|
6259
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6260
|
+
}
|
6261
|
+
const urlPath = "/v2/systemmessages/{clanId}"
|
6262
|
+
.replace("{clanId}", encodeURIComponent(String(clanId)));
|
6263
|
+
const queryParams = new Map<string, any>();
|
6264
|
+
|
6265
|
+
let bodyJson : string = "";
|
6266
|
+
bodyJson = JSON.stringify(body || {});
|
6267
|
+
|
6268
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6269
|
+
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
6270
|
+
if (bearerToken) {
|
6271
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6272
|
+
}
|
6273
|
+
|
6274
|
+
return Promise.race([
|
6275
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6276
|
+
if (response.status == 204) {
|
6277
|
+
return response;
|
6278
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6279
|
+
return response.json();
|
6280
|
+
} else {
|
6281
|
+
throw response;
|
6282
|
+
}
|
6283
|
+
}),
|
6284
|
+
new Promise((_, reject) =>
|
6285
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6286
|
+
),
|
6287
|
+
]);
|
6288
|
+
}
|
6289
|
+
|
6099
6290
|
/** Update fields in a given category. */
|
6100
6291
|
updateCategory(bearerToken: string,
|
6101
6292
|
body:ApiUpdateCategoryDescRequest,
|