@internxt/sdk 1.15.4 → 1.15.6

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.
@@ -1,5 +1,5 @@
1
1
  import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
2
- import { ReferralTokenResponse, UserReferral } from './types';
2
+ import { ReferralEnabledResponse, ReferralTokenResponse, UserReferral } from './types';
3
3
  export * as ReferralTypes from './types';
4
4
  export declare class Referrals {
5
5
  private readonly client;
@@ -15,6 +15,10 @@ export declare class Referrals {
15
15
  * Generates a referral token for the authenticated user
16
16
  */
17
17
  createReferralToken(): Promise<ReferralTokenResponse>;
18
+ /**
19
+ * Checks if the referral feature is enabled for the authenticated user
20
+ */
21
+ isReferralEnabled(): Promise<ReferralEnabledResponse>;
18
22
  /**
19
23
  * Returns the needed headers for the module requests
20
24
  * @private
@@ -58,6 +58,12 @@ var Referrals = /** @class */ (function () {
58
58
  Referrals.prototype.createReferralToken = function () {
59
59
  return this.client.post('/referral/token', {}, this.headers());
60
60
  };
61
+ /**
62
+ * Checks if the referral feature is enabled for the authenticated user
63
+ */
64
+ Referrals.prototype.isReferralEnabled = function () {
65
+ return this.client.get('/referral/enabled', this.headers());
66
+ };
61
67
  /**
62
68
  * Returns the needed headers for the module requests
63
69
  * @private
@@ -22,3 +22,6 @@ export interface UserReferral {
22
22
  export interface ReferralTokenResponse {
23
23
  token: string;
24
24
  }
25
+ export interface ReferralEnabledResponse {
26
+ isEnabled: boolean;
27
+ }
@@ -1,5 +1,5 @@
1
1
  import { ApiSecurity, ApiUrl, AppDetails } from '../shared';
2
- import { CreateCallResponse, JoinCallPayload, JoinCallResponse, UsersInCallResponse } from './types';
2
+ import { CreateCallResponse, JoinCallPayload, JoinCallResponse, LeaveCallPayload, UsersInCallResponse } from './types';
3
3
  export declare class Meet {
4
4
  private readonly client;
5
5
  private readonly appDetails;
@@ -8,7 +8,7 @@ export declare class Meet {
8
8
  static client(apiUrl: ApiUrl, appDetails: AppDetails, apiSecurity?: ApiSecurity): Meet;
9
9
  createCall(): Promise<CreateCallResponse>;
10
10
  joinCall(callId: string, payload: JoinCallPayload): Promise<JoinCallResponse>;
11
- leaveCall(callId: string): Promise<void>;
11
+ leaveCall(callId: string, payload?: LeaveCallPayload): Promise<void>;
12
12
  getCurrentUsersInCall(callId: string): Promise<UsersInCallResponse[]>;
13
13
  private headersWithToken;
14
14
  private basicHeaders;
@@ -76,13 +76,13 @@ var Meet = /** @class */ (function () {
76
76
  });
77
77
  });
78
78
  };
79
- Meet.prototype.leaveCall = function (callId) {
79
+ Meet.prototype.leaveCall = function (callId, payload) {
80
80
  return __awaiter(this, void 0, void 0, function () {
81
81
  var headers;
82
82
  var _a;
83
83
  return __generator(this, function (_b) {
84
84
  headers = ((_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token) ? this.headersWithToken() : this.basicHeaders();
85
- return [2 /*return*/, this.client.post("call/".concat(callId, "/users/leave"), {}, headers)];
85
+ return [2 /*return*/, this.client.post("call/".concat(callId, "/users/leave"), payload ? __assign({}, payload) : {}, headers)];
86
86
  });
87
87
  });
88
88
  };
@@ -16,6 +16,9 @@ export interface JoinCallResponse {
16
16
  userId: string;
17
17
  appId: string;
18
18
  }
19
+ export interface LeaveCallPayload {
20
+ userId: string;
21
+ }
19
22
  export interface UsersInCallResponse {
20
23
  userId: string;
21
24
  name: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@internxt/sdk",
3
3
  "author": "Internxt <hello@internxt.com>",
4
- "version": "1.15.4",
4
+ "version": "1.15.6",
5
5
  "description": "An sdk for interacting with Internxt's services",
6
6
  "repository": {
7
7
  "type": "git",