@cosmicdrift/kumiko-bundled-features 0.243.2 → 0.243.4
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-bundled-features",
|
|
3
|
-
"version": "0.243.
|
|
3
|
+
"version": "0.243.4",
|
|
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>",
|
|
@@ -130,12 +130,12 @@
|
|
|
130
130
|
"./workflow-runner": "./src/workflow-runner/index.ts"
|
|
131
131
|
},
|
|
132
132
|
"dependencies": {
|
|
133
|
-
"@cosmicdrift/kumiko-dispatcher-live": "0.243.
|
|
134
|
-
"@cosmicdrift/kumiko-framework": "0.243.
|
|
135
|
-
"@cosmicdrift/kumiko-headless": "0.243.
|
|
136
|
-
"@cosmicdrift/kumiko-renderer": "0.243.
|
|
137
|
-
"@cosmicdrift/kumiko-renderer-web": "0.243.
|
|
138
|
-
"@cosmicdrift/kumiko-types": "0.243.
|
|
133
|
+
"@cosmicdrift/kumiko-dispatcher-live": "0.243.4",
|
|
134
|
+
"@cosmicdrift/kumiko-framework": "0.243.4",
|
|
135
|
+
"@cosmicdrift/kumiko-headless": "0.243.4",
|
|
136
|
+
"@cosmicdrift/kumiko-renderer": "0.243.4",
|
|
137
|
+
"@cosmicdrift/kumiko-renderer-web": "0.243.4",
|
|
138
|
+
"@cosmicdrift/kumiko-types": "0.243.4",
|
|
139
139
|
"@mollie/api-client": "^4.5.0",
|
|
140
140
|
"@node-rs/argon2": "^2.0.2",
|
|
141
141
|
"@types/mailparser": "^3.4.6",
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
"devDependencies": {
|
|
165
165
|
"@testing-library/user-event": "^14.6.1",
|
|
166
166
|
"@types/qrcode": "^1.5.5",
|
|
167
|
-
"@cosmicdrift/kumiko-locale-de": "0.243.
|
|
168
|
-
"@cosmicdrift/kumiko-locale-es": "0.243.
|
|
167
|
+
"@cosmicdrift/kumiko-locale-de": "0.243.4",
|
|
168
|
+
"@cosmicdrift/kumiko-locale-es": "0.243.4"
|
|
169
169
|
}
|
|
170
170
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Regression test for #missing r.storeTable() registration: inAppMessagesTable
|
|
2
|
+
// was declared as a plain pgTable but never registered via r.storeTable(), so
|
|
3
|
+
// collectTableMetas() (the source migrations are generated from) never saw
|
|
4
|
+
// "in_app_messages" — no migration was ever emitted and every app using
|
|
5
|
+
// channel-in-app crashed at runtime with `relation "in_app_messages" does not
|
|
6
|
+
// exist`. Mirrors framework/src/engine/__tests__/store-table.test.ts.
|
|
7
|
+
|
|
8
|
+
import { describe, expect, test } from "bun:test";
|
|
9
|
+
import { collectTableMetas } from "@cosmicdrift/kumiko-framework/db";
|
|
10
|
+
import { createChannelInAppFeature } from "../feature";
|
|
11
|
+
|
|
12
|
+
describe("channel-in-app — in_app_messages store table", () => {
|
|
13
|
+
test("registers in_app_messages via r.storeTable", () => {
|
|
14
|
+
const feature = createChannelInAppFeature();
|
|
15
|
+
expect(feature.storeTables).toHaveProperty("in_app_messages");
|
|
16
|
+
expect(feature.storeTables["in_app_messages"]?.meta.tableName).toBe("in_app_messages");
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test("in_app_messages is part of collectTableMetas() so a migration is generated for it", () => {
|
|
20
|
+
const feature = createChannelInAppFeature();
|
|
21
|
+
const metas = collectTableMetas([feature]);
|
|
22
|
+
const tableNames = metas.map((m) => m.tableName);
|
|
23
|
+
expect(tableNames).toContain("in_app_messages");
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -4,6 +4,7 @@ import { markAllReadWrite } from "./handlers/mark-all-read.write";
|
|
|
4
4
|
import { markReadWrite } from "./handlers/mark-read.write";
|
|
5
5
|
import { unreadCountQuery } from "./handlers/unread-count.query";
|
|
6
6
|
import { inAppChannel } from "./in-app-channel";
|
|
7
|
+
import { inAppMessagesTableMeta } from "./tables";
|
|
7
8
|
|
|
8
9
|
export function createChannelInAppFeature(): FeatureDefinition {
|
|
9
10
|
return defineFeature("channel-in-app", (r) => {
|
|
@@ -17,6 +18,10 @@ export function createChannelInAppFeature(): FeatureDefinition {
|
|
|
17
18
|
});
|
|
18
19
|
r.requires("delivery");
|
|
19
20
|
|
|
21
|
+
r.storeTable(inAppMessagesTableMeta, {
|
|
22
|
+
reason: "read_side.in_app_messages",
|
|
23
|
+
});
|
|
24
|
+
|
|
20
25
|
// Register as delivery channel via extension system
|
|
21
26
|
r.useExtension("deliveryChannel", "inApp", {
|
|
22
27
|
mode: inAppChannel.mode,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { asEntityTableMeta } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
1
2
|
import {
|
|
2
3
|
boolean,
|
|
4
|
+
type EntityTableMeta,
|
|
3
5
|
instant,
|
|
4
6
|
table as pgTable,
|
|
5
7
|
serial,
|
|
@@ -20,3 +22,11 @@ export const inAppMessagesTable = pgTable("in_app_messages", {
|
|
|
20
22
|
readAt: instant("read_at"),
|
|
21
23
|
createdAt: instant("created_at").default(sql`now()`).notNull(),
|
|
22
24
|
});
|
|
25
|
+
|
|
26
|
+
// Derived from inAppMessagesTable (table() attaches the meta as a Symbol) so
|
|
27
|
+
// the two can't drift, instead of hand-duplicating the column list.
|
|
28
|
+
const derivedInAppMessagesTableMeta = asEntityTableMeta(inAppMessagesTable);
|
|
29
|
+
if (!derivedInAppMessagesTableMeta) {
|
|
30
|
+
throw new Error("inAppMessagesTable: table carries no EntityTableMeta — built via table()?");
|
|
31
|
+
}
|
|
32
|
+
export const inAppMessagesTableMeta: EntityTableMeta = derivedInAppMessagesTableMeta;
|
|
@@ -147,9 +147,12 @@ describe("privacy-center screen (fw#2312 projectionDetail conversion)", () => {
|
|
|
147
147
|
handler: "user-data-rights:write:restrict-account",
|
|
148
148
|
visible: { field: "status", ne: "restricted" },
|
|
149
149
|
});
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
const restrictAction = byId["restrict"];
|
|
151
|
+
expect(
|
|
152
|
+
restrictAction?.kind === "navigate" || restrictAction?.kind === "drawer"
|
|
153
|
+
? undefined
|
|
154
|
+
: restrictAction?.confirm,
|
|
155
|
+
).toBe("userDataRights.privacyCenter.restriction.dialogDescription");
|
|
153
156
|
|
|
154
157
|
expect(byId["request-deletion"]).toMatchObject({
|
|
155
158
|
handler: "user-data-rights:write:request-deletion",
|