@churchapps/helpers 1.1.8 → 1.2.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.
Files changed (40) hide show
  1. package/.eslintrc.json +29 -0
  2. package/.github/FUNDING.yml +1 -1
  3. package/.prettierrc +11 -11
  4. package/.yarnrc.yml +6 -0
  5. package/CLAUDE.md +97 -89
  6. package/LICENSE +21 -21
  7. package/README.md +15 -15
  8. package/dist/interfaces/Donation.d.ts +6 -0
  9. package/dist/interfaces/Donation.d.ts.map +1 -1
  10. package/dist/interfaces/Donation.js.map +1 -1
  11. package/package.json +55 -54
  12. package/scripts/build-cjs.js +32 -32
  13. package/src/ApiHelper.ts +176 -176
  14. package/src/AppearanceHelper.ts +69 -69
  15. package/src/ArrayHelper.ts +157 -157
  16. package/src/CommonEnvironmentHelper.ts +104 -104
  17. package/src/CurrencyHelper.ts +10 -10
  18. package/src/DateHelper.ts +153 -153
  19. package/src/DonationHelper.ts +26 -26
  20. package/src/ErrorHelper.ts +39 -39
  21. package/src/EventHelper.ts +49 -49
  22. package/src/FileHelper.ts +55 -55
  23. package/src/PersonHelper.ts +82 -82
  24. package/src/UniqueIdHelper.ts +36 -36
  25. package/src/UserHelper.ts +59 -59
  26. package/src/index.ts +15 -15
  27. package/src/interfaces/Access.ts +138 -138
  28. package/src/interfaces/Attendance.ts +45 -45
  29. package/src/interfaces/Content.ts +84 -84
  30. package/src/interfaces/Doing.ts +93 -93
  31. package/src/interfaces/Donation.ts +190 -183
  32. package/src/interfaces/Error.ts +17 -17
  33. package/src/interfaces/Membership.ts +184 -184
  34. package/src/interfaces/Messaging.ts +96 -96
  35. package/src/interfaces/Permissions.ts +92 -92
  36. package/src/interfaces/Reporting.ts +41 -41
  37. package/src/interfaces/UserContextInterface.ts +13 -13
  38. package/src/interfaces/index.ts +13 -13
  39. package/tsconfig.json +36 -36
  40. package/eslint.config.js +0 -33
