mezon-js 2.10.16 → 2.10.17
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/api.gen.ts +39 -36
- package/client.ts +4 -2
- package/dist/api.gen.d.ts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/mezon-js.cjs.js +6 -4
- package/dist/mezon-js.esm.mjs +6 -4
- package/package.json +1 -1
package/api.gen.ts
CHANGED
@@ -7497,42 +7497,45 @@ export class MezonApi {
|
|
7497
7497
|
}
|
7498
7498
|
|
7499
7499
|
/** Fetch list of notifications. */
|
7500
|
-
listNotifications(
|
7501
|
-
|
7502
|
-
clanId
|
7503
|
-
|
7504
|
-
|
7505
|
-
|
7506
|
-
|
7507
|
-
|
7508
|
-
|
7509
|
-
|
7510
|
-
|
7511
|
-
|
7512
|
-
|
7513
|
-
|
7514
|
-
|
7515
|
-
|
7516
|
-
|
7517
|
-
|
7518
|
-
|
7519
|
-
|
7520
|
-
|
7521
|
-
|
7522
|
-
|
7523
|
-
|
7524
|
-
|
7525
|
-
|
7526
|
-
|
7527
|
-
|
7528
|
-
|
7529
|
-
|
7530
|
-
}
|
7531
|
-
|
7532
|
-
|
7533
|
-
|
7534
|
-
|
7535
|
-
|
7500
|
+
listNotifications(bearerToken: string,
|
7501
|
+
limit?:number,
|
7502
|
+
clanId?:string,
|
7503
|
+
notificationId?:string,
|
7504
|
+
code?:number,
|
7505
|
+
direction?:number,
|
7506
|
+
options: any = {}): Promise<ApiNotificationList> {
|
7507
|
+
|
7508
|
+
const urlPath = "/v2/notification";
|
7509
|
+
const queryParams = new Map<string, any>();
|
7510
|
+
queryParams.set("limit", limit);
|
7511
|
+
queryParams.set("clan_id", clanId);
|
7512
|
+
queryParams.set("notification_id", notificationId);
|
7513
|
+
queryParams.set("code", code);
|
7514
|
+
queryParams.set("direction", direction);
|
7515
|
+
|
7516
|
+
let bodyJson : string = "";
|
7517
|
+
|
7518
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
7519
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
7520
|
+
if (bearerToken) {
|
7521
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
7522
|
+
}
|
7523
|
+
|
7524
|
+
return Promise.race([
|
7525
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
7526
|
+
if (response.status == 204) {
|
7527
|
+
return response;
|
7528
|
+
} else if (response.status >= 200 && response.status < 300) {
|
7529
|
+
return response.json();
|
7530
|
+
} else {
|
7531
|
+
throw response;
|
7532
|
+
}
|
7533
|
+
}),
|
7534
|
+
new Promise((_, reject) =>
|
7535
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
7536
|
+
),
|
7537
|
+
]);
|
7538
|
+
}
|
7536
7539
|
|
7537
7540
|
/** set notification user channel. */
|
7538
7541
|
setNotificationChannelSetting(
|
package/client.ts
CHANGED
@@ -2229,7 +2229,9 @@ export class Client {
|
|
2229
2229
|
session: Session,
|
2230
2230
|
clanId: string,
|
2231
2231
|
limit?: number,
|
2232
|
-
|
2232
|
+
notificationId?:string,
|
2233
|
+
code?:number,
|
2234
|
+
direction?:number,
|
2233
2235
|
): Promise<NotificationList> {
|
2234
2236
|
if (
|
2235
2237
|
this.autoRefreshSession &&
|
@@ -2240,7 +2242,7 @@ export class Client {
|
|
2240
2242
|
}
|
2241
2243
|
|
2242
2244
|
return this.apiClient
|
2243
|
-
.listNotifications(session.token, clanId,
|
2245
|
+
.listNotifications(session.token, limit, clanId, notificationId, code, direction)
|
2244
2246
|
.then((response: ApiNotificationList) => {
|
2245
2247
|
var result: NotificationList = {
|
2246
2248
|
cacheable_cursor: response.cacheable_cursor,
|
package/dist/api.gen.d.ts
CHANGED
@@ -1839,7 +1839,7 @@ export declare class MezonApi {
|
|
1839
1839
|
/** Delete one or more notifications for the current user. */
|
1840
1840
|
deleteNotifications(bearerToken: string, ids?: Array<string>, options?: any): Promise<any>;
|
1841
1841
|
/** Fetch list of notifications. */
|
1842
|
-
listNotifications(bearerToken: string, clanId
|
1842
|
+
listNotifications(bearerToken: string, limit?: number, clanId?: string, notificationId?: string, code?: number, direction?: number, options?: any): Promise<ApiNotificationList>;
|
1843
1843
|
/** set notification user channel. */
|
1844
1844
|
setNotificationChannelSetting(bearerToken: string, body: ApiSetNotificationRequest, options?: any): Promise<any>;
|
1845
1845
|
/** set notification user channel. */
|
package/dist/client.d.ts
CHANGED
@@ -468,7 +468,7 @@ export declare class Client {
|
|
468
468
|
/** List all friends for the current user. */
|
469
469
|
listFriends(session: Session, state?: number, limit?: number, cursor?: string): Promise<Friends>;
|
470
470
|
/** Fetch list of notifications. */
|
471
|
-
listNotifications(session: Session, clanId: string, limit?: number,
|
471
|
+
listNotifications(session: Session, clanId: string, limit?: number, notificationId?: string, code?: number, direction?: number): Promise<NotificationList>;
|
472
472
|
/** Execute an RPC function on the server. */
|
473
473
|
rpc(session: Session, basicAuthUsername: string, basicAuthPassword: string, id: string, input: object): Promise<RpcResponse>;
|
474
474
|
/** Execute an RPC function on the server. */
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -4440,12 +4440,14 @@ var MezonApi = class {
|
|
4440
4440
|
]);
|
4441
4441
|
}
|
4442
4442
|
/** Fetch list of notifications. */
|
4443
|
-
listNotifications(bearerToken, clanId,
|
4443
|
+
listNotifications(bearerToken, limit, clanId, notificationId, code, direction, options = {}) {
|
4444
4444
|
const urlPath = "/v2/notification";
|
4445
4445
|
const queryParams = /* @__PURE__ */ new Map();
|
4446
4446
|
queryParams.set("limit", limit);
|
4447
4447
|
queryParams.set("clan_id", clanId);
|
4448
|
-
queryParams.set("
|
4448
|
+
queryParams.set("notification_id", notificationId);
|
4449
|
+
queryParams.set("code", code);
|
4450
|
+
queryParams.set("direction", direction);
|
4449
4451
|
let bodyJson = "";
|
4450
4452
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4451
4453
|
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
@@ -9101,12 +9103,12 @@ var Client = class {
|
|
9101
9103
|
});
|
9102
9104
|
}
|
9103
9105
|
/** Fetch list of notifications. */
|
9104
|
-
listNotifications(session, clanId, limit,
|
9106
|
+
listNotifications(session, clanId, limit, notificationId, code, direction) {
|
9105
9107
|
return __async(this, null, function* () {
|
9106
9108
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
9107
9109
|
yield this.sessionRefresh(session);
|
9108
9110
|
}
|
9109
|
-
return this.apiClient.listNotifications(session.token, clanId,
|
9111
|
+
return this.apiClient.listNotifications(session.token, limit, clanId, notificationId, code, direction).then((response) => {
|
9110
9112
|
var result = {
|
9111
9113
|
cacheable_cursor: response.cacheable_cursor,
|
9112
9114
|
notifications: []
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -4406,12 +4406,14 @@ var MezonApi = class {
|
|
4406
4406
|
]);
|
4407
4407
|
}
|
4408
4408
|
/** Fetch list of notifications. */
|
4409
|
-
listNotifications(bearerToken, clanId,
|
4409
|
+
listNotifications(bearerToken, limit, clanId, notificationId, code, direction, options = {}) {
|
4410
4410
|
const urlPath = "/v2/notification";
|
4411
4411
|
const queryParams = /* @__PURE__ */ new Map();
|
4412
4412
|
queryParams.set("limit", limit);
|
4413
4413
|
queryParams.set("clan_id", clanId);
|
4414
|
-
queryParams.set("
|
4414
|
+
queryParams.set("notification_id", notificationId);
|
4415
|
+
queryParams.set("code", code);
|
4416
|
+
queryParams.set("direction", direction);
|
4415
4417
|
let bodyJson = "";
|
4416
4418
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4417
4419
|
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
@@ -9067,12 +9069,12 @@ var Client = class {
|
|
9067
9069
|
});
|
9068
9070
|
}
|
9069
9071
|
/** Fetch list of notifications. */
|
9070
|
-
listNotifications(session, clanId, limit,
|
9072
|
+
listNotifications(session, clanId, limit, notificationId, code, direction) {
|
9071
9073
|
return __async(this, null, function* () {
|
9072
9074
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
9073
9075
|
yield this.sessionRefresh(session);
|
9074
9076
|
}
|
9075
|
-
return this.apiClient.listNotifications(session.token, clanId,
|
9077
|
+
return this.apiClient.listNotifications(session.token, limit, clanId, notificationId, code, direction).then((response) => {
|
9076
9078
|
var result = {
|
9077
9079
|
cacheable_cursor: response.cacheable_cursor,
|
9078
9080
|
notifications: []
|