@fonderie/workspaces 6.0.5 → 6.0.7

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/dist/index.cjs CHANGED
@@ -1439,12 +1439,11 @@ function invitationController(store, ttl, bus) {
1439
1439
  roleId: resolvedRoleId,
1440
1440
  ttl
1441
1441
  });
1442
- bus?.emit(import_events.NOTIFICATION_EVENT, {
1442
+ await (0, import_core6.background)(bus?.emit(import_events.NOTIFICATION_EVENT, {
1443
1443
  type: MESSAGE_KEYS.workspaceInvitation,
1444
1444
  recipient: { email: email2, phone: null, deviceToken: null },
1445
1445
  data: { token: invitation.token, pin: invitation.pin }
1446
- }).catch(() => {
1447
- });
1446
+ }));
1448
1447
  return { invitationId: invitation.id, email: email2 };
1449
1448
  })
1450
1449
  );
@@ -1553,6 +1552,7 @@ function buildWorkspaceRoutes(store, config, bus) {
1553
1552
  }
1554
1553
 
1555
1554
  // src/module.ts
1555
+ var import_core7 = require("@fonderie/core");
1556
1556
  var AUTH_USER_REGISTERED = "fonderie.user.registered";
1557
1557
  var WorkspacesModule = class {
1558
1558
  constructor(store, config = {}, bus) {
@@ -1601,11 +1601,10 @@ var WorkspacesModule = class {
1601
1601
  });
1602
1602
  });
1603
1603
  if (workspaceId) {
1604
- this.bus?.emit(EVENT_KEYS.personalWorkspaceCreated, {
1604
+ await (0, import_core7.background)(this.bus?.emit(EVENT_KEYS.personalWorkspaceCreated, {
1605
1605
  workspaceId,
1606
1606
  userId: payload.userId
1607
- }).catch(() => {
1608
- });
1607
+ }));
1609
1608
  }
1610
1609
  }
1611
1610
  };
@@ -1632,10 +1631,10 @@ var SAMPLE_PAYLOADS = {
1632
1631
  };
1633
1632
 
1634
1633
  // src/middlewares/require-workspace.ts
1635
- var import_core7 = require("@fonderie/core");
1634
+ var import_core8 = require("@fonderie/core");
1636
1635
  var requireWorkspace = async (ctx, next) => {
1637
1636
  if (!ctx.workspace) {
1638
- return (0, import_core7.setApiResponse)(import_core7.HTTP.BAD_REQUEST, "WORKSPACE_REQUIRED", "Workspace context required");
1637
+ return (0, import_core8.setApiResponse)(import_core8.HTTP.BAD_REQUEST, "WORKSPACE_REQUIRED", "Workspace context required");
1639
1638
  }
1640
1639
  return next();
1641
1640
  };