mezon-js 2.11.38 → 2.11.39

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 CHANGED
@@ -78,6 +78,8 @@ export interface MezonDeleteWebhookByIdBody {
78
78
  export interface MezonUpdateAppBody {
79
79
  //about the app.
80
80
  about?: string;
81
+ //App url.
82
+ app_url?: string;
81
83
  //Avatar URL.
82
84
  applogo?: string;
83
85
  //Username.
@@ -4908,33 +4910,28 @@ export class MezonApi {
4908
4910
  }
4909
4911
 
4910
4912
  /** Update one or more fields on a app. */
4911
- updateApp(
4912
- bearerToken: string,
4913
- id: string,
4914
- body: MezonUpdateAppBody,
4915
- options: any = {}
4916
- ): Promise<any> {
4913
+ updateApp(bearerToken: string,
4914
+ id:string,
4915
+ body:MezonUpdateAppBody,
4916
+ options: any = {}): Promise<ApiApp> {
4917
+
4917
4918
  if (id === null || id === undefined) {
4918
4919
  throw new Error("'id' is a required parameter but is null or undefined.");
4919
4920
  }
4920
4921
  if (body === null || body === undefined) {
4921
- throw new Error(
4922
- "'body' is a required parameter but is null or undefined."
4923
- );
4922
+ throw new Error("'body' is a required parameter but is null or undefined.");
4924
4923
  }
4925
- const urlPath = "/v2/apps/app/{id}".replace(
4926
- "{id}",
4927
- encodeURIComponent(String(id))
4928
- );
4924
+ const urlPath = "/v2/apps/app/{id}"
4925
+ .replace("{id}", encodeURIComponent(String(id)));
4929
4926
  const queryParams = new Map<string, any>();
4930
4927
 
4931
- let bodyJson: string = "";
4928
+ let bodyJson : string = "";
4932
4929
  bodyJson = JSON.stringify(body || {});
4933
4930
 
4934
4931
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4935
4932
  const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
4936
4933
  if (bearerToken) {
4937
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4934
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4938
4935
  }
4939
4936
 
4940
4937
  return Promise.race([
package/client.ts CHANGED
@@ -2810,7 +2810,7 @@ export class Client {
2810
2810
  session: Session,
2811
2811
  roleId: string,
2812
2812
  request: MezonUpdateAppBody
2813
- ): Promise<boolean> {
2813
+ ): Promise<ApiApp> {
2814
2814
  if (
2815
2815
  this.autoRefreshSession &&
2816
2816
  session.refresh_token &&
@@ -2822,7 +2822,7 @@ export class Client {
2822
2822
  return this.apiClient
2823
2823
  .updateApp(session.token, roleId, request)
2824
2824
  .then((response: any) => {
2825
- return response !== undefined;
2825
+ return Promise.resolve(response);
2826
2826
  });
2827
2827
  }
2828
2828
 
package/dist/api.gen.d.ts CHANGED
@@ -43,6 +43,7 @@ export interface MezonDeleteWebhookByIdBody {
43
43
  /** Update app information. */
44
44
  export interface MezonUpdateAppBody {
45
45
  about?: string;
46
+ app_url?: string;
46
47
  applogo?: string;
47
48
  appname?: string;
48
49
  metadata?: string;
@@ -1931,7 +1932,7 @@ export declare class MezonApi {
1931
1932
  /** Get detailed app information. */
1932
1933
  getApp(bearerToken: string, id: string, options?: any): Promise<ApiApp>;
1933
1934
  /** Update one or more fields on a app. */
1934
- updateApp(bearerToken: string, id: string, body: MezonUpdateAppBody, options?: any): Promise<any>;
1935
+ updateApp(bearerToken: string, id: string, body: MezonUpdateAppBody, options?: any): Promise<ApiApp>;
1935
1936
  /** Ban a app. */
1936
1937
  banApp(bearerToken: string, id: string, options?: any): Promise<any>;
1937
1938
  /** Unban an app. */
package/dist/client.d.ts CHANGED
@@ -519,7 +519,7 @@ export declare class Client {
519
519
  /** Update fields in a given event. */
520
520
  updateEvent(session: Session, roleId: string, request: MezonUpdateEventBody): Promise<boolean>;
521
521
  /** Update fields in a given event. */
522
- updateApp(session: Session, roleId: string, request: MezonUpdateAppBody): Promise<boolean>;
522
+ updateApp(session: Session, roleId: string, request: MezonUpdateAppBody): Promise<ApiApp>;
523
523
  /** Update fields in a given clan profile. */
524
524
  createLinkInviteUser(session: Session, request: ApiLinkInviteUserRequest): Promise<ApiLinkInviteUser>;
525
525
  /** Get link invite user */
@@ -2062,14 +2062,9 @@ var MezonApi = class {
2062
2062
  throw new Error("'id' is a required parameter but is null or undefined.");
2063
2063
  }
2064
2064
  if (body === null || body === void 0) {
2065
- throw new Error(
2066
- "'body' is a required parameter but is null or undefined."
2067
- );
2065
+ throw new Error("'body' is a required parameter but is null or undefined.");
2068
2066
  }
2069
- const urlPath = "/v2/apps/app/{id}".replace(
2070
- "{id}",
2071
- encodeURIComponent(String(id))
2072
- );
2067
+ const urlPath = "/v2/apps/app/{id}".replace("{id}", encodeURIComponent(String(id)));
2073
2068
  const queryParams = /* @__PURE__ */ new Map();
2074
2069
  let bodyJson = "";
2075
2070
  bodyJson = JSON.stringify(body || {});
@@ -9982,7 +9977,7 @@ var Client = class {
9982
9977
  yield this.sessionRefresh(session);
9983
9978
  }
9984
9979
  return this.apiClient.updateApp(session.token, roleId, request).then((response) => {
9985
- return response !== void 0;
9980
+ return Promise.resolve(response);
9986
9981
  });
9987
9982
  });
9988
9983
  }
@@ -2028,14 +2028,9 @@ var MezonApi = class {
2028
2028
  throw new Error("'id' is a required parameter but is null or undefined.");
2029
2029
  }
2030
2030
  if (body === null || body === void 0) {
2031
- throw new Error(
2032
- "'body' is a required parameter but is null or undefined."
2033
- );
2031
+ throw new Error("'body' is a required parameter but is null or undefined.");
2034
2032
  }
2035
- const urlPath = "/v2/apps/app/{id}".replace(
2036
- "{id}",
2037
- encodeURIComponent(String(id))
2038
- );
2033
+ const urlPath = "/v2/apps/app/{id}".replace("{id}", encodeURIComponent(String(id)));
2039
2034
  const queryParams = /* @__PURE__ */ new Map();
2040
2035
  let bodyJson = "";
2041
2036
  bodyJson = JSON.stringify(body || {});
@@ -9948,7 +9943,7 @@ var Client = class {
9948
9943
  yield this.sessionRefresh(session);
9949
9944
  }
9950
9945
  return this.apiClient.updateApp(session.token, roleId, request).then((response) => {
9951
- return response !== void 0;
9946
+ return Promise.resolve(response);
9952
9947
  });
9953
9948
  });
9954
9949
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.11.38",
4
+ "version": "2.11.39",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"