feat : add stygian guide
This commit is contained in:
@@ -42,6 +42,15 @@ describe("invalidation event envelopes", () => {
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("accepts public Stygian invalidations only on the Stygian topic", () => {
|
||||
expect(toInvalidationEvent({
|
||||
topic: "stygian",
|
||||
aggregateId: "5269001",
|
||||
eventType: "stygian.updated",
|
||||
payload: { id: "5269001", version: 4 },
|
||||
})).toEqual({ type: "stygian.updated", id: "5269001", version: 4 });
|
||||
});
|
||||
|
||||
it("keeps valid scopes only on authenticated admin events", () => {
|
||||
const id = "4afeea7b-6f24-43f3-b747-2db98335e01e";
|
||||
expect(toInvalidationEvent({
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export const INVALIDATION_TYPES = [
|
||||
"directory.updated",
|
||||
"page.updated",
|
||||
"stygian.updated",
|
||||
"admin.updated",
|
||||
] as const;
|
||||
|
||||
@@ -59,6 +60,8 @@ export function expectedTopic(event: InvalidationEvent): string {
|
||||
return "directory";
|
||||
case "page.updated":
|
||||
return `page:${event.id}`;
|
||||
case "stygian.updated":
|
||||
return "stygian";
|
||||
case "admin.updated":
|
||||
return "admin";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user