@bash-app/bash-common 30.400.0 → 30.406.0

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.
Files changed (47) hide show
  1. package/dist/__tests__/audienceImport.test.d.ts +2 -0
  2. package/dist/__tests__/audienceImport.test.d.ts.map +1 -0
  3. package/dist/__tests__/audienceImport.test.js +39 -0
  4. package/dist/__tests__/audienceImport.test.js.map +1 -0
  5. package/dist/__tests__/definitionsHelpers.test.js +34 -1
  6. package/dist/__tests__/definitionsHelpers.test.js.map +1 -1
  7. package/dist/__tests__/eventStaffRoles.test.d.ts +2 -0
  8. package/dist/__tests__/eventStaffRoles.test.d.ts.map +1 -0
  9. package/dist/__tests__/eventStaffRoles.test.js +37 -0
  10. package/dist/__tests__/eventStaffRoles.test.js.map +1 -0
  11. package/dist/audienceImport.d.ts +71 -0
  12. package/dist/audienceImport.d.ts.map +1 -0
  13. package/dist/audienceImport.js +115 -0
  14. package/dist/audienceImport.js.map +1 -0
  15. package/dist/definitions.d.ts +51 -2
  16. package/dist/definitions.d.ts.map +1 -1
  17. package/dist/definitions.js +223 -150
  18. package/dist/definitions.js.map +1 -1
  19. package/dist/eventStaffRoles.d.ts +39 -0
  20. package/dist/eventStaffRoles.d.ts.map +1 -0
  21. package/dist/eventStaffRoles.js +125 -0
  22. package/dist/eventStaffRoles.js.map +1 -0
  23. package/dist/extendedSchemas.d.ts +22 -1
  24. package/dist/extendedSchemas.d.ts.map +1 -1
  25. package/dist/extendedSchemas.js.map +1 -1
  26. package/dist/index.d.ts +2 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +2 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/utils/__tests__/locationVisibility.test.js +27 -1
  31. package/dist/utils/__tests__/locationVisibility.test.js.map +1 -1
  32. package/dist/utils/locationVisibility.d.ts +9 -0
  33. package/dist/utils/locationVisibility.d.ts.map +1 -1
  34. package/dist/utils/locationVisibility.js +13 -0
  35. package/dist/utils/locationVisibility.js.map +1 -1
  36. package/package.json +1 -1
  37. package/prisma/schema.prisma +154 -3
  38. package/src/__tests__/audienceImport.test.ts +58 -0
  39. package/src/__tests__/definitionsHelpers.test.ts +50 -0
  40. package/src/__tests__/eventStaffRoles.test.ts +50 -0
  41. package/src/audienceImport.ts +181 -0
  42. package/src/definitions.ts +260 -151
  43. package/src/eventStaffRoles.ts +168 -0
  44. package/src/extendedSchemas.ts +22 -1
  45. package/src/index.ts +2 -0
  46. package/src/utils/__tests__/locationVisibility.test.ts +38 -0
  47. package/src/utils/locationVisibility.ts +16 -0
@@ -257,7 +257,22 @@ export const PUBLIC_TEASER_USER_DATA_TO_SELECT = {
257
257
 
258
258
  export type PublicTeaserUser = Prisma.UserGetPayload<{
259
259
  select: typeof PUBLIC_TEASER_USER_DATA_TO_SELECT;
260
- }>;
260
+ }> & {
261
+ /** Only populated by Intros endpoints for eligible viewers. */
262
+ openToIntros?: boolean;
263
+ /** Only populated by Intros endpoints for eligible viewers. */
264
+ personalityType?: string | null;
265
+ /** Only populated by Intros endpoints for eligible viewers. */
266
+ locusOfControl?: string | null;
267
+ /** True when the viewer already sent an interest expression to this person. */
268
+ alreadyExpressedInterest?: boolean;
269
+ /** True when this person already sent an interest expression to the viewer. */
270
+ interestFromThem?: boolean;
271
+ /** True when both people have sent a signal. */
272
+ mutualInterest?: boolean;
273
+ /** Only populated by Intros endpoints for eligible viewers. */
274
+ introIntents?: string[];
275
+ };
261
276
 
