wedance-shared 1.0.21 → 1.0.23

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.
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "../Timestamp";
1
+ import { Timestamp } from "firebase/firestore";
2
2
  export type GoogleAnalyticsResponse = {
3
3
  dimensionHeaders: {
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "../Timestamp";
1
+ import { Timestamp } from "firebase/firestore";
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 "../../Timestamp";
1
+ import { Timestamp } from "firebase/firestore";
2
2
  import { Links } from "../event";
3
3
  import { EventTicket } from "wedance-shared";
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "../../Timestamp";
1
+ import { Timestamp } from "firebase/firestore";
2
2
  import { Role } from "../user";
3
3
  export type FestivalUser = {
4
4
  id: string;
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "../Timestamp";
1
+ import { Timestamp } from "firebase/firestore";
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 "../Timestamp";
1
+ import { Timestamp } from "firebase/firestore";
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
1
  import dayjs from "dayjs";
2
2
  import relativeTime from "dayjs/plugin/relativeTime";
3
- import { Timestamp } from "../Timestamp";
3
+ import { Timestamp } from "firebase/firestore";
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,KAAK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AO,KAAK,CAAC;IAE7B,6CAA6C;IAC7C,MAAM,eAAe,GACnB,SAAS,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC;IAC7D,OAAO,eAAe,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AACtC,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,SAAuC,EAC9B,EAAE;IACX,IAAI,CAAC,SAAS;QAAE,OAAO,KAAK,CAAC;IAE7B,6CAA6C;IAC7C,MAAM,eAAe,GACnB,SAAS,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC;IAC7D,OAAO,eAAe,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AACtC,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,SAAuC,EAC/B,EAAE;IACV,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAE1B,IAAI,CAAC;QACH,6CAA6C;QAC7C,MAAM,eAAe,GACnB,SAAS,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC;QAE7D,iCAAiC;QACjC,OAAO,KAAK,CAAC,eAAe,CAAC,CAAC,OAAO,EAAE,CAAC;IAC1C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;QACxD,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wedance-shared",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
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",
@@ -36,6 +36,7 @@
36
36
  },
37
37
  "type": "module",
38
38
  "dependencies": {
39
- "dayjs": "^1.11.13"
39
+ "dayjs": "^1.11.13",
40
+ "firebase": "^11.5.0"
40
41
  }
41
42
  }
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "../Timestamp";
1
+ import { Timestamp } from "firebase/firestore";
2
2
 
3
3
  export type GoogleAnalyticsResponse = {
4
4
  dimensionHeaders: { name: string }[];
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "../Timestamp";
1
+ import { Timestamp } from "firebase/firestore";
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 "../../Timestamp";
1
+ import { Timestamp } from "firebase/firestore";
2
2
  import { Links } from "../event";
3
3
  import { DanceTag, EventTicket } from "wedance-shared";
4
4
 
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "../../Timestamp";
1
+ import { Timestamp } from "firebase/firestore";
2
2
  import { Role } from "../user";
3
3
 
4
4
  export type FestivalUser = {
@@ -1,4 +1,4 @@
1
- import { Timestamp } from "../Timestamp";
1
+ import { Timestamp } from "firebase/firestore";
2
2
 
3
3
  export type TicketStatus =
4
4
  | "Confirmed"
package/src/utils/date.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import dayjs from "dayjs";
2
2
  import relativeTime from "dayjs/plugin/relativeTime";
3
- import { Timestamp } from "../Timestamp";
3
+ import { Timestamp } from "firebase/firestore";
4
4
 
5
5
  // Register the relativeTime plugin
6
6
  dayjs.extend(relativeTime);
@@ -1,78 +0,0 @@
1
- /**
2
- * A `Timestamp` represents a point in time independent of any time zone or
3
- * calendar, represented as seconds and fractions of seconds at nanosecond
4
- * resolution in UTC Epoch time.
5
- *
6
- * It is encoded using the Proleptic Gregorian Calendar which extends the
7
- * Gregorian calendar backwards to year one. It is encoded assuming all minutes
8
- * are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second
9
- * table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to
10
- * 9999-12-31T23:59:59.999999999Z.
11
- *
12
- * For examples and further specifications, refer to the
13
- * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.
14
- */
15
- export declare class Timestamp {
16
- readonly seconds: number;
17
- readonly nanoseconds: number;
18
- constructor(seconds: number, nanoseconds: number);
19
- /**
20
- * Creates a new timestamp with the current date, with millisecond precision.
21
- *
22
- * @returns a new timestamp representing the current date.
23
- */
24
- static now(): Timestamp;
25
- /**
26
- * Creates a new timestamp from the given date.
27
- *
28
- * @param date - The date to initialize the `Timestamp` from.
29
- * @returns A new `Timestamp` representing the same point in time as the given
30
- * date.
31
- */
32
- static fromDate(date: Date): Timestamp;
33
- /**
34
- * Creates a new timestamp from the given number of milliseconds.
35
- *
36
- * @param milliseconds - Number of milliseconds since Unix epoch
37
- * 1970-01-01T00:00:00Z.
38
- * @returns A new `Timestamp` representing the same point in time as the given
39
- * number of milliseconds.
40
- */
41
- static fromMillis(milliseconds: number): Timestamp;
42
- /**
43
- * Converts a `Timestamp` to a JavaScript `Date` object. This conversion
44
- * causes a loss of precision since `Date` objects only support millisecond
45
- * precision.
46
- *
47
- * @returns JavaScript `Date` object representing the same point in time as
48
- * this `Timestamp`, with millisecond precision.
49
- */
50
- toDate(): Date;
51
- /**
52
- * Converts a `Timestamp` to a numeric timestamp (in milliseconds since
53
- * epoch). This operation causes a loss of precision.
54
- *
55
- * @returns The point in time corresponding to this timestamp, represented as
56
- * the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.
57
- */
58
- toMillis(): number;
59
- /**
60
- * Returns true if this `Timestamp` is equal to the provided one.
61
- *
62
- * @param other - The `Timestamp` to compare against.
63
- * @returns true if this `Timestamp` is equal to the provided one.
64
- */
65
- isEqual(other: Timestamp): boolean;
66
- /** Returns a JSON-serializable representation of this `Timestamp`. */
67
- toJSON(): {
68
- seconds: number;
69
- nanoseconds: number;
70
- };
71
- /** Returns a textual representation of this `Timestamp`. */
72
- toString(): string;
73
- /**
74
- * Converts this object to a primitive string, which allows `Timestamp` objects
75
- * to be compared using the `>`, `<=`, `>=` and `>` operators.
76
- */
77
- valueOf(): string;
78
- }
package/dist/Timestamp.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=Timestamp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Timestamp.js","sourceRoot":"","sources":["../src/Timestamp.ts"],"names":[],"mappings":""}
package/src/Timestamp.ts DELETED
@@ -1,85 +0,0 @@
1
- /**
2
- * A `Timestamp` represents a point in time independent of any time zone or
3
- * calendar, represented as seconds and fractions of seconds at nanosecond
4
- * resolution in UTC Epoch time.
5
- *
6
- * It is encoded using the Proleptic Gregorian Calendar which extends the
7
- * Gregorian calendar backwards to year one. It is encoded assuming all minutes
8
- * are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second
9
- * table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to
10
- * 9999-12-31T23:59:59.999999999Z.
11
- *
12
- * For examples and further specifications, refer to the
13
- * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.
14
- */
15
- export declare class Timestamp {
16
- readonly seconds: number;
17
- readonly nanoseconds: number;
18
-
19
- constructor(seconds: number, nanoseconds: number);
20
-
21
- /**
22
- * Creates a new timestamp with the current date, with millisecond precision.
23
- *
24
- * @returns a new timestamp representing the current date.
25
- */
26
- static now(): Timestamp;
27
-
28
- /**
29
- * Creates a new timestamp from the given date.
30
- *
31
- * @param date - The date to initialize the `Timestamp` from.
32
- * @returns A new `Timestamp` representing the same point in time as the given
33
- * date.
34
- */
35
- static fromDate(date: Date): Timestamp;
36
-
37
- /**
38
- * Creates a new timestamp from the given number of milliseconds.
39
- *
40
- * @param milliseconds - Number of milliseconds since Unix epoch
41
- * 1970-01-01T00:00:00Z.
42
- * @returns A new `Timestamp` representing the same point in time as the given
43
- * number of milliseconds.
44
- */
45
- static fromMillis(milliseconds: number): Timestamp;
46
-
47
- /**
48
- * Converts a `Timestamp` to a JavaScript `Date` object. This conversion
49
- * causes a loss of precision since `Date` objects only support millisecond
50
- * precision.
51
- *
52
- * @returns JavaScript `Date` object representing the same point in time as
53
- * this `Timestamp`, with millisecond precision.
54
- */
55
- toDate(): Date;
56
-
57
- /**
58
- * Converts a `Timestamp` to a numeric timestamp (in milliseconds since
59
- * epoch). This operation causes a loss of precision.
60
- *
61
- * @returns The point in time corresponding to this timestamp, represented as
62
- * the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.
63
- */
64
- toMillis(): number;
65
-
66
- /**
67
- * Returns true if this `Timestamp` is equal to the provided one.
68
- *
69
- * @param other - The `Timestamp` to compare against.
70
- * @returns true if this `Timestamp` is equal to the provided one.
71
- */
72
- isEqual(other: Timestamp): boolean;
73
-
74
- /** Returns a JSON-serializable representation of this `Timestamp`. */
75
- toJSON(): { seconds: number; nanoseconds: number };
76
-
77
- /** Returns a textual representation of this `Timestamp`. */
78
- toString(): string;
79
-
80
- /**
81
- * Converts this object to a primitive string, which allows `Timestamp` objects
82
- * to be compared using the `>`, `<=`, `>=` and `>` operators.
83
- */
84
- valueOf(): string;
85
- }