@narrative.io/data-collaboration-sdk-ts 2.85.0 → 2.86.0

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 { BaseApi } from "../base-api";
2
- import type { ApiToken, LoggedInUser, LoginRequest, LoginResponse, RegisterRequest, RegisterResponse, RegistrationStatus, RegistrationStatusRequest, RegistrationStatusResponse, StytchToken, UserRole } from "./types";
2
+ import type { ApiToken, LoggedInUser, LoginRequest, LoginResponse, RegisterRequest, RegisterResponse, RegistrationStatus, RegistrationStatusB2bRequest, RegistrationStatusRequest, RegistrationStatusResponse, StytchToken, UserRole } from "./types";
3
3
  /**
4
4
  * A class for accessing the Authentication API
5
5
  * @extends BaseApi
@@ -8,23 +8,56 @@ declare class AuthenticationApi extends BaseApi {
8
8
  /**
9
9
  * Logs in the user.
10
10
  *
11
+ * @see https://docs.narrative.io/open-api#tag/Authentication/paths/~1authentication~1login/post
12
+ *
11
13
  * @param {LoginRequest} loginRequest - The login request object.
12
14
  * @returns {Promise<LoginResponse>} - A promise that resolves to the login response.
13
15
  */
14
16
  login(loginRequest: LoginRequest): Promise<LoginResponse>;
17
+ /**
18
+ * Logs in a B2B user.
19
+ *
20
+ * @see https://docs.narrative.io/open-api#tag/Authentication/paths/~1authentication~1b2b~1login/post
21
+ *
22
+ * @param {LoginRequest} loginRequest - The login request object.
23
+ * @returns {Promise<LoginResponse>} - A promise that resolves to the login response.
24
+ */
25
+ loginB2b(loginRequest: LoginRequest): Promise<LoginResponse>;
15
26
  /**
16
27
  * Registers a new user.
17
28
  *
29
+ * @see https://docs.narrative.io/open-api#tag/Authentication/paths/~1authentication~1register/post
30
+ *
18
31
  * @param {RegisterRequest} registerRequest - The register request object.
19
32
  * @returns {Promise<RegisterResponse>} - A promise that resolves to the register response.
20
33
  */
21
34
  register(registerRequest: RegisterRequest): Promise<RegisterResponse>;
35
+ /**
36
+ * Registers a new B2B user.
37
+ *
38
+ * @see https://docs.narrative.io/open-api#tag/Authentication/paths/~1authentication~1b2b~1register/post
39
+ *
40
+ * @param {RegisterRequest} registerRequest - The register request object.
41
+ * @returns {Promise<RegisterResponse>} - A promise that resolves to the register response.
42
+ */
43
+ registerB2b(registerRequest: RegisterRequest): Promise<RegisterResponse>;
22
44
  /**
23
45
  * Checks the resgistration status of a user.
24
46
  *
25
- * @param {RegistrationStatusRequest} statusRewquest - request payload of user login for whom to check status.
47
+ * @see https://docs.narrative.io/open-api#tag/Authentication/paths/~1authentication~1registration-status/post
48
+ *
49
+ * @param {RegistrationStatusRequest} statusRequest - request payload of user login for whom to check status.
26
50
  * @returns {Promise<RegistrationStatusResponse>} - A promise that resolves to the response.
27
51
  */
28
52
  checkRegistrationStatus(statusRequest: RegistrationStatusRequest): Promise<RegistrationStatusResponse>;
53
+ /**
54
+ * Checks the registration status of a B2B user.
55
+ *
56
+ * @see https://docs.narrative.io/open-api#tag/Authentication/paths/~1authentication~1b2b~1registration-status/post
57
+ *
58
+ * @param {RegistrationStatusB2bRequest} statusRequest - The B2B registration status request.
59
+ * @returns {Promise<RegistrationStatusResponse>} - A promise that resolves to the response.
60
+ */
61
+ checkRegistrationStatusB2b(statusRequest: RegistrationStatusB2bRequest): Promise<RegistrationStatusResponse>;
29
62
  }