262
277
  export const PRIVATE_USER_ACCOUNT_TO_SELECT = {
263
278
  ...FRONT_END_USER_DATA_TO_SELECT,
@@ -729,6 +744,10 @@ type BashEventExtBase = Override<
729
744
  * When true (default), signed-in visitors can message the host from the bash detail page.
730
745
  */
731
746
  allowViewerContact: boolean;
747
+ /**
748
+ * Host opt-in: guests must have a profile photo to RSVP or buy tickets.
749
+ */
750
+ requireProfilePhoto: boolean;
732
751
  };
733
752
 
734
753
  export type BashEventExt = Omit<
@@ -1794,6 +1813,8 @@ export interface InvitationExtraData extends Invitation {
1794
1813
  isFreeGuest: boolean;
1795
1814
  isOrganizer?: boolean;
1796
1815
  isCoHost?: boolean;
1816
+ isDoorStaff?: boolean;
1817
+ eventRole?: string;
1797
1818
  organizerTitle?: string;
1798
1819
  isOwnershipTransfer?: boolean;
1799
1820
  includeQRCode?: boolean; // Controls whether QR code should be included in the invitation email
package/src/index.ts CHANGED
@@ -49,6 +49,8 @@ export * from "./hostCrmAutomation.js";
49
49
  export * from "./relationshipHealth.js";
50
50
  export * from "./hostCrmConstants.js";
51
51
  export * from "./hostPromoter.js";
52
+ export * from "./audienceImport.js";
53
+ export * from "./eventStaffRoles.js";
52
54
  export * from "./bashEventCancellationPolicy.js";
53
55
  export * from "./userReportTypes.js";
54
56
  export * from "./mirroredPrismaEnums.js";
@@ -5,6 +5,7 @@ import {
5
5
  defaultLocationRevealMode,
6
6
  geocodeQueryTextForPublicBashMap,
7
7
  isLocationGloballyPublic,
8
+ resolveMeetingPointLabel,
8
9
  redactBashEventLocation,
9
10
  shouldAutoRevealLocationToPublicNow,
10
11
  viewerCanSeeFullBashLocation,
@@ -310,3 +311,40 @@ describe("geocodeQueryTextForPublicBashMap", () => {
310
311
  ).toBe("Venue|123 St");
311
312
  });
312
313
  });
314
+
315
+ describe("resolveMeetingPointLabel", () => {
316
+ it("returns the trimmed label when an exact address is present", () => {
317
+ expect(
318
+ resolveMeetingPointLabel({
319
+ meetingPointLabel: " Side door on 9th ",
320
+ location: "123 Main St",
321
+ })
322
+ ).toBe("Side door on 9th");
323
+ });
324
+
325
+ it("treats street as an exact address when location is empty", () => {
326
+ expect(
327
+ resolveMeetingPointLabel({
328
+ meetingPointLabel: "Loading dock",
329
+ street: "88 Pier Ave",
330
+ })
331
+ ).toBe("Loading dock");
332
+ });
333
+
334
+ it("returns null when the label is blank or the address is still hidden", () => {
335
+ expect(
336
+ resolveMeetingPointLabel({
337
+ meetingPointLabel: " ",
338
+ location: "123 Main St",
339
+ })
340
+ ).toBeNull();
341
+ expect(
342
+ resolveMeetingPointLabel({
343
+ meetingPointLabel: "Side door",
344
+ location: null,
345
+ street: " ",
346
+ })
347
+ ).toBeNull();
348
+ expect(resolveMeetingPointLabel({})).toBeNull();
349
+ });
350
+ });
@@ -168,6 +168,22 @@ export function defaultLocationRevealMode(): LocationRevealMode {
168
168
  return "ManualOnly";
169
169
  }
170
170
 
171
+ /**
172
+ * Guest-facing meeting pin. Show only when the label is a non-empty string
173
+ * and an exact address is present (already revealed / not redacted).
174
+ */
175
+ export function resolveMeetingPointLabel(event: {
176
+ meetingPointLabel?: string | null;
177
+ location?: string | null;
178
+ street?: string | null;
179
+ }): string | null {
180
+ const label = event.meetingPointLabel?.trim();
181
+ if (!label) return null;
182
+ const hasExactAddress = Boolean(event.location?.trim() || event.street?.trim());
183
+ if (!hasExactAddress) return null;
184
+ return label;
185
+ }
186
+
171
187
  /** Address string for Google geocoding on public maps when full `location` is redacted. */
172
188
  export function geocodeQueryTextForPublicBashMap(event: {
173
189
  location?: string | null;