@jobsearch-works/firestore-models 1.0.32 → 1.0.34
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 -305
- package/dist/index.d.ts +225 -305
- package/dist/index.js +97 -378
- package/dist/index.mjs +92 -367
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -1,332 +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
|
-
company?: string;
|
51
|
-
position?: string;
|
52
|
-
location?: string;
|
53
|
-
jobId?: string;
|
54
|
-
advertisingUrl?: string;
|
55
|
-
applicationUrl?: string;
|
56
|
-
applicationDomain?: string;
|
57
|
-
advertisingDomain?: string;
|
58
|
-
description?: string;
|
59
|
-
fullPageText?: string;
|
60
|
-
}) => Application.Model;
|
61
|
-
const updateStatus: (application: Application.Model, newStatus: Application.Model["status"]) => Application.Model;
|
62
|
-
}
|
63
|
-
|
64
|
-
declare namespace AuthUser {
|
65
|
-
export interface Model extends BaseModel {
|
66
|
-
email: string;
|
67
|
-
displayName?: string;
|
68
|
-
photoURL?: string;
|
69
|
-
lastSignIn?: string;
|
70
|
-
emailVerified?: boolean;
|
71
|
-
}
|
72
|
-
interface FirestoreTimestamp {
|
73
|
-
seconds: number;
|
74
|
-
nanoseconds: number;
|
75
|
-
_firestore_timestamp?: boolean;
|
76
|
-
}
|
77
|
-
export const collection: () => string;
|
78
|
-
export const document: (userId: string) => string;
|
79
|
-
export const getTimestampFields: () => (keyof Model)[];
|
80
|
-
export const isFirestoreTimestamp: (value: any) => value is FirestoreTimestamp;
|
81
|
-
export const fromFirebaseUser: (user: any) => Model;
|
82
|
-
export const format: (user: Model) => string;
|
83
|
-
export const formatDates: (user: Model) => {
|
84
|
-
lastSignIn: string;
|
85
|
-
createdAt: string;
|
86
|
-
updatedAt?: string;
|
87
|
-
};
|
88
|
-
export const toFirestore: (user: Model) => Record<string, any>;
|
89
|
-
export const fromFirestore: (data: Record<string, any>) => Model;
|
90
|
-
export const createNew: (email: string, displayName?: string, photoURL?: string) => Model;
|
91
|
-
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;
|
92
50
|
}
|
93
51
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
const formatClient: (client: Client.Model) => string;
|
104
|
-
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;
|
105
61
|
}
|
106
62
|
|
107
|
-
declare
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
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;
|
133
112
|
}
|
134
113
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
username?: string;
|
144
|
-
password: string;
|
145
|
-
email?: string;
|
146
|
-
}
|
147
|
-
const collection: (userId: string) => string;
|
148
|
-
const document: (userId: string, domain: string) => string;
|
149
|
-
const formatClientLogin: (clientLogin: ClientLogin.Model) => string;
|
150
|
-
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;
|
151
122
|
}
|
152
123
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
type Type = "text" | "select";
|
164
|
-
const TypeOptions: readonly Type[];
|
165
|
-
const collection: (clientId: string) => string;
|
166
|
-
const document: (clientId: string, questionId: string) => string;
|
167
|
-
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;
|
168
134
|
}
|
169
135
|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
readonly HospitalityAndTourism: "Hospitality & Tourism";
|
191
|
-
readonly HumanResourcesAndRecruitment: "Human Resources & Recruitment";
|
192
|
-
readonly InformationAndCommunicationTechnology: "Information & Communication Technology";
|
193
|
-
readonly InsuranceAndSuperannuation: "Insurance & Superannuation";
|
194
|
-
readonly Legal: "Legal";
|
195
|
-
readonly ManufacturingTransportAndLogistics: "Manufacturing, Transport & Logistics";
|
196
|
-
readonly MarketingAndCommunications: "Marketing & Communications";
|
197
|
-
readonly MiningResourcesAndEnergy: "Mining, Resources & Energy";
|
198
|
-
readonly RealEstateAndProperty: "Real Estate & Property";
|
199
|
-
readonly RetailAndConsumerProducts: "Retail & Consumer Products";
|
200
|
-
readonly Sales: "Sales";
|
201
|
-
readonly ScienceAndTechnology: "Science & Technology";
|
202
|
-
readonly SelfEmployment: "Self Employment";
|
203
|
-
readonly SportAndRecreation: "Sport & Recreation";
|
204
|
-
readonly TradesAndServices: "Trades & Services";
|
205
|
-
};
|
206
|
-
/**
|
207
|
-
* Type representing a valid category value.
|
208
|
-
*/
|
209
|
-
type Category = (typeof Category)[keyof typeof Category];
|
210
|
-
/**
|
211
|
-
* Vacancy model definition.
|
212
|
-
*/
|
213
|
-
interface Model extends BaseModel {
|
214
|
-
company: string;
|
215
|
-
position: string;
|
216
|
-
location: string;
|
217
|
-
description: string;
|
218
|
-
advertisingUrl: string;
|
219
|
-
applicationUrl: string;
|
220
|
-
applicationDomain: string;
|
221
|
-
advertisingDomain: string;
|
222
|
-
fullPageText: string;
|
223
|
-
jobId: string;
|
224
|
-
category: Category;
|
225
|
-
suggestedTo?: string[];
|
226
|
-
}
|
227
|
-
/**
|
228
|
-
* Returns the Firestore collection path for vacancies.
|
229
|
-
*/
|
230
|
-
const collection: () => string;
|
231
|
-
/**
|
232
|
-
* Returns the Firestore document path for a specific vacancy.
|
233
|
-
*/
|
234
|
-
const document: (vacancyId: string) => string;
|
235
|
-
/**
|
236
|
-
* Formats a short summary of a vacancy.
|
237
|
-
*/
|
238
|
-
const formatSummary: (vacancy: Vacancy.Model) => string;
|
239
|
-
/**
|
240
|
-
* Formats a date into a localized string.
|
241
|
-
*/
|
242
|
-
const formatDate: (date: Date | string) => string;
|
243
|
-
/**
|
244
|
-
* Creates a new Vacancy.Model with the given data.
|
245
|
-
*/
|
246
|
-
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;
|
247
156
|
}
|
248
157
|
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
location: string;
|
260
|
-
description: string;
|
261
|
-
advertisingUrl: string;
|
262
|
-
applicationUrl: string;
|
263
|
-
applicationDomain: string;
|
264
|
-
advertisingDomain: string;
|
265
|
-
fullPageText: string;
|
266
|
-
jobId: string;
|
267
|
-
category: Vacancy.Category;
|
268
|
-
}
|
269
|
-
const collection: (clientId: string) => string;
|
270
|
-
const document: (clientId: string, suggestionId: string) => string;
|
271
|
-
const formatSummary: (suggestion: VacancySuggestion.Model) => string;
|
272
|
-
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;
|
273
168
|
}
|
274
169
|
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
type Type = "text" | "select";
|
285
|
-
const TypeOptions: readonly Type[];
|
286
|
-
const collection: (clientId: string, applicationId: string) => string;
|
287
|
-
const document: (clientId: string, applicationId: string, questionId: string) => string;
|
288
|
-
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;
|
289
179
|
}
|
290
180
|
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
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;
|
302
199
|
}
|
303
200
|
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
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;
|
316
218
|
body?: {
|
317
219
|
data?: string;
|
318
220
|
};
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
};
|
324
|
-
}>;
|
325
|
-
};
|
326
|
-
}
|
327
|
-
const collection: (clientId: string) => string;
|
328
|
-
const document: (clientId: string, messageId: string) => string;
|
329
|
-
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;
|
330
225
|
}
|
331
226
|
|
332
|
-
|
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 };
|