wedance-shared 1.0.20 → 1.0.22

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/Timestamp.d.ts +11 -0
  2. package/dist/Timestamp.js +36 -0
  3. package/dist/Timestamp.js.map +1 -0
  4. package/dist/types/analytics.d.ts +1 -1
  5. package/dist/types/event.d.ts +1 -1
  6. package/dist/types/festivals/festival.d.ts +1 -1
  7. package/dist/types/festivals/user.d.ts +1 -1
  8. package/dist/types/ticket.d.ts +1 -1
  9. package/dist/utils/date.d.ts +1 -1
  10. package/dist/utils/date.js +1 -1
  11. package/dist/utils/date.js.map +1 -1
  12. package/package.json +5 -3
  13. package/script/incrementVersion.sh +73 -0
  14. package/src/Timestamp.ts +47 -0
  15. package/src/types/analytics.ts +1 -1
  16. package/src/types/event.ts +1 -1
  17. package/src/types/festivals/festival.ts +1 -1
  18. package/src/types/festivals/user.ts +1 -1
  19. package/src/types/ticket.ts +1 -1
  20. package/src/utils/date.ts +1 -1
  21. package/dist/analytics.d.ts +0 -33
  22. package/dist/analytics.js +0 -2
  23. package/dist/analytics.js.map +0 -1
  24. package/dist/city.d.ts +0 -36
  25. package/dist/city.js +0 -44
  26. package/dist/city.js.map +0 -1
  27. package/dist/event.d.ts +0 -128
  28. package/dist/event.js +0 -2
  29. package/dist/event.js.map +0 -1
  30. package/dist/festivals/festival.d.ts +0 -60
  31. package/dist/festivals/festival.js +0 -2
  32. package/dist/festivals/festival.js.map +0 -1
  33. package/dist/festivals/user.d.ts +0 -20
  34. package/dist/festivals/user.js +0 -2
  35. package/dist/festivals/user.js.map +0 -1
  36. package/dist/organizer.d.ts +0 -16
  37. package/dist/organizer.js +0 -2
  38. package/dist/organizer.js.map +0 -1
  39. package/dist/other.d.ts +0 -24
  40. package/dist/other.js +0 -2
  41. package/dist/other.js.map +0 -1
  42. package/dist/ticket.d.ts +0 -129
  43. package/dist/ticket.js +0 -2
  44. package/dist/ticket.js.map +0 -1
  45. package/dist/user.d.ts +0 -40
  46. package/dist/user.js +0 -2
  47. package/dist/user.js.map +0 -1
