@internxt/sdk 1.11.24 → 1.11.26

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.
@@ -87,7 +87,7 @@ export declare class Auth {
87
87
  * @param tfa - The two factor auth code.
88
88
  * @returns The opaque login response.
89
89
  */
90
- loginOpaqueStart(email: string, startLoginRequest: string, tfa: string | undefined): Promise<{
90
+ loginOpaqueStart(email: string, startLoginRequest: string): Promise<{
91
91
  loginResponse: string;
92
92
  }>;
93
93
  /**
@@ -95,9 +95,10 @@ export declare class Auth {
95
95
  * @param email
96
96
  * @param finishLoginRequest
97
97
  */
98
- loginOpaqueFinish(email: string, finishLoginRequest: string): Promise<{
98
+ loginOpaqueFinish(email: string, finishLoginRequest: string, tfa: string | undefined): Promise<{
99
99
  sessionID: string;
100
100
  user: UserSettings;
101
+ token: string;
101
102
  }>;
102
103
  /**
103
104
  * Tries to log in a user given its login details
@@ -234,13 +234,12 @@ var Auth = /** @class */ (function () {
234
234
  * @param tfa - The two factor auth code.
235
235
  * @returns The opaque login response.
236
236
  */
237
- Auth.prototype.loginOpaqueStart = function (email, startLoginRequest, tfa) {
237
+ Auth.prototype.loginOpaqueStart = function (email, startLoginRequest) {
238
238
  return __awaiter(this, void 0, void 0, function () {
239
239
  return __generator(this, function (_a) {
240
240
  return [2 /*return*/, this.client.post('/auth/login-opaque/start', {
241
241
  email: email,
242
242
  startLoginRequest: startLoginRequest,
243
- tfa: tfa,
244
243
  }, this.basicHeaders())];
245
244
  });
246
245
  });
@@ -250,12 +249,13 @@ var Auth = /** @class */ (function () {
250
249
  * @param email
251
250
  * @param finishLoginRequest
252
251
  */
253
- Auth.prototype.loginOpaqueFinish = function (email, finishLoginRequest) {
252
+ Auth.prototype.loginOpaqueFinish = function (email, finishLoginRequest, tfa) {
254
253
  return __awaiter(this, void 0, void 0, function () {
255
254
  return __generator(this, function (_a) {
256
255
  return [2 /*return*/, this.client.post('/auth/login-opaque/finish', {
257
256
  email: email,
258
257
  finishLoginRequest: finishLoginRequest,
258
+ tfa: tfa,
259
259
  }, this.basicHeaders())];
260
260
  });
261
261
  });
@@ -1,7 +1,7 @@
1
1
  import { paths } from '../../schema';
2
2
  import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
3
3
  import { UserSettings } from '../../shared/types/userSettings';
4
- import { ChangePasswordPayload, ChangePasswordPayloadNew, CheckChangeEmailExpirationResponse, FriendInvite, InitializeUserResponse, PreCreateUserResponse, Token, UpdateProfilePayload, UserPublicKeyResponse, UserPublicKeyWithCreationResponse, VerifyEmailChangeResponse } from './types';
4
+ import { ChangePasswordPayload, ChangePasswordPayloadNew, CheckChangeEmailExpirationResponse, FriendInvite, IncompleteCheckoutPayload, IncompleteCheckoutResponse, InitializeUserResponse, PreCreateUserResponse, Token, UpdateProfilePayload, UserPublicKeyResponse, UserPublicKeyWithCreationResponse, VerifyEmailChangeResponse } from './types';
5
5
  import { UserKeys } from '../../auth/types';
6
6
  export * as UserTypes from './types';
7
7
  export declare class Users {
@@ -201,6 +201,12 @@ export declare class Users {
201
201
  generateMnemonic(): Promise<{
202
202
  mnemonic: string;
203
203
  }>;
204
+ /**
205
+ * Tracks incomplete checkout event and sends notification email when user abandons checkout process
206
+ * @param payload - The incomplete checkout data containing checkout URL, plan name and price
207
+ * @returns A promise that resolves when the event is tracked successfully
208
+ */
209
+ handleIncompleteCheckout(payload: IncompleteCheckoutPayload): Promise<IncompleteCheckoutResponse>;
204
210
  private basicHeaders;
205
211
  private headers;
206
212
  private headersWithToken;
@@ -344,6 +344,14 @@ var Users = /** @class */ (function () {
344
344
  Users.prototype.generateMnemonic = function () {
345
345
  return this.client.get('/users/generate-mnemonic', this.basicHeaders());
346
346
  };
347
+ /**
348
+ * Tracks incomplete checkout event and sends notification email when user abandons checkout process
349
+ * @param payload - The incomplete checkout data containing checkout URL, plan name and price
350
+ * @returns A promise that resolves when the event is tracked successfully
351
+ */
352
+ Users.prototype.handleIncompleteCheckout = function (payload) {
353
+ return this.client.post('/users/payments/incomplete-checkout', payload, this.headers());
354
+ };
347
355
  Users.prototype.basicHeaders = function () {
348
356
  return (0, headers_1.basicHeaders)({
349
357
  clientName: this.appDetails.clientName,
@@ -76,3 +76,12 @@ export type VerifyEmailChangeResponse = {
76
76
  export type CheckChangeEmailExpirationResponse = {
77
77
  isExpired: boolean;
78
78
  };
79
+ export interface IncompleteCheckoutPayload extends Record<string, unknown> {
80
+ completeCheckoutUrl: string;
81
+ planName?: string;
82
+ price?: number;
83
+ }
84
+ export interface IncompleteCheckoutResponse {
85
+ success: boolean;
86
+ message: string;
87
+ }
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.11.24",
4
+ "version": "1.11.26",
5
5
  "description": "An sdk for interacting with Internxt's services",
6
6
  "repository": {
7
7
  "type": "git",