@cosmicdrift/kumiko-bundled-features 0.255.0 → 0.255.1

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.255.0",
3
+ "version": "0.255.1",
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.255.0",
134
- "@cosmicdrift/kumiko-framework": "0.255.0",
135
- "@cosmicdrift/kumiko-headless": "0.255.0",
136
- "@cosmicdrift/kumiko-renderer": "0.255.0",
137
- "@cosmicdrift/kumiko-renderer-web": "0.255.0",
138
- "@cosmicdrift/kumiko-types": "0.255.0",
133
+ "@cosmicdrift/kumiko-dispatcher-live": "0.255.1",
134
+ "@cosmicdrift/kumiko-framework": "0.255.1",
135
+ "@cosmicdrift/kumiko-headless": "0.255.1",
136
+ "@cosmicdrift/kumiko-renderer": "0.255.1",
137
+ "@cosmicdrift/kumiko-renderer-web": "0.255.1",
138
+ "@cosmicdrift/kumiko-types": "0.255.1",
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.255.0",
168
- "@cosmicdrift/kumiko-locale-es": "0.255.0"
167
+ "@cosmicdrift/kumiko-locale-de": "0.255.1",
168
+ "@cosmicdrift/kumiko-locale-es": "0.255.1"
169
169
  }
170
170
  }
@@ -855,12 +855,13 @@ describe("scenario 10: PII is encrypted at rest, not just erasable on destroy",
855
855
  // is written through the encrypted path above. If that changes (billing-
856
856
  // foundation goes live before a KMS is configured somewhere), note for
857
857
  // whoever builds the backfill: the existing backfillEventPiiEncryption
858
- // (#799, db/queries/backfill-pii.ts) does NOT cover this feature yet —
859
- // its lifecycle-event matcher expects `<aggregateType>.<verb>` event
860
- // names (billing's are `billing-foundation:event:subscription-created`)
861
- // and its custom-event catalog only supports user-subject fields
862
- // (`{kind: "user"}`), not the tenant-subject fields billing uses. Closing
863
- // that gap is new framework capability, not a wiring fix.
858
+ // (#799, db/queries/backfill-pii.ts) does NOT cover this feature yet — its
859
+ // lifecycle-event matcher expects `<aggregateType>.<verb>` event names,
860
+ // but billing's are `billing-foundation:event:subscription-created`. The
861
+ // custom-event catalog branch itself already resolves user/tenant/self
862
+ // subjects (fw#2801/#2819) no framework gap to close here, only the
863
+ // lifecycle-event matcher would need widening if this feature ever needs
864
+ // a backfill.
864
865
  });
865
866
 
866
867
  // =============================================================================
@@ -3,8 +3,8 @@ import { requestContext } from "@cosmicdrift/kumiko-framework/api";
3
3
  import { ROLES } from "@cosmicdrift/kumiko-framework/auth";
4
4
  import {
5
5
  configuredPiiSubjectKms,
6
- RECORD_ENTITY_PATTERN,
7
6
  type SubjectId,
7
+ subjectIdSchema,
8
8
  subjectIdToKey,
9
9
  } from "@cosmicdrift/kumiko-framework/crypto";
10
10
  import {
@@ -19,7 +19,6 @@ import {
19
19
  type FeatureDefinition,
20
20
  type HandlerContext,
21
21
  type SessionUser,
22
- type TenantId,
23
22
  type WriteEvent,
24
23
  } from "@cosmicdrift/kumiko-framework/engine";
25
24
  import {
@@ -49,15 +48,7 @@ import {
49
48
  TARGET_TENANT_NOT_ADMIN_TENANT,
50
49
  } from "../constants";
51
50
 
52
- export const subjectIdSchema = z.discriminatedUnion("kind", [
53
- z.object({ kind: z.literal("user"), userId: z.uuid() }),
54
- z.object({ kind: z.literal("tenant"), tenantId: z.uuid() }),
55
- z.object({
56
- kind: z.literal("record"),
57
- entity: z.string().regex(RECORD_ENTITY_PATTERN),
58
- id: z.uuid(),
59
- }),
60
- ]);
51
+ export { subjectIdSchema };
61
52
 
62
53
  export const forgetSubjectSchema = z.object({
63
54
  subject: subjectIdSchema,
@@ -296,7 +287,7 @@ export const forgetSubjectWrite = defineWriteHandler({
296
287
  raw.kind === "user"
297
288
  ? { kind: "user", userId: raw.userId }
298
289
  : raw.kind === "tenant"
299
- ? { kind: "tenant", tenantId: raw.tenantId as TenantId } // @cast-boundary uuid-validated command payload → branded id
290
+ ? { kind: "tenant", tenantId: raw.tenantId }
300
291
  : { kind: "record", entity: raw.entity, id: raw.id };
301
292
  const subjectKey = subjectIdToKey(subject);
302
293