@cosmicdrift/kumiko-bundled-features 0.75.0 → 0.76.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 +6 -6
- package/src/auth-email-password/__tests__/auth.integration.test.ts +2 -2
- package/src/auth-email-password/__tests__/email-verification.integration.test.ts +3 -3
- package/src/auth-email-password/__tests__/password-reset.integration.test.ts +3 -3
- package/src/tags/web/client-plugin.tsx +0 -5
- package/src/user/schema/user.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-bundled-features",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.76.0",
|
|
4
4
|
"description": "Built-in features — tenant, user, auth, delivery. The stuff you'd rewrite anyway, already typed.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -84,11 +84,11 @@
|
|
|
84
84
|
"./step-dispatcher": "./src/step-dispatcher/index.ts"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@cosmicdrift/kumiko-dispatcher-live": "0.
|
|
88
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
89
|
-
"@cosmicdrift/kumiko-headless": "0.
|
|
90
|
-
"@cosmicdrift/kumiko-renderer": "0.
|
|
91
|
-
"@cosmicdrift/kumiko-renderer-web": "0.
|
|
87
|
+
"@cosmicdrift/kumiko-dispatcher-live": "0.76.0",
|
|
88
|
+
"@cosmicdrift/kumiko-framework": "0.76.0",
|
|
89
|
+
"@cosmicdrift/kumiko-headless": "0.76.0",
|
|
90
|
+
"@cosmicdrift/kumiko-renderer": "0.76.0",
|
|
91
|
+
"@cosmicdrift/kumiko-renderer-web": "0.76.0",
|
|
92
92
|
"@mollie/api-client": "^4.5.0",
|
|
93
93
|
"@node-rs/argon2": "^2.0.2",
|
|
94
94
|
"@types/nodemailer": "^8.0.0",
|
|
@@ -2,7 +2,7 @@ import { afterAll, beforeAll, beforeEach, describe, expect, test } from "bun:tes
|
|
|
2
2
|
import { randomBytes } from "node:crypto";
|
|
3
3
|
import { asRawClient } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
4
4
|
import { createEncryptionProvider } from "@cosmicdrift/kumiko-framework/db";
|
|
5
|
-
import type
|
|
5
|
+
import { SYSTEM_TENANT_ID, type TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
6
6
|
import {
|
|
7
7
|
createTestUser,
|
|
8
8
|
setupTestStack,
|
|
@@ -255,7 +255,7 @@ describe("scenario 5b: change-password when the aggregate stream tenant != sessi
|
|
|
255
255
|
`SELECT "tenant_id" AS t FROM "kumiko_events" WHERE "aggregate_id" = $1 AND "aggregate_type" = $2 ORDER BY "version" LIMIT 1`,
|
|
256
256
|
[seed.id, "user"],
|
|
257
257
|
)) as ReadonlyArray<{ t: string }>;
|
|
258
|
-
expect(streamRows[0]?.t).toBe(
|
|
258
|
+
expect(streamRows[0]?.t).toBe(SYSTEM_TENANT_ID);
|
|
259
259
|
expect(streamRows[0]?.t).not.toBe(membershipTenant);
|
|
260
260
|
|
|
261
261
|
const signedIn = createTestUser({ id: seed.id, tenantId: seed.tenantId, roles: ["User"] });
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
updateMany,
|
|
8
8
|
} from "@cosmicdrift/kumiko-framework/bun-db";
|
|
9
9
|
import { createEncryptionProvider } from "@cosmicdrift/kumiko-framework/db";
|
|
10
|
-
import type
|
|
10
|
+
import { SYSTEM_TENANT_ID, type TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
11
11
|
import {
|
|
12
12
|
setupTestStack,
|
|
13
13
|
type TestStack,
|
|
@@ -250,7 +250,7 @@ describe("POST /auth/verify-email", () => {
|
|
|
250
250
|
`SELECT "tenant_id" FROM "kumiko_events" WHERE "aggregate_id" = $1 AND "aggregate_type" = 'user' ORDER BY "version" LIMIT 1`,
|
|
251
251
|
[seed.id],
|
|
252
252
|
)) as ReadonlyArray<{ tenant_id: string }>;
|
|
253
|
-
expect(streamRows[0]?.tenant_id).toBe(
|
|
253
|
+
expect(streamRows[0]?.tenant_id).toBe(SYSTEM_TENANT_ID);
|
|
254
254
|
|
|
255
255
|
const { token } = signVerificationToken(seed.id, 60, verifySecret);
|
|
256
256
|
const res = await post("/api/auth/verify-email", { token });
|
|
@@ -407,7 +407,7 @@ describe("verify-email — aggregate stream in a non-membership tenant (sysadmin
|
|
|
407
407
|
[seed.id],
|
|
408
408
|
)) as ReadonlyArray<{ tenant_id: string; aggregate_type: string }>;
|
|
409
409
|
expect(streamRows[0]?.aggregate_type).toBe("user");
|
|
410
|
-
expect(streamRows[0]?.tenant_id).toBe(
|
|
410
|
+
expect(streamRows[0]?.tenant_id).toBe(SYSTEM_TENANT_ID);
|
|
411
411
|
expect(streamRows[0]?.tenant_id).not.toBe(membershipTenant);
|
|
412
412
|
|
|
413
413
|
const { token } = signVerificationToken(seed.id, 60, verifySecret);
|
|
@@ -2,7 +2,7 @@ import { afterAll, beforeAll, beforeEach, describe, expect, test } from "bun:tes
|
|
|
2
2
|
import { randomBytes } from "node:crypto";
|
|
3
3
|
import { asRawClient, insertOne, selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
4
4
|
import { createEncryptionProvider } from "@cosmicdrift/kumiko-framework/db";
|
|
5
|
-
import type
|
|
5
|
+
import { SYSTEM_TENANT_ID, type TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
6
6
|
import {
|
|
7
7
|
setupTestStack,
|
|
8
8
|
type TestStack,
|
|
@@ -308,7 +308,7 @@ describe("POST /auth/reset-password", () => {
|
|
|
308
308
|
`SELECT "tenant_id" FROM "kumiko_events" WHERE "aggregate_id" = $1 AND "aggregate_type" = 'user' ORDER BY "version" LIMIT 1`,
|
|
309
309
|
[seed.id],
|
|
310
310
|
)) as ReadonlyArray<{ tenant_id: string }>;
|
|
311
|
-
expect(streamRows[0]?.tenant_id).toBe(
|
|
311
|
+
expect(streamRows[0]?.tenant_id).toBe(SYSTEM_TENANT_ID);
|
|
312
312
|
|
|
313
313
|
const { token } = signResetToken(seed.id, 15, resetSecret);
|
|
314
314
|
const res = await post("/api/auth/reset-password", {
|
|
@@ -390,7 +390,7 @@ describe("POST /auth/reset-password", () => {
|
|
|
390
390
|
[seed.id],
|
|
391
391
|
)) as ReadonlyArray<{ tenant_id: string; aggregate_type: string }>;
|
|
392
392
|
expect(streamRows[0]?.aggregate_type).toBe("user");
|
|
393
|
-
expect(streamRows[0]?.tenant_id).toBe(
|
|
393
|
+
expect(streamRows[0]?.tenant_id).toBe(SYSTEM_TENANT_ID);
|
|
394
394
|
expect(streamRows[0]?.tenant_id).not.toBe(membershipTenant);
|
|
395
395
|
|
|
396
396
|
const { token } = signResetToken(seed.id, 15, resetSecret);
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
// @runtime client
|
|
2
|
-
// Client-feature factory for tags. Mounted via
|
|
3
|
-
// createKumikoApp({ clientFeatures: [tagsClient()] }) — registers TagSection
|
|
4
|
-
// under TAGS_SECTION_EXTENSION_NAME and contributes the default translations.
|
|
5
|
-
// Required even for standalone <TagSection> use, otherwise its i18n keys render
|
|
6
|
-
// raw.
|
|
7
2
|
|
|
8
3
|
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer-web";
|
|
9
4
|
import { TAGS_FEATURE_NAME, TAGS_SECTION_EXTENSION_NAME } from "../constants";
|
package/src/user/schema/user.ts
CHANGED
|
@@ -56,6 +56,9 @@ const USER_STATUS_OPTIONS = [
|
|
|
56
56
|
export const userEntity = createEntity({
|
|
57
57
|
table: "read_users",
|
|
58
58
|
softDelete: true,
|
|
59
|
+
// Tenant-independent identity aggregate — its event stream lives on
|
|
60
|
+
// SYSTEM_TENANT_ID instead of whichever tenant happened to create it (#497).
|
|
61
|
+
systemStream: true,
|
|
59
62
|
fields: {
|
|
60
63
|
// Identity — anyone who can see the user can read the email, but only
|
|
61
64
|
// privileged roles (SYSTEM auth code, SystemAdmin) may change it.
|