@jobsearch-works/firestore-models 2.2.5 → 2.3.1

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
@@ -634,6 +634,13 @@ interface VacancySuggestion {
634
634
  createdAt?: Date | string;
635
635
  }
636
636
 
637
+ /**
638
+ * Document under authEmails/{authEmail}
639
+ */
640
+ interface AuthEmail {
641
+ UID: string;
642
+ }
643
+
637
644
  interface ApplicationEnrichedForm {
638
645
  fields: ApplicationEnrichedField[];
639
646
  formSelector: string;
@@ -820,37 +827,6 @@ interface Client {
820
827
  readonly createdAt?: Date | string;
821
828
  }
822
829
 
823
- /**
824
- * Subcollection document under Client
825
- * Path: clients/{clientId}/emails/{docId}
826
- * @see Client - Parent document
827
- */
828
- interface ClientEmail {
829
- id?: string;
830
- messageId: string;
831
- threadId?: string;
832
- labelIds?: string[];
833
- snippet?: string;
834
- internalDate?: string;
835
- payload?: {
836
- headers?: Array<{
837
- name: string;
838
- value: string;
839
- }>;
840
- body?: {
841
- data?: string;
842
- };
843
- parts?: Array<{
844
- mimeType?: string;
845
- body?: {
846
- data?: string;
847
- };
848
- }>;
849
- };
850
- createdAt?: Date | string;
851
- updatedAt?: Date | string;
852
- }
853
-
854
830
  /**
855
831
  * Subcollection document under Client
856
832
  * Path: clients/{clientId}/gmailTokens/{docId}
@@ -877,7 +853,7 @@ interface ClientInitialQuestion {
877
853
 
878
854
  /**
879
855
  * Subcollection document under Client
880
- * Path: clients/{clientId}/applications/{applicationId}/virtualinterview/{interviewId}
856
+ * Path: clients/{clientId}/applications/{applicationId}/virtualInterview/{interviewId}
881
857
  * @see Client - Parent document
882
858
  * @see Application - Related application
883
859
  */
@@ -973,6 +949,41 @@ interface ClientResume {
973
949
  }>;
974
950
  }
975
951
 
