@bgord/bun 1.4.20 → 1.4.21

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.
@@ -6,7 +6,13 @@ import type * as Commands from "../commands";
6
6
  import * as Events from "../events";
7
7
  import type * as Ports from "../ports";
8
8
  import type * as VO from "../value-objects";
9
+ type Dependencies = {
10
+ EventStore: EventStoreLike<AcceptedEvent>;
11
+ IdProvider: IdProviderPort;
12
+ Clock: ClockPort;
13
+ UserLanguageQuery: Ports.UserLanguageQueryPort;
14
+ };
9
15
  type AcceptedEvent = Events.UserLanguageSetEventType;
10
- export declare const handleSetUserLanguageCommand: <L extends readonly tools.LanguageType[]>(EventStore: EventStoreLike<AcceptedEvent>, IdProvider: IdProviderPort, Clock: ClockPort, query: Ports.UserLanguageQueryPort, supported: VO.SupportedLanguagesSet<L>) => (command: Commands.SetUserLanguageCommandType) => Promise<void>;
16
+ export declare const handleSetUserLanguageCommand: <L extends readonly tools.LanguageType[]>(supported: VO.SupportedLanguagesSet<L>, deps: Dependencies) => (command: Commands.SetUserLanguageCommandType) => Promise<void>;
11
17
  export {};
12
18
  //# sourceMappingURL=handleSetUserLanguageCommand.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handleSetUserLanguageCommand.d.ts","sourceRoot":"","sources":["../../../../src/modules/preferences/command-handlers/handleSetUserLanguageCommand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,KAAK,QAAQ,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE5C,KAAK,aAAa,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAErD,eAAO,MAAM,4BAA4B,GACtC,CAAC,SAAS,SAAS,KAAK,CAAC,YAAY,EAAE,EACtC,YAAY,cAAc,CAAC,aAAa,CAAC,EACzC,YAAY,cAAc,EAC1B,OAAO,SAAS,EAChB,OAAO,KAAK,CAAC,qBAAqB,EAClC,WAAW,EAAE,CAAC,qBAAqB,CAAC,CAAC,CAAC,MAEjC,SAAS,QAAQ,CAAC,0BAA0B,kBAalD,CAAC"}
1
+ {"version":3,"file":"handleSetUserLanguageCommand.d.ts","sourceRoot":"","sources":["../../../../src/modules/preferences/command-handlers/handleSetUserLanguageCommand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,KAAK,QAAQ,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE5C,KAAK,YAAY,GAAG;IAClB,UAAU,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;IAC1C,UAAU,EAAE,cAAc,CAAC;IAC3B,KAAK,EAAE,SAAS,CAAC;IACjB,iBAAiB,EAAE,KAAK,CAAC,qBAAqB,CAAC;CAChD,CAAC;AAEF,KAAK,aAAa,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAErD,eAAO,MAAM,4BAA4B,GACtC,CAAC,SAAS,SAAS,KAAK,CAAC,YAAY,EAAE,EAAE,WAAW,EAAE,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,MAAM,YAAY,MAC7F,SAAS,QAAQ,CAAC,0BAA0B,kBAalD,CAAC"}
@@ -1,16 +1,16 @@
1
1
  import { createEventEnvelope } from "../../../event-envelope";
2
2
  import * as Events from "../events";
3
3
  import * as Invariants from "../invariants";
4
- export const handleSetUserLanguageCommand = (EventStore, IdProvider, Clock, query, supported) => async (command) => {
4
+ export const handleSetUserLanguageCommand = (supported, deps) => async (command) => {
5
5
  const candidate = supported.ensure(command.payload.language);
6
- const current = await query.get(command.payload.userId);
6
+ const current = await deps.UserLanguageQuery.get(command.payload.userId);
7
7
  if (Invariants.UserLanguageHasChanged.fails({ current, candidate: command.payload.language }))
8
8
  return;
9
9
  const event = Events.UserLanguageSetEvent.parse({
10
- ...createEventEnvelope(`preferences_${command.payload.userId}`, { IdProvider, Clock }),
10
+ ...createEventEnvelope(`preferences_${command.payload.userId}`, deps),
11
11
  name: Events.USER_LANGUAGE_SET_EVENT,
12
12
  payload: { userId: command.payload.userId, language: candidate },
13
13
  });
14
- await EventStore.save([event]);
14
+ await deps.EventStore.save([event]);
15
15
  };
16
16
  //# sourceMappingURL=handleSetUserLanguageCommand.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"handleSetUserLanguageCommand.js","sourceRoot":"","sources":["../../../../src/modules/preferences/command-handlers/handleSetUserLanguageCommand.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAI9D,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAM5C,MAAM,CAAC,MAAM,4BAA4B,GACvC,CACE,UAAyC,EACzC,UAA0B,EAC1B,KAAgB,EAChB,KAAkC,EAClC,SAAsC,EACtC,EAAE,CACJ,KAAK,EAAE,OAA4C,EAAE,EAAE;IACrD,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7D,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAExD,IAAI,UAAU,CAAC,sBAAsB,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QAAE,OAAO;IAEtG,MAAM,KAAK,GAAG,MAAM,CAAC,oBAAoB,CAAC,KAAK,CAAC;QAC9C,GAAG,mBAAmB,CAAC,eAAe,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;QACtF,IAAI,EAAE,MAAM,CAAC,uBAAuB;QACpC,OAAO,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE;KACvB,CAAC,CAAC;IAE7C,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACjC,CAAC,CAAC"}
1
+ {"version":3,"file":"handleSetUserLanguageCommand.js","sourceRoot":"","sources":["../../../../src/modules/preferences/command-handlers/handleSetUserLanguageCommand.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAI9D,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAa5C,MAAM,CAAC,MAAM,4BAA4B,GACvC,CAA0C,SAAsC,EAAE,IAAkB,EAAE,EAAE,CACxG,KAAK,EAAE,OAA4C,EAAE,EAAE;IACrD,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzE,IAAI,UAAU,CAAC,sBAAsB,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QAAE,OAAO;IAEtG,MAAM,KAAK,GAAG,MAAM,CAAC,oBAAoB,CAAC,KAAK,CAAC;QAC9C,GAAG,mBAAmB,CAAC,eAAe,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC;QACrE,IAAI,EAAE,MAAM,CAAC,uBAAuB;QACpC,OAAO,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE;KACvB,CAAC,CAAC;IAE7C,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACtC,CAAC,CAAC"}