@jobsearch-works/firestore-models 1.0.23 → 1.0.25

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/dist/index.d.mts CHANGED
@@ -28,7 +28,18 @@ declare namespace Application {
28
28
  description?: string;
29
29
  fullPageText?: string;
30
30
  }
31
- type Status = "new" | "submitted" | "interviewing" | "accepted" | "rejected" | "withdrawn" | "applying" | "suggested" | "approved";
31
+ const Status: {
32
+ readonly New: "new";
33
+ readonly Submitted: "submitted";
34
+ readonly Interviewing: "interviewing";
35
+ readonly Accepted: "accepted";
36
+ readonly Rejected: "rejected";
37
+ readonly Withdrawn: "withdrawn";
38
+ readonly Applying: "applying";
39
+ readonly Suggested: "suggested";
40
+ readonly Approved: "approved";
41
+ };
42
+ type Status = (typeof Status)[keyof typeof Status];
32
43
  const StatusOptions: readonly Status[];
33
44
  const collection: (clientId: string) => string;
34
45
  const document: (clientId: string, applicationId: string) => string;
@@ -260,4 +271,20 @@ declare namespace VacancySuggestion {
260
271
  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;
261
272
  }
262
273
 
263
- export { Application, AuthUser, AuthUserCollectionPath, AuthUserUtils, Client, ClientData, ClientLogin, ClientQuestion, Vacancy, VacancySuggestion, getAuthUserDocumentPath };
274
+ declare namespace ApplicationQuestion {
275
+ /**
276
+ * Represents a question and answer for a job application
277
+ */
278
+ interface Model extends BaseModel {
279
+ questionText: string;
280
+ answerText?: string;
281
+ type: Type;
282
+ }
283
+ type Type = "text" | "select";
284
+ const TypeOptions: readonly Type[];
285
+ const collection: (clientId: string, applicationId: string) => string;
286
+ const document: (clientId: string, applicationId: string, questionId: string) => string;
287
+ const createNew: (questionText: string, type: Type, answerText?: string) => ApplicationQuestion.Model;
288
+ }
289
+
290
+ export { Application, ApplicationQuestion, AuthUser, AuthUserCollectionPath, AuthUserUtils, Client, ClientData, ClientLogin, ClientQuestion, Vacancy, VacancySuggestion, getAuthUserDocumentPath };
package/dist/index.d.ts CHANGED
@@ -28,7 +28,18 @@ declare namespace Application {
28
28
  description?: string;
29
29
  fullPageText?: string;
30
30
  }
31
- type Status = "new" | "submitted" | "interviewing" | "accepted" | "rejected" | "withdrawn" | "applying" | "suggested" | "approved";
31
+ const Status: {
32
+ readonly New: "new";
33
+ readonly Submitted: "submitted";
34
+ readonly Interviewing: "interviewing";
35
+ readonly Accepted: "accepted";
36
+ readonly Rejected: "rejected";
37
+ readonly Withdrawn: "withdrawn";
38
+ readonly Applying: "applying";
39
+ readonly Suggested: "suggested";
40
+ readonly Approved: "approved";
41
+ };
42
+ type Status = (typeof Status)[keyof typeof Status];
32
43
  const StatusOptions: readonly Status[];
33
44
  const collection: (clientId: string) => string;
34
45
  const document: (clientId: string, applicationId: string) => string;
@@ -260,4 +271,20 @@ declare namespace VacancySuggestion {
260
271
  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;
261
272
  }
262
273
 