30
- export { type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole, type RegistrationStatus, type RegistrationStatusRequest, type RegistrationStatusResponse, AuthenticationApi, };
63
+ export { type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole, type RegistrationStatus, type RegistrationStatusB2bRequest, type RegistrationStatusRequest, type RegistrationStatusResponse, AuthenticationApi, };
@@ -14,29 +14,68 @@ class AuthenticationApi extends BaseApi {
14
14
  /**
15
15
  * Logs in the user.
16
16
  *
17
+ * @see https://docs.narrative.io/open-api#tag/Authentication/paths/~1authentication~1login/post
18
+ *
17
19
  * @param {LoginRequest} loginRequest - The login request object.
18
20
  * @returns {Promise<LoginResponse>} - A promise that resolves to the login response.
19
21
  */
20
22
  async login(loginRequest) {
21
23
  return await this.post(`${resourceName}/login`, loginRequest);
22
24
  }
25
+ /**
26
+ * Logs in a B2B user.
27
+ *
28
+ * @see https://docs.narrative.io/open-api#tag/Authentication/paths/~1authentication~1b2b~1login/post
29
+ *
30
+ * @param {LoginRequest} loginRequest - The login request object.
31
+ * @returns {Promise<LoginResponse>} - A promise that resolves to the login response.
32
+ */
33
+ async loginB2b(loginRequest) {
34
+ return await this.post(`${resourceName}/b2b/login`, loginRequest);
35
+ }
23
36
  /**
24
37
  * Registers a new user.
25
38
  *
39
+ * @see https://docs.narrative.io/open-api#tag/Authentication/paths/~1authentication~1register/post
40
+ *
26
41
  * @param {RegisterRequest} registerRequest - The register request object.
27
42
  * @returns {Promise<RegisterResponse>} - A promise that resolves to the register response.
28
43
  */
29
44
  async register(registerRequest) {
30
45
  return await this.post(`${resourceName}/register`, registerRequest);
31
46
  }
47
+ /**
48
+ * Registers a new B2B user.
49
+ *
50
+ * @see https://docs.narrative.io/open-api#tag/Authentication/paths/~1authentication~1b2b~1register/post
51
+ *
52
+ * @param {RegisterRequest} registerRequest - The register request object.
53
+ * @returns {Promise<RegisterResponse>} - A promise that resolves to the register response.
54
+ */
55
+ async registerB2b(registerRequest) {
56
+ return await this.post(`${resourceName}/b2b/register`, registerRequest);
57
+ }
32
58
  /**
33
59
  * Checks the resgistration status of a user.
34
60
  *
35
- * @param {RegistrationStatusRequest} statusRewquest - request payload of user login for whom to check status.
61
+ * @see https://docs.narrative.io/open-api#tag/Authentication/paths/~1authentication~1registration-status/post
62
+ *
63
+ * @param {RegistrationStatusRequest} statusRequest - request payload of user login for whom to check status.
36
64
  * @returns {Promise<RegistrationStatusResponse>} - A promise that resolves to the response.
37
65
  */
38
66
  async checkRegistrationStatus(statusRequest) {
39
67
  return await this.post(`${resourceName}/registration-status`, statusRequest);
40
68
  }
69
+ /**
70
+ * Checks the registration status of a B2B user.
71
+ *
72
+ * @see https://docs.narrative.io/open-api#tag/Authentication/paths/~1authentication~1b2b~1registration-status/post
73
+ *
74
+ * @param {RegistrationStatusB2bRequest} statusRequest - The B2B registration status request.
75
+ * @returns {Promise<RegistrationStatusResponse>} - A promise that resolves to the response.
76
+ */
77
+ async checkRegistrationStatusB2b(statusRequest) {
78
+ return await this.post(`${resourceName}/b2b/registration-status`, statusRequest);
79
+ }
41
80
  }
42
81
  export { AuthenticationApi, };
@@ -44,6 +44,10 @@ export interface RegistrationStatusRequest {
44
44
  stytch_token: StytchToken;
45
45
  session_duration_minutes?: number;
46
46
  }
47
+ export interface RegistrationStatusB2bRequest {
48
+ stytch_token: string;
49
+ session_duration_minutes: number;
50
+ }
47
51
  export interface RegistrationStatusResponse {
48
52
  status: RegistrationStatus;
49
53
  email: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narrative.io/data-collaboration-sdk-ts",
3
- "version": "2.85.0",
3
+ "version": "2.86.0",
4
4
  "main": "build/index.js",
5
5
  "repository": "github:narrative-io/data-collaboration-sdk-ts",
6
6
  "source": "src/index.ts",