@jobsearch-works/firestore-models 1.0.33 → 1.1.0
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 +58 -284
- package/dist/index.d.mts +225 -313
- package/dist/index.d.ts +225 -313
- package/dist/index.js +97 -378
- package/dist/index.mjs +92 -367
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -1,340 +1,252 @@
|
|
1
|
-
|
2
|
-
* Generic type for all model interfaces
|
3
|
-
*/
|
4
|
-
interface BaseModel {
|
1
|
+
interface Client {
|
5
2
|
id?: string;
|
3
|
+
name: string;
|
4
|
+
email: string;
|
5
|
+
status: "active" | "inactive";
|
6
|
+
resume?: string;
|
6
7
|
createdAt?: Date | string;
|
7
|
-
updatedAt?: Date | string;
|
8
8
|
}
|
9
9
|
|
10
|
-
declare
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
};
|
51
|
-
type Status = (typeof Status)[keyof typeof Status];
|
52
|
-
const StatusOptions: readonly Status[];
|
53
|
-
const collection: (clientId: string) => string;
|
54
|
-
const document: (clientId: string, applicationId: string) => string;
|
55
|
-
const formatSummary: (application: Application.Model) => string;
|
56
|
-
const formatDate: (date: Date | string) => string;
|
57
|
-
const createNew: (clientId: string, vacancyId: string, vacancyData?: {
|
58
|
-
company?: string;
|
59
|
-
position?: string;
|
60
|
-
location?: string;
|
61
|
-
jobId?: string;
|
62
|
-
advertisingUrl?: string;
|
63
|
-
applicationUrl?: string;
|
64
|
-
applicationDomain?: string;
|
65
|
-
advertisingDomain?: string;
|
66
|
-
description?: string;
|
67
|
-
fullPageText?: string;
|
68
|
-
}) => Application.Model;
|
69
|
-
const updateStatus: (application: Application.Model, newStatus: Application.Model["status"]) => Application.Model;
|
70
|
-
}
|
71
|
-
|
72
|
-
declare namespace AuthUser {
|
73
|
-
export interface Model extends BaseModel {
|
74
|
-
email: string;
|
75
|
-
displayName?: string;
|
76
|
-
photoURL?: string;
|
77
|
-
lastSignIn?: string;
|
78
|
-
emailVerified?: boolean;
|
79
|
-
}
|
80
|
-
interface FirestoreTimestamp {
|
81
|
-
seconds: number;
|
82
|
-
nanoseconds: number;
|
83
|
-
_firestore_timestamp?: boolean;
|
84
|
-
}
|
85
|
-
export const collection: () => string;
|
86
|
-
export const document: (userId: string) => string;
|
87
|
-
export const getTimestampFields: () => (keyof Model)[];
|
88
|
-
export const isFirestoreTimestamp: (value: any) => value is FirestoreTimestamp;
|
89
|
-
export const fromFirebaseUser: (user: any) => Model;
|
90
|
-
export const format: (user: Model) => string;
|
91
|
-
export const formatDates: (user: Model) => {
|
92
|
-
lastSignIn: string;
|
93
|
-
createdAt: string;
|
94
|
-
updatedAt?: string;
|
95
|
-
};
|
96
|
-
export const toFirestore: (user: Model) => Record<string, any>;
|
97
|
-
export const fromFirestore: (data: Record<string, any>) => Model;
|
98
|
-
export const createNew: (email: string, displayName?: string, photoURL?: string) => Model;
|
99
|
-
export {};
|
10
|
+
declare const ApplicationStatus: {
|
11
|
+
readonly New: "new";
|
12
|
+
readonly Submitted: "submitted";
|
13
|
+
readonly Interviewing: "interviewing";
|
14
|
+
readonly Accepted: "accepted";
|
15
|
+
readonly Rejected: "rejected";
|
16
|
+
readonly Withdrawn: "withdrawn";
|
17
|
+
readonly Applying: "applying";
|
18
|
+
readonly Suggested: "suggested";
|
19
|
+
readonly Approved: "approved";
|
20
|
+
};
|
21
|
+
type ApplicationStatus = (typeof ApplicationStatus)[keyof typeof ApplicationStatus];
|
22
|
+
interface Application {
|
23
|
+
id?: string;
|
24
|
+
vacancyId: string;
|
25
|
+
clientId: string;
|
26
|
+
status: ApplicationStatus;
|
27
|
+
assignedTo?: string;
|
28
|
+
coverLetter?: string;
|
29
|
+
resume?: string;
|
30
|
+
submittedAt?: Date | string;
|
31
|
+
interviewingAt?: Date | string;
|
32
|
+
acceptedAt?: Date | string;
|
33
|
+
rejectedAt?: Date | string;
|
34
|
+
withdrawnAt?: Date | string;
|
35
|
+
applyingAt?: Date | string;
|
36
|
+
suggestedAt?: Date | string;
|
37
|
+
approvedAt?: Date | string;
|
38
|
+
company?: string;
|
39
|
+
position?: string;
|
40
|
+
location?: string;
|
41
|
+
jobId?: string;
|
42
|
+
advertisingUrl?: string;
|
43
|
+
applicationUrl?: string;
|
44
|
+
applicationDomain?: string;
|
45
|
+
advertisingDomain?: string;
|
46
|
+
description?: string;
|
47
|
+
fullPageText?: string;
|
48
|
+
createdAt?: Date | string;
|
49
|
+
updatedAt?: Date | string;
|
100
50
|
}
|
101
51
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
const formatClient: (client: Client.Model) => string;
|
112
|
-
const createNew: (name: string, email: string) => Client.Model;
|
52
|
+
interface AuthUser {
|
53
|
+
id?: string;
|
54
|
+
email: string;
|
55
|
+
displayName?: string;
|
56
|
+
photoURL?: string;
|
57
|
+
lastSignIn?: string;
|
58
|
+
emailVerified?: boolean;
|
59
|
+
createdAt?: Date | string;
|
60
|
+
updatedAt?: Date | string;
|
113
61
|
}
|
114
62
|
|
115
|
-
declare
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
63
|
+
declare const VacancyCategory: {
|
64
|
+
readonly Accounting: "Accounting";
|
65
|
+
readonly AdministrationAndOfficeSupport: "Administration & Office Support";
|
66
|
+
readonly AdvertisingArtsAndMedia: "Advertising, Arts & Media";
|
67
|
+
readonly BankingAndFinancialServices: "Banking & Financial Services";
|
68
|
+
readonly CallCentreAndCustomerService: "Call Centre & Customer Service";
|
69
|
+
readonly CEOAndGeneralManagement: "CEO & General Management";
|
70
|
+
readonly CommunityServicesAndDevelopment: "Community Services & Development";
|
71
|
+
readonly Construction: "Construction";
|
72
|
+
readonly ConsultingAndStrategy: "Consulting & Strategy";
|
73
|
+
readonly DesignAndArchitecture: "Design & Architecture";
|
74
|
+
readonly EducationAndTraining: "Education & Training";
|
75
|
+
readonly Engineering: "Engineering";
|
76
|
+
readonly FarmingAnimalsAndConservation: "Farming, Animals & Conservation";
|
77
|
+
readonly GovernmentAndDefence: "Government & Defence";
|
78
|
+
readonly HealthcareAndMedical: "Healthcare & Medical";
|
79
|
+
readonly HospitalityAndTourism: "Hospitality & Tourism";
|
80
|
+
readonly HumanResourcesAndRecruitment: "Human Resources & Recruitment";
|
81
|
+
readonly InformationAndCommunicationTechnology: "Information & Communication Technology";
|
82
|
+
readonly InsuranceAndSuperannuation: "Insurance & Superannuation";
|
83
|
+
readonly Legal: "Legal";
|
84
|
+
readonly ManufacturingTransportAndLogistics: "Manufacturing, Transport & Logistics";
|
85
|
+
readonly MarketingAndCommunications: "Marketing & Communications";
|
86
|
+
readonly MiningResourcesAndEnergy: "Mining, Resources & Energy";
|
87
|
+
readonly RealEstateAndProperty: "Real Estate & Property";
|
88
|
+
readonly RetailAndConsumerProducts: "Retail & Consumer Products";
|
89
|
+
readonly Sales: "Sales";
|
90
|
+
readonly ScienceAndTechnology: "Science & Technology";
|
91
|
+
readonly SelfEmployment: "Self Employment";
|
92
|
+
readonly SportAndRecreation: "Sport & Recreation";
|
93
|
+
readonly TradesAndServices: "Trades & Services";
|
94
|
+
};
|
95
|
+
type VacancyCategory = (typeof VacancyCategory)[keyof typeof VacancyCategory];
|
96
|
+
interface Vacancy {
|
97
|
+
id?: string;
|
98
|
+
company: string;
|
99
|
+
position: string;
|
100
|
+
location: string;
|
101
|
+
description: string;
|
102
|
+
advertisingUrl: string;
|
103
|
+
applicationUrl: string;
|
104
|
+
applicationDomain: string;
|
105
|
+
advertisingDomain: string;
|
106
|
+
fullPageText: string;
|
107
|
+
jobId: string;
|
108
|
+
category: VacancyCategory;
|
109
|
+
suggestedTo?: string[];
|
110
|
+
createdAt?: Date | string;
|
111
|
+
updatedAt?: Date | string;
|
141
112
|
}
|
142
113
|
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
username?: string;
|
152
|
-
password: string;
|
153
|
-
email?: string;
|
154
|
-
}
|
155
|
-
const collection: (userId: string) => string;
|
156
|
-
const document: (userId: string, domain: string) => string;
|
157
|
-
const formatClientLogin: (clientLogin: ClientLogin.Model) => string;
|
158
|
-
const createNew: (userId: string, url: string, domain: string, password: string, username?: string, email?: string) => ClientLogin.Model;
|
114
|
+
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;
|
159
122
|
}
|
160
123
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
type Type = "text" | "select";
|
172
|
-
const TypeOptions: readonly Type[];
|
173
|
-
const collection: (clientId: string) => string;
|
174
|
-
const document: (clientId: string, questionId: string) => string;
|
175
|
-
const createNew: (questionText: string, type: Type, answerText?: string, options?: string[]) => ClientQuestion.Model;
|
124
|
+
type ClientQuestionType = "text" | "select";
|
125
|
+
declare const ClientQuestionTypeOptions: readonly ClientQuestionType[];
|
126
|
+
interface ClientQuestion {
|
127
|
+
id?: string;
|
128
|
+
questionText: string;
|
129
|
+
answerText?: string;
|
130
|
+
type: ClientQuestionType;
|
131
|
+
options?: string[];
|
132
|
+
createdAt?: Date | string;
|
133
|
+
updatedAt?: Date | string;
|
176
134
|
}
|
177
135
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
readonly HospitalityAndTourism: "Hospitality & Tourism";
|
199
|
-
readonly HumanResourcesAndRecruitment: "Human Resources & Recruitment";
|
200
|
-
readonly InformationAndCommunicationTechnology: "Information & Communication Technology";
|
201
|
-
readonly InsuranceAndSuperannuation: "Insurance & Superannuation";
|
202
|
-
readonly Legal: "Legal";
|
203
|
-
readonly ManufacturingTransportAndLogistics: "Manufacturing, Transport & Logistics";
|
204
|
-
readonly MarketingAndCommunications: "Marketing & Communications";
|
205
|
-
readonly MiningResourcesAndEnergy: "Mining, Resources & Energy";
|
206
|
-
readonly RealEstateAndProperty: "Real Estate & Property";
|
207
|
-
readonly RetailAndConsumerProducts: "Retail & Consumer Products";
|
208
|
-
readonly Sales: "Sales";
|
209
|
-
readonly ScienceAndTechnology: "Science & Technology";
|
210
|
-
readonly SelfEmployment: "Self Employment";
|
211
|
-
readonly SportAndRecreation: "Sport & Recreation";
|
212
|
-
readonly TradesAndServices: "Trades & Services";
|
213
|
-
};
|
214
|
-
/**
|
215
|
-
* Type representing a valid category value.
|
216
|
-
*/
|
217
|
-
type Category = (typeof Category)[keyof typeof Category];
|
218
|
-
/**
|
219
|
-
* Vacancy model definition.
|
220
|
-
*/
|
221
|
-
interface Model extends BaseModel {
|
222
|
-
company: string;
|
223
|
-
position: string;
|
224
|
-
location: string;
|
225
|
-
description: string;
|
226
|
-
advertisingUrl: string;
|
227
|
-
applicationUrl: string;
|
228
|
-
applicationDomain: string;
|
229
|
-
advertisingDomain: string;
|
230
|
-
fullPageText: string;
|
231
|
-
jobId: string;
|
232
|
-
category: Category;
|
233
|
-
suggestedTo?: string[];
|
234
|
-
}
|
235
|
-
/**
|
236
|
-
* Returns the Firestore collection path for vacancies.
|
237
|
-
*/
|
238
|
-
const collection: () => string;
|
239
|
-
/**
|
240
|
-
* Returns the Firestore document path for a specific vacancy.
|
241
|
-
*/
|
242
|
-
const document: (vacancyId: string) => string;
|
243
|
-
/**
|
244
|
-
* Formats a short summary of a vacancy.
|
245
|
-
*/
|
246
|
-
const formatSummary: (vacancy: Vacancy.Model) => string;
|
247
|
-
/**
|
248
|
-
* Formats a date into a localized string.
|
249
|
-
*/
|
250
|
-
const formatDate: (date: Date | string) => string;
|
251
|
-
/**
|
252
|
-
* Creates a new Vacancy.Model with the given data.
|
253
|
-
*/
|
254
|
-
const createNew: (company: string, position: string, location: string, description: string, advertisingUrl: string, applicationUrl: string, applicationDomain: string, advertisingDomain: string, fullPageText: string, jobId: string, category: Category) => Vacancy.Model;
|
136
|
+
interface ClientData {
|
137
|
+
id?: string;
|
138
|
+
firstName: string;
|
139
|
+
lastName: string;
|
140
|
+
middleName?: string;
|
141
|
+
preferredName?: string;
|
142
|
+
email: string;
|
143
|
+
phone: string;
|
144
|
+
address: string;
|
145
|
+
city: string;
|
146
|
+
suburb: string;
|
147
|
+
state: string;
|
148
|
+
zip: string;
|
149
|
+
country: string;
|
150
|
+
linkedIn?: string;
|
151
|
+
countryPhoneCode: string;
|
152
|
+
nationality: string;
|
153
|
+
dateOfBirth?: Date | string;
|
154
|
+
createdAt?: Date | string;
|
155
|
+
updatedAt?: Date | string;
|
255
156
|
}
|
256
157
|
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
location: string;
|
268
|
-
description: string;
|
269
|
-
advertisingUrl: string;
|
270
|
-
applicationUrl: string;
|
271
|
-
applicationDomain: string;
|
272
|
-
advertisingDomain: string;
|
273
|
-
fullPageText: string;
|
274
|
-
jobId: string;
|
275
|
-
category: Vacancy.Category;
|
276
|
-
}
|
277
|
-
const collection: (clientId: string) => string;
|
278
|
-
const document: (clientId: string, suggestionId: string) => string;
|
279
|
-
const formatSummary: (suggestion: VacancySuggestion.Model) => string;
|
280
|
-
const createNew: (clientId: string, vacancyId: string, status: string, company: string, position: string, location: string, description: string, advertisingUrl: string, applicationUrl: string, applicationDomain: string, advertisingDomain: string, fullPageText: string, jobId: string, category: Vacancy.Category) => VacancySuggestion.Model;
|
158
|
+
interface ClientLogin {
|
159
|
+
id?: string;
|
160
|
+
userId: string;
|
161
|
+
url: string;
|
162
|
+
domain: string;
|
163
|
+
username?: string;
|
164
|
+
password: string;
|
165
|
+
email?: string;
|
166
|
+
createdAt?: Date | string;
|
167
|
+
updatedAt?: Date | string;
|
281
168
|
}
|
282
169
|
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
type Type = "text" | "select";
|
293
|
-
const TypeOptions: readonly Type[];
|
294
|
-
const collection: (clientId: string, applicationId: string) => string;
|
295
|
-
const document: (clientId: string, applicationId: string, questionId: string) => string;
|
296
|
-
const createNew: (questionText: string, type: Type, answerText?: string) => ApplicationQuestion.Model;
|
170
|
+
type ApplicationQuestionType = "text" | "select";
|
171
|
+
declare const ApplicationQuestionTypeOptions: readonly ApplicationQuestionType[];
|
172
|
+
interface ApplicationQuestion {
|
173
|
+
id?: string;
|
174
|
+
questionText: string;
|
175
|
+
answerText?: string;
|
176
|
+
type: ApplicationQuestionType;
|
177
|
+
createdAt?: Date | string;
|
178
|
+
updatedAt?: Date | string;
|
297
179
|
}
|
298
180
|
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
181
|
+
interface VacancySuggestion {
|
182
|
+
id?: string;
|
183
|
+
clientId: string;
|
184
|
+
vacancyId: string;
|
185
|
+
status: string;
|
186
|
+
company: string;
|
187
|
+
position: string;
|
188
|
+
location: string;
|
189
|
+
description: string;
|
190
|
+
advertisingUrl: string;
|
191
|
+
applicationUrl: string;
|
192
|
+
applicationDomain: string;
|
193
|
+
advertisingDomain: string;
|
194
|
+
fullPageText: string;
|
195
|
+
jobId: string;
|
196
|
+
category: VacancyCategory;
|
197
|
+
createdAt?: Date | string;
|
198
|
+
updatedAt?: Date | string;
|
310
199
|
}
|
311
200
|
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
201
|
+
interface GmailMessage {
|
202
|
+
id?: string;
|
203
|
+
messageId: string;
|
204
|
+
threadId?: string;
|
205
|
+
labelIds?: string[];
|
206
|
+
snippet?: string;
|
207
|
+
internalDate?: string;
|
208
|
+
payload?: {
|
209
|
+
headers?: Array<{
|
210
|
+
name: string;
|
211
|
+
value: string;
|
212
|
+
}>;
|
213
|
+
body?: {
|
214
|
+
data?: string;
|
215
|
+
};
|
216
|
+
parts?: Array<{
|
217
|
+
mimeType?: string;
|
324
218
|
body?: {
|
325
219
|
data?: string;
|
326
220
|
};
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
};
|
332
|
-
}>;
|
333
|
-
};
|
334
|
-
}
|
335
|
-
const collection: (clientId: string) => string;
|
336
|
-
const document: (clientId: string, messageId: string) => string;
|
337
|
-
const createNew: (messageId: string, threadId?: string, payload?: Model["payload"], labelIds?: string[], snippet?: string, internalDate?: string) => Model;
|
221
|
+
}>;
|
222
|
+
};
|
223
|
+
createdAt?: Date | string;
|
224
|
+
updatedAt?: Date | string;
|
338
225
|
}
|
339
226
|
|
340
|
-
|
227
|
+
declare const pathStrings: {
|
228
|
+
readonly clients: () => string;
|
229
|
+
readonly client: (clientId: string) => string;
|
230
|
+
readonly applications: (clientId: string) => string;
|
231
|
+
readonly application: (clientId: string, applicationId: string) => string;
|
232
|
+
readonly users: () => string;
|
233
|
+
readonly user: (userId: string) => string;
|
234
|
+
readonly vacancies: () => string;
|
235
|
+
readonly vacancy: (vacancyId: string) => string;
|
236
|
+
readonly agents: () => string;
|
237
|
+
readonly agent: (agentId: string) => string;
|
238
|
+
readonly clientQuestions: (clientId: string) => string;
|
239
|
+
readonly clientQuestion: (clientId: string, questionId: string) => string;
|
240
|
+
readonly clientData: () => string;
|
241
|
+
readonly clientDataItem: (clientDataId: string) => string;
|
242
|
+
readonly clientLogins: (userId: string) => string;
|
243
|
+
readonly clientLogin: (userId: string, domain: string) => string;
|
244
|
+
readonly applicationQuestions: (clientId: string, applicationId: string) => string;
|
245
|
+
readonly applicationQuestion: (clientId: string, applicationId: string, questionId: string) => string;
|
246
|
+
readonly vacancySuggestions: (clientId: string) => string;
|
247
|
+
readonly vacancySuggestion: (clientId: string, suggestionId: string) => string;
|
248
|
+
readonly gmailMessages: (clientId: string) => string;
|
249
|
+
readonly gmailMessage: (clientId: string, messageId: string) => string;
|
250
|
+
};
|
251
|
+
|
252
|
+
export { Agent, Application, ApplicationQuestion, ApplicationQuestionType, ApplicationQuestionTypeOptions, ApplicationStatus, AuthUser, Client, ClientData, ClientLogin, ClientQuestion, ClientQuestionType, ClientQuestionTypeOptions, GmailMessage, Vacancy, VacancyCategory, VacancySuggestion, pathStrings };
|