@@ -0,0 +1,11 @@
1
+ export declare class Timestamp {
2
+ seconds: number;
3
+ nanoseconds: number;
4
+ constructor(seconds: number, nanoseconds: number);
5
+ static now(): Timestamp;
6
+ static fromDate(date: Date): Timestamp;
7
+ static fromMillis(milliseconds: number): Timestamp;
8
+ toDate(): Date;
9
+ toMillis(): number;
10
+ isEqual(other: Timestamp): boolean;
11
+ }
@@ -0,0 +1,36 @@
1
+ export class Timestamp {
2
+ constructor(seconds, nanoseconds) {
3
+ this.seconds = seconds;
4
+ this.nanoseconds = nanoseconds;
5
+ if (nanoseconds < 0 || nanoseconds >= 1e9) {
6
+ throw new RangeError("Nanoseconds must be between 0 and 999,999,999");
7
+ }
8
+ }
9
+ static now() {
10
+ const now = Date.now(); // milliseconds
11
+ const seconds = Math.floor(now / 1000);
12
+ const nanoseconds = (now % 1000) * 1e6;
13
+ return new Timestamp(seconds, nanoseconds);
14
+ }
15
+ static fromDate(date) {
16
+ const millis = date.getTime();
17
+ const seconds = Math.floor(millis / 1000);
18
+ const nanoseconds = (millis % 1000) * 1e6;
19
+ return new Timestamp(seconds, nanoseconds);
20
+ }
21
+ static fromMillis(milliseconds) {
22
+ const seconds = Math.floor(milliseconds / 1000);
23
+ const nanoseconds = (milliseconds % 1000) * 1e6;
24
+ return new Timestamp(seconds, nanoseconds);
25
+ }
26
+ toDate() {
27
+ return new Date(this.seconds * 1000 + this.nanoseconds / 1e6);
28
+ }
29
+ toMillis() {
30
+ return this.seconds * 1000 + this.nanoseconds / 1e6;
31
+ }
32
+ isEqual(other) {
33
+ return (this.seconds === other.seconds && this.nanoseconds === other.nanoseconds);
34
+ }
35
+ }
36
+ //# sourceMappingURL=Timestamp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Timestamp.js","sourceRoot":"","sources":["../src/Timestamp.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,S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AAI,CAAC,WAAW,GAAG,GAAG,CAAC,CAAC;IAChE,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;IACtD,CAAC;IAED,OAAO,CAAC,KAAgB;QACtB,OAAO,CACL,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,WAAW,KAAK,KAAK,CAAC,WAAW,CACzE,CAAC;IACJ,CAAC;CACF"}
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "@react-native-firebase/firestore";
1
+ import { Timestamp } from "../Timestamp";
2
2
  export type GoogleAnalyticsResponse = {
3
3
  dimensionHeaders: {
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "@react-native-firebase/firestore";
1
+ import { Timestamp } from "../Timestamp";
2
2
  import { City } from "./city";
3
3
  import { OrganizerName } from "./organizer";
4
4
  import { EventTicket } from "./ticket";
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "@react-native-firebase/firestore";
1
+ import { Timestamp } from "../../Timestamp";
2
2
  import { Links } from "../event";
3
3
  import { EventTicket } from "wedance-shared";
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "@react-native-firebase/firestore";
1
+ import { Timestamp } from "../../Timestamp";
2
2
  import { Role } from "../user";
3
3
  export type FestivalUser = {
4
4
  id: string;
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "@react-native-firebase/firestore";
1
+ import { Timestamp } from "../Timestamp";
2
2
  export type TicketStatus = "Confirmed" | "Cancelled" | "Refunded" | "Expired" | "Used" | "Transferred";
3
3
  export type Ticket = {
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "@react-native-firebase/firestore";
1
+ import { Timestamp } from "../Timestamp";
2
2
  /**
3
3
  * Converts a Firestore Timestamp to a JavaScript Date object
4
4
  * @param timestamp Firestore Timestamp or null/undefined
@@ -1,6 +1,6 @@
1
- import { Timestamp } from "@react-native-firebase/firestore";
2
1
  import dayjs from "dayjs";
3
2
  import relativeTime from "dayjs/plugin/relativeTime";
3
+ import { Timestamp } from "../Timestamp";
4
4
  // Register the relativeTime plugin
5
5
  dayjs.extend(relativeTime);
6
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"date.js","sourceRoot":"","sources":["../../src/utils/date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,2BAA2B,CAAC;AAErD,mCAAmC;AACnC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAE3B;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,SAAuC,EAC1B,EAAE;IACf,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5B,OAAO,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC,CAAC;AAC9E,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,IAA6B,EACX,EAAE;IACpB,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,SAAuC,EACvC,YAAoB,aAAa,EACjC,eAAuB,EAAE,EACjB,EAAE;IACV,IAAI,CAAC,SAAS;QAAE,OAAO,YAAY,CAAC;IAEpC,IAAI,CAAC;QACH,4BAA4B;QAC5B,MAAM,IAAI,GAAG,IAAI,IAAI,CACnB,SAAS,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,WAAW,GAAG,OAAO,CAC3D,CAAC;QAEF,8DAA8D;QAC9D,OAAO,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IACZ,CAAC;AACH,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wedance-shared",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "This repository contains shared TypeScript types and interfaces used across multiple WeDance applications:",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,7 +15,10 @@
15
15
  "check-format": "prettier --check \"src/**/*.ts\"",
16
16
  "test": "echo \"Error: no test specified\" && exit 1",
17
17
  "clean": "rm -rf dist",
18
- "npm:publish": "npm run build && npm publish --access public"
18
+ "version:patch": "script/incrementVersion.sh",
19
+ "version:minor": "script/incrementVersion.sh minor",
20
+ "version:major": "script/incrementVersion.sh major",
21
+ "npm:publish": "npm run build && npm run version:patch && npm publish --access public"
19
22
  },
20
23
  "keywords": [],
21
24
  "author": "",
@@ -33,7 +36,6 @@
33
36
  },
34
37
  "type": "module",
35
38
  "dependencies": {
36
- "@react-native-firebase/firestore": "21.2.0",
37
39
  "dayjs": "^1.11.13"
38
40
  }
39
41
  }
@@ -0,0 +1,73 @@
1
+ #!/bin/bash
2
+
3
+ # This script increments the version in package.json
4
+ # Usage: ./incrementVersion.sh [major|minor|patch]
5
+ # Default is patch if no argument is provided
6
+
7
+ # Function to display usage information
8
+ show_usage() {
9
+ echo "Usage: $0 [major|minor|patch]"
10
+ echo "Default is patch if no argument is provided"
11
+ }
12
+
13
+ # Check if package.json exists
14
+ if [ ! -f "package.json" ]; then
15
+ echo "Error: package.json not found in current directory"
16
+ exit 1
17
+ fi
18
+
19
+ # Determine which version part to increment
20
+ VERSION_PART=${1:-patch}
21
+
22
+ if [[ ! $VERSION_PART =~ ^(major|minor|patch)$ ]]; then
23
+ echo "Error: Invalid version part. Must be one of: major, minor, patch"
24
+ show_usage
25
+ exit 1
26
+ fi
27
+
28
+ # Get current version from package.json
29
+ CURRENT_VERSION=$(grep -o '"version": "[^"]*' package.json | cut -d'"' -f4)
30
+
31
+ if [ -z "$CURRENT_VERSION" ]; then
32
+ echo "Error: Unable to find version in package.json"
33
+ exit 1
34
+ fi
35
+
36
+ echo "Current version: $CURRENT_VERSION"
37
+
38
+ # Split version into components
39
+ IFS='.' read -r -a VERSION_PARTS <<< "$CURRENT_VERSION"
40
+ MAJOR=${VERSION_PARTS[0]}
41
+ MINOR=${VERSION_PARTS[1]}
42
+ PATCH=${VERSION_PARTS[2]}
43
+
44
+ # Increment appropriate version part
45
+ case $VERSION_PART in
46
+ major)
47
+ MAJOR=$((MAJOR + 1))
48
+ MINOR=0
49
+ PATCH=0
50
+ ;;
51
+ minor)
52
+ MINOR=$((MINOR + 1))
53
+ PATCH=0
54
+ ;;
55
+ patch)
56
+ PATCH=$((PATCH + 1))
57
+ ;;
58
+ esac
59
+
60
+ # Construct new version
61
+ NEW_VERSION="$MAJOR.$MINOR.$PATCH"
62
+ echo "New version: $NEW_VERSION"
63
+
64
+ # Update version in package.json
65
+ if [[ "$OSTYPE" == "darwin"* ]]; then
66
+ # macOS requires a slightly different sed syntax
67
+ sed -i '' "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/" package.json
68
+ else
69
+ # Linux version
70
+ sed -i "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/" package.json
71
+ fi
72
+
73
+ echo "Updated package.json version to $NEW_VERSION"
@@ -0,0 +1,47 @@
1
+ export class Timestamp {
2
+ seconds: number;
3
+ nanoseconds: number;
4
+
5
+ constructor(seconds: number, nanoseconds: number) {
6
+ this.seconds = seconds;
7
+ this.nanoseconds = nanoseconds;
8
+
9
+ if (nanoseconds < 0 || nanoseconds >= 1e9) {
10
+ throw new RangeError("Nanoseconds must be between 0 and 999,999,999");
11
+ }
12
+ }
13
+
14
+ static now(): Timestamp {
15
+ const now = Date.now(); // milliseconds
16
+ const seconds = Math.floor(now / 1000);
17
+ const nanoseconds = (now % 1000) * 1e6;
18
+ return new Timestamp(seconds, nanoseconds);
19
+ }
20
+
21
+ static fromDate(date: Date): Timestamp {
22
+ const millis = date.getTime();
23
+ const seconds = Math.floor(millis / 1000);
24
+ const nanoseconds = (millis % 1000) * 1e6;
25
+ return new Timestamp(seconds, nanoseconds);
26
+ }
27
+
28
+ static fromMillis(milliseconds: number): Timestamp {
29
+ const seconds = Math.floor(milliseconds / 1000);
30
+ const nanoseconds = (milliseconds % 1000) * 1e6;
31
+ return new Timestamp(seconds, nanoseconds);
32
+ }
33
+
34
+ toDate(): Date {
35
+ return new Date(this.seconds * 1000 + this.nanoseconds / 1e6);
36
+ }
37
+
38
+ toMillis(): number {
39
+ return this.seconds * 1000 + this.nanoseconds / 1e6;
40
+ }
41
+
42
+ isEqual(other: Timestamp): boolean {
43
+ return (
44
+ this.seconds === other.seconds && this.nanoseconds === other.nanoseconds
45
+ );
46
+ }
47
+ }
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "@react-native-firebase/firestore";
1
+ import { Timestamp } from "../Timestamp";
2
2
 
