@jobsearch-works/firestore-models 1.1.9 → 1.1.11

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 CHANGED
@@ -37,6 +37,17 @@ This package acts as a single source of truth for Firestore schema and paths, en
37
37
  - Consistent Firestore path generation (no hardcoded strings)
38
38
  - Cross-environment compatibility (e.g., CLI, testing, rules)
39
39
 
40
+ This package provides no Firestore SDK bindings. Firestore `DocumentReference`s and `CollectionReference`s are constructed in your application using these path strings, typically in a `firestoreRefs.ts` file like:
41
+
42
+ ```ts
43
+ import { doc, collection } from "firebase/firestore";
44
+ import { firestore } from "./firebaseConfig";
45
+ import { firestorePaths } from "@jobsearch-works/firestore-models";
46
+
47
+ export const userRef = (userId: string) =>
48
+ doc(firestore, firestorePaths.users.doc(userId));
49
+ ```
50
+
40
51
  ---
41
52
 
42
53
  ## 🧱 Project Structure
@@ -98,6 +109,7 @@ ClientLogin
98
109
  | ClientData | Root collection | Standalone entity |
99
110
  | ClientLogin | clientLogins/{userId}/logins/{domain} | References `userId` |
100
111
  | GmailMessage | clientEmails/{clientId}/messages/{messageId} | References `clientId` |
112
+ | ResumeLink | clients/{clientId}/resumeLinks/{linkId} | References `clientId`, stores PDF resume URLs |
101
113
 
102
114
  **Notes:**
103
115
 
@@ -110,6 +122,8 @@ ClientLogin
110
122
 
111
123
  ## ✅ Usage
112
124
 
125
+ 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
+
113
127
  ### Importing Models and Paths
114
128
 
115
129
  ```ts
@@ -279,6 +293,27 @@ All Firestore document schemas are defined as TypeScript interfaces in `src/type
279
293
  }