952
+ /**
953
+ * Subcollection document under clients/{userId}/access_tokens/{provider}
954
+ */
955
+ interface ClientAccessToken {
956
+ access_token: string;
957
+ auth_email: string;
958
+ created_at: Date | string;
959
+ gmail_watch_history_id: number;
960
+ refresh_token: string;
961
+ scope: string[];
962
+ token_type: string;
963
+ }
964
+
965
+ /**
966
+ * Subcollection document under clients/{userId}/emails/{emailId}
967
+ * For new email structure
968
+ */
969
+ type EmailCategory = "One Time Pin" | "Spam" | "Job Interview" | "Job Rejection" | "Require More Info" | "Job Suggestions" | "Uncategorised";
970
+ interface ClientEmail {
971
+ bcc: string[];
972
+ cc: string[];
973
+ to: string[];
974
+ from: string[];
975
+ date: string;
976
+ "html-content": string;
977
+ "text-content": string;
978
+ message_id: string;
979
+ snippet: string;
980
+ subject: string;
981
+ thread_id: string;
982
+ timestamp: number;
983
+ labels: string[];
984
+ categories: EmailCategory[];
985
+ }
986
+
976
987
  type FirestoreTimestamp = {
977
988
  seconds: number;
978
989
  nanoseconds: number;
@@ -982,7 +993,10 @@ declare const firestorePaths: {
982
993
  readonly clients: {
983
994
  readonly collection: () => string;
984
995
  readonly doc: (id: string) => string;
985
- readonly gmailTokens: (id: string) => string;
996
+ readonly accessTokens: {
997
+ readonly collection: (clientId: string) => string;
998
+ readonly doc: (clientId: string, providerName: string) => string;
999
+ };
986
1000
  readonly emails: {
987
1001
  readonly collection: (clientId: string) => string;
988
1002
  readonly doc: (clientId: string, emailId: string) => string;
@@ -1006,7 +1020,7 @@ declare const firestorePaths: {
1006
1020
  readonly applications: {
1007
1021
  readonly collection: (clientId: string) => string;
1008
1022
  readonly doc: (clientId: string, applicationId: string) => string;
1009
- readonly virtualinterview: {
1023
+ readonly virtualInterview: {
1010
1024
  readonly collection: (clientId: string, applicationId: string) => string;
1011
1025
  readonly doc: (clientId: string, applicationId: string, interviewId: string) => string;
1012
1026
  };
@@ -1044,6 +1058,10 @@ declare const firestorePaths: {
1044
1058
  readonly collection: () => string;
1045
1059
  readonly doc: (id: string) => string;
1046
1060
  };
1061
+ readonly authEmails: {
1062
+ readonly collection: () => string;
1063
+ readonly doc: (authEmail: string) => string;
1064
+ };
1047
1065
  };
1048
1066
 
1049
- export { Agent, AgentStatus, Application, ApplicationEnrichedField, ApplicationEnrichedForm, ApplicationQuestion, ApplicationQuestionType, ApplicationQuestionTypeOptions, ApplicationStatus, AuthUser, Client, ClientCertifications, ClientEducation, ClientEmail, ClientGmailToken, ClientInitialQuestion, ClientJobPreferences, ClientLanguage, ClientLogin, ClientPersonalData, ClientQuestion, ClientResume, ClientSkill, ClientStatus, ClientVirtualInterview, ClientWebsitePreferences, ClientWorkExperience, FirestoreTimestamp, JobCategory, JobTitle, LocationId, UserPublic, Vacancy, VacancyCategory, VacancyExtractedField, VacancyExtractedForm, VacancySuggestion, firestorePaths, jobClassifications, locations };
1067
+ export { Agent, AgentStatus, Application, ApplicationEnrichedField, ApplicationEnrichedForm, 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, VacancyExtractedField, VacancyExtractedForm, VacancySuggestion, firestorePaths, jobClassifications, locations };
package/dist/index.d.ts CHANGED
@@ -634,6 +634,13 @@ interface VacancySuggestion {
634
634
  createdAt?: Date | string;
635
635
  }
636
636
 
637
+ /**
638
+ * Document under authEmails/{authEmail}
639
+ */
640
+ interface AuthEmail {
641
+ UID: string;
642
+ }
643
+
637
644
  interface ApplicationEnrichedForm {
638
645
  fields: ApplicationEnrichedField[];
639
646
  formSelector: string;
@@ -820,37 +827,6 @@ interface Client {
820
827
  readonly createdAt?: Date | string;
821
828
  }
822
829
 
823
- /**
824
- * Subcollection document under Client
825
- * Path: clients/{clientId}/emails/{docId}
826
- * @see Client - Parent document
827
- */
828
- interface ClientEmail {
829
- id?: string;
830
- messageId: string;
831
- threadId?: string;
832
- labelIds?: string[];
833
- snippet?: string;
834
- internalDate?: string;
835
- payload?: {
836
- headers?: Array<{
837
- name: string;
838
- value: string;
839
- }>;
840
- body?: {
841
- data?: string;
842
- };
843
- parts?: Array<{
844
- mimeType?: string;
845
- body?: {
846
- data?: string;
847
- };
848
- }>;
849
- };
850
- createdAt?: Date | string;
851
- updatedAt?: Date | string;
852
- }
853
-
854
830
  /**
855
831
  * Subcollection document under Client
856
832
  * Path: clients/{clientId}/gmailTokens/{docId}
@@ -877,7 +853,7 @@ interface ClientInitialQuestion {
877
853
 
878
854
  /**
879
855
  * Subcollection document under Client
880
- * Path: clients/{clientId}/applications/{applicationId}/virtualinterview/{interviewId}
856
+ * Path: clients/{clientId}/applications/{applicationId}/virtualInterview/{interviewId}
881
857
  * @see Client - Parent document
882
858
  * @see Application - Related application
883
859
  */
@@ -973,6 +949,41 @@ interface ClientResume {
973
949
  }>;
974
950
  }
975
951
 
952
+ /**
953
+ * Subcollection document under clients/{userId}/access_tokens/{provider}
954
+ */
955
+ interface ClientAccessToken {
956
+ access_token: string;
957
+ auth_email: string;
958
+ created_at: Date | string;
959
+ gmail_watch_history_id: number;
960
+ refresh_token: string;
961
+ scope: string[];
962
+ token_type: string;
963
+ }
964
+
965
+ /**
966
+ * Subcollection document under clients/{userId}/emails/{emailId}
967
+ * For new email structure
968
+ */
969
+ type EmailCategory = "One Time Pin" | "Spam" | "Job Interview" | "Job Rejection" | "Require More Info" | "Job Suggestions" | "Uncategorised";
970
+ interface ClientEmail {
971
+ bcc: string[];
972
+ cc: string[];
973
+ to: string[];
974
+ from: string[];
975
+ date: string;
976
+ "html-content": string;
977
+ "text-content": string;
978
+ message_id: string;
979
+ snippet: string;
980
+ subject: string;
981
+ thread_id: string;
982
+ timestamp: number;
983
+ labels: string[];
984
+ categories: EmailCategory[];
985
+ }
986
+
976
987
  type FirestoreTimestamp = {
977
988
  seconds: number;
978
989
  nanoseconds: number;
@@ -982,7 +993,10 @@ declare const firestorePaths: {
982
993
  readonly clients: {
983
994
  readonly collection: () => string;
984
995
  readonly doc: (id: string) => string;
985
- readonly gmailTokens: (id: string) => string;
996
+ readonly accessTokens: {
997
+ readonly collection: (clientId: string) => string;
998
+ readonly doc: (clientId: string, providerName: string) => string;
999
+ };
986
1000
  readonly emails: {
987
1001
  readonly collection: (clientId: string) => string;
988
1002
  readonly doc: (clientId: string, emailId: string) => string;
@@ -1006,7 +1020,7 @@ declare const firestorePaths: {
1006
1020
  readonly applications: {
1007
1021
  readonly collection: (clientId: string) => string;
1008
1022
  readonly doc: (clientId: string, applicationId: string) => string;
1009
- readonly virtualinterview: {
1023
+ readonly virtualInterview: {
1010
1024
  readonly collection: (clientId: string, applicationId: string) => string;
1011
1025
  readonly doc: (clientId: string, applicationId: string, interviewId: string) => string;
1012
1026
  };
@@ -1044,6 +1058,10 @@ declare const firestorePaths: {
1044
1058
  readonly collection: () => string;
1045
1059
  readonly doc: (id: string) => string;
1046
1060
  };
1061
+ readonly authEmails: {
1062
+ readonly collection: () => string;
1063
+ readonly doc: (authEmail: string) => string;
1064
+ };
1047
1065
  };
1048
1066
 
1049
- export { Agent, AgentStatus, Application, ApplicationEnrichedField, ApplicationEnrichedForm, ApplicationQuestion, ApplicationQuestionType, ApplicationQuestionTypeOptions, ApplicationStatus, AuthUser, Client, ClientCertifications, ClientEducation, ClientEmail, ClientGmailToken, ClientInitialQuestion, ClientJobPreferences, ClientLanguage, ClientLogin, ClientPersonalData, ClientQuestion, ClientResume, ClientSkill, ClientStatus, ClientVirtualInterview, ClientWebsitePreferences, ClientWorkExperience, FirestoreTimestamp, JobCategory, JobTitle, LocationId, UserPublic, Vacancy, VacancyCategory, VacancyExtractedField, VacancyExtractedForm, VacancySuggestion, firestorePaths, jobClassifications, locations };
1067
+ export { Agent, AgentStatus, Application, ApplicationEnrichedField, ApplicationEnrichedForm, 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, VacancyExtractedField, VacancyExtractedForm, VacancySuggestion, firestorePaths, jobClassifications, locations };
package/dist/index.js CHANGED
@@ -1065,7 +1065,10 @@ var firestorePaths = {
1065
1065
  clients: {
1066
1066
  collection: () => "clients",
1067
1067
  doc: (id) => `clients/${id}`,
1068
- gmailTokens: (id) => `clients/${id}/gmailTokens`,
1068
+ accessTokens: {
1069
+ collection: (clientId) => `clients/${clientId}/access_tokens`,
1070
+ doc: (clientId, providerName) => `clients/${clientId}/access_tokens/${providerName}`
1071
+ },
1069
1072
  emails: {
1070
1073
  collection: (clientId) => `clients/${clientId}/emails`,
1071
1074
  doc: (clientId, emailId) => `clients/${clientId}/emails/${emailId}`
@@ -1089,9 +1092,9 @@ var firestorePaths = {
1089
1092
  applications: {
1090
1093
  collection: (clientId) => `clients/${clientId}/applications`,
1091
1094
  doc: (clientId, applicationId) => `clients/${clientId}/applications/${applicationId}`,
1092
- virtualinterview: {
1093
- collection: (clientId, applicationId) => `clients/${clientId}/applications/${applicationId}/virtualinterview`,
1094
- doc: (clientId, applicationId, interviewId) => `clients/${clientId}/applications/${applicationId}/virtualinterview/${interviewId}`
1095
+ virtualInterview: {
1096
+ collection: (clientId, applicationId) => `clients/${clientId}/applications/${applicationId}/virtualInterview`,
1097
+ doc: (clientId, applicationId, interviewId) => `clients/${clientId}/applications/${applicationId}/virtualInterview/${interviewId}`
1095
1098
  },
1096
1099
  questions: {
1097
1100
  collection: (clientId, applicationId) => `clients/${clientId}/applications/${applicationId}/questions`,
@@ -1126,6 +1129,10 @@ var firestorePaths = {
1126
1129
  agents: {
1127
1130
  collection: () => "agents",
1128
1131
  doc: (id) => `agents/${id}`
1132
+ },
1133
+ authEmails: {
1134
+ collection: () => "authEmails",
1135
+ doc: (authEmail) => `authEmails/${authEmail}`
1129
1136
  }
1130
1137
  };
1131
1138
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.mjs CHANGED
@@ -1034,7 +1034,10 @@ var firestorePaths = {
1034
1034
  clients: {
1035
1035
  collection: () => "clients",
1036
1036
  doc: (id) => `clients/${id}`,
1037
- gmailTokens: (id) => `clients/${id}/gmailTokens`,
1037
+ accessTokens: {
1038
+ collection: (clientId) => `clients/${clientId}/access_tokens`,
1039
+ doc: (clientId, providerName) => `clients/${clientId}/access_tokens/${providerName}`
1040
+ },
1038
1041
  emails: {
1039
1042
  collection: (clientId) => `clients/${clientId}/emails`,
1040
1043
  doc: (clientId, emailId) => `clients/${clientId}/emails/${emailId}`
@@ -1058,9 +1061,9 @@ var firestorePaths = {
1058
1061
  applications: {
1059
1062
  collection: (clientId) => `clients/${clientId}/applications`,
1060
1063
  doc: (clientId, applicationId) => `clients/${clientId}/applications/${applicationId}`,
1061
- virtualinterview: {
1062
- collection: (clientId, applicationId) => `clients/${clientId}/applications/${applicationId}/virtualinterview`,
1063
- doc: (clientId, applicationId, interviewId) => `clients/${clientId}/applications/${applicationId}/virtualinterview/${interviewId}`
1064
+ virtualInterview: {
1065
+ collection: (clientId, applicationId) => `clients/${clientId}/applications/${applicationId}/virtualInterview`,
1066
+ doc: (clientId, applicationId, interviewId) => `clients/${clientId}/applications/${applicationId}/virtualInterview/${interviewId}`
1064
1067
  },
1065
1068
  questions: {
1066
1069
  collection: (clientId, applicationId) => `clients/${clientId}/applications/${applicationId}/questions`,
@@ -1095,6 +1098,10 @@ var firestorePaths = {
1095
1098
  agents: {
1096
1099
  collection: () => "agents",
1097
1100
  doc: (id) => `agents/${id}`
1101
+ },
1102
+ authEmails: {
1103
+ collection: () => "authEmails",
1104
+ doc: (authEmail) => `authEmails/${authEmail}`
1098
1105
  }
1099
1106
  };
1100
1107
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobsearch-works/firestore-models",
3
- "version": "2.2.5",
3
+ "version": "2.3.1",
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",