@jskit-ai/users-core 0.2.55 → 0.2.57

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
@@ -2,6 +2,7 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - `users_core_generic_initial-collation`, a migration Knex runs just before `users_core_generic_initial` (run `npm run db:migrate`): on MySQL and MariaDB it creates `users` and `user_settings`, where they do not exist yet, in the collation of the existing tables (`users`, then `auth_local_users`) rather than the database's default, and converts one recorded in another collation when no character can be lost. It changes nothing where they match.
5
6
  - `@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.
6
7
  - 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.
7
8
  - 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.
@@ -0,0 +1,18 @@
1
+ // Knex sorts this file just before users_core_generic_initial.cjs ("-" sorts before "."), so it runs first on every
2
+ // database that has not run it. It runs that released migration with each table it creates in the collation of
3
+ // users, or of the next table listed that exists, instead of the database's default, and repairs a table that
4
+ // default left: see migrateInExistingCollation. The released migration then finds its tables in place.
5
+ const released = require("./users_core_generic_initial.cjs");
6
+
7
+ exports.up = async function up(knex) {
8
+ const { migrateInExistingCollation } = await import("@jskit-ai/database-runtime/server/tableCollationMigrations");
9
+ await migrateInExistingCollation(knex, {
10
+ migration: "users_core_generic_initial.cjs",
11
+ up: released.up,
12
+ tables: ["users", "user_settings"],
13
+ referenceTables: ["users", "auth_local_users"]
14
+ });
15
+ };
16
+
17
+ // The released migration's down drops its tables.
18
+ exports.down = async function down() {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/users-core",
3
- "version": "0.2.55",
3
+ "version": "0.2.57",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "jskit test"
@@ -19,10 +19,10 @@
19
19
  "./locales/en.json": "./locales/en.json"
20
20
  },
21
21
  "dependencies": {
22
- "@jskit-ai/resource-core": "0.1.219",
23
- "@jskit-ai/resource-crud-core": "0.1.221",
24
- "@jskit-ai/storage-runtime": "0.1.274",
25
- "@jskit-ai/uploads-runtime": "0.2.28",
22
+ "@jskit-ai/resource-core": "0.1.220",
23
+ "@jskit-ai/resource-crud-core": "0.1.222",
24
+ "@jskit-ai/storage-runtime": "0.1.275",
25
+ "@jskit-ai/uploads-runtime": "0.2.29",
26
26
  "json-rest-schema": "^1.0.20"
27
27
  },
28
28
  "description": "Users/account runtime plus HTTP routes for account features.",
@@ -201,10 +201,10 @@
201
201
  }
202
202
  },
203
203
  "peerDependencies": {
204
- "@jskit-ai/auth-core": "0.2.32",
205
- "@jskit-ai/database-runtime": "0.1.277",
206
- "@jskit-ai/http-runtime": "0.2.28",
207
- "@jskit-ai/kernel": "0.2.28",
208
- "@jskit-ai/resource-runtime": "0.2.41"
204
+ "@jskit-ai/auth-core": "0.2.33",
205
+ "@jskit-ai/database-runtime": "0.1.279",
206
+ "@jskit-ai/http-runtime": "0.2.29",
207
+ "@jskit-ai/kernel": "0.2.29",
208
+ "@jskit-ai/resource-runtime": "0.2.43"
209
209
  }
210
210
  }
@@ -10,9 +10,9 @@
10
10
  "./shared": "./src/shared/index.js"
11
11
  },
12
12
  "dependencies": {
13
- "@jskit-ai/crud-core": "0.2.45",
14
- "@jskit-ai/resource-crud-core": "0.1.221",
15
- "@jskit-ai/users-core": "0.2.55"
13
+ "@jskit-ai/crud-core": "0.2.47",
14
+ "@jskit-ai/resource-crud-core": "0.1.222",
15
+ "@jskit-ai/users-core": "0.2.57"
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.45",
14
- "@jskit-ai/resource-crud-core": "0.1.221",
15
- "@jskit-ai/users-core": "0.2.55",
16
- "@jskit-ai/workspaces-core": "0.2.55"
13
+ "@jskit-ai/crud-core": "0.2.47",
14
+ "@jskit-ai/resource-crud-core": "0.1.222",
15
+ "@jskit-ai/users-core": "0.2.57",
16
+ "@jskit-ai/workspaces-core": "0.2.57"
17
17
  },
18
18
  "peerDependencies": {
19
- "@jskit-ai/kernel": "0.2.28",
20
- "@jskit-ai/resource-runtime": "0.2.41"
19
+ "@jskit-ai/kernel": "0.2.29",
20
+ "@jskit-ai/resource-runtime": "0.2.43"
21
21
  },
22
22
  "jskit": {
23
23
  "kind": "runtime",