@jobsearch-works/firestore-models 1.1.12 → 1.1.13
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 +17 -14
- package/package.json +1 -1
package/README.md
CHANGED
@@ -75,7 +75,9 @@ Client
|
|
75
75
|
├── questions (ClientQuestion)
|
76
76
|
├── preferences/targetPreferences (TargetPreferences)
|
77
77
|
├── vacancySuggestions (VacancySuggestion)
|
78
|
-
|
78
|
+
├── emails (GmailMessage)
|
79
|
+
├── logins (ClientLogin)
|
80
|
+
└── resumeLinks (ResumeLink)
|
79
81
|
|
80
82
|
Vacancy
|
81
83
|
└── Referenced by Application and VacancySuggestion
|
@@ -88,9 +90,6 @@ User
|
|
88
90
|
|
89
91
|
ClientData
|
90
92
|
└── Root collection
|
91
|
-
|
92
|
-
ClientLogin
|
93
|
-
└── clientLogins/{userId}/logins/{domain}
|
94
93
|
```
|
95
94
|
|
96
95
|
| Entity | References / Path | Description |
|
@@ -107,8 +106,8 @@ ClientLogin
|
|
107
106
|
| Agent | Root collection | Standalone entity |
|
108
107
|
| AuthUser | Root collection | Standalone entity |
|
109
108
|
| ClientData | Root collection | Standalone entity |
|
110
|
-
| ClientLogin |
|
111
|
-
| GmailMessage |
|
109
|
+
| ClientLogin | clients/{clientId}/logins/{domain} | References `clientId` |
|
110
|
+
| GmailMessage | clients/{clientId}/emails/{messageId} | References `clientId` |
|
112
111
|
| ResumeLink | clients/{clientId}/resumeLinks/{linkId} | References `clientId`, stores PDF resume URLs |
|
113
112
|
|
114
113
|
**Notes:**
|
@@ -122,7 +121,7 @@ ClientLogin
|
|
122
121
|
|
123
122
|
## ✅ Usage
|
124
123
|
|
125
|
-
This library is intentionally SDK-free. All Firebase logic — including `Timestamp`, `doc()`, and `onSnapshot()` — is handled in your app
|
124
|
+
This library is intentionally SDK-free. All Firebase logic — including `Timestamp`, `doc()`, and `onSnapshot()` — is handled in your app's service layer. This ensures portability across React apps, Firebase functions, and testing environments.
|
126
125
|
|
127
126
|
### Importing Models and Paths
|
128
127
|
|
@@ -304,11 +303,11 @@ All Firestore document schemas are defined as TypeScript interfaces in `src/type
|
|
304
303
|
|
305
304
|
```ts
|
306
305
|
export interface ResumeLink {
|
307
|
-
id
|
306
|
+
id?: string;
|
308
307
|
title: string;
|
309
308
|
url: string;
|
310
309
|
description: string;
|
311
|
-
createdAt
|
310
|
+
createdAt?: Date | string;
|
312
311
|
createdBy: string;
|
313
312
|
clientId: string;
|
314
313
|
}
|
@@ -447,9 +446,17 @@ export function withId<T>(snap: DocumentSnapshot): T & { id: string } {
|
|
447
446
|
- `firestorePaths.clients.doc(clientId)` → "clients/{clientId}"
|
448
447
|
- `firestorePaths.clients.applications.collection(clientId)` → "clients/{clientId}/applications"
|
449
448
|
- `firestorePaths.clients.applications.doc(clientId, applicationId)` → "clients/{clientId}/applications/{applicationId}"
|
449
|
+
- `firestorePaths.clients.applications.questions.collection(clientId, applicationId)` → "clients/{clientId}/applications/{applicationId}/questions"
|
450
|
+
- `firestorePaths.clients.applications.questions.doc(clientId, applicationId, questionId)` → "clients/{clientId}/applications/{applicationId}/questions/{questionId}"
|
451
|
+
- `firestorePaths.clients.emails.collection(clientId)` → "clients/{clientId}/emails"
|
452
|
+
- `firestorePaths.clients.emails.doc(clientId, messageId)` → "clients/{clientId}/emails/{messageId}"
|
453
|
+
- `firestorePaths.clients.logins.collection(clientId)` → "clients/{clientId}/logins"
|
454
|
+
- `firestorePaths.clients.logins.doc(clientId, domain)` → "clients/{clientId}/logins/{domain}"
|
455
|
+
- `firestorePaths.clients.preferences.target(clientId)` → "clients/{clientId}/preferences/targetPreferences"
|
450
456
|
- `firestorePaths.clients.questions.collection(clientId)` → "clients/{clientId}/questions"
|
451
457
|
- `firestorePaths.clients.questions.doc(clientId, questionId)` → "clients/{clientId}/questions/{questionId}"
|
452
|
-
- `firestorePaths.clients.
|
458
|
+
- `firestorePaths.clients.resumeLinks.collection(clientId)` → "clients/{clientId}/resumeLinks"
|
459
|
+
- `firestorePaths.clients.resumeLinks.doc(clientId, resumeLinkId)` → "clients/{clientId}/resumeLinks/{resumeLinkId}"
|
453
460
|
- `firestorePaths.clients.vacancySuggestions.collection(clientId)` → "clients/{clientId}/vacancySuggestions"
|
454
461
|
- `firestorePaths.clients.vacancySuggestions.doc(clientId, suggestionId)` → "clients/{clientId}/vacancySuggestions/{suggestionId}"
|
455
462
|
- `firestorePaths.users.collection()` → "users"
|
@@ -460,10 +467,6 @@ export function withId<T>(snap: DocumentSnapshot): T & { id: string } {
|
|
460
467
|
- `firestorePaths.agents.doc(agentId)` → "agents/{agentId}"
|
461
468
|
- `firestorePaths.clientData.collection()` → "clientData"
|
462
469
|
- `firestorePaths.clientData.doc(clientDataId)` → "clientData/{clientDataId}"
|
463
|
-
- `firestorePaths.clientLogins.collection(userId)` → "clientLogins/{userId}"
|
464
|
-
- `firestorePaths.clientLogins.doc(userId, domain)` → "clientLogins/{userId}/logins/{domain}"
|
465
|
-
- `firestorePaths.gmailMessages.collection(clientId)` → "clientEmails/{clientId}/messages"
|
466
|
-
- `firestorePaths.gmailMessages.doc(clientId, messageId)` → "clientEmails/{clientId}/messages/{messageId}"
|
467
470
|
|
468
471
|
---
|
469
472
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@jobsearch-works/firestore-models",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.13",
|
4
4
|
"description": "A shared library for standardizing Firestore document schemas and paths across multiple projects",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|