@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.
- package/.eslintrc.json +29 -0
- package/.github/FUNDING.yml +1 -1
- package/.prettierrc +11 -11
- package/.yarnrc.yml +6 -0
- package/CLAUDE.md +97 -89
- package/LICENSE +21 -21
- package/README.md +15 -15
- package/dist/interfaces/Donation.d.ts +6 -0
- package/dist/interfaces/Donation.d.ts.map +1 -1
- package/dist/interfaces/Donation.js.map +1 -1
- package/package.json +55 -54
- package/scripts/build-cjs.js +32 -32
- package/src/ApiHelper.ts +176 -176
- package/src/AppearanceHelper.ts +69 -69
- package/src/ArrayHelper.ts +157 -157
- package/src/CommonEnvironmentHelper.ts +104 -104
- package/src/CurrencyHelper.ts +10 -10
- package/src/DateHelper.ts +153 -153
- package/src/DonationHelper.ts +26 -26
- package/src/ErrorHelper.ts +39 -39
- package/src/EventHelper.ts +49 -49
- package/src/FileHelper.ts +55 -55
- package/src/PersonHelper.ts +82 -82
- package/src/UniqueIdHelper.ts +36 -36
- package/src/UserHelper.ts +59 -59
- package/src/index.ts +15 -15
- package/src/interfaces/Access.ts +138 -138
- package/src/interfaces/Attendance.ts +45 -45
- package/src/interfaces/Content.ts +84 -84
- package/src/interfaces/Doing.ts +93 -93
- package/src/interfaces/Donation.ts +190 -183
- package/src/interfaces/Error.ts +17 -17
- package/src/interfaces/Membership.ts +184 -184
- package/src/interfaces/Messaging.ts +96 -96
- package/src/interfaces/Permissions.ts +92 -92
- package/src/interfaces/Reporting.ts +41 -41
- package/src/interfaces/UserContextInterface.ts +13 -13
- package/src/interfaces/index.ts +13 -13
- package/tsconfig.json +36 -36
- package/eslint.config.js +0 -33
|
@@ -1,183 +1,190 @@
|
|
|
1
|
-
import { PersonInterface } from ".";
|
|
2
|
-
|
|
3
|
-
export interface DonationBatchInterface {
|
|
4
|
-
id?: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
batchDate?: Date;
|
|
7
|
-
donationCount?: number;
|
|
8
|
-
totalAmount?: number;
|
|
9
|
-
}
|
|
10
|
-
export interface DonationInterface {
|
|
11
|
-
id?: string;
|
|
12
|
-
batchId?: string;
|
|
13
|
-
personId?: string;
|
|
14
|
-
donationDate?: Date;
|
|
15
|
-
amount?: number;
|
|
16
|
-
method?: string;
|
|
17
|
-
methodDetails?: string;
|
|
18
|
-
notes?: string;
|
|
19
|
-
person?: PersonInterface;
|
|
20
|
-
fund?: FundInterface;
|
|
21
|
-
}
|
|
22
|
-
export interface DonationSummaryInterface {
|
|
23
|
-
week: number;
|
|
24
|
-
donations?: DonationSummaryDonation[];
|
|
25
|
-
}
|
|
26
|
-
export interface DonationSummaryDonation {
|
|
27
|
-
totalAmount: number;
|
|
28
|
-
fund?: FundInterface;
|
|
29
|
-
}
|
|
30
|
-
export interface FundInterface {
|
|
31
|
-
id: string;
|
|
32
|
-
name: string;
|
|
33
|
-
taxDeductible?: boolean;
|
|
34
|
-
amount?: number;
|
|
35
|
-
}
|
|
36
|
-
export interface FundDonationInterface {
|
|
37
|
-
id?: string;
|
|
38
|
-
donationId?: string;
|
|
39
|
-
fundId?: string;
|
|
40
|
-
amount?: number;
|
|
41
|
-
donation?: DonationInterface;
|
|
42
|
-
}
|
|
43
|
-
export interface PaymentMethodInterface {
|
|
44
|
-
id?: string;
|
|
45
|
-
churchId?: string;
|
|
46
|
-
personId?: string;
|
|
47
|
-
customerId?: string;
|
|
48
|
-
email?: string;
|
|
49
|
-
name?: string;
|
|
50
|
-
provider?: "stripe" | "paypal";
|
|
51
|
-
type?: "card" | "bank" | "paypal";
|
|
52
|
-
last4?: string;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
this.
|
|
181
|
-
this.
|
|
182
|
-
|
|
183
|
-
|
|
1
|
+
import { PersonInterface } from ".";
|
|
2
|
+
|
|
3
|
+
export interface DonationBatchInterface {
|
|
4
|
+
id?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
batchDate?: Date;
|
|
7
|
+
donationCount?: number;
|
|
8
|
+
totalAmount?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface DonationInterface {
|
|
11
|
+
id?: string;
|
|
12
|
+
batchId?: string;
|
|
13
|
+
personId?: string;
|
|
14
|
+
donationDate?: Date;
|
|
15
|
+
amount?: number;
|
|
16
|
+
method?: string;
|
|
17
|
+
methodDetails?: string;
|
|
18
|
+
notes?: string;
|
|
19
|
+
person?: PersonInterface;
|
|
20
|
+
fund?: FundInterface;
|
|
21
|
+
}
|
|
22
|
+
export interface DonationSummaryInterface {
|
|
23
|
+
week: number;
|
|
24
|
+
donations?: DonationSummaryDonation[];
|
|
25
|
+
}
|
|
26
|
+
export interface DonationSummaryDonation {
|
|
27
|
+
totalAmount: number;
|
|
28
|
+
fund?: FundInterface;
|
|
29
|
+
}
|
|
30
|
+
export interface FundInterface {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
taxDeductible?: boolean;
|
|
34
|
+
amount?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface FundDonationInterface {
|
|
37
|
+
id?: string;
|
|
38
|
+
donationId?: string;
|
|
39
|
+
fundId?: string;
|
|
40
|
+
amount?: number;
|
|
41
|
+
donation?: DonationInterface;
|
|
42
|
+
}
|
|
43
|
+
export interface PaymentMethodInterface {
|
|
44
|
+
id?: string;
|
|
45
|
+
churchId?: string;
|
|
46
|
+
personId?: string;
|
|
47
|
+
customerId?: string;
|
|
48
|
+
email?: string;
|
|
49
|
+
name?: string;
|
|
50
|
+
provider?: "stripe" | "paypal";
|
|
51
|
+
type?: "card" | "bank" | "paypal";
|
|
52
|
+
last4?: string;
|
|
53
|
+
gatewayId?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface StripeCardUpdateInterface {
|
|
56
|
+
paymentMethodId: string;
|
|
57
|
+
cardData: StripeCardDataInterface;
|
|
58
|
+
personId?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface StripeCardDataInterface {
|
|
61
|
+
card: StripeCardExpirationInterface;
|
|
62
|
+
}
|
|
63
|
+
export interface StripeCardExpirationInterface {
|
|
64
|
+
exp_month: string;
|
|
65
|
+
exp_year: string;
|
|
66
|
+
}
|
|
67
|
+
export interface StripeBankAccountInterface {
|
|
68
|
+
account_holder_name: any;
|
|
69
|
+
account_holder_type: any;
|
|
70
|
+
country: string;
|
|
71
|
+
currency: string;
|
|
72
|
+
account_number: any;
|
|
73
|
+
routing_number: any;
|
|
74
|
+
}
|
|
75
|
+
export interface StripeBankAccountUpdateInterface {
|
|
76
|
+
paymentMethodId: string;
|
|
77
|
+
customerId: string;
|
|
78
|
+
personId?: string;
|
|
79
|
+
bankData: StripeBankAccountHolderDataInterface;
|
|
80
|
+
}
|
|
81
|
+
export interface StripeBankAccountHolderDataInterface {
|
|
82
|
+
account_holder_name: string;
|
|
83
|
+
account_holder_type: string;
|
|
84
|
+
}
|
|
85
|
+
export interface StripeBankAccountVerifyInterface {
|
|
86
|
+
customerId: string;
|
|
87
|
+
paymentMethodId: string;
|
|
88
|
+
amountData: { amounts: string[] };
|
|
89
|
+
}
|
|
90
|
+
export interface StripePersonDonationInterface {
|
|
91
|
+
id: string;
|
|
92
|
+
email: string;
|
|
93
|
+
name: string;
|
|
94
|
+
}
|
|
95
|
+
export interface StripeFundDonationInterface {
|
|
96
|
+
id: string;
|
|
97
|
+
amount: number;
|
|
98
|
+
name?: string;
|
|
99
|
+
}
|
|
100
|
+
export interface StripeDonationInterface {
|
|
101
|
+
id?: string;
|
|
102
|
+
type?: string;
|
|
103
|
+
amount?: number;
|
|
104
|
+
customerId?: string;
|
|
105
|
+
billing_cycle_anchor?: number;
|
|
106
|
+
proration_behavior?: string;
|
|
107
|
+
interval?: StripeDonationIntervalInterface;
|
|
108
|
+
person?: StripePersonDonationInterface;
|
|
109
|
+
funds?: StripeFundDonationInterface[];
|
|
110
|
+
notes?: string;
|
|
111
|
+
churchId?: string;
|
|
112
|
+
}
|
|
113
|
+
export interface StripeDonationIntervalInterface {
|
|
114
|
+
interval: string;
|
|
115
|
+
interval_count: number;
|
|
116
|
+
}
|
|
117
|
+
export interface SubscriptionInterface {
|
|
118
|
+
id: string;
|
|
119
|
+
funds: [];
|
|
120
|
+
billing_cycle_anchor: number;
|
|
121
|
+
default_payment_method: string;
|
|
122
|
+
default_source: string;
|
|
123
|
+
plan: { amount: number; interval: string; interval_count: number };
|
|
124
|
+
customer: string;
|
|
125
|
+
gatewayId?: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface PayPalPaymentMethodInterface {
|
|
129
|
+
id: string;
|
|
130
|
+
type: "paypal";
|
|
131
|
+
name: string;
|
|
132
|
+
last4?: string;
|
|
133
|
+
email?: string;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface PayPalDonationInterface {
|
|
137
|
+
gatewayId?: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface PaymentGatewayInterface {
|
|
141
|
+
id: string;
|
|
142
|
+
provider: "stripe" | "paypal";
|
|
143
|
+
publicKey: string;
|
|
144
|
+
enabled: boolean;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface MultiGatewayDonationInterface {
|
|
148
|
+
id: string;
|
|
149
|
+
type: "card" | "bank" | "paypal";
|
|
150
|
+
provider: "stripe" | "paypal";
|
|
151
|
+
customerId?: string;
|
|
152
|
+
person?: {
|
|
153
|
+
id?: string;
|
|
154
|
+
email?: string;
|
|
155
|
+
name?: string;
|
|
156
|
+
};
|
|
157
|
+
amount: number;
|
|
158
|
+
billing_cycle_anchor?: number;
|
|
159
|
+
interval?: {
|
|
160
|
+
interval_count: number;
|
|
161
|
+
interval: string;
|
|
162
|
+
};
|
|
163
|
+
funds?: FundDonationInterface[];
|
|
164
|
+
notes?: string;
|
|
165
|
+
gatewayId?: string;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export class StripePaymentMethod {
|
|
169
|
+
id: string;
|
|
170
|
+
type: string;
|
|
171
|
+
name: string;
|
|
172
|
+
last4: string;
|
|
173
|
+
exp_month?: string;
|
|
174
|
+
exp_year?: string;
|
|
175
|
+
status?: string;
|
|
176
|
+
account_holder_name?: string;
|
|
177
|
+
account_holder_type?: string;
|
|
178
|
+
|
|
179
|
+
constructor(obj?: any) {
|
|
180
|
+
this.id = obj?.id || null;
|
|
181
|
+
this.type = obj?.type || (obj?.object && obj.object === "bank_account" ? "bank" : null);
|
|
182
|
+
this.name = obj?.card?.brand || obj?.bank_name || null;
|
|
183
|
+
this.last4 = obj?.last4 || obj?.card?.last4 || null;
|
|
184
|
+
this.exp_month = obj?.exp_month || obj?.card?.exp_month || null;
|
|
185
|
+
this.exp_year = obj?.exp_year || obj?.card?.exp_year || null;
|
|
186
|
+
this.status = obj?.status || null;
|
|
187
|
+
this.account_holder_name = obj?.account_holder_name || "";
|
|
188
|
+
this.account_holder_type = obj?.account_holder_type || "individual";
|
|
189
|
+
}
|
|
190
|
+
}
|
package/src/interfaces/Error.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export interface ErrorLogInterface {
|
|
2
|
-
application?: string;
|
|
3
|
-
errorTime?: Date;
|
|
4
|
-
userId?: string;
|
|
5
|
-
churchId?: string;
|
|
6
|
-
originUrl?: string;
|
|
7
|
-
errorType?: string;
|
|
8
|
-
message?: string;
|
|
9
|
-
details?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface ErrorAppDataInterface {
|
|
13
|
-
churchId: string;
|
|
14
|
-
userId: string;
|
|
15
|
-
originUrl: string;
|
|
16
|
-
application: string;
|
|
17
|
-
}
|
|
1
|
+
export interface ErrorLogInterface {
|
|
2
|
+
application?: string;
|
|
3
|
+
errorTime?: Date;
|
|
4
|
+
userId?: string;
|
|
5
|
+
churchId?: string;
|
|
6
|
+
originUrl?: string;
|
|
7
|
+
errorType?: string;
|
|
8
|
+
message?: string;
|
|
9
|
+
details?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface ErrorAppDataInterface {
|
|
13
|
+
churchId: string;
|
|
14
|
+
userId: string;
|
|
15
|
+
originUrl: string;
|
|
16
|
+
application: string;
|
|
17
|
+
}
|