mezon-js 2.12.59 → 2.12.61

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
@@ -3306,7 +3306,7 @@ export interface ApiClanDiscoverRequest {
3306
3306
  /** */
3307
3307
  export interface ApiIsFollowerRequest {
3308
3308
  //
3309
- username?: string;
3309
+ follow_id?: string;
3310
3310
  }
3311
3311
 
3312
3312
  /** */
@@ -3314,7 +3314,7 @@ export interface ApiIsFollowerResponse {
3314
3314
  //
3315
3315
  is_follower?: boolean;
3316
3316
  //
3317
- username?: string;
3317
+ follow_id?: string;
3318
3318
  }
3319
3319
 
3320
3320
  export class MezonApi {
@@ -6890,7 +6890,8 @@ export class MezonApi {
6890
6890
 
6891
6891
  /** Add users to a channel. */
6892
6892
  getLinkInvite(
6893
- bearerToken: string,
6893
+ basicAuthUsername: string,
6894
+ basicAuthPassword: string,
6894
6895
  inviteId: string,
6895
6896
  options: any = {}
6896
6897
  ): Promise<ApiInviteUserRes> {
@@ -6909,8 +6910,9 @@ export class MezonApi {
6909
6910
 
6910
6911
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
6911
6912
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
6912
- if (bearerToken) {
6913
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
6913
+ if (basicAuthUsername) {
6914
+ fetchOptions.headers["Authorization"] =
6915
+ "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
6914
6916
  }
6915
6917
 
6916
6918
  return Promise.race([
package/client.ts CHANGED
@@ -2335,19 +2335,10 @@ export class Client {
2335
2335
 
2336
2336
  /** Get link invite user */
2337
2337
  async getLinkInvite(
2338
- session: Session,
2339
2338
  inviteId: string
2340
2339
  ): Promise<ApiInviteUserRes> {
2341
- if (
2342
- this.autoRefreshSession &&
2343
- session.refresh_token &&
2344
- session.isexpired(Date.now() / 1000)
2345
- ) {
2346
- await this.sessionRefresh(session);
2347
- }
2348
-
2349
2340
  return this.apiClient
2350
- .getLinkInvite(session.token, inviteId)
2341
+ .getLinkInvite( this.serverkey, "", inviteId)
2351
2342
  .then((response: ApiInviteUserRes) => {
2352
2343
  return Promise.resolve(response);
2353
2344
  });
package/dist/api.gen.d.ts CHANGED
@@ -1893,12 +1893,12 @@ export interface ApiClanDiscoverRequest {
1893
1893
  }
1894
1894
  /** */
1895
1895
  export interface ApiIsFollowerRequest {
1896
- username?: string;
1896
+ follow_id?: string;
1897
1897
  }
1898
1898
  /** */
1899
1899
  export interface ApiIsFollowerResponse {
1900
1900
  is_follower?: boolean;
1901
- username?: string;
1901
+ follow_id?: string;
1902
1902
  }
1903
1903
  export declare class MezonApi {
1904
1904
  readonly serverKey: string;
@@ -2085,7 +2085,7 @@ export declare class MezonApi {
2085
2085
  /** Add users to a channel. */
2086
2086
  createLinkInviteUser(bearerToken: string, body: ApiLinkInviteUserRequest, options?: any): Promise<ApiLinkInviteUser>;
2087
2087
  /** Add users to a channel. */
2088
- getLinkInvite(bearerToken: string, inviteId: string, options?: any): Promise<ApiInviteUserRes>;
2088
+ getLinkInvite(basicAuthUsername: string, basicAuthPassword: string, inviteId: string, options?: any): Promise<ApiInviteUserRes>;
2089
2089
  /** Add users to a channel. */
2090
2090
  inviteUser(bearerToken: string, inviteId: string, options?: any): Promise<ApiInviteUserRes>;
2091
2091
  /** List HashtagDMList */
package/dist/client.d.ts CHANGED
@@ -470,7 +470,7 @@ export declare class Client {
470
470
  /** Update fields in a given clan profile. */
471
471
  createLinkInviteUser(session: Session, request: ApiLinkInviteUserRequest): Promise<ApiLinkInviteUser>;
472
472
  /** Get link invite user */
473
- getLinkInvite(session: Session, inviteId: string): Promise<ApiInviteUserRes>;
473
+ getLinkInvite(inviteId: string): Promise<ApiInviteUserRes>;
474
474
  /** Get permission of user in the clan */
475
475
  GetRoleOfUserInTheClan(session: Session, clanId: string): Promise<ApiRoleList>;
476
476
  /** invite user */
@@ -3520,7 +3520,7 @@ var MezonApi = class {
3520
3520
  ]);
3521
3521
  }
3522
3522
  /** Add users to a channel. */
3523
- getLinkInvite(bearerToken, inviteId, options = {}) {
3523
+ getLinkInvite(basicAuthUsername, basicAuthPassword, inviteId, options = {}) {
3524
3524
  if (inviteId === null || inviteId === void 0) {
3525
3525
  throw new Error(
3526
3526
  "'inviteId' is a required parameter but is null or undefined."
@@ -3534,8 +3534,8 @@ var MezonApi = class {
3534
3534
  let bodyJson = "";
3535
3535
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3536
3536
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3537
- if (bearerToken) {
3538
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3537
+ if (basicAuthUsername) {
3538
+ fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
3539
3539
  }
3540
3540
  return Promise.race([
3541
3541
  fetch(fullUrl, fetchOptions).then((response) => {
@@ -9264,12 +9264,9 @@ var Client = class {
9264
9264
  });
9265
9265
  }
9266
9266
  /** Get link invite user */
9267
- getLinkInvite(session, inviteId) {
9267
+ getLinkInvite(inviteId) {
9268
9268
  return __async(this, null, function* () {
9269
- if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
9270
- yield this.sessionRefresh(session);
9271
- }
9272
- return this.apiClient.getLinkInvite(session.token, inviteId).then((response) => {
9269
+ return this.apiClient.getLinkInvite(this.serverkey, "", inviteId).then((response) => {
9273
9270
  return Promise.resolve(response);
9274
9271
  });
9275
9272
  });
@@ -3486,7 +3486,7 @@ var MezonApi = class {
3486
3486
  ]);
3487
3487
  }
3488
3488
  /** Add users to a channel. */
3489
- getLinkInvite(bearerToken, inviteId, options = {}) {
3489
+ getLinkInvite(basicAuthUsername, basicAuthPassword, inviteId, options = {}) {
3490
3490
  if (inviteId === null || inviteId === void 0) {
3491
3491
  throw new Error(
3492
3492
  "'inviteId' is a required parameter but is null or undefined."
@@ -3500,8 +3500,8 @@ var MezonApi = class {
3500
3500
  let bodyJson = "";
3501
3501
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3502
3502
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3503
- if (bearerToken) {
3504
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3503
+ if (basicAuthUsername) {
3504
+ fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
3505
3505
  }
3506
3506
  return Promise.race([
3507
3507
  fetch(fullUrl, fetchOptions).then((response) => {
@@ -9230,12 +9230,9 @@ var Client = class {
9230
9230
  });
9231
9231
  }
9232
9232
  /** Get link invite user */
9233
- getLinkInvite(session, inviteId) {
9233
+ getLinkInvite(inviteId) {
9234
9234
  return __async(this, null, function* () {
9235
- if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
9236
- yield this.sessionRefresh(session);
9237
- }
9238
- return this.apiClient.getLinkInvite(session.token, inviteId).then((response) => {
9235
+ return this.apiClient.getLinkInvite(this.serverkey, "", inviteId).then((response) => {
9239
9236
  return Promise.resolve(response);
9240
9237
  });
9241
9238
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.12.59",
3
+ "version": "2.12.61",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },