@ossy/users 3.6.1 → 3.11.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ossy/users",
3
3
  "description": "User domain - aggregate, events, and validators for the Ossy user model",
4
- "version": "3.6.1",
4
+ "version": "3.11.0",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "main": "./src/index.js",
@@ -10,6 +10,7 @@
10
10
  ".": "./src/index.js",
11
11
  "./server": "./src/server.js",
12
12
  "./update-email.flow.js": "./src/update-email.flow.js",
13
+ "./update-profile-name.flow.js": "./src/update-profile-name.flow.js",
13
14
  "./update-profile-details.schema.js": "./src/update-profile-details.schema.js"
14
15
  },
15
16
  "scripts": {
@@ -36,7 +37,7 @@
36
37
  "dependencies": {
37
38
  "@ossy/config": "^3.0.9",
38
39
  "@ossy/observability": "^3.0.9",
39
- "@ossy/schema": "^3.6.1",
40
+ "@ossy/schema": "^3.8.0",
40
41
  "nanoid": "^5.1.11"
41
42
  },
42
43
  "devDependencies": {
@@ -48,5 +49,5 @@
48
49
  "/src",
49
50
  "README.md"
50
51
  ],
51
- "gitHead": "a5983ae88369e1caddd039c20983ae629ce3166c"
52
+ "gitHead": "53ff8456920e09151c9d88df4a6c3ee958d811eb"
52
53
  }
@@ -14,6 +14,7 @@ export async function run ({ payload, req }) {
14
14
  type: TokenSchema.token,
15
15
  'state.subject': userId,
16
16
  'state.type': 'Api',
17
+ 'state.status': 'Active',
17
18
  }, { state: true }).toArray().then(docs => docs.map(d => d.state))
18
19
 
19
20
  return tokens.map(({ token: _secret, ...meta }) => meta)
@@ -0,0 +1,50 @@
1
+ import signUpFlow from '@ossy/authentication/sign-up.flow.js'
2
+ import { metadata as EditProfileDetails } from './edit-profile-details.action.js'
3
+ import { metadata as SaveProfileDetails } from './save-profile-details.action.js'
4
+ import { metadata as UpdateProfileDetailsForm } from './update-profile-details.form.js'
5
+
6
+ export const metadata = {
7
+ id: '@ossy/users/flows/update-profile-name',
8
+ feature: 'users',
9
+ requires: ['server', 'database'],
10
+ }
11
+
12
+ /**
13
+ * Happy path for issue #5 — change first/last name from profile without
14
+ * requesting an email change (email stays the sign-up address).
15
+ */
16
+ export default {
17
+ title: 'Update profile name',
18
+ description:
19
+ 'Signed-in user edits profile name only, saves, and sees the updated name on profile',
20
+ steps: [
21
+ ...signUpFlow.steps,
22
+ { page: '@profile' },
23
+ { result: { action: EditProfileDetails, timeout: 10000 } },
24
+ { action: EditProfileDetails },
25
+ { result: { action: SaveProfileDetails, timeout: 10000 } },
26
+ // Keep sign-up email so RequestEmailChange does not run — name-only path.
27
+ {
28
+ form: UpdateProfileDetailsForm,
29
+ fields: {
30
+ firstName: 'E2E',
31
+ lastName: 'UpdatedName',
32
+ email: '$email',
33
+ },
34
+ },
35
+ { action: SaveProfileDetails },
36
+ {
37
+ result: {
38
+ selector: '[data-user-name="E2E UpdatedName"]',
39
+ timeout: 15000,
40
+ },
41
+ },
42
+ {
43
+ result: {
44
+ selector: '[data-action="@ossy/users/actions/save-profile-details"]',
45
+ hidden: true,
46
+ timeout: 10000,
47
+ },
48
+ },
49
+ ],
50
+ }