@churchapps/helpers 1.0.37 → 1.0.39

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 (77) hide show
  1. package/.prettierrc +12 -0
  2. package/CLAUDE.md +90 -0
  3. package/dist/ApiHelper.d.ts.map +1 -1
  4. package/dist/ApiHelper.js +92 -110
  5. package/dist/ApiHelper.js.map +1 -1
  6. package/dist/AppearanceHelper.js +12 -12
  7. package/dist/AppearanceHelper.js.map +1 -1
  8. package/dist/ArrayHelper.d.ts +1 -1
  9. package/dist/ArrayHelper.d.ts.map +1 -1
  10. package/dist/ArrayHelper.js +5 -4
  11. package/dist/ArrayHelper.js.map +1 -1
  12. package/dist/DateHelper.d.ts.map +1 -1
  13. package/dist/DateHelper.js +5 -4
  14. package/dist/DateHelper.js.map +1 -1
  15. package/dist/ErrorHelper.d.ts +2 -2
  16. package/dist/ErrorHelper.d.ts.map +1 -1
  17. package/dist/ErrorHelper.js.map +1 -1
  18. package/dist/EventHelper.js +1 -2
  19. package/dist/EventHelper.js.map +1 -1
  20. package/dist/FileHelper.d.ts.map +1 -1
  21. package/dist/FileHelper.js +8 -1
  22. package/dist/FileHelper.js.map +1 -1
  23. package/dist/PersonHelper.js +12 -8
  24. package/dist/PersonHelper.js.map +1 -1
  25. package/dist/UniqueIdHelper.d.ts.map +1 -1
  26. package/dist/UniqueIdHelper.js +2 -2
  27. package/dist/UniqueIdHelper.js.map +1 -1
  28. package/dist/UserHelper.js +3 -12
  29. package/dist/UserHelper.js.map +1 -1
  30. package/dist/index.d.ts +4 -1
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +9 -3
  33. package/dist/index.js.map +1 -1
  34. package/dist/interfaces/Access.d.ts +1 -1
  35. package/dist/interfaces/Access.d.ts.map +1 -1
  36. package/dist/interfaces/Attendance.d.ts.map +1 -1
  37. package/dist/interfaces/Content.d.ts.map +1 -1
  38. package/dist/interfaces/Doing.d.ts.map +1 -1
  39. package/dist/interfaces/Donation.d.ts.map +1 -1
  40. package/dist/interfaces/Donation.js +9 -15
  41. package/dist/interfaces/Donation.js.map +1 -1
  42. package/dist/interfaces/Error.d.ts +1 -1
  43. package/dist/interfaces/Error.d.ts.map +1 -1
  44. package/dist/interfaces/Error.js +0 -1
  45. package/dist/interfaces/Error.js.map +1 -1
  46. package/dist/interfaces/Membership.d.ts.map +1 -1
  47. package/dist/interfaces/Messaging.d.ts.map +1 -1
  48. package/dist/interfaces/Permissions.d.ts.map +1 -1
  49. package/dist/interfaces/Permissions.js +31 -7
  50. package/dist/interfaces/Permissions.js.map +1 -1
  51. package/dist/interfaces/Reporting.d.ts.map +1 -1
  52. package/dist/interfaces/index.d.ts.map +1 -1
  53. package/dist/interfaces/index.js.map +1 -1
  54. package/eslint.config.js +33 -0
  55. package/package.json +17 -4
  56. package/src/ApiHelper.ts +7 -4
  57. package/src/AppearanceHelper.ts +8 -8
  58. package/src/ArrayHelper.ts +2 -1
  59. package/src/DateHelper.ts +3 -2
  60. package/src/ErrorHelper.ts +2 -2
  61. package/src/FileHelper.ts +6 -2
  62. package/src/UniqueIdHelper.ts +2 -2
  63. package/src/UserHelper.ts +1 -1
  64. package/src/index.ts +6 -3
  65. package/src/interfaces/Access.ts +137 -24
  66. package/src/interfaces/Attendance.ts +45 -8
  67. package/src/interfaces/Content.ts +84 -10
  68. package/src/interfaces/Doing.ts +93 -11
  69. package/src/interfaces/Donation.ts +145 -45
  70. package/src/interfaces/Error.ts +17 -17
  71. package/src/interfaces/Membership.ts +183 -52
  72. package/src/interfaces/Messaging.ts +96 -12
  73. package/src/interfaces/Permissions.ts +92 -71
  74. package/src/interfaces/Reporting.ts +41 -7
  75. package/src/interfaces/UserContextInterface.ts +13 -13
  76. package/src/interfaces/index.ts +13 -14
  77. package/tsconfig.json +6 -6
