@jobsearch-works/firestore-models 2.3.0 → 2.4.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/dist/index.d.mts CHANGED
@@ -529,6 +529,13 @@ interface Agent {
529
529
  readonly updatedAt?: Date | string;
530
530
  }
531
531
 
532
+ /**
533
+ * Document under authEmails/{authEmail}
534
+ */
535
+ interface AuthEmail {
536
+ UID: string;
537
+ }
538
+
532
539
  interface AuthUser {
533
540
  id?: string;
534
541
  email: string;
@@ -556,24 +563,6 @@ interface UserPublic {
556
563
  updatedAt?: Date | string;
557
564
  }
558
565
 
559
- interface VacancyExtractedForm {
560
- fields: VacancyExtractedField[];
561
- formSelector: string;
562
- submitButtonSelector: string;
563
- url: string;
564
- extractedAt: Date | string;
565
- }
566
- interface VacancyExtractedField {
567
- id?: string;
568
- type: string;
569
- name: string;
570
- label: string;
571
- selector: string;
572
- options: string[] | null;
573
- required: boolean;
574
- value?: string;
575
- }
576
-
577
566
  declare const VacancyCategory: {
578
567
  readonly Accounting: "Accounting";
579
568
  readonly AdministrationAndOfficeSupport: "Administration & Office Support";
@@ -621,7 +610,6 @@ interface Vacancy {
621
610
  jobId: string;
622
611
  category: VacancyCategory;
623
612
  suggestedTo?: string[];
624
- extractedForm?: VacancyExtractedForm;
625
613
  createdAt?: Date | string;
626
614
  updatedAt?: Date | string;
627
615
  }
@@ -634,34 +622,6 @@ interface VacancySuggestion {
634
622
  createdAt?: Date | string;
635
623
  }
636
624
 
637
- /**
638
- * Document under authEmails/{authEmail}
639
- */
640
- interface AuthEmail {
641
- UID: string;
642
- }
643
-
644
- interface ApplicationEnrichedForm {
645
- fields: ApplicationEnrichedField[];
646
- formSelector: string;
647
- submitButtonSelector: string;
648
- url: string;
649
- enrichedAt: Date | string;
650
- }
651
- interface ApplicationEnrichedField {
652
- id: string;
653
- name: string;
654
- label: string;
655
- type: string;
656
- value: string;
657
- confidence: number;
658
- response?: string;
659
- selector?: string;
660
- required?: boolean;
661
- options?: string[] | null;
662
- needsClientReview?: boolean;
663
- }
664
-
665
625
  declare const ApplicationStatus: {
666
626
  readonly New: "new";
667
627
  readonly Submitted: "submitted";
@@ -690,7 +650,6 @@ interface Application {
690
650
  applyingAt?: Date | string;
691
651
  suggestedAt?: Date | string;
692
652
  approvedAt?: Date | string;
693
- enrichedForm?: ApplicationEnrichedForm;
694
653
  company?: string;
695
654
  position?: string;
696
655
  location?: string;
@@ -714,6 +673,8 @@ interface ApplicationQuestion {
714
673
  type: ApplicationQuestionType;
715
674
  createdAt?: Date | string;
716
675
  updatedAt?: Date | string;
676
+ selector?: string;
677
+ action?: string;
717
678
  }
718
679
 
719
680
  interface ClientLanguage {
@@ -801,6 +762,9 @@ interface ClientPersonalData {
801
762
  countryPhoneCode: string;
802
763
  nationality: string;
803
764
  dateOfBirth?: Date | string;
765
+ ethnicity?: string;
766
+ disabilityStatus?: string;
767
+ securityClearance?: string;
804
768
  createdAt?: Date | string;
805
769
  updatedAt?: Date | string;
806
770
  }
@@ -851,28 +815,6 @@ interface ClientInitialQuestion {
851
815
  answerText: string;
852
816
  }
853
817
 
854
- /**
855
- * Subcollection document under Client
856
- * Path: clients/{clientId}/applications/{applicationId}/virtualInterview/{interviewId}
857
- * @see Client - Parent document
858
- * @see Application - Related application
859
- */
860
- interface ClientVirtualInterview {
861
- readonly id?: string;
862
- jobTitle: string;
863
- company: string;
864
- role: string;
865
- date: string;
866
- clientId: string;
867
- messages: Array<{
868
- sender: 'user' | 'interviewer' | 'feedback';
869
- text: string;
870
- timestamp: string;
871
- duration?: number;
872
- audioUrl?: string;
873
- }>;
874
- }
875
-
876
818
  /**
877
819
  * Subcollection document under Client
878
820
  * Path: clients/{clientId}/logins/{docId}
@@ -949,6 +891,28 @@ interface ClientResume {
949
891
  }>;
950
892
  }
951
893
 
894
+ /**
895
+ * Subcollection document under Client
896
+ * Path: clients/{clientId}/applications/{applicationId}/virtualInterview/{interviewId}
897
+ * @see Client - Parent document
898
+ * @see Application - Related application
899
+ */
900
+ interface ClientVirtualInterview {
901
+ readonly id?: string;
902
+ jobTitle: string;
903
+ company: string;
904
+ role: string;
905
+ date: string;
906
+ clientId: string;
907
+ messages: Array<{
908
+ sender: 'user' | 'interviewer' | 'feedback';
909
+ text: string;
910
+ timestamp: string;
911
+ duration?: number;
912
+ audioUrl?: string;
913
+ }>;
914
+ }
915
+
952
916
  /**
953
917
  * Subcollection document under clients/{userId}/access_tokens/{provider}
954
918
  */
@@ -966,7 +930,8 @@ interface ClientAccessToken {
966
930
  * Subcollection document under clients/{userId}/emails/{emailId}
967
931
  * For new email structure
968
932
  */
969
- interface ClientEmailV2 {
933
+ type EmailCategory = "One Time Pin" | "Spam" | "Job Interview" | "Job Rejection" | "Require More Info" | "Job Suggestions" | "Uncategorised";
934
+ interface ClientEmail {
970
935
  bcc: string[];
971
936
  cc: string[];
972
937
  to: string[];
@@ -980,24 +945,7 @@ interface ClientEmailV2 {
980
945
  thread_id: string;
981
946
  timestamp: number;
982
947
  labels: string[];
983
- }
984
-
985
- /**
986
- * Subcollection document under clients/{userId}/emails/{emailId}/analysed/general
987
- */
988
- interface EmailAnalysedGeneral {
989
- category: string;
990
- date: string;
991
- job_response: boolean;
992
- suggested_action: string;
993
- }
994
-
995
- /**
996
- * Subcollection document under clients/{userId}/emails/{emailId}/analysed/classified
997
- * All fields are dynamic.
998
- */
999
- interface EmailAnalysedClassified {
1000
- [key: string]: any;
948
+ categories: EmailCategory[];
1001
949
  }
1002
950
 
1003
951
  type FirestoreTimestamp = {
@@ -1016,10 +964,6 @@ declare const firestorePaths: {
1016
964
  readonly emails: {
1017
965
  readonly collection: (clientId: string) => string;
1018
966
  readonly doc: (clientId: string, emailId: string) => string;
1019
- readonly analysed: {
1020
- readonly collection: (clientId: string, emailId: string) => string;
1021
- readonly doc: (clientId: string, emailId: string, analysedType: "general" | "classified") => string;
1022
- };
1023
967
  };
1024
968
  readonly questions: {
1025
969
  readonly collection: (clientId: string) => string;
@@ -1078,10 +1022,14 @@ declare const firestorePaths: {
1078
1022
  readonly collection: () => string;
1079
1023
  readonly doc: (id: string) => string;
1080
1024
  };
1025
+ readonly companies: {
1026
+ readonly collection: () => string;
1027
+ readonly doc: (companyId: string) => string;
1028
+ };
1081
1029
  readonly authEmails: {
1082
1030
  readonly collection: () => string;
1083
1031
  readonly doc: (authEmail: string) => string;
1084
1032
  };
1085
1033
  };
1086
1034
 
1087
- export { Agent, AgentStatus, Application, ApplicationEnrichedField, ApplicationEnrichedForm, ApplicationQuestion, ApplicationQuestionType, ApplicationQuestionTypeOptions, ApplicationStatus, AuthEmail, AuthUser, Client, ClientAccessToken, ClientCertifications, ClientEducation, ClientEmailV2, ClientGmailToken, ClientInitialQuestion, ClientJobPreferences, ClientLanguage, ClientLogin, ClientPersonalData, ClientQuestion, ClientResume, ClientSkill, ClientStatus, ClientVirtualInterview, ClientWebsitePreferences, ClientWorkExperience, EmailAnalysedClassified, EmailAnalysedGeneral, FirestoreTimestamp, JobCategory, JobTitle, LocationId, UserPublic, Vacancy, VacancyCategory, VacancyExtractedField, VacancyExtractedForm, VacancySuggestion, firestorePaths, jobClassifications, locations };
1035
+ export { Agent, AgentStatus, Application, ApplicationQuestion, ApplicationQuestionType, ApplicationQuestionTypeOptions, ApplicationStatus, AuthEmail, AuthUser, Client, ClientAccessToken, ClientCertifications, ClientEducation, ClientEmail, ClientGmailToken, ClientInitialQuestion, ClientJobPreferences, ClientLanguage, ClientLogin, ClientPersonalData, ClientQuestion, ClientResume, ClientSkill, ClientStatus, ClientVirtualInterview, ClientWebsitePreferences, ClientWorkExperience, EmailCategory, FirestoreTimestamp, JobCategory, JobTitle, LocationId, UserPublic, Vacancy, VacancyCategory, VacancySuggestion, firestorePaths, jobClassifications, locations };
package/dist/index.d.ts CHANGED
@@ -529,6 +529,13 @@ interface Agent {
529
529
  readonly updatedAt?: Date | string;
530
530
  }
531
531
 
532
+ /**
533
+ * Document under authEmails/{authEmail}
534
+ */
535
+ interface AuthEmail {
536
+ UID: string;
537
+ }
538
+
532
539
  interface AuthUser {
533
540
  id?: string;
534
541
  email: string;
@@ -556,24 +563,6 @@ interface UserPublic {
556
563
  updatedAt?: Date | string;
557
564
  }
558
565
 
559
- interface VacancyExtractedForm {
560
- fields: VacancyExtractedField[];
561
- formSelector: string;
562
- submitButtonSelector: string;
563
- url: string;
564
- extractedAt: Date | string;
565
- }
566
- interface VacancyExtractedField {
567
- id?: string;
568
- type: string;
569
- name: string;
570
- label: string;
571
- selector: string;
572
- options: string[] | null;
573
- required: boolean;
574
- value?: string;
575
- }
576
-
577
566
  declare const VacancyCategory: {
578
567
  readonly Accounting: "Accounting";
579
568
  readonly AdministrationAndOfficeSupport: "Administration & Office Support";
@@ -621,7 +610,6 @@ interface Vacancy {
621
610
  jobId: string;
622
611
  category: VacancyCategory;
623
612
  suggestedTo?: string[];
624
- extractedForm?: VacancyExtractedForm;
625
613
  createdAt?: Date | string;
626
614
  updatedAt?: Date | string;
627
615
  }
@@ -634,34 +622,6 @@ interface VacancySuggestion {
634
622
  createdAt?: Date | string;
635
623
  }
636
624
 
637
- /**
638
- * Document under authEmails/{authEmail}
639
- */
640
- interface AuthEmail {
641
- UID: string;
642
- }
643
-
644
- interface ApplicationEnrichedForm {
645
- fields: ApplicationEnrichedField[];
646
- formSelector: string;
647
- submitButtonSelector: string;
648
- url: string;
649
- enrichedAt: Date | string;
650
- }
651
- interface ApplicationEnrichedField {
652
- id: string;
653
- name: string;
654
- label: string;
655
- type: string;
656
- value: string;
657
- confidence: number;
658
- response?: string;
659
- selector?: string;
660
- required?: boolean;
661
- options?: string[] | null;
662
- needsClientReview?: boolean;
663
- }
664
-
665
625
  declare const ApplicationStatus: {
666
626
  readonly New: "new";
667
627
  readonly Submitted: "submitted";
@@ -690,7 +650,6 @@ interface Application {
690
650
  applyingAt?: Date | string;
691
651
  suggestedAt?: Date | string;
692
652
  approvedAt?: Date | string;
693
- enrichedForm?: ApplicationEnrichedForm;
694
653
  company?: string;
695
654
  position?: string;
696
655
  location?: string;
@@ -714,6 +673,8 @@ interface ApplicationQuestion {
714
673
  type: ApplicationQuestionType;
715
674
  createdAt?: Date | string;
716
675
  updatedAt?: Date | string;
676
+ selector?: string;
677
+ action?: string;
717
678
  }
718
679
 
719
680
  interface ClientLanguage {
@@ -801,6 +762,9 @@ interface ClientPersonalData {
801
762
  countryPhoneCode: string;
802
763
  nationality: string;
803
764
  dateOfBirth?: Date | string;
765
+ ethnicity?: string;
766
+ disabilityStatus?: string;
767
+ securityClearance?: string;
804
768
  createdAt?: Date | string;
805
769
  updatedAt?: Date | string;
806
770
  }
@@ -851,28 +815,6 @@ interface ClientInitialQuestion {
851
815
  answerText: string;
852
816
  }
853
817
 
854
- /**
855
- * Subcollection document under Client
856
- * Path: clients/{clientId}/applications/{applicationId}/virtualInterview/{interviewId}
857
- * @see Client - Parent document
858
- * @see Application - Related application
859
- */
860
- interface ClientVirtualInterview {
861
- readonly id?: string;
862
- jobTitle: string;
863
- company: string;
864
- role: string;
865
- date: string;
866
- clientId: string;
867
- messages: Array<{
868
- sender: 'user' | 'interviewer' | 'feedback';
869
- text: string;
870
- timestamp: string;
871
- duration?: number;
872
- audioUrl?: string;
873
- }>;
874
- }
875
-
876
818
  /**
877
819
  * Subcollection document under Client
878
820
  * Path: clients/{clientId}/logins/{docId}
@@ -949,6 +891,28 @@ interface ClientResume {
949
891
  }>;
950
892
  }
951
893
 
894
+ /**
895
+ * Subcollection document under Client
896
+ * Path: clients/{clientId}/applications/{applicationId}/virtualInterview/{interviewId}
897
+ * @see Client - Parent document
898
+ * @see Application - Related application
899
+ */
900
+ interface ClientVirtualInterview {
901
+ readonly id?: string;
902
+ jobTitle: string;
903
+ company: string;
904
+ role: string;
905
+ date: string;
906
+ clientId: string;
907
+ messages: Array<{
908
+ sender: 'user' | 'interviewer' | 'feedback';
909
+ text: string;
910
+ timestamp: string;
911
+ duration?: number;
912
+ audioUrl?: string;
913
+ }>;
914
+ }
915
+
952
916
  /**
953
917
  * Subcollection document under clients/{userId}/access_tokens/{provider}
954
918
  */
@@ -966,7 +930,8 @@ interface ClientAccessToken {
966
930
  * Subcollection document under clients/{userId}/emails/{emailId}
967
931
  * For new email structure
968
932
  */
969
- interface ClientEmailV2 {
933
+ type EmailCategory = "One Time Pin" | "Spam" | "Job Interview" | "Job Rejection" | "Require More Info" | "Job Suggestions" | "Uncategorised";
934
+ interface ClientEmail {
970
935
  bcc: string[];
971
936
  cc: string[];
972
937
  to: string[];
@@ -980,24 +945,7 @@ interface ClientEmailV2 {
980
945
  thread_id: string;
981
946
  timestamp: number;
982
947
  labels: string[];
983
- }
984
-
985
- /**
986
- * Subcollection document under clients/{userId}/emails/{emailId}/analysed/general
987
- */
988
- interface EmailAnalysedGeneral {
989
- category: string;
990
- date: string;
991
- job_response: boolean;
992
- suggested_action: string;
993
- }
994
-
995
- /**
996
- * Subcollection document under clients/{userId}/emails/{emailId}/analysed/classified
997
- * All fields are dynamic.
998
- */
999
- interface EmailAnalysedClassified {
1000
- [key: string]: any;
948
+ categories: EmailCategory[];
1001
949
  }
1002
950
 
1003
951
  type FirestoreTimestamp = {
@@ -1016,10 +964,6 @@ declare const firestorePaths: {
1016
964
  readonly emails: {
1017
965
  readonly collection: (clientId: string) => string;
1018
966
  readonly doc: (clientId: string, emailId: string) => string;
1019
- readonly analysed: {
1020
- readonly collection: (clientId: string, emailId: string) => string;
1021
- readonly doc: (clientId: string, emailId: string, analysedType: "general" | "classified") => string;
1022
- };
1023
967
  };
1024
968
  readonly questions: {
1025
969
  readonly collection: (clientId: string) => string;
@@ -1078,10 +1022,14 @@ declare const firestorePaths: {
1078
1022
  readonly collection: () => string;
1079
1023
  readonly doc: (id: string) => string;
1080
1024
  };
1025
+ readonly companies: {
1026
+ readonly collection: () => string;
1027
+ readonly doc: (companyId: string) => string;
1028
+ };
1081
1029
  readonly authEmails: {
1082
1030
  readonly collection: () => string;
1083
1031
  readonly doc: (authEmail: string) => string;
1084
1032
  };
1085
1033
  };
1086
1034
 
1087
- export { Agent, AgentStatus, Application, ApplicationEnrichedField, ApplicationEnrichedForm, ApplicationQuestion, ApplicationQuestionType, ApplicationQuestionTypeOptions, ApplicationStatus, AuthEmail, AuthUser, Client, ClientAccessToken, ClientCertifications, ClientEducation, ClientEmailV2, ClientGmailToken, ClientInitialQuestion, ClientJobPreferences, ClientLanguage, ClientLogin, ClientPersonalData, ClientQuestion, ClientResume, ClientSkill, ClientStatus, ClientVirtualInterview, ClientWebsitePreferences, ClientWorkExperience, EmailAnalysedClassified, EmailAnalysedGeneral, FirestoreTimestamp, JobCategory, JobTitle, LocationId, UserPublic, Vacancy, VacancyCategory, VacancyExtractedField, VacancyExtractedForm, VacancySuggestion, firestorePaths, jobClassifications, locations };
1035
+ export { Agent, AgentStatus, Application, ApplicationQuestion, ApplicationQuestionType, ApplicationQuestionTypeOptions, ApplicationStatus, AuthEmail, AuthUser, Client, ClientAccessToken, ClientCertifications, ClientEducation, ClientEmail, ClientGmailToken, ClientInitialQuestion, ClientJobPreferences, ClientLanguage, ClientLogin, ClientPersonalData, ClientQuestion, ClientResume, ClientSkill, ClientStatus, ClientVirtualInterview, ClientWebsitePreferences, ClientWorkExperience, EmailCategory, FirestoreTimestamp, JobCategory, JobTitle, LocationId, UserPublic, Vacancy, VacancyCategory, VacancySuggestion, firestorePaths, jobClassifications, locations };
package/dist/index.js CHANGED
@@ -1071,11 +1071,7 @@ var firestorePaths = {
1071
1071
  },
1072
1072
  emails: {
1073
1073
  collection: (clientId) => `clients/${clientId}/emails`,
1074
- doc: (clientId, emailId) => `clients/${clientId}/emails/${emailId}`,
1075
- analysed: {
1076
- collection: (clientId, emailId) => `clients/${clientId}/emails/${emailId}/analysed`,
1077
- doc: (clientId, emailId, analysedType) => `clients/${clientId}/emails/${emailId}/analysed/${analysedType}`
1078
- }
1074
+ doc: (clientId, emailId) => `clients/${clientId}/emails/${emailId}`
1079
1075
  },
1080
1076
  questions: {
1081
1077
  collection: (clientId) => `clients/${clientId}/questions`,
@@ -1134,6 +1130,10 @@ var firestorePaths = {
1134
1130
  collection: () => "agents",
1135
1131
  doc: (id) => `agents/${id}`
1136
1132
  },
1133
+ companies: {
1134
+ collection: () => "companies",
1135
+ doc: (companyId) => `companies/${companyId}`
1136
+ },
1137
1137
  authEmails: {
1138
1138
  collection: () => "authEmails",
1139
1139
  doc: (authEmail) => `authEmails/${authEmail}`
package/dist/index.mjs CHANGED
@@ -1040,11 +1040,7 @@ var firestorePaths = {
1040
1040
  },
1041
1041
  emails: {
1042
1042
  collection: (clientId) => `clients/${clientId}/emails`,
1043
- doc: (clientId, emailId) => `clients/${clientId}/emails/${emailId}`,
1044
- analysed: {
1045
- collection: (clientId, emailId) => `clients/${clientId}/emails/${emailId}/analysed`,
1046
- doc: (clientId, emailId, analysedType) => `clients/${clientId}/emails/${emailId}/analysed/${analysedType}`
1047
- }
1043
+ doc: (clientId, emailId) => `clients/${clientId}/emails/${emailId}`
1048
1044
  },
1049
1045
  questions: {
1050
1046
  collection: (clientId) => `clients/${clientId}/questions`,
@@ -1103,6 +1099,10 @@ var firestorePaths = {
1103
1099
  collection: () => "agents",
1104
1100
  doc: (id) => `agents/${id}`
1105
1101
  },
1102
+ companies: {
1103
+ collection: () => "companies",
1104
+ doc: (companyId) => `companies/${companyId}`
1105
+ },
1106
1106
  authEmails: {
1107
1107
  collection: () => "authEmails",
1108
1108
  doc: (authEmail) => `authEmails/${authEmail}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobsearch-works/firestore-models",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
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",