@qrush/types 1.0.1 → 1.1.1
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/README.md +7 -1
- package/dist/WebappUsers.d.ts +14 -0
- package/dist/WebappUsers.js +1 -0
- package/dist/firebase.d.ts +5 -0
- package/dist/firebase.js +12 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -28,6 +28,8 @@ import { Genre } from '@qrush/types/Genres';
|
|
|
28
28
|
import { Meta } from '@qrush/types/Meta';
|
|
29
29
|
import { CommonFields } from '@qrush/types/Common';
|
|
30
30
|
import { CustomDocType } from '@qrush/types/CustomDocType';
|
|
31
|
+
import { Timestamp, GeoPoint, formatTimestamp } from '@qrush/types/firebase';
|
|
32
|
+
import { IFireWebappUser, FireWebappUserSnapshotRef } from '@qrush/types/WebappUsers';
|
|
31
33
|
```
|
|
32
34
|
|
|
33
35
|
## Available Types
|
|
@@ -40,6 +42,8 @@ import { CustomDocType } from '@qrush/types/CustomDocType';
|
|
|
40
42
|
- **Meta** - Metadata and configuration types
|
|
41
43
|
- **Common** - Shared utility types and interfaces
|
|
42
44
|
- **CustomDocType** - Custom document type definitions
|
|
45
|
+
- **firebase** - Firebase/Firestore type re-exports and utilities
|
|
46
|
+
- **WebappUsers** - Web application specific user types and interfaces
|
|
43
47
|
|
|
44
48
|
## Development
|
|
45
49
|
|
|
@@ -73,7 +77,9 @@ src/
|
|
|
73
77
|
├── Location.ts # Location types
|
|
74
78
|
├── Genres.ts # Genre definitions
|
|
75
79
|
├── Meta.ts # Metadata types
|
|
76
|
-
|
|
80
|
+
├── CustomDocType.ts # Custom document types
|
|
81
|
+
├── firebase.ts # Firebase/Firestore type utilities
|
|
82
|
+
└── WebappUsers.ts # Web application user types
|
|
77
83
|
```
|
|
78
84
|
|
|
79
85
|
## Publishing
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FireQueryDocSnapshotRef } from "./CustomDocType.js";
|
|
2
|
+
import { UserRole } from "./Users.js";
|
|
3
|
+
import { Timestamp } from "@firebase/firestore";
|
|
4
|
+
export type IFireWebappUser = {
|
|
5
|
+
email: string;
|
|
6
|
+
name: string;
|
|
7
|
+
createdAt: Timestamp;
|
|
8
|
+
locationIds: string[];
|
|
9
|
+
role?: UserRole;
|
|
10
|
+
isApproved?: boolean;
|
|
11
|
+
ownedPromotionIds?: string[];
|
|
12
|
+
preferredLanguage?: string;
|
|
13
|
+
};
|
|
14
|
+
export type FireWebappUserSnapshotRef = FireQueryDocSnapshotRef<IFireWebappUser>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Timestamp, GeoPoint, QueryDocumentSnapshot, DocumentData, FieldValue } from '@firebase/firestore';
|
|
2
|
+
export type { Timestamp, GeoPoint, QueryDocumentSnapshot, DocumentData, FieldValue };
|
|
3
|
+
export type FirebaseTimestamp = Timestamp;
|
|
4
|
+
export type FirebaseGeoPoint = GeoPoint;
|
|
5
|
+
export declare function formatTimestamp(timestamp: Timestamp | undefined): string;
|
package/dist/firebase.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Utility function to format Firebase Timestamp for display
|
|
2
|
+
export function formatTimestamp(timestamp) {
|
|
3
|
+
if (!timestamp)
|
|
4
|
+
return "Unknown";
|
|
5
|
+
const date = timestamp.toDate();
|
|
6
|
+
// Simple date formatting without external dependencies
|
|
7
|
+
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
8
|
+
const month = months[date.getMonth()];
|
|
9
|
+
const day = date.getDate();
|
|
10
|
+
const year = date.getFullYear();
|
|
11
|
+
return `${month} ${day.toString().padStart(2, '0')}, ${year}`;
|
|
12
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,3 +3,8 @@ export * from './Events.js';
|
|
|
3
3
|
export * from './Users.js';
|
|
4
4
|
export * from './Location.js';
|
|
5
5
|
export * from './Common.js';
|
|
6
|
+
export * from './CustomDocType.js';
|
|
7
|
+
export * from './Genres.js';
|
|
8
|
+
export * from './Meta.js';
|
|
9
|
+
export * from './firebase.js';
|
|
10
|
+
export * from './WebappUsers.js';
|
package/dist/index.js
CHANGED
|
@@ -3,3 +3,8 @@ export * from './Events.js';
|
|
|
3
3
|
export * from './Users.js';
|
|
4
4
|
export * from './Location.js';
|
|
5
5
|
export * from './Common.js';
|
|
6
|
+
export * from './CustomDocType.js';
|
|
7
|
+
export * from './Genres.js';
|
|
8
|
+
export * from './Meta.js';
|
|
9
|
+
export * from './firebase.js';
|
|
10
|
+
export * from './WebappUsers.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qrush/types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Shared TypeScript types for the QRush ecosystem",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -56,6 +56,14 @@
|
|
|
56
56
|
"./Meta": {
|
|
57
57
|
"import": "./dist/Meta.js",
|
|
58
58
|
"types": "./dist/Meta.d.ts"
|
|
59
|
+
},
|
|
60
|
+
"./firebase": {
|
|
61
|
+
"import": "./dist/firebase.js",
|
|
62
|
+
"types": "./dist/firebase.d.ts"
|
|
63
|
+
},
|
|
64
|
+
"./WebappUsers": {
|
|
65
|
+
"import": "./dist/WebappUsers.js",
|
|
66
|
+
"types": "./dist/WebappUsers.d.ts"
|
|
59
67
|
}
|
|
60
68
|
}
|
|
61
69
|
}
|