263
- export { Application, AuthUser, AuthUserCollectionPath, AuthUserUtils, Client, ClientData, ClientLogin, ClientQuestion, Vacancy, VacancySuggestion, getAuthUserDocumentPath };
274
+ declare namespace ApplicationQuestion {
275
+ /**
276
+ * Represents a question and answer for a job application
277
+ */
278
+ interface Model extends BaseModel {
279
+ questionText: string;
280
+ answerText?: string;
281
+ type: Type;
282
+ }
283
+ type Type = "text" | "select";
284
+ const TypeOptions: readonly Type[];
285
+ const collection: (clientId: string, applicationId: string) => string;
286
+ const document: (clientId: string, applicationId: string, questionId: string) => string;
287
+ const createNew: (questionText: string, type: Type, answerText?: string) => ApplicationQuestion.Model;
288
+ }
289
+
290
+ export { Application, ApplicationQuestion, AuthUser, AuthUserCollectionPath, AuthUserUtils, Client, ClientData, ClientLogin, ClientQuestion, Vacancy, VacancySuggestion, getAuthUserDocumentPath };
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var src_exports = {};
22
22
  __export(src_exports, {
23
23
  Application: () => Application,
24
+ ApplicationQuestion: () => ApplicationQuestion,
24
25
  AuthUserCollectionPath: () => AuthUserCollectionPath,
25
26
  AuthUserUtils: () => AuthUserUtils,
26
27
  Client: () => Client,
@@ -36,17 +37,18 @@ module.exports = __toCommonJS(src_exports);
36
37
  // src/models/Application.ts
37
38
  var Application;
38
39
  ((Application2) => {
39
- Application2.StatusOptions = [
40
- "new",
41
- "submitted",
42
- "interviewing",
43
- "accepted",
44
- "rejected",
45
- "withdrawn",
46
- "applying",
47
- "suggested",
48
- "approved"
49
- ];
40
+ Application2.Status = {
41
+ New: "new",
42
+ Submitted: "submitted",
43
+ Interviewing: "interviewing",
44
+ Accepted: "accepted",
45
+ Rejected: "rejected",
46
+ Withdrawn: "withdrawn",
47
+ Applying: "applying",
48
+ Suggested: "suggested",
49
+ Approved: "approved"
50
+ };
51
+ Application2.StatusOptions = Object.values(Application2.Status);
50
52
  Application2.collection = (clientId) => `clients/${clientId}/applications`;
51
53
  Application2.document = (clientId, applicationId) => `clients/${clientId}/applications/${applicationId}`;
52
54
  Application2.formatSummary = (application) => {
@@ -328,9 +330,26 @@ var VacancySuggestion;
328
330
  };
329
331
  };
330
332
  })(VacancySuggestion || (VacancySuggestion = {}));
333
+
334
+ // src/models/ApplicationQuestion.ts
335
+ var ApplicationQuestion;
336
+ ((ApplicationQuestion2) => {
337
+ ApplicationQuestion2.TypeOptions = ["text", "select"];
338
+ ApplicationQuestion2.collection = (clientId, applicationId) => `clients/${clientId}/applications/${applicationId}/questions`;
339
+ ApplicationQuestion2.document = (clientId, applicationId, questionId) => `clients/${clientId}/applications/${applicationId}/questions/${questionId}`;
340
+ ApplicationQuestion2.createNew = (questionText, type, answerText) => {
341
+ return {
342
+ questionText,
343
+ type,
344
+ answerText,
345
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
346
+ };
347
+ };
348
+ })(ApplicationQuestion || (ApplicationQuestion = {}));
331
349
  // Annotate the CommonJS export names for ESM import in node:
332
350
  0 && (module.exports = {
333
351
  Application,
352
+ ApplicationQuestion,
334
353
  AuthUserCollectionPath,
335
354
  AuthUserUtils,
336
355
  Client,
package/dist/index.mjs CHANGED
@@ -1,17 +1,18 @@
1
1
  // src/models/Application.ts
2
2
  var Application;
3
3
  ((Application2) => {
4
- Application2.StatusOptions = [
5
- "new",
6
- "submitted",
7
- "interviewing",
8
- "accepted",
9
- "rejected",
10
- "withdrawn",
11
- "applying",
12
- "suggested",
13
- "approved"
14
- ];
4
+ Application2.Status = {
5
+ New: "new",
6
+ Submitted: "submitted",
7
+ Interviewing: "interviewing",
8
+ Accepted: "accepted",
9
+ Rejected: "rejected",
10
+ Withdrawn: "withdrawn",
11
+ Applying: "applying",
12
+ Suggested: "suggested",
13
+ Approved: "approved"
14
+ };
15
+ Application2.StatusOptions = Object.values(Application2.Status);
15
16
  Application2.collection = (clientId) => `clients/${clientId}/applications`;
16
17
  Application2.document = (clientId, applicationId) => `clients/${clientId}/applications/${applicationId}`;
17
18
  Application2.formatSummary = (application) => {
@@ -293,8 +294,25 @@ var VacancySuggestion;
293
294
  };
294
295
  };
295
296
  })(VacancySuggestion || (VacancySuggestion = {}));
297
+
298
+ // src/models/ApplicationQuestion.ts
299
+ var ApplicationQuestion;
300
+ ((ApplicationQuestion2) => {
301
+ ApplicationQuestion2.TypeOptions = ["text", "select"];
302
+ ApplicationQuestion2.collection = (clientId, applicationId) => `clients/${clientId}/applications/${applicationId}/questions`;
303
+ ApplicationQuestion2.document = (clientId, applicationId, questionId) => `clients/${clientId}/applications/${applicationId}/questions/${questionId}`;
304
+ ApplicationQuestion2.createNew = (questionText, type, answerText) => {
305
+ return {
306
+ questionText,
307
+ type,
308
+ answerText,
309
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
310
+ };
311
+ };
312
+ })(ApplicationQuestion || (ApplicationQuestion = {}));
296
313
  export {
297
314
  Application,
315
+ ApplicationQuestion,
298
316
  AuthUserCollectionPath,
299
317
  AuthUserUtils,
300
318
  Client,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobsearch-works/firestore-models",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
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",