@bash-app/bash-common 30.51.0 → 30.52.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 (184) hide show
  1. package/dist/definitions.d.ts +668 -0
  2. package/dist/definitions.d.ts.map +1 -0
  3. package/dist/definitions.js +467 -0
  4. package/dist/definitions.js.map +1 -0
  5. package/dist/extendedSchemas.d.ts +2206 -0
  6. package/dist/extendedSchemas.d.ts.map +1 -0
  7. package/dist/extendedSchemas.js +429 -0
  8. package/dist/extendedSchemas.js.map +1 -0
  9. package/dist/index.d.ts +39 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +40 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/utils/addressUtils.d.ts +14 -0
  14. package/dist/utils/addressUtils.d.ts.map +1 -0
  15. package/dist/utils/addressUtils.js +177 -0
  16. package/dist/utils/addressUtils.js.map +1 -0
  17. package/dist/utils/apiUtils.d.ts +14 -0
  18. package/dist/utils/apiUtils.d.ts.map +1 -0
  19. package/dist/utils/apiUtils.js +61 -0
  20. package/dist/utils/apiUtils.js.map +1 -0
  21. package/dist/utils/arrayUtils.d.ts +2 -0
  22. package/dist/utils/arrayUtils.d.ts.map +1 -0
  23. package/dist/utils/arrayUtils.js +5 -0
  24. package/dist/utils/arrayUtils.js.map +1 -0
  25. package/dist/utils/awsS3Utils.d.ts +10 -0
  26. package/dist/utils/awsS3Utils.d.ts.map +1 -0
  27. package/dist/utils/awsS3Utils.js +89 -0
  28. package/dist/utils/awsS3Utils.js.map +1 -0
  29. package/dist/utils/badgeUtils.d.ts +33 -0
  30. package/dist/utils/badgeUtils.d.ts.map +1 -0
  31. package/dist/utils/badgeUtils.js +57 -0
  32. package/dist/utils/badgeUtils.js.map +1 -0
  33. package/dist/utils/blog/blogDbUtils.d.ts +48 -0
  34. package/dist/utils/blog/blogDbUtils.d.ts.map +1 -0
  35. package/dist/utils/blog/blogDbUtils.js +218 -0
  36. package/dist/utils/blog/blogDbUtils.js.map +1 -0
  37. package/dist/utils/blogUtils.d.ts +19 -0
  38. package/dist/utils/blogUtils.d.ts.map +1 -0
  39. package/dist/utils/blogUtils.js +118 -0
  40. package/dist/utils/blogUtils.js.map +1 -0
  41. package/dist/utils/dateTimeUtils.d.ts +38 -0
  42. package/dist/utils/dateTimeUtils.d.ts.map +1 -0
  43. package/dist/utils/dateTimeUtils.js +207 -0
  44. package/dist/utils/dateTimeUtils.js.map +1 -0
  45. package/dist/utils/entityUtils.d.ts +5 -0
  46. package/dist/utils/entityUtils.d.ts.map +1 -0
  47. package/dist/utils/entityUtils.js +5 -0
  48. package/dist/utils/entityUtils.js.map +1 -0
  49. package/dist/utils/generalDateTimeUtils.d.ts +15 -0
  50. package/dist/utils/generalDateTimeUtils.d.ts.map +1 -0
  51. package/dist/utils/generalDateTimeUtils.js +38 -0
  52. package/dist/utils/generalDateTimeUtils.js.map +1 -0
  53. package/dist/utils/luxonUtils.d.ts +95 -0
  54. package/dist/utils/luxonUtils.d.ts.map +1 -0
  55. package/dist/utils/luxonUtils.js +623 -0
  56. package/dist/utils/luxonUtils.js.map +1 -0
  57. package/dist/utils/mathUtils.d.ts +2 -0
  58. package/dist/utils/mathUtils.d.ts.map +1 -0
  59. package/dist/utils/mathUtils.js +4 -0
  60. package/dist/utils/mathUtils.js.map +1 -0
  61. package/dist/utils/objUtils.d.ts +3 -0
  62. package/dist/utils/objUtils.d.ts.map +1 -0
  63. package/dist/utils/objUtils.js +29 -0
  64. package/dist/utils/objUtils.js.map +1 -0
  65. package/dist/utils/paymentUtils.d.ts +18 -0
  66. package/dist/utils/paymentUtils.d.ts.map +1 -0
  67. package/dist/utils/paymentUtils.js +50 -0
  68. package/dist/utils/paymentUtils.js.map +1 -0
  69. package/dist/utils/promoCodesUtils.d.ts +6 -0
  70. package/dist/utils/promoCodesUtils.d.ts.map +1 -0
  71. package/dist/utils/promoCodesUtils.js +23 -0
  72. package/dist/utils/promoCodesUtils.js.map +1 -0
  73. package/dist/utils/qrCodeUtils.d.ts +4 -0
  74. package/dist/utils/qrCodeUtils.d.ts.map +1 -0
  75. package/dist/utils/qrCodeUtils.js +22 -0
  76. package/dist/utils/qrCodeUtils.js.map +1 -0
  77. package/dist/utils/recurrenceUtils.d.ts +8 -0
  78. package/dist/utils/recurrenceUtils.d.ts.map +1 -0
  79. package/dist/utils/recurrenceUtils.js +153 -0
  80. package/dist/utils/recurrenceUtils.js.map +1 -0
  81. package/dist/utils/reviewUtils.d.ts +29 -0
  82. package/dist/utils/reviewUtils.d.ts.map +1 -0
  83. package/dist/utils/reviewUtils.js +65 -0
  84. package/dist/utils/reviewUtils.js.map +1 -0
  85. package/dist/utils/service/apiServiceBookingApiUtils.d.ts +21 -0
  86. package/dist/utils/service/apiServiceBookingApiUtils.d.ts.map +1 -0
  87. package/dist/utils/service/apiServiceBookingApiUtils.js +131 -0
  88. package/dist/utils/service/apiServiceBookingApiUtils.js.map +1 -0
  89. package/dist/utils/service/attendeeOptionUtils.d.ts +11 -0
  90. package/dist/utils/service/attendeeOptionUtils.d.ts.map +1 -0
  91. package/dist/utils/service/attendeeOptionUtils.js +9 -0
  92. package/dist/utils/service/attendeeOptionUtils.js.map +1 -0
  93. package/dist/utils/service/frontendServiceBookingUtils.d.ts +53 -0
  94. package/dist/utils/service/frontendServiceBookingUtils.d.ts.map +1 -0
  95. package/dist/utils/service/frontendServiceBookingUtils.js +134 -0
  96. package/dist/utils/service/frontendServiceBookingUtils.js.map +1 -0
  97. package/dist/utils/service/regexUtils.d.ts +6 -0
  98. package/dist/utils/service/regexUtils.d.ts.map +1 -0
  99. package/dist/utils/service/regexUtils.js +16 -0
  100. package/dist/utils/service/regexUtils.js.map +1 -0
  101. package/dist/utils/service/serviceBookingStatusUtils.d.ts +21 -0
  102. package/dist/utils/service/serviceBookingStatusUtils.d.ts.map +1 -0
  103. package/dist/utils/service/serviceBookingStatusUtils.js +130 -0
  104. package/dist/utils/service/serviceBookingStatusUtils.js.map +1 -0
  105. package/dist/utils/service/serviceBookingTypes.d.ts +19 -0
  106. package/dist/utils/service/serviceBookingTypes.d.ts.map +1 -0
  107. package/dist/utils/service/serviceBookingTypes.js +2 -0
  108. package/dist/utils/service/serviceBookingTypes.js.map +1 -0
  109. package/dist/utils/service/serviceDBUtils.d.ts +5 -0
  110. package/dist/utils/service/serviceDBUtils.d.ts.map +1 -0
  111. package/dist/utils/service/serviceDBUtils.js +48 -0
  112. package/dist/utils/service/serviceDBUtils.js.map +1 -0
  113. package/dist/utils/service/serviceRateDBUtils.d.ts +1 -0
  114. package/dist/utils/service/serviceRateDBUtils.d.ts.map +1 -0
  115. package/dist/utils/service/serviceRateDBUtils.js +159 -0
  116. package/dist/utils/service/serviceRateDBUtils.js.map +1 -0
  117. package/dist/utils/service/serviceRateTypes.d.ts +9 -0
  118. package/dist/utils/service/serviceRateTypes.d.ts.map +1 -0
  119. package/dist/utils/service/serviceRateTypes.js +2 -0
  120. package/dist/utils/service/serviceRateTypes.js.map +1 -0
  121. package/dist/utils/service/serviceRateUtils.d.ts +24 -0
  122. package/dist/utils/service/serviceRateUtils.d.ts.map +1 -0
  123. package/dist/utils/service/serviceRateUtils.js +183 -0
  124. package/dist/utils/service/serviceRateUtils.js.map +1 -0
  125. package/dist/utils/service/serviceUtils.d.ts +83 -0
  126. package/dist/utils/service/serviceUtils.d.ts.map +1 -0
  127. package/dist/utils/service/serviceUtils.js +311 -0
  128. package/dist/utils/service/serviceUtils.js.map +1 -0
  129. package/dist/utils/service/venueUtils.d.ts +13 -0
  130. package/dist/utils/service/venueUtils.d.ts.map +1 -0
  131. package/dist/utils/service/venueUtils.js +18 -0
  132. package/dist/utils/service/venueUtils.js.map +1 -0
  133. package/dist/utils/slugUtils.d.ts +9 -0
  134. package/dist/utils/slugUtils.d.ts.map +1 -0
  135. package/dist/utils/slugUtils.js +47 -0
  136. package/dist/utils/slugUtils.js.map +1 -0
  137. package/dist/utils/sortUtils.d.ts +7 -0
  138. package/dist/utils/sortUtils.d.ts.map +1 -0
  139. package/dist/utils/sortUtils.js +26 -0
  140. package/dist/utils/sortUtils.js.map +1 -0
  141. package/dist/utils/stringUtils.d.ts +2 -0
  142. package/dist/utils/stringUtils.d.ts.map +1 -0
  143. package/dist/utils/stringUtils.js +6 -0
  144. package/dist/utils/stringUtils.js.map +1 -0
  145. package/dist/utils/stripeAccountUtils.d.ts +3 -0
  146. package/dist/utils/stripeAccountUtils.d.ts.map +1 -0
  147. package/dist/utils/stripeAccountUtils.js +10 -0
  148. package/dist/utils/stripeAccountUtils.js.map +1 -0
  149. package/dist/utils/ticketListUtils.d.ts +12 -0
  150. package/dist/utils/ticketListUtils.d.ts.map +1 -0
  151. package/dist/utils/ticketListUtils.js +78 -0
  152. package/dist/utils/ticketListUtils.js.map +1 -0
  153. package/dist/utils/typeUtils.d.ts +11 -0
  154. package/dist/utils/typeUtils.d.ts.map +1 -0
  155. package/dist/utils/typeUtils.js +8 -0
  156. package/dist/utils/typeUtils.js.map +1 -0
  157. package/dist/utils/urlUtils.d.ts +10 -0
  158. package/dist/utils/urlUtils.d.ts.map +1 -0
  159. package/dist/utils/urlUtils.js +66 -0
  160. package/dist/utils/urlUtils.js.map +1 -0
  161. package/dist/utils/userPromoCodeUtils.d.ts +21 -0
  162. package/dist/utils/userPromoCodeUtils.d.ts.map +1 -0
  163. package/dist/utils/userPromoCodeUtils.js +13 -0
  164. package/dist/utils/userPromoCodeUtils.js.map +1 -0
  165. package/dist/utils/userSubscriptionUtils.d.ts +36 -0
  166. package/dist/utils/userSubscriptionUtils.d.ts.map +1 -0
  167. package/dist/utils/userSubscriptionUtils.js +56 -0
  168. package/dist/utils/userSubscriptionUtils.js.map +1 -0
  169. package/dist/utils/userUtils.d.ts +2 -0
  170. package/dist/utils/userUtils.d.ts.map +1 -0
  171. package/dist/utils/userUtils.js +2 -0
  172. package/dist/utils/userUtils.js.map +1 -0
  173. package/package.json +4 -2
  174. package/prisma/schema.prisma +117 -0
  175. package/src/definitions.ts +52 -1
  176. package/src/extendedSchemas.ts +177 -6
  177. package/src/index.ts +32 -21
  178. package/src/utils/blog/blogDbUtils.ts +343 -0
  179. package/src/utils/blogUtils.ts +134 -0
  180. package/src/utils/qrCodeUtils.ts +4 -2
  181. package/src/utils/service/apiServiceBookingApiUtils.ts +0 -0
  182. package/src/utils/slugUtils.ts +60 -0
  183. package/src/utils/ticketListUtils.ts +24 -6
  184. package/src/utils/typeUtils.ts +0 -0