3
3
  export type GoogleAnalyticsResponse = {
4
4
  dimensionHeaders: { name: string }[];
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "@react-native-firebase/firestore";
1
+ import { Timestamp } from "../Timestamp";
2
2
  import { City } from "./city";
3
3
  import { OrganizerName } from "./organizer";
4
4
  import { EventTicket } from "./ticket";
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "@react-native-firebase/firestore";
1
+ import { Timestamp } from "../../Timestamp";
2
2
  import { Links } from "../event";
3
3
  import { DanceTag, EventTicket } from "wedance-shared";
4
4
 
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "@react-native-firebase/firestore";
1
+ import { Timestamp } from "../../Timestamp";
2
2
  import { Role } from "../user";
3
3
 
4
4
  export type FestivalUser = {
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "@react-native-firebase/firestore";
1
+ import { Timestamp } from "../Timestamp";
2
2
 
3
3
  export type TicketStatus =
4
4
  | "Confirmed"
package/src/utils/date.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { Timestamp } from "@react-native-firebase/firestore";
2
1
  import dayjs from "dayjs";
3
2
  import relativeTime from "dayjs/plugin/relativeTime";
3
+ import { Timestamp } from "../Timestamp";
4
4
 
5
5
  // Register the relativeTime plugin
6
6
  dayjs.extend(relativeTime);
@@ -1,33 +0,0 @@
1
- import { Timestamp } from "@react-native-firebase/firestore";
2
- export type GoogleAnalyticsResponse = {
3
- dimensionHeaders: {
4
- name: string;
5
- }[];
6
- metricHeaders: {
7
- name: string;
8
- type: string;
9
- }[];
10
- rows: {
11
- dimensionValues: {
12
- value: string;
13
- }[];
14
- metricValues: {
15
- value: string;
16
- }[];
17
- }[];
18
- rowCount: number;
19
- };
20
- export type EventAnalyticsMetrics = {
21
- eventCount: string;
22
- totalUsers: string;
23
- eventId: string;
24
- };
25
- export type DailyAnalyticsReport = {
26
- createdAt: Timestamp;
27
- data: EventAnalyticsMetrics[];
28
- reportDate: string;
29
- dateRange: {
30
- endDate: string;
31
- startDate: string;
32
- };
33
- };
package/dist/analytics.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=analytics.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"analytics.js","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":""}
package/dist/city.d.ts DELETED
@@ -1,36 +0,0 @@
1
- type CityData = {
2
- city: "helsinki";
3
- country: "fi";
4
- coordinates: [60.1695, 24.9354];
5
- } | {
6
- city: "tampere";
7
- country: "fi";
8
- coordinates: [61.4978, 23.761];
9
- } | {
10
- city: "oslo";
11
- country: "no";
12
- coordinates: [59.9139, 10.7522];
13
- } | {
14
- city: "tallinn";
15
- country: "ee";
16
- coordinates: [59.437, 24.7536];
17
- } | {
18
- city: "copenhagen";
19
- country: "dk";
20
- coordinates: [55.6761, 12.5683];
21
- } | {
22
- city: "oulu";
23
- country: "fi";
24
- coordinates: [65.012, 25.468];
25
- };
26
- export declare const LIST_CITIES: CityData[];
27
- export type City = CityData;
28
- export type CityName = CityData["city"];
29
- export type CountryCode = CityData["country"];
30
- export declare enum Timezone {
31
- FINLAND = "Europe/Helsinki",
32
- DENMARK = "Europe/Copenhagen",
33
- SWEDEN = "Europe/Stockholm",
34
- NORWAY = "Europe/Oslo"
35
- }
36
- export {};
package/dist/city.js DELETED
@@ -1,44 +0,0 @@
1
- export const LIST_CITIES = [
2
- {
3
- city: "helsinki",
4
- country: "fi",
5
- coordinates: [60.1695, 24.9354]
6
- },
7
- {
8
- city: "tampere",
9
- country: "fi",
10
- coordinates: [61.4978, 23.761]
11
- },
12
- {
13
- city: "oslo",
14
- country: "no",
15
- coordinates: [59.9139, 10.7522]
16
- },
17
- // {
18
- // city: 'stockholm',
19
- // country: 'se',
20
- // },
21
- {
22
- city: "tallinn",
23
- country: "ee",
24
- coordinates: [59.437, 24.7536]
25
- },
26
- {
27
- city: "copenhagen",
28
- country: "dk",
29
- coordinates: [55.6761, 12.5683]
30
- },
31
- {
32
- city: "oulu",
33
- country: "fi",
34
- coordinates: [65.012, 25.468]
35
- }
36
- ];
37
- export var Timezone;
38
- (function (Timezone) {
39
- Timezone["FINLAND"] = "Europe/Helsinki";
40
- Timezone["DENMARK"] = "Europe/Copenhagen";
41
- Timezone["SWEDEN"] = "Europe/Stockholm";
42
- Timezone["NORWAY"] = "Europe/Oslo";
43
- })(Timezone || (Timezone = {}));
44
- //# sourceMappingURL=city.js.map
package/dist/city.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"city.js","sourceRoot":"","sources":["../src/city.ts"],"names":[],"mappings":"AAgCA,MAAM,CAAC,MAAM,WAAW,GAAe;IACrC;QACE,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;KAChC;IACD;QACE,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;KAC/B;IACD;QACE,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;KAChC;IACD,IAAI;IACJ,uBAAuB;IACvB,mBAAmB;IACnB,KAAK;IACL;QACE,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;KAC/B;IACD;QACE,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;KAChC;IACD;QACE,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;KAC9B;CACF,CAAC;AAMF,MAAM,CAAN,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,uCAA2B,CAAA;IAC3B,yCAA6B,CAAA;IAC7B,uCAA2B,CAAA;IAC3B,kCAAsB,CAAA;AACxB,CAAC,EALW,QAAQ,KAAR,QAAQ,QAKnB"}
package/dist/event.d.ts DELETED
@@ -1,128 +0,0 @@
1
- import { Timestamp } from "@react-native-firebase/firestore";
2
- import { City } from "./city";
3
- import { OrganizerName } from "./organizer";
4
- import { EventTicket } from "./ticket";
5
- import { UserBadge } from "./user";
6
- export type DanceTag = "salsa" | "kizomba" | "bachata" | "zouk";
7
- export type Organizer = {
8
- name: OrganizerName;
9
- email?: string;
10
- };
11
- export type Links = {
12
- paymentLink?: string;
13
- instagram?: string;
14
- facebook?: string;
15
- website?: string;
16
- other?: string;
17
- };
18
- export type Location = {
19
- name: string;
20
- address?: string;
21
- };
22
- export type EventStatus = "draft" | "published" | "cancelled";
23
- export type ImageData = {
24
- url: string;
25
- alt?: string;
26
- blurhash?: string;
27
- };
28
- /**
29
- * This is the type of the data we get from the server
30
- * */
31
- export type EventData = {
32
- id: string;
33
- title: string;
34
- from: string;
35
- until: string;
36
- price: number;
37
- priceProvided: boolean;
38
- organizer: Organizer;
39
- description: string;
40
- location: Location;
41
- duration?: number;
42
- tags: DanceTag[];
43
- links: Links;
44
- /**
45
- * Events have international artists
46
- */
47
- isInternational: boolean;
48
- /**
49
- * Is event private? @deprecated
50
- */
51
- isPrivate?: boolean;
52
- hasSeveralPrices?: boolean;
53
- createdAt: string;
54
- lastUpdated?: string;
55
- publishedSchedule?: boolean;
56
- schedule: EventSchedule | null;
57
- addedBy: string;
58
- updatedBy: string;
59
- paymentLink: string | null;
60
- status: EventStatus | null;
61
- city: City;
62
- isFestival: boolean | null;
63
- going: UserBadge[] | null;
64
- interested: UserBadge[] | null;
65
- imageData: ImageData;
66
- eventTickets?: EventTicket[] | null;
67
- lineup?: LineUpArtist[] | null;
68
- };
69
- export type EventCellType = "workshop" | "social" | "break" | "other";
70
- export type ScheduleItem = {
71
- id: string;
72
- headline: string;
73
- subheader: string | null;
74
- from: string;
75
- until: string;
76
- type: EventCellType;
77
- level: string | null;
78
- };
79
- export type EventSchedule = Record<string, ScheduleItem[]>;
80
- export type LineUpArtist = {
81
- id: string;
82
- name: string;
83
- description: string;
84
- image: string;
85
- imageUrl: string;
86
- };
87
- export type Featured = {
88
- /**
89
- * ID of the promotion
90
- */
91
- id: string;
92
- /**
93
- * ID of the event being promoted
94
- */
95
- eventId: string;
96
- /**
97
- * Cities where this promotion should be shown
98
- */
99
- cities: City["city"][];
100
- /**
101
- * Priority level for displaying multiple featured events (higher = more prominent)
102
- */
103
- priority: number;
104
- /**
105
- * Optional custom promotion message
106
- */
107
- promotionalText?: string;
108
- /**
109
- * Who created this promotion
110
- */
111
- createdBy: string;
112
- /**
113
- * When this promotion was created (ISO date string)
114
- */
115
- createdAt: Timestamp;
116
- updatedAt: Timestamp;
117
- /**
118
- * Whether the promotion is currently active
119
- */
120
- isActive: boolean;
121
- /**
122
- * Date range of the promotion
123
- */
124
- dateRange: {
125
- startDate: Timestamp;
126
- endDate: Timestamp;
127
- };
128
- };
package/dist/event.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=event.js.map
package/dist/event.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"event.js","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":""}
@@ -1,60 +0,0 @@
1
- import { Timestamp } from "@react-native-firebase/firestore";
2
- import { Links } from "../event";
3
- import { EventTicket } from "wedance-shared";
4
- /**
5
- * This is the type of the data we get from the server
6
- * */
7
- export type FestivalData = {
8
- id: string;
9
- title: string;
10
- from: Timestamp;
11
- until: Timestamp;
12
- organizerId: string[];
13
- description: string;
14
- location: FestivalLocation[];
15
- genre?: FestivalGenre[];
16
- tags?: string[];
17
- imageData: FestivalImageData[];
18
- priceRange?: {
19
- min: number;
20
- max: number;
21
- currency: string;
22
- };
23
- createdAt: Timestamp;
24
- updatedAt: Timestamp;
25
- createdBy: string;
26
- updatedBy: string;
27
- links: Links;
28
- isFree: boolean;
29
- artists: FestivalArtist[];
30
- tickets?: EventTicket[];
31
- };
32
- type FestivalGenre = "salsa" | "bachata" | "kizomba" | "zouk";
33
- type FestivalImageData = {
34
- url: string;
35
- alt?: string;
36
- blurhash?: string;
37
- };
38
- export type FestivalLocation = {
39
- city: string;
40
- countryCode: string;
41
- country: string;
42
- address?: string;
43
- venue?: string;
44
- geoLocation?: {
45
- lat: number;
46
- lng: number;
47
- };
48
- timeZone: string;
49
- region: Region[];
50
- };
51
- export type FestivalArtist = {
52
- id: string;
53
- name: string;
54
- image: string;
55
- imageUrl: string;
56
- role: FestivalArtistRole;
57
- };
58
- export type FestivalArtistRole = "dj" | "dancer" | "mc" | "guest-dancer" | "organizer" | "media";
59
- export type Region = "Nordics" | "Baltics" | "Western Europe" | "Eastern Europe" | "Southern Europe" | "Central Europe" | "Asia" | "Africa";
60
- export {};
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=festival.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"festival.js","sourceRoot":"","sources":["../../src/festivals/festival.ts"],"names":[],"mappings":""}
@@ -1,20 +0,0 @@
1
- import { Timestamp } from "@react-native-firebase/firestore";
2
- import { Role } from "../user";
3
- export type FestivalUser = {
4
- id: string;
5
- email: string;
6
- displayName: string;
7
- profilePicture?: string;
8
- favoriteFestivals: string[];
9
- role: Role;
10
- basedIn?: string;
11
- createdAt: Timestamp;
12
- lastUpdated: Timestamp;
13
- lastConnected: Timestamp;
14
- fcmTokens?: string[];
15
- appVersion: string;
16
- deviceModel: string;
17
- platform: string;
18
- emailVerified: boolean;
19
- stripeId?: string;
20
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=user.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/festivals/user.ts"],"names":[],"mappings":""}
@@ -1,16 +0,0 @@
1
- import { City } from "./city";
2
- export type OrganizerName = "SOB Productions" | "Helsinki SBK" | "Avec Dance Club" | "Still Dancing" | "Tanssikoulu SalsaLatina" | "Helsinki Salsa Academy" | "BabaGen" | "Bachata Studio" | "Tanssikoulu BailaBaila" | "Petra & Otso" | "Bachata Helsinki" | "Anton Kargaltsev" | "Salsa Borealis" | "Helsinki Dance Central" | "Ted's Kizomba" | "Urbankiz Helsinki" | "Azembora" | "S-Dance" | "Helsinki Kizomba Studio" | "idance Helsinki" | "Dance Social" | "Tampere Social Dance" | "Azúcar" | "DJ Pies Locos" | "Kizomba Social Tampere" | "Bachata & Kizomba Oulu" | "SALSA Klubi" | "Tanssikoulu Vamos" | "Feels Oulu" | "Bachata Sensual Lovers" | "Tanssikoulu Matleena" | "Merja Tanjunen" | "Fever Dance Oslo" | "Pure Dance Official" | "Dancecity" | "Bachata Monthly" | "Salsakompaniet" | "Bachata Studio Tallinn" | "Casa De Baile" | "Havana Moderna" | "Crazy Lion Events" | "Other";
3
- export type OrganizerData = {
4
- id: string;
5
- name: OrganizerName;
6
- email?: string;
7
- website?: string;
8
- city: City;
9
- description?: {
10
- fi: string;
11
- en: string;
12
- };
13
- lastUpdated: string;
14
- createdAt: string;
15
- isFlagged: boolean;
16
- };
package/dist/organizer.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=organizer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"organizer.js","sourceRoot":"","sources":["../src/organizer.ts"],"names":[],"mappings":""}
package/dist/other.d.ts DELETED
@@ -1,24 +0,0 @@
1
- export type Language = {
2
- code: LanguageCode;
3
- };
4
- export type LanguageCode = "en-gb" | "fi";
5
- export type DayPoll = {
6
- [eventId: string]: string[];
7
- other: string[];
8
- };
9
- export type WeekendPoll = {
10
- pollId: string;
11
- createdAt: string;
12
- friday: DayPoll;
13
- saturday: DayPoll;
14
- };
15
- export type FeatureFlags = {
16
- multicity: boolean;
17
- copenhagen: boolean;
18
- oslo: boolean;
19
- stockholm: boolean;
20
- };
21
- export type RemoteConfigMessageType = {
22
- severity: "info" | "warning";
23
- message: string;
24
- };
package/dist/other.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=other.js.map
package/dist/other.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"other.js","sourceRoot":"","sources":["../src/other.ts"],"names":[],"mappings":""}
package/dist/ticket.d.ts DELETED
@@ -1,129 +0,0 @@
1
- import { Timestamp } from "@react-native-firebase/firestore";
2
- export type TicketStatus = "Confirmed" | "Cancelled" | "Refunded" | "Expired" | "Used" | "Transferred";
3
- export type Ticket = {
4
- /**
5
- * ID of the ticket
6
- */
7
- id: string;
8
- /**
9
- * ID of the event ticket
10
- */
11
- ticketId: string;
12
- eventId: string;
13
- eventName: string;
14
- eventDate: string;
15
- purchaseDate: string;
16
- quantity: number;
17
- ticketPrice: number;
18
- ticketType: string;
19
- previousOwner: string[];
20
- originalOwnerId: string;
21
- /**
22
- * ID of the user who owns the ticket
23
- */
24
- owner: string;
25
- status: TicketStatus;
26
- isRefundable: boolean;
27
- isTransferable: boolean;
28
- paymentId: string;
29
- appliedCoupon?: {
30
- code: string;
31
- discountAmount: number;
32
- discountType: "fixed" | "percentage";
33
- };
34
- originalPrice: number;
35
- orderNumber: string;
36
- checkedInAt?: string;
37
- notes?: string;
38
- transferredAt?: string;
39
- refundedAt?: string;
40
- createdAt: Timestamp;
41
- updatedAt: Timestamp;
42
- };
43
- export type TicketTransfer = {
44
- type: "transfer";
45
- fromUserId: string;
46
- toUserId: string;
47
- timestamp: Timestamp;
48
- };
49
- export type CouponCode = {
50
- code: string;
51
- discountAmount: number;
52
- discountType: "fixed" | "percentage";
53
- minPurchaseQuantity?: number;
54
- maxUsage?: number;
55
- expiryDate?: string;
56
- };
57
- export type EventTicket = {
58
- id: string;
59
- price: number;
60
- ticketType: string;
61
- eventId: string;
62
- quantity: number;
63
- amountSold: number;
64
- coupons?: CouponCode[];
65
- name: string;
66
- description?: string;
67
- maxQuantityPerPurchase?: number;
68
- minQuantityPerPurchase?: number;
69
- saleStartDate?: string;
70
- saleEndDate?: string;
71
- isEarlyBird?: boolean;
72
- isTransferable: boolean;
73
- isRefundable: boolean;
74
- status: "published" | "draft";
75
- };
76
- export type Payment = {
77
- amount: number;
78
- amount_capturable: number;
79
- amount_details: {
80
- tip: any;
81
- };
82
- amount_received: number;
83
- application: string | null;
84
- application_fee_amount: number | null;
85
- automatic_payment_methods: {
86
- allow_redirects: "always" | "never";
87
- enabled: boolean;
88
- };
89
- canceled_at: string | null;
90
- cancellation_reason: string | null;
91
- capture_method: "automatic" | "manual";
92
- client_secret: string;
93
- confirmation_method: string;
94
- created: number;
95
- currency: string;
96
- customer: string;
97
- description: string | null;
98
- id: string;
99
- invoice: string | null;
100
- last_payment_error: string | null;
101
- latest_charge: string;
102
- livemode: boolean;
103
- metadata: Record<string, any>;
104
- next_action: string | null;
105
- object: string;
106
- on_behalf_of: string | null;
107
- payment_method_types: ("card" | "mobilepay")[];
108
- payment_method_configuration_details: {
109
- id: string;
110
- };
111
- payment_method_options: {
112
- card: {
113
- network?: string;
114
- request_three_d_secure: string;
115
- };
116
- mobilepay: any;
117
- };
118
- processing: string | null;
119
- receipt_email: string;
120
- review: string | null;
121
- setup_future_usage: string | null;
122
- shipping: string | null;
123
- source: string | null;
124
- statement_descriptor: string | null;
125
- statement_descriptor_suffix: string | null;
126
- status: "succeeded" | string;
127
- transfer_data: string | null;
128
- transfer_group: string | null;
129
- };
package/dist/ticket.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ticket.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ticket.js","sourceRoot":"","sources":["../src/ticket.ts"],"names":[],"mappings":""}
package/dist/user.d.ts DELETED
@@ -1,40 +0,0 @@
1
- import { City } from './city';
2
- import { DanceTag } from './event';
3
- import { OrganizerName } from './organizer';
4
- import { Ticket } from './ticket';
5
- export type Role = 'admin' | 'manager' | 'organiser' | 'user';
6
- export type User = {
7
- id: string;
8
- email: string;
9
- displayName: string;
10
- createdAt: string;
11
- lastUpdated?: string;
12
- lastConnected?: string;
13
- savedEvents: string[];
14
- goingEvents: string[];
15
- role: Role;
16
- managerCity?: City;
17
- organiser?: OrganizerName;
18
- city: City | null;
19
- followingOrganisers: OrganizerName[];
20
- favoriteDance?: DanceTag;
21
- fcmTokens?: string[];
22
- notificationPreferences?: NotificationPreferences;
23
- appVersion?: string;
24
- deviceModel?: string;
25
- platform?: string;
26
- tickets?: Ticket[];
27
- emailVerified: boolean;
28
- stripeId?: string;
29
- };
30
- export type NotificationPreferences = {
31
- all: boolean;
32
- };
33
- /**
34
- * This is used to show who is going to the event
35
- */
36
- export type UserBadge = {
37
- id: string;
38
- displayName: string;
39
- avatar?: string;
40
- };
package/dist/user.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=user.js.map
package/dist/user.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.js","sourceRoot":"","sources":["../src/user.ts"],"names":[],"mappings":""}