280
294
  ```
281
295
 
296
+ - **GmailMessage**
297
+
298
+ ```ts
299
+ export interface GmailMessage {
300
+ id?: string;
301
+ ```
302
+
303
+ - **ResumeLink**
304
+
305
+ ```ts
306
+ export interface ResumeLink {
307
+ id: string;
308
+ title: string;
309
+ url: string;
310
+ description: string;
311
+ createdAt: any; // Timestamp from firebase/firestore
312
+ createdBy: string;
313
+ clientId: string;
314
+ }
315
+ ```
316
+
282
317
  - **GmailMessage**
283
318
 
284
319
  ```ts
package/dist/index.d.mts CHANGED
@@ -1,10 +1,11 @@
1
+ type ClientStatus = "active" | "inactive";
1
2
  interface Client {
2
- id?: string;
3
- name: string;
4
- email: string;
5
- status: "active" | "inactive";
6
- resume?: string;
7
- createdAt?: Date | string;
3
+ readonly id?: string;
4
+ readonly name: string;
5
+ readonly email: string;
6
+ readonly status: ClientStatus;
7
+ readonly resume?: string;
8
+ readonly createdAt?: Date | string;
8
9
  }
9
10
 
10
11
  declare const ApplicationStatus: {
@@ -111,14 +112,15 @@ interface Vacancy {
111
112
  updatedAt?: Date | string;
112
113
  }
113
114
 
115
+ type AgentStatus = "active" | "inactive";
114
116
  interface Agent {
115
- id?: string;
116
- name: string;
117
- email: string;
118
- status: "active" | "inactive";
119
- profilePicture?: string;
120
- createdAt?: Date | string;
121
- updatedAt?: Date | string;
117
+ readonly id?: string;
118
+ readonly name: string;
119
+ readonly email: string;
120
+ readonly status: AgentStatus;
121
+ readonly profilePicture?: string;
122
+ readonly createdAt?: Date | string;
123
+ readonly updatedAt?: Date | string;
122
124
  }
123
125
 
124
126
  type ClientQuestionType = "text" | "select";
@@ -237,6 +239,16 @@ interface TargetPreferences {
237
239
  updatedAt: Date;
238
240
  }
239
241
 
242
+ interface ResumeLink {
243
+ id?: string;
244
+ title: string;
245
+ url: string;
246
+ description: string;
247
+ createdAt?: Date | string;
248
+ createdBy: string;
249
+ clientId: string;
250
+ }
251
+
240
252
  declare const firestorePaths: {
241
253
  readonly clients: {
242
254
  readonly collection: () => string;
@@ -260,6 +272,10 @@ declare const firestorePaths: {
260
272
  readonly collection: (clientId: string) => string;
261
273
  readonly doc: (clientId: string, suggestionId: string) => string;
262
274
  };
275
+ readonly resumeLinks: {
276
+ readonly collection: (clientId: string) => string;
277
+ readonly doc: (clientId: string, resumeLinkId: string) => string;
278
+ };
263
279
  };
264
280
  readonly users: {
265
281
  readonly collection: () => string;
@@ -287,4 +303,4 @@ declare const firestorePaths: {
287
303
  };
288
304
  };
289
305
 
290
- export { Agent, Application, ApplicationQuestion, ApplicationQuestionType, ApplicationQuestionTypeOptions, ApplicationStatus, AuthUser, Client, ClientData, ClientLogin, ClientQuestion, ClientQuestionType, ClientQuestionTypeOptions, GmailMessage, TargetJob, TargetLocation, TargetPreferences, Vacancy, VacancyCategory, VacancySuggestion, firestorePaths };
306
+ export { Agent, AgentStatus, Application, ApplicationQuestion, ApplicationQuestionType, ApplicationQuestionTypeOptions, ApplicationStatus, AuthUser, Client, ClientData, ClientLogin, ClientQuestion, ClientQuestionType, ClientQuestionTypeOptions, ClientStatus, GmailMessage, ResumeLink, TargetJob, TargetLocation, TargetPreferences, Vacancy, VacancyCategory, VacancySuggestion, firestorePaths };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
+ type ClientStatus = "active" | "inactive";
1
2
  interface Client {
2
- id?: string;
3
- name: string;
4
- email: string;
5
- status: "active" | "inactive";
6
- resume?: string;
7
- createdAt?: Date | string;
3
+ readonly id?: string;
4
+ readonly name: string;
5
+ readonly email: string;
6
+ readonly status: ClientStatus;
7
+ readonly resume?: string;
8
+ readonly createdAt?: Date | string;
8
9
  }
9
10
 
10
11
  declare const ApplicationStatus: {
@@ -111,14 +112,15 @@ interface Vacancy {
111
112
  updatedAt?: Date | string;
112
113
  }
113
114
 
115
+ type AgentStatus = "active" | "inactive";
114
116
  interface Agent {
115
- id?: string;
116
- name: string;
117
- email: string;
118
- status: "active" | "inactive";
119
- profilePicture?: string;
120
- createdAt?: Date | string;
121
- updatedAt?: Date | string;
117
+ readonly id?: string;
118
+ readonly name: string;
119
+ readonly email: string;
120
+ readonly status: AgentStatus;
121
+ readonly profilePicture?: string;
122
+ readonly createdAt?: Date | string;
123
+ readonly updatedAt?: Date | string;
122
124
  }
123
125
 
124
126
  type ClientQuestionType = "text" | "select";
@@ -237,6 +239,16 @@ interface TargetPreferences {
237
239
  updatedAt: Date;
238
240
  }
239
241
 
242
+ interface ResumeLink {
243
+ id?: string;
244
+ title: string;
245
+ url: string;
246
+ description: string;
247
+ createdAt?: Date | string;
248
+ createdBy: string;
249
+ clientId: string;
250
+ }
251
+
240
252
  declare const firestorePaths: {
241
253
  readonly clients: {
242
254
  readonly collection: () => string;
@@ -260,6 +272,10 @@ declare const firestorePaths: {
260
272
  readonly collection: (clientId: string) => string;
261
273
  readonly doc: (clientId: string, suggestionId: string) => string;
262
274
  };
275
+ readonly resumeLinks: {
276
+ readonly collection: (clientId: string) => string;
277
+ readonly doc: (clientId: string, resumeLinkId: string) => string;
278
+ };
263
279
  };
264
280
  readonly users: {
265
281
  readonly collection: () => string;
@@ -287,4 +303,4 @@ declare const firestorePaths: {
287
303
  };
288
304
  };
289
305
 
290
- export { Agent, Application, ApplicationQuestion, ApplicationQuestionType, ApplicationQuestionTypeOptions, ApplicationStatus, AuthUser, Client, ClientData, ClientLogin, ClientQuestion, ClientQuestionType, ClientQuestionTypeOptions, GmailMessage, TargetJob, TargetLocation, TargetPreferences, Vacancy, VacancyCategory, VacancySuggestion, firestorePaths };
306
+ export { Agent, AgentStatus, Application, ApplicationQuestion, ApplicationQuestionType, ApplicationQuestionTypeOptions, ApplicationStatus, AuthUser, Client, ClientData, ClientLogin, ClientQuestion, ClientQuestionType, ClientQuestionTypeOptions, ClientStatus, GmailMessage, ResumeLink, TargetJob, TargetLocation, TargetPreferences, Vacancy, VacancyCategory, VacancySuggestion, firestorePaths };
package/dist/index.js CHANGED
@@ -107,6 +107,10 @@ var firestorePaths = {
107
107
  vacancySuggestions: {
108
108
  collection: (clientId) => `clients/${clientId}/vacancySuggestions`,
109
109
  doc: (clientId, suggestionId) => `clients/${clientId}/vacancySuggestions/${suggestionId}`
110
+ },
111
+ resumeLinks: {
112
+ collection: (clientId) => `clients/${clientId}/resumeLinks`,
113
+ doc: (clientId, resumeLinkId) => `clients/${clientId}/resumeLinks/${resumeLinkId}`
110
114
  }
111
115
  },
112
116
  users: {
@@ -126,7 +130,7 @@ var firestorePaths = {
126
130
  doc: (clientDataId) => `clientData/${clientDataId}`
127
131
  },
128
132
  clientLogins: {
129
- collection: (userId) => `clientLogins/${userId}`,
133
+ collection: (userId) => `clientLogins/${userId}/logins`,
130
134
  doc: (userId, domain) => `clientLogins/${userId}/logins/${domain}`
131
135
  },
132
136
  gmailMessages: {
package/dist/index.mjs CHANGED
@@ -77,6 +77,10 @@ var firestorePaths = {
77
77
  vacancySuggestions: {
78
78
  collection: (clientId) => `clients/${clientId}/vacancySuggestions`,
79
79
  doc: (clientId, suggestionId) => `clients/${clientId}/vacancySuggestions/${suggestionId}`
80
+ },
81
+ resumeLinks: {
82
+ collection: (clientId) => `clients/${clientId}/resumeLinks`,
83
+ doc: (clientId, resumeLinkId) => `clients/${clientId}/resumeLinks/${resumeLinkId}`
80
84
  }
81
85
  },
82
86
  users: {
@@ -96,7 +100,7 @@ var firestorePaths = {
96
100
  doc: (clientDataId) => `clientData/${clientDataId}`
97
101
  },
98
102
  clientLogins: {
99
- collection: (userId) => `clientLogins/${userId}`,
103
+ collection: (userId) => `clientLogins/${userId}/logins`,
100
104
  doc: (userId, domain) => `clientLogins/${userId}/logins/${domain}`
101
105
  },
102
106
  gmailMessages: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobsearch-works/firestore-models",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
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",