@@ -0,0 +1,8 @@
1
+ // Create the final object dynamically
2
+ export function createAllTrueObject(keys) {
3
+ return keys.reduce((acc, key) => {
4
+ acc[key] = true;
5
+ return acc;
6
+ }, {});
7
+ }
8
+ //# sourceMappingURL=typeUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeUtils.js","sourceRoot":"","sources":["../../src/utils/typeUtils.ts"],"names":[],"mappings":"AAsBA,sCAAsC;AACtC,MAAM,UAAU,mBAAmB,CACjC,IAAS;IAET,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC9B,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QAChB,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAqB,CAAC,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare function getFrontendHost(): string;
2
+ export declare function getBackendHost(): string;
3
+ export declare function getSsrBashDetailUrl(bashEventId: string | undefined): string;
4
+ export interface QueryParam {
5
+ key: string;
6
+ value: string;
7
+ }
8
+ export declare function urlAppendQueryParam(url: string, params: QueryParam[]): string;
9
+ export declare function urlRemoveQueryParam(url: string, keys: string[]): string;
10
+ //# sourceMappingURL=urlUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urlUtils.d.ts","sourceRoot":"","sources":["../../src/utils/urlUtils.ts"],"names":[],"mappings":"AAKA,wBAAgB,eAAe,IAAI,MAAM,CAKxC;AAED,wBAAgB,cAAc,IAAI,MAAM,CAKvC;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAO3E;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CA0B7E;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CA0BvE"}
@@ -0,0 +1,66 @@
1
+ import { isProduction } from "./apiUtils";
2
+ import { BASH_DETAIL_URL } from "../definitions";
3
+ const API_HOST = process.env.REACT_APP_API ?? "http://localhost:3500";
4
+ export function getFrontendHost() {
5
+ const host = isProduction()
6
+ ? `${window.location.protocol}//${window.location.host}`
7
+ : `${window.location.protocol}//${window.location.hostname}:3000`;
8
+ return host;
9
+ }
10
+ export function getBackendHost() {
11
+ const host = isProduction()
12
+ ? API_HOST
13
+ : `${window.location.protocol}//${window.location.hostname}:3500`;
14
+ return host;
15
+ }
16
+ export function getSsrBashDetailUrl(bashEventId) {
17
+ if (bashEventId) {
18
+ const url = `/api/ssr${BASH_DETAIL_URL}/${bashEventId}`;
19
+ return url;
20
+ }
21
+ console.error(`BashEventId was not specified for the ssr bash detail url`);
22
+ return "";
23
+ }
24
+ export function urlAppendQueryParam(url, params) {
25
+ // Split the URL into base and hash
26
+ const [base, hash = ""] = url.split("#");
27
+ // Split the base into path and query
28
+ const [path, query = ""] = base.split("?");
29
+ // Initialize URLSearchParams with existing query
30
+ const searchParams = new URLSearchParams(query);
31
+ // Append each new query parameter
32
+ params.forEach(({ key, value }) => searchParams.append(key, value));
33
+ // Convert searchParams back to string
34
+ const newQuery = searchParams.toString();
35
+ // Reconstruct the URL
36
+ let newUrl = path;
37
+ if (newQuery) {
38
+ newUrl += `?${newQuery}`;
39
+ }
40
+ if (hash) {
41
+ newUrl += `#${hash}`;
42
+ }
43
+ return newUrl;
44
+ }
45
+ export function urlRemoveQueryParam(url, keys) {
46
+ // Split the URL into base and hash
47
+ const [base, hash = ""] = url.split("#");
48
+ // Split the base into path and query
49
+ const [path, query = ""] = base.split("?");
50
+ // Initialize URLSearchParams with existing query
51
+ const searchParams = new URLSearchParams(query);
52
+ // Remove each specified query parameter
53
+ keys.forEach((key) => searchParams.delete(key));
54
+ // Convert searchParams back to string
55
+ const newQuery = searchParams.toString();
56
+ // Reconstruct the URL
57
+ let newUrl = path;
58
+ if (newQuery) {
59
+ newUrl += `?${newQuery}`;
60
+ }
61
+ if (hash) {
62
+ newUrl += `#${hash}`;
63
+ }
64
+ return newUrl;
65
+ }
66
+ //# sourceMappingURL=urlUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urlUtils.js","sourceRoot":"","sources":["../../src/utils/urlUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,uBAAuB,CAAC;AAEtE,MAAM,UAAU,eAAe;IAC7B,MAAM,IAAI,GAAG,YAAY,EAAE;QACzB,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;QACxD,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC,QAAQ,OAAO,CAAC;IACpE,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,MAAM,IAAI,GAAG,YAAY,EAAE;QACzB,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC,QAAQ,OAAO,CAA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IAAI,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEzC,qCAAqC;IACrC,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE3C,iDAAiD;IACjD,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;IAEhD,wCAAwC;IACxC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAEhD,sCAAsC;IACtC,MAAM,QAAQ,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;IAEzC,sBAAsB;IACtB,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;IAC3B,CAAC;IACD,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;IACvB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,21 @@
1
+ export type UserPromoCodeType = "PerUser" | "PerService" | "PerBashEvent";
2
+ export type UserPromoCodeDuration = {
3
+ days?: number;
4
+ };
5
+ export type UserPromoCode = {
6
+ code?: string;
7
+ maxRedemptions?: number;
8
+ isTrial?: boolean;
9
+ discountPercentageFee?: number;
10
+ discountMonthlyFee?: number;
11
+ duration: UserPromoCodeDuration;
12
+ type: UserPromoCodeType;
13
+ automaticallyApplied: boolean;
14
+ expiresAfter?: number;
15
+ };
16
+ export type UserPromoCodeMap = {
17
+ [key: string]: UserPromoCode;
18
+ };
19
+ export declare const SERVICE_FREE_TRIAL_PROMO_CODE: "ServiceFreeTrial0000";
20
+ export declare const USER_PROMO_CODES: UserPromoCodeMap;
21
+ //# sourceMappingURL=userPromoCodeUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userPromoCodeUtils.d.ts","sourceRoot":"","sources":["../../src/utils/userPromoCodeUtils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,YAAY,GAAG,cAAc,CAAC;AAE1E,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,qBAAqB,CAAC;IAChC,IAAI,EAAE,iBAAiB,CAAC;IACxB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAG,sBAA+B,CAAC;AAE7E,eAAO,MAAM,gBAAgB,EAAE,gBASrB,CAAC"}
@@ -0,0 +1,13 @@
1
+ export const SERVICE_FREE_TRIAL_PROMO_CODE = "ServiceFreeTrial0000";
2
+ export const USER_PROMO_CODES = {
3
+ [SERVICE_FREE_TRIAL_PROMO_CODE]: {
4
+ isTrial: true,
5
+ duration: {
6
+ days: 90,
7
+ },
8
+ type: "PerUser",
9
+ automaticallyApplied: true,
10
+ },
11
+ };
12
+ Object.entries(USER_PROMO_CODES).forEach((promoCode) => (promoCode[1].code = promoCode[0]));
13
+ //# sourceMappingURL=userPromoCodeUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userPromoCodeUtils.js","sourceRoot":"","sources":["../../src/utils/userPromoCodeUtils.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,MAAM,6BAA6B,GAAG,sBAA+B,CAAC;AAE7E,MAAM,CAAC,MAAM,gBAAgB,GAAqB;IAChD,CAAC,6BAA6B,CAAC,EAAE;QAC/B,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE;YACR,IAAI,EAAE,EAAE;SACT;QACD,IAAI,EAAE,SAAS;QACf,oBAAoB,EAAE,IAAI;KAC3B;CACO,CAAC;AAEX,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,CACtC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAClD,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { ServiceTypes, UserSubscriptionType } from "@prisma/client";
2
+ export declare const ServiceSubscriptionTier: {
3
+ readonly Ally: "Ally";
4
+ readonly Partner: "Partner";
5
+ readonly Patreon: "Patron";
6
+ };
7
+ export type ServiceSubscriptionTier = "Ally" | "Partner" | "Patron";
8
+ export type UserSubscriptionServiceTierInfo = {
9
+ name: string;
10
+ type?: ServiceSubscriptionTier;
11
+ description: string;
12
+ price: number;
13
+ };
14
+ export type UserSubscriptionServiceTierInfoMap = {
15
+ [key in ServiceSubscriptionTier]: UserSubscriptionServiceTierInfo;
16
+ };
17
+ export type UserSubscriptionInfo = {
18
+ name: string;
19
+ type?: UserSubscriptionType;
20
+ description: string;
21
+ price: number;
22
+ };
23
+ export type UserSubscriptionServiceInfoMap = {
24
+ [key in UserSubscriptionType]: UserSubscriptionInfo;
25
+ };
26
+ export type UserServiceSubscriptionTierToServiceTypes = {
27
+ [key in ServiceSubscriptionTier]: ServiceTypes[];
28
+ };
29
+ export type UserServiceSubscriptionTierFromServiceTypes = {
30
+ [key in ServiceTypes]: ServiceSubscriptionTier;
31
+ };
32
+ export declare const SERVICE_TIER_TO_SERVICES_LIST: UserServiceSubscriptionTierToServiceTypes;
33
+ export declare const SERVICE_TIER_FROM_SERVICE_TYPE: UserServiceSubscriptionTierFromServiceTypes;
34
+ export declare const USER_SUBSCRIPTION_TYPES: UserSubscriptionServiceInfoMap;
35
+ export declare const SERVICE_SUBSCRIPTION_TIERS: UserSubscriptionServiceTierInfoMap;
36
+ //# sourceMappingURL=userSubscriptionUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userSubscriptionUtils.d.ts","sourceRoot":"","sources":["../../src/utils/userSubscriptionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEpE,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC;AACX,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEpE,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,uBAAuB,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;KAC9C,GAAG,IAAI,uBAAuB,GAAG,+BAA+B;CAClE,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CAIf,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;KAC1C,GAAG,IAAI,oBAAoB,GAAG,oBAAoB;CACpD,CAAC;AAEF,MAAM,MAAM,yCAAyC,GAAG;KACrD,GAAG,IAAI,uBAAuB,GAAG,YAAY,EAAE;CACjD,CAAC;AACF,MAAM,MAAM,2CAA2C,GAAG;KACvD,GAAG,IAAI,YAAY,GAAG,uBAAuB;CAC/C,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAIrC,yCAAyC,CAAC;AAE/C,eAAO,MAAM,8BAA8B,6CAOU,CAAC;AAEtD,eAAO,MAAM,uBAAuB,EAqB/B,8BAA8B,CAAC;AAEpC,eAAO,MAAM,0BAA0B,EAgBlC,kCAAkC,CAAC"}
@@ -0,0 +1,56 @@
1
+ export const ServiceSubscriptionTier = {
2
+ Ally: "Ally",
3
+ Partner: "Partner",
4
+ Patreon: "Patron",
5
+ };
6
+ export const SERVICE_TIER_TO_SERVICES_LIST = {
7
+ Ally: ["EventServices", "EntertainmentServices"],
8
+ Partner: ["Vendors", "Exhibitors", "Sponsors"],
9
+ Patron: ["Venues", "Organizations"],
10
+ };
11
+ export const SERVICE_TIER_FROM_SERVICE_TYPE = Object.entries(SERVICE_TIER_TO_SERVICES_LIST).reduce((sofar, [type, serviceTypes]) => {
12
+ serviceTypes.forEach((serviceType) => (sofar[serviceType] = type));
13
+ return sofar;
14
+ }, {});
15
+ export const USER_SUBSCRIPTION_TYPES = {
16
+ // "Free": {
17
+ // name: "Free",
18
+ // description: "Free",
19
+ // price: 0,
20
+ // },
21
+ Basic: {
22
+ name: "Basic",
23
+ description: "Basic",
24
+ price: 0,
25
+ },
26
+ // "Premium": {
27
+ // name: "Premium",
28
+ // description: "Premium",
29
+ // price: 200,
30
+ // },
31
+ // "VIP": {
32
+ // name: "VIP",
33
+ // description: "VIP",
34
+ // price: 500,
35
+ // }
36
+ };
37
+ export const SERVICE_SUBSCRIPTION_TIERS = {
38
+ Ally: {
39
+ name: "Ally",
40
+ description: "Ally",
41
+ price: 14,
42
+ },
43
+ Partner: {
44
+ name: "Partner",
45
+ description: "Partner",
46
+ price: 49.0,
47
+ },
48
+ Patron: {
49
+ name: "Patron",
50
+ description: "Patron",
51
+ price: 99.0,
52
+ },
53
+ };
54
+ Object.entries(USER_SUBSCRIPTION_TYPES).forEach(([type, info]) => (info.type = type));
55
+ Object.entries(SERVICE_SUBSCRIPTION_TIERS).forEach(([type, info]) => (info.type = type));
56
+ //# sourceMappingURL=userSubscription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E,MAAM;QACnB,KAAK,EAAE,EAAE;KACV;IACD,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,SAAS;QACtB,KAAK,EAAE,IAAI;KACZ;IACD,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,QAAQ;QACrB,KAAK,EAAE,IAAI;KACZ;CACoC,CAAC;AAExC,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,OAAO,CAC7C,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,IAA4B,CAAC,CAC7D,CAAC;AACF,MAAM,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC,OAAO,CAChD,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,IAA+B,CAAC,CAChE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const MAX_USER_NAME_CHANGES: 3;
2
+ //# sourceMappingURL=userUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userUtils.d.ts","sourceRoot":"","sources":["../../src/utils/userUtils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,EAAG,CAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const MAX_USER_NAME_CHANGES = 3;
2
+ //# sourceMappingURL=userUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userUtils.js","sourceRoot":"","sources":["../../src/utils/userUtils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAU,CAAC"}
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@bash-app/bash-common",
3
- "version": "30.51.0",
3
+ "version": "30.52.0",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
- "main": "src/index.ts",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
7
8
  "scripts": {
8
9
  "build": "npm run generate && npm run tsc",
9
10
  "generate": "prisma generate",
@@ -44,6 +45,7 @@
44
45
  "@types/shelljs": "^0.8.15",
45
46
  "jest": "^29.7.0",
46
47
  "shelljs": "^0.8.5",
48
+ "slugify": "^1.6.6",
47
49
  "stripe": "^16.12.0",
48
50
  "ts-jest": "^29.1.1",
49
51
  "ts-node": "^10.9.1",
@@ -311,6 +311,7 @@ model BashEvent {
311
311
  id String @id @default(cuid())
312
312
  source BashEventSource @default(Bash)
313
313
  title String
314
+ slug String? @unique
314
315
  creatorId String
315
316
  creator User @relation("CreatedEvent", fields: [creatorId], references: [id], onDelete: Cascade)
316
317
  createdAt DateTime? @default(now())
@@ -374,6 +375,7 @@ model BashEvent {
374
375
  serviceBookings ServiceBooking[] // Add this field to create the reverse relation
375
376
  userReport UserReport[]
376
377
  favoritedBy UserFavorite[]
378
+ slugHistory BashSlugHistory[]
377
379
  }
378
380
 
379
381
  model Coordinates {
@@ -1167,6 +1169,10 @@ model User {
1167
1169
  favorites UserFavorite[]
1168
1170
 
1169
1171
  vendorBid VendorBid[]
1172
+
1173
+ // Blog relations
1174
+ blogPosts BlogPost[] @relation("BlogAuthor")
1175
+ blogComments BlogComment[] @relation("BlogCommentAuthor")
1170
1176
  }
1171
1177
 
1172
1178
  model UserPreferences {
@@ -3466,3 +3472,114 @@ model UserFavorite {
3466
3472
  @@index([serviceId])
3467
3473
  @@index([bashEventId])
3468
3474
  }
3475
+
3476
+ model BashSlugHistory {
3477
+ id String @id @default(cuid())
3478
+ bashId String
3479
+ bash BashEvent @relation(fields: [bashId], references: [id], onDelete: Cascade)
3480
+ oldSlug String
3481
+ createdAt DateTime @default(now())
3482
+
3483
+ @@index([oldSlug])
3484
+ @@index([bashId])
3485
+ }
3486
+
3487
+ model BlogPost {
3488
+ id String @id @default(cuid())
3489
+ title String
3490
+ slug String @unique
3491
+ excerpt String?
3492
+ content String // Rich text content
3493
+ coverImage String?
3494
+ authorId String
3495
+ author User @relation("BlogAuthor", fields: [authorId], references: [id], onDelete: Cascade)
3496
+
3497
+ // SEO fields
3498
+ metaTitle String?
3499
+ metaDescription String?
3500
+ metaKeywords String[] @default([])
3501
+
3502
+ // Publishing
3503
+ status BlogStatus @default(Draft)
3504
+ publishedAt DateTime?
3505
+ scheduledFor DateTime?
3506
+
3507
+ // Engagement
3508
+ viewCount Int @default(0)
3509
+ readTime Int? // Estimated read time in minutes
3510
+
3511
+ // Categorization
3512
+ categoryId String?
3513
+ category BlogCategory? @relation(fields: [categoryId], references: [id], onDelete: SetNull)
3514
+ tags BlogTag[]
3515
+
3516
+ // Timestamps
3517
+ createdAt DateTime @default(now())
3518
+ updatedAt DateTime @updatedAt
3519
+
3520
+ // Relations
3521
+ comments BlogComment[]
3522
+
3523
+ @@index([status, publishedAt])
3524
+ @@index([categoryId])
3525
+ @@index([authorId])
3526
+ @@index([slug])
3527
+ }
3528
+
3529
+ model BlogCategory {
3530
+ id String @id @default(cuid())
3531
+ name String @unique
3532
+ slug String @unique
3533
+ description String?
3534
+ color String? // Hex color for UI
3535
+ posts BlogPost[]
3536
+ createdAt DateTime @default(now())
3537
+ updatedAt DateTime @updatedAt
3538
+ }
3539
+
3540
+ model BlogTag {
3541
+ id String @id @default(cuid())
3542
+ name String @unique
3543
+ slug String @unique
3544
+ color String? // Hex color for UI
3545
+ posts BlogPost[]
3546
+ createdAt DateTime @default(now())
3547
+ updatedAt DateTime @updatedAt
3548
+ }
3549
+
3550
+ model BlogComment {
3551
+ id String @id @default(cuid())
3552
+ content String
3553
+ authorId String
3554
+ author User @relation("BlogCommentAuthor", fields: [authorId], references: [id], onDelete: Cascade)
3555
+ postId String
3556
+ post BlogPost @relation(fields: [postId], references: [id], onDelete: Cascade)
3557
+
3558
+ // Nested comments
3559
+ parentId String?
3560
+ parent BlogComment? @relation("CommentReplies", fields: [parentId], references: [id], onDelete: Cascade)
3561
+ replies BlogComment[] @relation("CommentReplies")
3562
+
3563
+ // Moderation
3564
+ status CommentStatus @default(Published)
3565
+
3566
+ createdAt DateTime @default(now())
3567
+ updatedAt DateTime @updatedAt
3568
+
3569
+ @@index([postId])
3570
+ @@index([authorId])
3571
+ }
3572
+
3573
+ enum BlogStatus {
3574
+ Draft
3575
+ Published
3576
+ Scheduled
3577
+ Archived
3578
+ }
3579
+
3580
+ enum CommentStatus {
3581
+ Published
3582
+ Pending
3583
+ Spam
3584
+ Trash
3585
+ }
@@ -137,7 +137,8 @@ export const SERVICE_BOOKING_DETAILS_SERVICE_VIEW_URL_PAGE =
137
137
 
138
138
  export const VERIFICATION_RETURN_URL = `/sign-up` as const;
139
139
  export const MY_SERVICES_URL = "/my-services" as const;
140
- export const BASH_DETAIL_URL = `/bash-detail` as const;
140
+ export const BASH_DETAIL_URL = `/bash` as const;
141
+ export const BASH_DETAIL_URL_PATTERN = `/bash/$bashEventIdSlug` as const;
141
142
  export const SERVICE_PAGE_URL = `/service-page` as const;
142
143
  export const LOGIN_URL = `/login` as const;
143
144
  export const TICKET_DETAILS = `/ticket-details` as const;
@@ -969,6 +970,20 @@ export enum BadgeCategory {
969
970
  Special = "Special"
970
971
  }
971
972
 
973
+ export enum BlogStatus {
974
+ Draft = "Draft",
975
+ Published = "Published",
976
+ Scheduled = "Scheduled",
977
+ Archived = "Archived"
978
+ }
979
+
980
+ export enum CommentStatus {
981
+ Published = "Published",
982
+ Pending = "Pending",
983
+ Spam = "Spam",
984
+ Trash = "Trash"
985
+ }
986
+
972
987
  // Type definitions for badges and reviews
973
988
  export interface Badge {
974
989
  id: string;
@@ -1160,3 +1175,39 @@ export const REVIEW_API_ENDPOINTS = {
1160
1175
  `/user/${userId}/eligible-for-review/${hostId}`,
1161
1176
  CREATE_REVIEW: () => `/reviews`,
1162
1177
  };
1178
+
1179
+ export const DEFAULT_BASH_EVENT_IMAGE = "https://via.placeholder.com/400x300/e5e7eb/6b7280?text=Bash+Event" as const;
1180
+
1181
+ // Blog constants
1182
+ export const BLOG_URL = "/blog" as const;
1183
+ export const BLOG_DETAIL_URL = "/blog" as const;
1184
+ export const DEFAULT_BLOG_IMAGE = "https://via.placeholder.com/800x400/e5e7eb/6b7280?text=Blog+Post" as const;
1185
+
1186
+ // Blog pagination
1187
+ export const BLOG_POSTS_PER_PAGE = 12 as const;
1188
+ export const BLOG_EXCERPT_LENGTH = 150 as const;
1189
+
1190
+ // Blog categories
1191
+ export const DEFAULT_BLOG_CATEGORIES = [
1192
+ { name: "Event Planning", slug: "event-planning", color: "#3B82F6" },
1193
+ { name: "Industry News", slug: "industry-news", color: "#10B981" },
1194
+ { name: "Tips & Tricks", slug: "tips-tricks", color: "#F59E0B" },
1195
+ { name: "Success Stories", slug: "success-stories", color: "#8B5CF6" },
1196
+ { name: "Community", slug: "community", color: "#EF4444" },
1197
+ ] as const;
1198
+
1199
+ // Blog tags
1200
+ export const POPULAR_BLOG_TAGS = [
1201
+ "event-planning",
1202
+ "networking",
1203
+ "marketing",
1204
+ "venues",
1205
+ "catering",
1206
+ "entertainment",
1207
+ "photography",
1208
+ "decorations",
1209
+ "budgeting",
1210
+ "timeline",
1211
+ ] as const;
1212
+
1213
+ export const SITE_NAME = "Bash" as const;