@jskit-ai/users-core 0.2.51 → 0.2.53
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 +1 -0
- package/package.json +7 -2
- package/patterns/user-administration-server/example/packages/users/package.json +2 -2
- package/patterns/user-administration-server/example/packages/users-workspace/package.json +4 -4
- package/src/server/UsersIdentityProvider.js +2 -4
- package/src/server/usersIdentity.js +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- `@jskit-ai/users-core/server/usersIdentity` exports `USERS_IDENTITY_TABLES`, the users and user settings tables `UsersIdentityProvider` owns, with `createUsersIdentity`, so code outside a server (workspaces-core's `createStandaloneRoleContext`) owns the same tables through standalone resources.
|
|
5
6
|
- Saving a profile picture (`POST /api/settings/profile/avatar`) answers 200 with the account's settings. The route sent the `settings.profile.avatar.upload` action's JSON:API result where its response schema, and the account settings page's upload, read the plain settings: the picture was saved and every save answered 500. The route now sends the settings the result carries (`jsonApiResultValue`); `accountProfileRoutes.test.js` proves it over HTTP.
|
|
6
7
|
- The user-administration-server pattern's workspace example (`users-workspace`'s `workspaceMembersOnly`) narrows users to the workspace's members in SQL. A list page is one report over the `users.profiles` and `workspaces.memberships` join sources: the users the list's filters match who hold an active membership, in the users list's order (display name, email, id), with a keyset cursor. A view reads that one membership with `findByWorkspaceIdAndUserId`. Before this, both read every active member id with `activeMemberIds` first. The page's cursor is the report's, and a cursor the list did not answer is refused with 400 `users.list.cursorInvalid`. workspaces-core's `userAdministrationExample.mysql.test.js` proves it on MariaDB/MySQL.
|
|
7
8
|
- `users.profiles` and `users.settings` answer `joinSource({ alias, filters }, options)`, the handle's join source, as `workspaces` and `workspaces.memberships` do: another owner's report reads people and their settings beside its own rows in one statement, under the users table's row policy, where it needed an app-side raw-SQL exception. Its tests run on MariaDB/MySQL (`joinSource.mysql.test.js`) and PostgreSQL (`joinSource.postgres.test.js`).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/users-core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.53",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jskit test"
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"./server/UsersFeature": "./src/server/UsersFeature.js",
|
|
10
10
|
"./server/UsersIdentityProvider": "./src/server/UsersIdentityProvider.js",
|
|
11
11
|
"./server/usersExtensions": "./src/server/usersExtensions.js",
|
|
12
|
+
"./server/usersIdentity": "./src/server/usersIdentity.js",
|
|
12
13
|
"./server/resolveActionUser": "./src/server/common/support/resolveActionUser.js",
|
|
13
14
|
"./server/types": "./src/server/types.js",
|
|
14
15
|
"./shared/resources/userProfileResource": "./src/shared/resources/userProfileResource.js",
|
|
@@ -91,6 +92,10 @@
|
|
|
91
92
|
"subpath": "./server/usersExtensions",
|
|
92
93
|
"summary": "Exports createUsersExtensions, the users.extensions registry of profile synchronization lifecycle contributors."
|
|
93
94
|
},
|
|
95
|
+
{
|
|
96
|
+
"subpath": "./server/usersIdentity",
|
|
97
|
+
"summary": "Exports createUsersIdentity, which builds users.profiles, users.settings and auth.profile.projector on handles of the users and user_settings tables, and USERS_IDENTITY_TABLES, those two table resources, for code outside a JSKIT server that owns them through standalone resources."
|
|
98
|
+
},
|
|
94
99
|
{
|
|
95
100
|
"subpath": "./server/resolveActionUser",
|
|
96
101
|
"summary": "Exports resolveActionUser, which reads an action's signed-in user."
|
|
@@ -200,6 +205,6 @@
|
|
|
200
205
|
"@jskit-ai/database-runtime": "0.1.276",
|
|
201
206
|
"@jskit-ai/http-runtime": "0.2.27",
|
|
202
207
|
"@jskit-ai/kernel": "0.2.27",
|
|
203
|
-
"@jskit-ai/resource-runtime": "0.2.
|
|
208
|
+
"@jskit-ai/resource-runtime": "0.2.39"
|
|
204
209
|
}
|
|
205
210
|
}
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"./shared": "./src/shared/index.js"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@jskit-ai/crud-core": "0.2.
|
|
13
|
+
"@jskit-ai/crud-core": "0.2.43",
|
|
14
14
|
"@jskit-ai/resource-crud-core": "0.1.220",
|
|
15
|
-
"@jskit-ai/users-core": "0.2.
|
|
15
|
+
"@jskit-ai/users-core": "0.2.53"
|
|
16
16
|
},
|
|
17
17
|
"jskit": {
|
|
18
18
|
"kind": "runtime",
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
"./shared": "./src/shared/index.js"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@jskit-ai/crud-core": "0.2.
|
|
13
|
+
"@jskit-ai/crud-core": "0.2.43",
|
|
14
14
|
"@jskit-ai/resource-crud-core": "0.1.220",
|
|
15
|
-
"@jskit-ai/users-core": "0.2.
|
|
16
|
-
"@jskit-ai/workspaces-core": "0.2.
|
|
15
|
+
"@jskit-ai/users-core": "0.2.53",
|
|
16
|
+
"@jskit-ai/workspaces-core": "0.2.53"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@jskit-ai/kernel": "0.2.27",
|
|
20
|
-
"@jskit-ai/resource-runtime": "0.2.
|
|
20
|
+
"@jskit-ai/resource-runtime": "0.2.39"
|
|
21
21
|
},
|
|
22
22
|
"jskit": {
|
|
23
23
|
"kind": "runtime",
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { defineFeature } from "@jskit-ai/kernel/server/features";
|
|
2
|
-
import {
|
|
3
|
-
import { userSettingsTableResource } from "../shared/resources/userSettingsResource.js";
|
|
4
|
-
import { createUsersIdentity } from "./usersIdentity.js";
|
|
2
|
+
import { USERS_IDENTITY_TABLES, createUsersIdentity } from "./usersIdentity.js";
|
|
5
3
|
|
|
6
4
|
// The users and user_settings tables' one owner. Other features reach them
|
|
7
5
|
// through the repositories it provides, never through the tables.
|
|
8
6
|
const UsersIdentityProvider = defineFeature({
|
|
9
7
|
id: "users.identity",
|
|
10
|
-
owns:
|
|
8
|
+
owns: USERS_IDENTITY_TABLES,
|
|
11
9
|
requires: {
|
|
12
10
|
extensions: "users.extensions"
|
|
13
11
|
},
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { userProfileTableResource } from "../shared/resources/userProfileResource.js";
|
|
2
|
+
import { userSettingsTableResource } from "../shared/resources/userSettingsResource.js";
|
|
1
3
|
import { createRepository as createUserProfilesRepository } from "./common/repositories/userProfilesRepository.js";
|
|
2
4
|
import { createRepository as createUserSettingsRepository } from "./common/repositories/userSettingsRepository.js";
|
|
3
5
|
import { createService as createAuthProfileSyncService } from "./common/services/authProfileSyncService.js";
|
|
4
6
|
|
|
7
|
+
// The users and user_settings tables, which users.identity owns.
|
|
8
|
+
const USERS_IDENTITY_TABLES = Object.freeze([userProfileTableResource, userSettingsTableResource]);
|
|
9
|
+
|
|
5
10
|
/**
|
|
6
11
|
* The users' profile and settings records (`users.profiles`, `users.settings`),
|
|
7
12
|
* and the projector that keeps a profile in step with the identity that signs
|
|
@@ -25,4 +30,4 @@ function createUsersIdentity({ resources, extensions }) {
|
|
|
25
30
|
});
|
|
26
31
|
}
|
|
27
32
|
|
|
28
|
-
export { createUsersIdentity };
|
|
33
|
+
export { USERS_IDENTITY_TABLES, createUsersIdentity };
|