@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,92 +1,92 @@
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
+ 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,41 +1,41 @@
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
+ 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,13 +1,13 @@
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";
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,36 +1,36 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "typeRoots": [
5
- "./types",
6
- "node_modules/@types"
7
- ],
8
- "lib": [
9
- "dom",
10
- "dom.iterable",
11
- "ES2022"
12
- ],
13
- "allowJs": true,
14
- "skipLibCheck": true,
15
- "esModuleInterop": true,
16
- "allowSyntheticDefaultImports": true,
17
- "strict": false,
18
- "forceConsistentCasingInFileNames": true,
19
- "module": "commonjs",
20
- "moduleResolution": "node",
21
- "resolveJsonModule": true,
22
- "isolatedModules": true,
23
- "jsx": "react-jsx",
24
- "sourceMap": true,
25
- "allowUnreachableCode": false,
26
- "allowUnusedLabels": false,
27
- "declaration": true,
28
- "declarationMap": true,
29
- "noImplicitReturns": true,
30
- "pretty": true,
31
- "paths": {},
32
- "outDir": "dist"
33
- },
34
- "include": ["src/**/*"],
35
- "exclude": ["node_modules", "dist"]
36
- }
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "typeRoots": [
5
+ "./types",
6
+ "node_modules/@types"
7
+ ],
8
+ "lib": [
9
+ "dom",
10
+ "dom.iterable",
11
+ "ES2022"
12
+ ],
13
+ "allowJs": true,
14
+ "skipLibCheck": true,
15
+ "esModuleInterop": true,
16
+ "allowSyntheticDefaultImports": true,
17
+ "strict": false,
18
+ "forceConsistentCasingInFileNames": true,
19
+ "module": "commonjs",
20
+ "moduleResolution": "node",
21
+ "resolveJsonModule": true,
22
+ "isolatedModules": true,
23
+ "jsx": "react-jsx",
24
+ "sourceMap": true,
25
+ "allowUnreachableCode": false,
26
+ "allowUnusedLabels": false,
27
+ "declaration": true,
28
+ "declarationMap": true,
29
+ "noImplicitReturns": true,
30
+ "pretty": true,
31
+ "paths": {},
32
+ "outDir": "dist"
33
+ },
34
+ "include": ["src/**/*"],
35
+ "exclude": ["node_modules", "dist"]
36
+ }
package/eslint.config.js DELETED
@@ -1,33 +0,0 @@
1
- const js = require("@eslint/js");
2
- const tseslint = require("@typescript-eslint/eslint-plugin");
3
- const tsparser = require("@typescript-eslint/parser");
4
-
5
- module.exports = [
6
- js.configs.recommended,
7
- {
8
- files: ["src/**/*.ts"],
9
- languageOptions: {
10
- parser: tsparser,
11
- parserOptions: {
12
- ecmaVersion: 2020,
13
- sourceType: "module",
14
- },
15
- },
16
- plugins: {
17
- "@typescript-eslint": tseslint,
18
- },
19
- rules: {
20
- "@typescript-eslint/no-explicit-any": "warn",
21
- "@typescript-eslint/no-unused-vars": "off",
22
- "no-unused-vars": "off",
23
- "prefer-const": "error",
24
- "no-console": "warn",
25
- "comma-dangle": ["error", "never"],
26
- "object-curly-newline": ["error", { "multiline": true, "consistent": true }],
27
- "array-bracket-newline": ["error", "consistent"]
28
- },
29
- },
30
- {
31
- ignores: ["dist/**", "node_modules/**"],
32
- },
33
- ];