@@ -1,12 +1,96 @@
1
- import { PersonInterface } from "./Membership";
2
-
3
- export interface ConnectionInterface { id?: string, churchId?: string, conversationId?: string, personId?: string, displayName?: string, timeJoined?: Date, socketId?: string, ipAddress?: string }
4
- export interface ConversationInterface { id?: string, churchId?: string, contentType?: string, contentId?: string, title?: string, dateCreated?: Date, groupId?: string, visibility?: string, firstPostId?: string, lastPostId?: string, postCount?: number, allowAnonymousPosts?: boolean, messages?: MessageInterface[] }
5
- export interface MessageInterface { id?: string, churchId?: string, conversationId?: string, personId?: string, displayName?: string, timeSent?: Date, timeUpdated?: Date, messageType?: string, content?: string, person?: PersonInterface }
6
- export interface NotificationInterface { id?: string, churchId?: string, personId?: string, contentType?: string, contentId:string, timeSent?: Date, isNew:boolean, message?:string, link?: string, deliveryMethod?:string }
7
- export interface NotificationPreferenceInterface { id?: string, churchId?: string, personId?: string, allowPush:boolean, emailFrequency:string }
8
- export interface PrivateMessageInterface { id?: string, churchId?: string, fromPersonId?: string, toPersonId?: string, conversationId?: string, notifyPersonId?: string, conversation?: ConversationInterface, person?: PersonInterface, deliveryMethod?: string }
9
- export interface BlockedIpInterface { id?: string, churchId?: string, conversationId?: string, serviceId?: string, ipAddress?: string }
10
- export interface SocketActionHandlerInterface { action:string, id:string, handleMessage:(data:any) => void }
11
- export type SocketPayloadAction = "message" | "deleteMessage" | "callout" | "attendance" | "prayerRequest" | "socketId" | "privateMessage" | "privateRoomAdded" | "videoChatInvite" | "reconnect";
12
- export interface SocketPayloadInterface { action: SocketPayloadAction, data: any }
1
+ import { PersonInterface } from "./Membership";
2
+
3
+ export interface ConnectionInterface {
4
+ id?: string;
5
+ churchId?: string;
6
+ conversationId?: string;
7
+ personId?: string;
8
+ displayName?: string;
9
+ timeJoined?: Date;
10
+ socketId?: string;
11
+ ipAddress?: string;
12
+ }
13
+ export interface ConversationInterface {
14
+ id?: string;
15
+ churchId?: string;
16
+ contentType?: string;
17
+ contentId?: string;
18
+ title?: string;
19
+ dateCreated?: Date;
20
+ groupId?: string;
21
+ visibility?: string;
22
+ firstPostId?: string;
23
+ lastPostId?: string;
24
+ postCount?: number;
25
+ allowAnonymousPosts?: boolean;
26
+ messages?: MessageInterface[];
27
+ }
28
+ export interface MessageInterface {
29
+ id?: string;
30
+ churchId?: string;
31
+ conversationId?: string;
32
+ personId?: string;
33
+ displayName?: string;
34
+ timeSent?: Date;
35
+ timeUpdated?: Date;
36
+ messageType?: string;
37
+ content?: string;
38
+ person?: PersonInterface;
39
+ }
40
+ export interface NotificationInterface {
41
+ id?: string;
42
+ churchId?: string;
43
+ personId?: string;
44
+ contentType?: string;
45
+ contentId: string;
46
+ timeSent?: Date;
47
+ isNew: boolean;
48
+ message?: string;
49
+ link?: string;
50
+ deliveryMethod?: string;
51
+ }
52
+ export interface NotificationPreferenceInterface {
53
+ id?: string;
54
+ churchId?: string;
55
+ personId?: string;
56
+ allowPush: boolean;
57
+ emailFrequency: string;
58
+ }
59
+ export interface PrivateMessageInterface {
60
+ id?: string;
61
+ churchId?: string;
62
+ fromPersonId?: string;
63
+ toPersonId?: string;
64
+ conversationId?: string;
65
+ notifyPersonId?: string;
66
+ conversation?: ConversationInterface;
67
+ person?: PersonInterface;
68
+ deliveryMethod?: string;
69
+ }
70
+ export interface BlockedIpInterface {
71
+ id?: string;
72
+ churchId?: string;
73
+ conversationId?: string;
74
+ serviceId?: string;
75
+ ipAddress?: string;
76
+ }
77
+ export interface SocketActionHandlerInterface {
78
+ action: string;
79
+ id: string;
80
+ handleMessage: (data: any) => void;
81
+ }
82
+ export type SocketPayloadAction =
83
+ | "message"
84
+ | "deleteMessage"
85
+ | "callout"
86
+ | "attendance"
87
+ | "prayerRequest"
88
+ | "socketId"
89
+ | "privateMessage"
90
+ | "privateRoomAdded"
91
+ | "videoChatInvite"
92
+ | "reconnect";
93
+ export interface SocketPayloadInterface {
94
+ action: SocketPayloadAction;
95
+ data: any;
96
+ }
@@ -1,71 +1,92 @@
1
- export class Permissions {
2
- static attendanceApi = {
3
- attendance: {
4
- view: { api: "AttendanceApi", contentType: "Attendance", action: "View" },
5
- viewSummary: { api: "AttendanceApi", contentType: "Attendance", action: "View Summary" },
6
- edit: { api: "AttendanceApi", contentType: "Attendance", action: "Edit" }
7
- },
8
- services: {
9
- edit: { api: "AttendanceApi", contentType: "Services", action: "Edit" }
10
- }
11
- };
12
-
13
- static membershipApi = {
14
- roles: {
15
- view: { api: "MembershipApi", contentType: "Roles", action: "View" },
16
- edit: { api: "MembershipApi", contentType: "Roles", action: "Edit" }
17
- },
18
- settings: {
19
- edit: { api: "MembershipApi", contentType: "Settings", action: "Edit" }
20
- },
21
- server: {
22
- admin: { api: "MembershipApi", contentType: "Server", action: "Admin" }
23
- },
24
- forms: {
25
- admin: { api: "MembershipApi", contentType: "Forms", action: "Admin" },
26
- edit: { api: "MembershipApi", contentType: "Forms", action: "Edit" }
27
- },
28
- groups: {
29
- edit: { api: "MembershipApi", contentType: "Groups", action: "Edit" }
30
- },
31
- people: {
32
- view: { api: "MembershipApi", contentType: "People", action: "View" },
33
- viewMembers: { api: "MembershipApi", contentType: "People", action: "View Members" },
34
- edit: { api: "MembershipApi", contentType: "People", action: "Edit" }
35
- },
36
- plans: {
37
- edit: { api: "MembershipApi", contentType: "Plans", action: "Edit" }
38
- },
39
- groupMembers: {
40
- edit: { api: "MembershipApi", contentType: "Group Members", action: "Edit" },
41
- view: { api: "MembershipApi", contentType: "Group Members", action: "View" }
42
- }
43
- };
44
-
45
- static givingApi = {
46
- donations: {
47
- viewSummary: { api: "GivingApi", contentType: "Donations", action: "View Summary" },
48
- view: { api: "GivingApi", contentType: "Donations", action: "View" },
49
- edit: { api: "GivingApi", contentType: "Donations", action: "Edit" }
50
- },
51
- settings: {
52
- view: { api: "GivingApi", contentType: "Settings", action: "View" },
53
- edit: { api: "GivingApi", contentType: "Settings", action: "Edit" }
54
- }
55
-
56
- }
57
-
58
- static contentApi = {
59
- chat: {
60
- host: { api: "ContentApi", contentType: "Chat", action: "Host" }
61
- },
62
- content: {
63
- edit: { api: "ContentApi", contentType: "Content", action: "Edit" }
64
- },
65
- streamingServices: {
66
- edit: { api: "ContentApi", contentType: "StreamingServices", action: "Edit" }
67
- },
68
-
69
- };
70
-
71
- }
1
+ export class Permissions {
2
+ static attendanceApi = {
3
+ attendance: {
4
+ view: { api: "AttendanceApi", contentType: "Attendance", action: "View" },
5
+ viewSummary: {
6
+ api: "AttendanceApi",
7
+ contentType: "Attendance",
8
+ action: "View Summary"
9
+ },
10
+ edit: { api: "AttendanceApi", contentType: "Attendance", action: "Edit" }
11
+ },
12
+ services: {
13
+ edit: { api: "AttendanceApi", contentType: "Services", action: "Edit" }
14
+ }
15
+ };
16
+
17
+ static membershipApi = {
18
+ roles: {
19
+ view: { api: "MembershipApi", contentType: "Roles", action: "View" },
20
+ edit: { api: "MembershipApi", contentType: "Roles", action: "Edit" }
21
+ },
22
+ settings: {
23
+ edit: { api: "MembershipApi", contentType: "Settings", action: "Edit" }
24
+ },
25
+ server: {
26
+ admin: { api: "MembershipApi", contentType: "Server", action: "Admin" }
27
+ },
28
+ forms: {
29
+ admin: { api: "MembershipApi", contentType: "Forms", action: "Admin" },
30
+ edit: { api: "MembershipApi", contentType: "Forms", action: "Edit" }
31
+ },
32
+ groups: {
33
+ edit: { api: "MembershipApi", contentType: "Groups", action: "Edit" }
34
+ },
35
+ people: {
36
+ view: { api: "MembershipApi", contentType: "People", action: "View" },
37
+ viewMembers: {
38
+ api: "MembershipApi",
39
+ contentType: "People",
40
+ action: "View Members"
41
+ },
42
+ edit: { api: "MembershipApi", contentType: "People", action: "Edit" }
43
+ },
44
+ plans: {
45
+ edit: { api: "MembershipApi", contentType: "Plans", action: "Edit" }
46
+ },
47
+ groupMembers: {
48
+ edit: {
49
+ api: "MembershipApi",
50
+ contentType: "Group Members",
51
+ action: "Edit"
52
+ },
53
+ view: {
54
+ api: "MembershipApi",
55
+ contentType: "Group Members",
56
+ action: "View"
57
+ }
58
+ }
59
+ };
60
+
61
+ static givingApi = {
62
+ donations: {
63
+ viewSummary: {
64
+ api: "GivingApi",
65
+ contentType: "Donations",
66
+ action: "View Summary"
67
+ },
68
+ view: { api: "GivingApi", contentType: "Donations", action: "View" },
69
+ edit: { api: "GivingApi", contentType: "Donations", action: "Edit" }
70
+ },
71
+ settings: {
72
+ view: { api: "GivingApi", contentType: "Settings", action: "View" },
73
+ edit: { api: "GivingApi", contentType: "Settings", action: "Edit" }
74
+ }
75
+ };
76
+
77
+ static contentApi = {
78
+ chat: {
79
+ host: { api: "ContentApi", contentType: "Chat", action: "Host" }
80
+ },
81
+ content: {
82
+ edit: { api: "ContentApi", contentType: "Content", action: "Edit" }
83
+ },
84
+ streamingServices: {
85
+ edit: {
86
+ api: "ContentApi",
87
+ contentType: "StreamingServices",
88
+ action: "Edit"
89
+ }
90
+ }
91
+ };
92
+ }
@@ -1,7 +1,41 @@
1
- export interface ReportResultInterface { displayName: string, description: string, table: any[], outputs: ReportOutputInterface[] }
2
- export interface ReportInterface { keyName: string, displayName: string, description: string, parameters: ParameterInterface[], permissions: ReportPermissionGroupInterface[] }
3
- export interface ParameterInterface { keyName: string, displayName?: string, source: string, sourceKey: string, options: { value: string, text: string }[], value?: string, requiredParentIds?: string[], defaultValue: string }
4
- export interface ReportOutputInterface { outputType: string, columns: ColumnInterface[], groupings?: number[] }
5
- export interface ColumnInterface { header: string, value: string, formatter: string }
6
- export interface ReportPermissionGroupInterface { requireOne: ReportPermissionInterface[] }
7
- export interface ReportPermissionInterface { api: string, contentType: string, action: string }
1
+ export interface ReportResultInterface {
2
+ displayName: string;
3
+ description: string;
4
+ table: any[];
5
+ outputs: ReportOutputInterface[];
6
+ }
7
+ export interface ReportInterface {
8
+ keyName: string;
9
+ displayName: string;
10
+ description: string;
11
+ parameters: ParameterInterface[];
12
+ permissions: ReportPermissionGroupInterface[];
13
+ }
14
+ export interface ParameterInterface {
15
+ keyName: string;
16
+ displayName?: string;
17
+ source: string;
18
+ sourceKey: string;
19
+ options: { value: string; text: string }[];
20
+ value?: string;
21
+ requiredParentIds?: string[];
22
+ defaultValue: string;
23
+ }
24
+ export interface ReportOutputInterface {
25
+ outputType: string;
26
+ columns: ColumnInterface[];
27
+ groupings?: number[];
28
+ }
29
+ export interface ColumnInterface {
30
+ header: string;
31
+ value: string;
32
+ formatter: string;
33
+ }
34
+ export interface ReportPermissionGroupInterface {
35
+ requireOne: ReportPermissionInterface[];
36
+ }
37
+ export interface ReportPermissionInterface {
38
+ api: string;
39
+ contentType: string;
40
+ action: string;
41
+ }
@@ -1,13 +1,13 @@
1
- import { LoginUserChurchInterface, UserInterface } from "./Access";
2
- import { PersonInterface } from "./Membership";
3
-
4
- export interface UserContextInterface {
5
- user: UserInterface,
6
- setUser: (user: UserInterface) => void,
7
- person: PersonInterface,
8
- setPerson: (person: PersonInterface) => void,
9
- userChurch: LoginUserChurchInterface,
10
- setUserChurch: (userChurch: LoginUserChurchInterface) => void,
11
- userChurches: LoginUserChurchInterface[],
12
- setUserChurches: (userChurches: LoginUserChurchInterface[]) => void,
13
- }
1
+ import { LoginUserChurchInterface, UserInterface } from "./Access";
2
+ import { PersonInterface } from "./Membership";
3
+
4
+ export interface UserContextInterface {
5
+ user: UserInterface;
6
+ setUser: (user: UserInterface) => void;
7
+ person: PersonInterface;
8
+ setPerson: (person: PersonInterface) => void;
9
+ userChurch: LoginUserChurchInterface;
10
+ setUserChurch: (userChurch: LoginUserChurchInterface) => void;
11
+ userChurches: LoginUserChurchInterface[];
12
+ setUserChurches: (userChurches: LoginUserChurchInterface[]) => void;
13
+ }
@@ -1,14 +1,13 @@
1
- export * from "./Error";
2
- export * from "./UserContextInterface";
3
- export * from "./Permissions";
4
-
5
-
6
- // API interfaces
7
- export * from "./Access";
8
- export * from "./Attendance";
9
- export * from "./Content";
10
- export * from "./Doing";
11
- export * from "./Donation";
12
- export * from "./Membership";
13
- export * from "./Messaging";
14
- export * from "./Reporting";
1
+ export * from "./Error";
2
+ export * from "./UserContextInterface";
3
+ export * from "./Permissions";
4
+
5
+ // API interfaces
6
+ export * from "./Access";
7
+ export * from "./Attendance";
8
+ export * from "./Content";
9
+ export * from "./Doing";
10
+ export * from "./Donation";
11
+ export * from "./Membership";
12
+ export * from "./Messaging";
13
+ export * from "./Reporting";
package/tsconfig.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "es6",
3
+ "target": "ES2020",
4
4
  "typeRoots": [
5
5
  "./types",
6
6
  "node_modules/@types"
@@ -14,14 +14,13 @@
14
14
  "skipLibCheck": true,
15
15
  "esModuleInterop": true,
16
16
  "allowSyntheticDefaultImports": true,
17
- "strict": true,
18
- "strictNullChecks": false,
17
+ "strict": false,
19
18
  "forceConsistentCasingInFileNames": true,
20
- "module": "CommonJS",
19
+ "module": "commonjs",
21
20
  "moduleResolution": "node",
22
21
  "resolveJsonModule": true,
23
22
  "isolatedModules": true,
24
- "jsx": "react",
23
+ "jsx": "react-jsx",
25
24
  "sourceMap": true,
26
25
  "allowUnreachableCode": false,
27
26
  "allowUnusedLabels": false,
@@ -32,5 +31,6 @@
32
31
  "paths": {},
33
32
  "outDir": "dist"
34
33
  },
35
- "include": ["src/**/*.ts"]
34
+ "include": ["src/**/*"],
35
+ "exclude": ["node_modules", "dist"]
36
36
  }