@bgord/bun 1.0.9 → 1.0.11

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": "@bgord/bun",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "author": "Bartosz Gordon",
@@ -4,7 +4,7 @@ import * as VO from "../value-objects";
4
4
 
5
5
  export const onHistoryPopulatedEvent =
6
6
  (projection: Ports.HistoryProjectionPort) => async (event: Events.HistoryPopulatedEventType) => {
7
- const data = VO.HistoryParsed.parse(event.payload);
7
+ const data = VO.HistoryParsed.parse({ ...event.payload, createdAt: event.createdAt });
8
8
 
9
- await projection.append(data, event.createdAt);
9
+ await projection.append(data);
10
10
  };
@@ -1,8 +1,7 @@
1
- import type * as tools from "@bgord/tools";
2
1
  import type * as VO from "../value-objects";
3
2
 
4
3
  export interface HistoryProjectionPort {
5
- append(data: VO.HistoryParsedType, createdAt: tools.TimestampType): Promise<void>;
4
+ append(data: VO.HistoryParsedType): Promise<void>;
6
5
 
7
6
  clear(subject: VO.HistoryParsedType["subject"]): Promise<void>;
8
7
  }
@@ -1,5 +1,5 @@
1
1
  import type * as VO from "../value-objects";
2
2
 
3
3
  export interface HistoryReaderPort {
4
- read(subject: VO.HistoryParsedType["subject"]): Promise<VO.HistoryType>;
4
+ read(subject: VO.HistoryParsedType["subject"]): Promise<VO.HistoryType[]>;
5
5
  }
@@ -8,13 +8,6 @@ import { HTTPException } from "hono/http-exception";
8
8
  export const AccessDeniedAuthShieldError = new HTTPException(403, { message: "access_denied_auth_shield" });
9
9
 
10
10
  export class ShieldAuth {
11
- cors = {
12
- origin: ["http://localhost:5173", "http://localhost:3000"],
13
- credentials: true,
14
- allowHeaders: ["Content-Type"],
15
- exposeHeaders: ["Set-Cookie"],
16
- };
17
-
18
11
  constructor(private readonly Auth: ReturnType<typeof betterAuth>) {}
19
12
 
20
13
  attach = createMiddleware(async (c: hono.Context, next: hono.Next) => {