@@ -1,82 +1,82 @@
1
- import { PersonInterface, ContactInfoInterface } from "./interfaces";
2
- import { CommonEnvironmentHelper } from "./CommonEnvironmentHelper";
3
-
4
- export class PersonHelper {
5
-
6
- public static getPhotoPath(churchId: string, person: any) {
7
- if (!person.photoUpdated) {
8
- if (person.id?.startsWith("PER0000")) return "https://app.staging.chums.org/images/demo/avatars/" + person.id + ".svg";
9
- else return "";
10
- }
11
- else return "/" + churchId + "/membership/people/" + person.id + ".png?dt=" + person.photoUpdated.getTime().toString();
12
- }
13
-
14
- static getPhotoUrl(person: PersonInterface) {
15
- if (!person?.photo) return "/images/sample-profile.png"
16
- else {
17
- return (person?.photo?.startsWith("data:image/png;base64,") || person.photo?.indexOf("://") > -1)
18
- ? person.photo
19
- : CommonEnvironmentHelper.ContentRoot + person.photo;
20
- }
21
- }
22
-
23
- static getAge(birthdate: Date): string {
24
- if (birthdate !== undefined && birthdate !== null) {
25
- let ageDifMs = Date.now() - new Date(birthdate).getTime();
26
- let ageDate = new Date(ageDifMs);
27
- let years = Math.abs(ageDate.getUTCFullYear() - 1970);
28
- return years + " years";
29
- }
30
- else return "";
31
- }
32
-
33
- public static getDisplayNameFromPerson(person: any) {
34
- if (person?.name?.nick !== null && person?.name?.nick !== "" && person?.name?.nick !== undefined) return person.name.first + " \"" + person.name.nick + "\" " + person.name.last;
35
- else return person.name.first + " " + person.name.last;
36
- }
37
-
38
- static getDisplayName(firstName: string, lastName: string, nickName: string): string {
39
- if (nickName !== undefined && nickName !== null && nickName.length > 0) return firstName + ' "' + nickName + '" ' + lastName;
40
- else return firstName + " " + lastName;
41
- }
42
-
43
- public static getBirthMonth(birthdate: Date): number {
44
- if (birthdate) return new Date(birthdate).getMonth() + 1;
45
- else return -1;
46
- }
47
-
48
- public static compareAddress(address1: ContactInfoInterface, address2: ContactInfoInterface): boolean {
49
- const displayAddress1: string = this.addressToString(address1).trim();
50
- const displayAddress2: string = this.addressToString(address2).trim();
51
-
52
- if (displayAddress1 !== displayAddress2) {
53
- return true
54
- }
55
- return false
56
- }
57
-
58
- public static addressToString(address: ContactInfoInterface): string {
59
- return `${address.address1 || ""} ${address.address2 || ""} ${address.city || ""}${(address.city && address.state) ? "," : ""} ${address.state || ""} ${address.zip || ""}`
60
- }
61
-
62
- public static changeOnlyAddress(contactInfo1: ContactInfoInterface, contactInfo2: ContactInfoInterface): ContactInfoInterface {
63
- const updatedAddress: ContactInfoInterface = {
64
- ...contactInfo1,
65
- address1: contactInfo2.address1,
66
- address2: contactInfo2.address2,
67
- city: contactInfo2.city,
68
- state: contactInfo2.state,
69
- zip: contactInfo2.zip
70
- }
71
-
72
- return updatedAddress
73
- }
74
-
75
- public static checkAddressAvailabilty(person: PersonInterface): boolean {
76
- const addressString: string = this.addressToString(person.contactInfo).trim();
77
- if (addressString !== "") {
78
- return true;
79
- }
80
- return false;
81
- }
82
- }
1
+ import { PersonInterface, ContactInfoInterface } from "./interfaces";
2
+ import { CommonEnvironmentHelper } from "./CommonEnvironmentHelper";
3
+
4
+ export class PersonHelper {
5
+
6
+ public static getPhotoPath(churchId: string, person: any) {
7
+ if (!person.photoUpdated) {
8
+ if (person.id?.startsWith("PER0000")) return "https://app.staging.chums.org/images/demo/avatars/" + person.id + ".svg";
9
+ else return "";
10
+ }
11
+ else return "/" + churchId + "/membership/people/" + person.id + ".png?dt=" + person.photoUpdated.getTime().toString();
12
+ }
13
+
14
+ static getPhotoUrl(person: PersonInterface) {
15
+ if (!person?.photo) return "/images/sample-profile.png"
16
+ else {
17
+ return (person?.photo?.startsWith("data:image/png;base64,") || person.photo?.indexOf("://") > -1)
18
+ ? person.photo
19
+ : CommonEnvironmentHelper.ContentRoot + person.photo;
20
+ }
21
+ }
22
+
23
+ static getAge(birthdate: Date): string {
24
+ if (birthdate !== undefined && birthdate !== null) {
25
+ let ageDifMs = Date.now() - new Date(birthdate).getTime();
26
+ let ageDate = new Date(ageDifMs);
27
+ let years = Math.abs(ageDate.getUTCFullYear() - 1970);
28
+ return years + " years";
29
+ }
30
+ else return "";
31
+ }
32
+
33
+ public static getDisplayNameFromPerson(person: any) {
34
+ if (person?.name?.nick !== null && person?.name?.nick !== "" && person?.name?.nick !== undefined) return person.name.first + " \"" + person.name.nick + "\" " + person.name.last;
35
+ else return person.name.first + " " + person.name.last;
36
+ }
37
+
38
+ static getDisplayName(firstName: string, lastName: string, nickName: string): string {
39
+ if (nickName !== undefined && nickName !== null && nickName.length > 0) return firstName + ' "' + nickName + '" ' + lastName;
40
+ else return firstName + " " + lastName;
41
+ }
42
+
43
+ public static getBirthMonth(birthdate: Date): number {
44
+ if (birthdate) return new Date(birthdate).getMonth() + 1;
45
+ else return -1;
46
+ }
47
+
48
+ public static compareAddress(address1: ContactInfoInterface, address2: ContactInfoInterface): boolean {
49
+ const displayAddress1: string = this.addressToString(address1).trim();
50
+ const displayAddress2: string = this.addressToString(address2).trim();
51
+
52
+ if (displayAddress1 !== displayAddress2) {
53
+ return true
54
+ }
55
+ return false
56
+ }
57
+
58
+ public static addressToString(address: ContactInfoInterface): string {
59
+ return `${address.address1 || ""} ${address.address2 || ""} ${address.city || ""}${(address.city && address.state) ? "," : ""} ${address.state || ""} ${address.zip || ""}`
60
+ }
61
+
62
+ public static changeOnlyAddress(contactInfo1: ContactInfoInterface, contactInfo2: ContactInfoInterface): ContactInfoInterface {
63
+ const updatedAddress: ContactInfoInterface = {
64
+ ...contactInfo1,
65
+ address1: contactInfo2.address1,
66
+ address2: contactInfo2.address2,
67
+ city: contactInfo2.city,
68
+ state: contactInfo2.state,
69
+ zip: contactInfo2.zip
70
+ }
71
+
72
+ return updatedAddress
73
+ }
74
+
75
+ public static checkAddressAvailabilty(person: PersonInterface): boolean {
76
+ const addressString: string = this.addressToString(person.contactInfo).trim();
77
+ if (addressString !== "") {
78
+ return true;
79
+ }
80
+ return false;
81
+ }
82
+ }
@@ -1,36 +1,36 @@
1
- export class UniqueIdHelper {
2
-
3
- static chars = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
4
- "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
5
- "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
6
- "-", "_"];
7
-
8
- static alphanumericChars = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
9
- "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
10
- "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
11
-
12
- public static isMissing(obj: any) {
13
- if (obj === undefined || obj === null) return true;
14
- else if (obj.toString() === "") return true;
15
- else return false;
16
- }
17
-
18
- public static shortId() {
19
- return this.generate(UniqueIdHelper.chars, 11);
20
- }
21
-
22
- public static generateAlphanumeric() {
23
- return this.generate(UniqueIdHelper.alphanumericChars, 11);
24
- }
25
-
26
- public static generate(charList: string[], length: number) {
27
- let result = "";
28
- for (let i = 0; i < length; i++) {
29
- const idx = Math.floor(Math.random() * charList.length);
30
- const c = charList[idx];
31
- result += c;
32
- }
33
- return result;
34
- }
35
-
36
- }
1
+ export class UniqueIdHelper {
2
+
3
+ static chars = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
4
+ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
5
+ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
6
+ "-", "_"];
7
+
8
+ static alphanumericChars = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
9
+ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
10
+ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
11
+
12
+ public static isMissing(obj: any) {
13
+ if (obj === undefined || obj === null) return true;
14
+ else if (obj.toString() === "") return true;
15
+ else return false;
16
+ }
17
+
18
+ public static shortId() {
19
+ return this.generate(UniqueIdHelper.chars, 11);
20
+ }
21
+
22
+ public static generateAlphanumeric() {
23
+ return this.generate(UniqueIdHelper.alphanumericChars, 11);
24
+ }
25
+
26
+ public static generate(charList: string[], length: number) {
27
+ let result = "";
28
+ for (let i = 0; i < length; i++) {
29
+ const idx = Math.floor(Math.random() * charList.length);
30
+ const c = charList[idx];
31
+ result += c;
32
+ }
33
+ return result;
34
+ }
35
+
36
+ }
package/src/UserHelper.ts CHANGED
@@ -1,59 +1,59 @@
1
- import { ApiHelper } from "./ApiHelper"
2
- import { UserInterface, UserContextInterface, IApiPermission, PersonInterface, LoginUserChurchInterface } from "./interfaces";
3
-
4
- export class UserHelper {
5
- static currentUserChurch: LoginUserChurchInterface;
6
- static userChurches: LoginUserChurchInterface[];
7
- static user: UserInterface;
8
- static churchChanged: boolean = false;
9
- static person: PersonInterface;
10
-
11
- static selectChurch = async (context?: UserContextInterface, churchId?: string, keyName?: string) => {
12
- let userChurch = null;
13
-
14
- if (churchId) {
15
- UserHelper.userChurches.forEach(uc => {
16
- if (uc.church.id === churchId) userChurch = uc;
17
- });
18
- }
19
- else if (keyName) UserHelper.userChurches.forEach(uc => { if (uc.church.subDomain === keyName) userChurch = uc; });
20
- else userChurch = UserHelper.userChurches[0];
21
- if (!userChurch) return;
22
- else {
23
- UserHelper.currentUserChurch = userChurch;
24
- UserHelper.setupApiHelper(UserHelper.currentUserChurch);
25
- // TODO - remove context code from here and perform the logic in the component itself.
26
- if (context) {
27
- if (context.userChurch !== null) UserHelper.churchChanged = true;
28
- context.setUserChurch(UserHelper.currentUserChurch);
29
- }
30
- }
31
- }
32
-
33
- static setupApiHelper(userChurch: LoginUserChurchInterface) {
34
- ApiHelper.setDefaultPermissions(userChurch.jwt);
35
- userChurch.apis.forEach(api => { ApiHelper.setPermissions(api.keyName, api.jwt, api.permissions); });
36
- }
37
-
38
- static setupApiHelperNoChurch(user: LoginUserChurchInterface) {
39
- ApiHelper.setDefaultPermissions(user.jwt);
40
- }
41
-
42
- static checkAccess({ api, contentType, action }: IApiPermission): boolean {
43
- const permissions = ApiHelper.getConfig(api).permissions;
44
-
45
- let result = false;
46
- if (permissions !== undefined) {
47
- permissions.forEach(element => {
48
- if (element.contentType === contentType && element.action === action) result = true;
49
- });
50
- }
51
- return result;
52
- }
53
-
54
- static createAppUrl(appUrl: string, returnUrl: string) {
55
- const jwt = ApiHelper.getConfig("MembershipApi").jwt;
56
-
57
- return `${appUrl}/login/?jwt=${jwt}&returnUrl=${returnUrl}`;
58
- }
59
- }
1
+ import { ApiHelper } from "./ApiHelper"
2
+ import { UserInterface, UserContextInterface, IApiPermission, PersonInterface, LoginUserChurchInterface } from "./interfaces";
3
+
4
+ export class UserHelper {
5
+ static currentUserChurch: LoginUserChurchInterface;
6
+ static userChurches: LoginUserChurchInterface[];
7
+ static user: UserInterface;
8
+ static churchChanged: boolean = false;
9
+ static person: PersonInterface;
10
+
11
+ static selectChurch = async (context?: UserContextInterface, churchId?: string, keyName?: string) => {
12
+ let userChurch = null;
13
+
14
+ if (churchId) {
15
+ UserHelper.userChurches.forEach(uc => {
16
+ if (uc.church.id === churchId) userChurch = uc;
17
+ });
18
+ }
19
+ else if (keyName) UserHelper.userChurches.forEach(uc => { if (uc.church.subDomain === keyName) userChurch = uc; });
20
+ else userChurch = UserHelper.userChurches[0];
21
+ if (!userChurch) return;
22
+ else {
23
+ UserHelper.currentUserChurch = userChurch;
24
+ UserHelper.setupApiHelper(UserHelper.currentUserChurch);
25
+ // TODO - remove context code from here and perform the logic in the component itself.
26
+ if (context) {
27
+ if (context.userChurch !== null) UserHelper.churchChanged = true;
28
+ context.setUserChurch(UserHelper.currentUserChurch);
29
+ }
30
+ }
31
+ }
32
+
33
+ static setupApiHelper(userChurch: LoginUserChurchInterface) {
34
+ ApiHelper.setDefaultPermissions(userChurch.jwt);
35
+ userChurch.apis.forEach(api => { ApiHelper.setPermissions(api.keyName, api.jwt, api.permissions); });
36
+ }
37
+
38
+ static setupApiHelperNoChurch(user: LoginUserChurchInterface) {
39
+ ApiHelper.setDefaultPermissions(user.jwt);
40
+ }
41
+
42
+ static checkAccess({ api, contentType, action }: IApiPermission): boolean {
43
+ const permissions = ApiHelper.getConfig(api).permissions;
44
+
45
+ let result = false;
46
+ if (permissions !== undefined) {
47
+ permissions.forEach(element => {
48
+ if (element.contentType === contentType && element.action === action) result = true;
49
+ });
50
+ }
51
+ return result;
52
+ }
53
+
54
+ static createAppUrl(appUrl: string, returnUrl: string) {
55
+ const jwt = ApiHelper.getConfig("MembershipApi").jwt;
56
+
57
+ return `${appUrl}/login/?jwt=${jwt}&returnUrl=${returnUrl}`;
58
+ }
59
+ }
package/src/index.ts CHANGED
@@ -1,15 +1,15 @@
1
- export * from "./interfaces";
2
- export { ApiHelper } from "./ApiHelper";
3
- export { AppearanceHelper } from "./AppearanceHelper";
4
- export { ArrayHelper } from "./ArrayHelper";
5
- export { CommonEnvironmentHelper } from "./CommonEnvironmentHelper";
6
- export { CurrencyHelper } from "./CurrencyHelper";
7
- export { DateHelper } from "./DateHelper";
8
- export { DonationHelper } from "./DonationHelper";
9
- export { ErrorHelper } from "./ErrorHelper";
10
- export { EventHelper } from "./EventHelper";
11
- export { FileHelper } from "./FileHelper";
12
- export { PersonHelper } from "./PersonHelper";
13
- export { UserHelper } from "./UserHelper";
14
- export { UniqueIdHelper } from "./UniqueIdHelper";
15
-
1
+ export * from "./interfaces";
2
+ export { ApiHelper } from "./ApiHelper";
3
+ export { AppearanceHelper } from "./AppearanceHelper";
4
+ export { ArrayHelper } from "./ArrayHelper";
5
+ export { CommonEnvironmentHelper } from "./CommonEnvironmentHelper";
6
+ export { CurrencyHelper } from "./CurrencyHelper";
7
+ export { DateHelper } from "./DateHelper";
8
+ export { DonationHelper } from "./DonationHelper";
9
+ export { ErrorHelper } from "./ErrorHelper";
10
+ export { EventHelper } from "./EventHelper";
11
+ export { FileHelper } from "./FileHelper";
12
+ export { PersonHelper } from "./PersonHelper";
13
+ export { UserHelper } from "./UserHelper";
14
+ export { UniqueIdHelper } from "./UniqueIdHelper";
15
+
@@ -1,138 +1,138 @@
1
- import { PersonInterface } from "./Membership";
2
-
3
- export interface ApiInterface {
4
- name: string;
5
- keyName?: string;
6
- permissions: RolePermissionInterface[];
7
- jwt: string;
8
- }
9
- export interface ChurchInterface {
10
- id?: string;
11
- name?: string;
12
- registrationDate?: Date;
13
- address1?: string;
14
- address2?: string;
15
- city?: string;
16
- state?: string;
17
- zip?: string;
18
- country?: string;
19
- subDomain?: string;
20
- settings?: GenericSettingInterface[];
21
- archivedDate?: Date;
22
- }
23
- export interface DomainInterface {
24
- id?: string;
25
- domainName?: string;
26
- }
27
- export interface RegisterChurchRequestInterface extends ChurchInterface {
28
- appName?: string;
29
- }
30
- export interface LoadCreateUserRequestInterface {
31
- userEmail: string;
32
- fromEmail?: string;
33
- subject?: string;
34
- body?: string;
35
- firstName: string;
36
- lastName: string;
37
- }
38
- export interface LoginResponseInterface {
39
- user: UserInterface;
40
- userChurches: LoginUserChurchInterface[];
41
- errors: string[];
42
- }
43
- export interface LoginUserChurchInterface {
44
- person: PersonInterface;
45
- church: ChurchInterface;
46
- apis: ApiInterface[];
47
- jwt: string;
48
- groups: { id: string; tags: string; name: string; leader: boolean }[];
49
- }
50
-
51
- export interface PermissionInterface {
52
- apiName?: string;
53
- section?: string;
54
- action?: string;
55
- displaySection?: string;
56
- displayAction?: string;
57
- }
58
- export interface RegisterUserInterface {
59
- firstName?: string;
60
- lastName: string;
61
- email?: string;
62
- appName: string;
63
- appUrl: string;
64
- }
65
- export interface RoleInterface {
66
- id?: string;
67
- churchId?: string;
68
- name?: string;
69
- }
70
- export interface RolePermissionInterface {
71
- id?: string;
72
- churchId?: string;
73
- roleId?: string;
74
- apiName?: string;
75
- contentType?: string;
76
- contentId?: string;
77
- action?: string;
78
- }
79
- export interface RoleMemberInterface {
80
- id?: string;
81
- churchId?: string;
82
- roleId?: string;
83
- userId?: string;
84
- user?: UserInterface;
85
- personId?: string;
86
- }
87
- export interface ResetPasswordRequestInterface {
88
- userEmail: string;
89
- }
90
- export interface ResetPasswordResponseInterface {
91
- emailed: boolean;
92
- }
93
- export interface UserInterface {
94
- id?: string;
95
- email?: string;
96
- authGuid?: string;
97
- firstName?: string;
98
- lastName?: string;
99
- registrationDate?: Date;
100
- lastLogin?: Date;
101
- password?: string;
102
- jwt?: string;
103
- }
104
- export interface GenericSettingInterface {
105
- id?: string;
106
- churchId?: string;
107
- keyName?: string;
108
- value?: string;
109
- public?: number;
110
- }
111
- export interface UserChurchInterface {
112
- id?: string;
113
- userId?: string;
114
- churchId?: string;
115
- personId?: string;
116
- }
117
-
118
- export interface ApiConfig {
119
- keyName: string;
120
- url: string;
121
- jwt: string;
122
- permissions: RolePermissionInterface[];
123
- }
124
- export type ApiListType =
125
- | "MembershipApi"
126
- | "AttendanceApi"
127
- | "GivingApi"
128
- | "DoingApi"
129
- | "MessagingApi"
130
- | "LessonsApi"
131
- | "ReportingApi"
132
- | "ContentApi"
133
- | "AskApi";
134
- export interface IApiPermission {
135
- api: string;
136
- contentType: string;
137
- action: string;
138
- }
1
+ import { PersonInterface } from "./Membership";
2
+
3
+ export interface ApiInterface {
4
+ name: string;
5
+ keyName?: string;
6
+ permissions: RolePermissionInterface[];
7
+ jwt: string;
8
+ }
9
+ export interface ChurchInterface {
10
+ id?: string;
11
+ name?: string;
12
+ registrationDate?: Date;
13
+ address1?: string;
14
+ address2?: string;
15
+ city?: string;
16
+ state?: string;
17
+ zip?: string;
18
+ country?: string;
19
+ subDomain?: string;
20
+ settings?: GenericSettingInterface[];
21
+ archivedDate?: Date;
22
+ }
23
+ export interface DomainInterface {
24
+ id?: string;
25
+ domainName?: string;
26
+ }
27
+ export interface RegisterChurchRequestInterface extends ChurchInterface {
28
+ appName?: string;
29
+ }
30
+ export interface LoadCreateUserRequestInterface {
31
+ userEmail: string;
32
+ fromEmail?: string;
33
+ subject?: string;
34
+ body?: string;
35
+ firstName: string;
36
+ lastName: string;
37
+ }
38
+ export interface LoginResponseInterface {
39
+ user: UserInterface;
40
+ userChurches: LoginUserChurchInterface[];
41
+ errors: string[];
42
+ }
43
+ export interface LoginUserChurchInterface {
44
+ person: PersonInterface;
45
+ church: ChurchInterface;
46
+ apis: ApiInterface[];
47
+ jwt: string;
48
+ groups: { id: string; tags: string; name: string; leader: boolean }[];
49
+ }
50
+
51
+ export interface PermissionInterface {
52
+ apiName?: string;
53
+ section?: string;
54
+ action?: string;
55
+ displaySection?: string;
56
+ displayAction?: string;
57
+ }
58
+ export interface RegisterUserInterface {
59
+ firstName?: string;
60
+ lastName: string;
61
+ email?: string;
62
+ appName: string;
63
+ appUrl: string;
64
+ }
65
+ export interface RoleInterface {
66
+ id?: string;
67
+ churchId?: string;
68
+ name?: string;
69
+ }
70
+ export interface RolePermissionInterface {
71
+ id?: string;
72
+ churchId?: string;
73
+ roleId?: string;
74
+ apiName?: string;
75
+ contentType?: string;
76
+ contentId?: string;
77
+ action?: string;
78
+ }
79
+ export interface RoleMemberInterface {
80
+ id?: string;
81
+ churchId?: string;
82
+ roleId?: string;
83
+ userId?: string;
84
+ user?: UserInterface;
85
+ personId?: string;
86
+ }
87
+ export interface ResetPasswordRequestInterface {
88
+ userEmail: string;
89
+ }
90
+ export interface ResetPasswordResponseInterface {
91
+ emailed: boolean;
92
+ }
93
+ export interface UserInterface {
94
+ id?: string;
95
+ email?: string;
96
+ authGuid?: string;
97
+ firstName?: string;
98
+ lastName?: string;
99
+ registrationDate?: Date;
100
+ lastLogin?: Date;
101
+ password?: string;
102
+ jwt?: string;
103
+ }
104
+ export interface GenericSettingInterface {
105
+ id?: string;
106
+ churchId?: string;
107
+ keyName?: string;
108
+ value?: string;
109
+ public?: number;
110
+ }
111
+ export interface UserChurchInterface {
112
+ id?: string;
113
+ userId?: string;
114
+ churchId?: string;
115
+ personId?: string;
116
+ }
117
+
118
+ export interface ApiConfig {
119
+ keyName: string;
120
+ url: string;
121
+ jwt: string;
122
+ permissions: RolePermissionInterface[];
123
+ }
124
+ export type ApiListType =
125
+ | "MembershipApi"
126
+ | "AttendanceApi"
127
+ | "GivingApi"
128
+ | "DoingApi"
129
+ | "MessagingApi"
130
+ | "LessonsApi"
131
+ | "ReportingApi"
132
+ | "ContentApi"
133
+ | "AskApi";
134
+ export interface IApiPermission {
135
+ api: string;
136
+ contentType: string;
137
+ action: string;
138
+ }