@proteinjs/user 1.0.40 → 1.1.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.1.0](https://github.com/proteinjs/user/compare/@proteinjs/user@1.0.39...@proteinjs/user@1.1.0) (2024-08-06)
7
+
8
+
9
+ ### Features
10
+
11
+ * add invite feature and SignupService ([50545d3](https://github.com/proteinjs/user/commit/50545d39c19238e9e1b3ec67c789c3c161860dc8))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [1.0.36](https://github.com/proteinjs/user/compare/@proteinjs/user@1.0.35...@proteinjs/user@1.0.36) (2024-07-20)
7
18
 
8
19
  **Note:** Version bump only for package @proteinjs/user
@@ -16,9 +16,24 @@ export type UserSignup = Pick<User, 'name' | 'password'> & {
16
16
  email?: User['email'];
17
17
  };
18
18
  export interface SignupService extends Service {
19
+ /**
20
+ * Creates a new user account.
21
+ * @param {UserSignup} user - User signup information. `user.email` is required if no token is provided.
22
+ * @param {string} [token] - Optional invite token. If provided, the corresponding invite record will be used to get the user's email.
23
+ * @returns {Promise<void>}
24
+ */
19
25
  createUser(user: UserSignup, token?: string): Promise<void>;
26
+ /** Creates invite record and sends email to the invited user.
27
+ * If invite already exists for the email, it will update the existing record with a new token and send a new email.
28
+ */
20
29
  sendInvite(email: string): Promise<SendInviteResponse>;
30
+ /** Deletes invite record associated with the email. */
21
31
  revokeInvite(email: string): Promise<void>;
32
+ /**
33
+ * Initializes signup process, validating invite configuration and token if provided.
34
+ * Invite configuration defaults to invite optional.
35
+ * @see `DefaultInviteConfigFactory` for configuring invite setting
36
+ */
22
37
  initializeSignup(inviteToken?: string): Promise<InitializeSignupResponse>;
23
38
  }
24
39
  //# sourceMappingURL=SignupService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignupService.d.ts","sourceRoot":"","sources":["../../../src/services/SignupService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAkB,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,eAAO,MAAM,gBAAgB,qBAAiE,CAAC;AAE/F,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,GAAG;IACzD,KAAK,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;CACvB,CAAC;AAEF,MAAM,WAAW,aAAc,SAAQ,OAAO;IAC5C,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACvD,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;CAC3E"}
1
+ {"version":3,"file":"SignupService.d.ts","sourceRoot":"","sources":["../../../src/services/SignupService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAkB,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,eAAO,MAAM,gBAAgB,qBAAiE,CAAC;AAE/F,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,GAAG;IACzD,KAAK,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;CACvB,CAAC;AAEF,MAAM,WAAW,aAAc,SAAQ,OAAO;IAC5C;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D;;OAEG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACvD,uDAAuD;IACvD,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C;;;;OAIG;IACH,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;CAC3E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proteinjs/user",
3
- "version": "1.0.40",
3
+ "version": "1.1.1",
4
4
  "description": "User management",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -22,15 +22,15 @@
22
22
  "test": "jest"
23
23
  },
24
24
  "dependencies": {
25
- "@proteinjs/db": "1.5.3",
25
+ "@proteinjs/db": "1.5.4",
26
26
  "@proteinjs/reflection": "1.1.8",
27
27
  "@proteinjs/server-api": "1.4.1",
28
- "@proteinjs/service": "1.0.26",
29
- "@proteinjs/user-auth": "^1.0.16",
28
+ "@proteinjs/service": "1.0.27",
29
+ "@proteinjs/user-auth": "^1.1.0",
30
30
  "moment": "2.29.4"
31
31
  },
32
32
  "devDependencies": {
33
- "@proteinjs/db-driver-knex": "1.1.13",
33
+ "@proteinjs/db-driver-knex": "1.1.14",
34
34
  "@proteinjs/reflection-build": "1.0.23",
35
35
  "@types/jest": "29.5.5",
36
36
  "@types/node": "14.0.13",
@@ -21,8 +21,23 @@ export type UserSignup = Pick<User, 'name' | 'password'> & {
21
21
  };
22
22
 
23
23
  export interface SignupService extends Service {
24
+ /**
25
+ * Creates a new user account.
26
+ * @param {UserSignup} user - User signup information. `user.email` is required if no token is provided.
27
+ * @param {string} [token] - Optional invite token. If provided, the corresponding invite record will be used to get the user's email.
28
+ * @returns {Promise<void>}
29
+ */
24
30
  createUser(user: UserSignup, token?: string): Promise<void>;
31
+ /** Creates invite record and sends email to the invited user.
32
+ * If invite already exists for the email, it will update the existing record with a new token and send a new email.
33
+ */
25
34
  sendInvite(email: string): Promise<SendInviteResponse>;
35
+ /** Deletes invite record associated with the email. */
26
36
  revokeInvite(email: string): Promise<void>;
37
+ /**
38
+ * Initializes signup process, validating invite configuration and token if provided.
39
+ * Invite configuration defaults to invite optional.
40
+ * @see `DefaultInviteConfigFactory` for configuring invite setting
41
+ */
27
42
  initializeSignup(inviteToken?: string): Promise<InitializeSignupResponse>;
28
43
  }