@churchapps/helpers 1.2.24 → 1.2.26

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 (43) hide show
  1. package/dist/interfaces/Messaging.d.ts +21 -0
  2. package/dist/interfaces/Messaging.d.ts.map +1 -1
  3. package/dist/interfaces/Permissions.d.ts +9 -0
  4. package/dist/interfaces/Permissions.d.ts.map +1 -1
  5. package/dist/interfaces/Permissions.js +5 -0
  6. package/dist/interfaces/Permissions.js.map +1 -1
  7. package/package.json +10 -5
  8. package/.github/FUNDING.yml +0 -1
  9. package/.yarnrc.yml +0 -6
  10. package/eslint.config.js +0 -48
  11. package/scripts/build-cjs.js +0 -33
  12. package/src/ApiHelper.ts +0 -169
  13. package/src/AppearanceHelper.ts +0 -69
  14. package/src/ArrayHelper.ts +0 -139
  15. package/src/CommonEnvironmentHelper.ts +0 -104
  16. package/src/CurrencyHelper.ts +0 -66
  17. package/src/DateHelper.ts +0 -180
  18. package/src/DonationHelper.ts +0 -25
  19. package/src/ErrorHelper.ts +0 -38
  20. package/src/EventHelper.ts +0 -83
  21. package/src/FileHelper.ts +0 -57
  22. package/src/PersonHelper.ts +0 -80
  23. package/src/PlanHelper.ts +0 -135
  24. package/src/UniqueIdHelper.ts +0 -159
  25. package/src/UserHelper.ts +0 -61
  26. package/src/contentProviders/ContentProvider.ts +0 -15
  27. package/src/contentProviders/LessonsContentProvider.ts +0 -278
  28. package/src/contentProviders/index.ts +0 -2
  29. package/src/index.ts +0 -16
  30. package/src/interfaces/Access.ts +0 -138
  31. package/src/interfaces/Attendance.ts +0 -45
  32. package/src/interfaces/Content.ts +0 -84
  33. package/src/interfaces/Doing.ts +0 -142
  34. package/src/interfaces/Donation.ts +0 -193
  35. package/src/interfaces/Error.ts +0 -17
  36. package/src/interfaces/Lessons.ts +0 -61
  37. package/src/interfaces/Membership.ts +0 -184
  38. package/src/interfaces/Messaging.ts +0 -96
  39. package/src/interfaces/Permissions.ts +0 -78
  40. package/src/interfaces/Reporting.ts +0 -41
  41. package/src/interfaces/UserContextInterface.ts +0 -13
  42. package/src/interfaces/index.ts +0 -14
  43. package/tsconfig.json +0 -36
@@ -1,138 +0,0 @@
1
- import { PersonInterface } from "./Membership.js";
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,45 +0,0 @@
1
- import { CampusInterface, ServiceInterface, ServiceTimeInterface, PersonInterface } from "./index.js";
2
-
3
- export interface AttendanceInterface {
4
- campus: CampusInterface;
5
- service: ServiceInterface;
6
- serviceTime: ServiceTimeInterface;
7
- groupId: string;
8
- }
9
- export interface AttendanceRecordInterface {
10
- serviceTime: ServiceTimeInterface;
11
- service: ServiceInterface;
12
- campus: CampusInterface;
13
- week: number;
14
- count: number;
15
- visitDate: Date;
16
- groupId: string;
17
- }
18
- export interface VisitInterface {
19
- id?: string;
20
- personId?: string;
21
- serviceId?: string;
22
- groupId?: string;
23
- visitDate?: Date;
24
- visitSessions?: VisitSessionInterface[];
25
- person?: PersonInterface;
26
- }
27
- export interface VisitSessionInterface {
28
- id?: string;
29
- visitId?: string;
30
- sessionId?: string;
31
- visit?: VisitInterface;
32
- session?: SessionInterface;
33
- }
34
- export interface SessionInterface {
35
- id?: string;
36
- groupId: string;
37
- serviceTimeId: string;
38
- sessionDate?: Date;
39
- displayName: string;
40
- }
41
- export interface SettingInterface {
42
- id?: string;
43
- keyName?: string;
44
- value?: string;
45
- }
@@ -1,84 +0,0 @@
1
- export interface LinkInterface {
2
- id?: string;
3
- churchId?: string;
4
- url?: string;
5
- text?: string;
6
- sort?: number;
7
- linkType: string;
8
- linkData: string;
9
- icon: string;
10
- category: string;
11
- parentId?: string;
12
- children?: any;
13
- }
14
- export interface SermonInterface {
15
- id?: string;
16
- churchId?: string;
17
- playlistId?: string;
18
- videoType?: string;
19
- videoData?: string;
20
- videoUrl?: string;
21
- title?: string;
22
- description?: string;
23
- publishDate?: Date;
24
- thumbnail?: string;
25
- duration?: number;
26
- permanentUrl?: boolean;
27
- }
28
- export interface PlaylistInterface {
29
- id?: string;
30
- churchId?: string;
31
- title?: string;
32
- description?: string;
33
- publishDate?: Date;
34
- thumbnail?: string;
35
- }
36
- export interface StreamingServiceInterface {
37
- id?: string;
38
- churchId?: string;
39
- serviceTime?: Date;
40
- earlyStart?: number;
41
- duration: number;
42
- chatBefore: number;
43
- chatAfter: number;
44
- provider: string;
45
- providerKey: string;
46
- videoUrl: string;
47
- timezoneOffset: number;
48
- recurring: boolean;
49
- label: string;
50
- sermonId?: string;
51
- }
52
- export interface EventInterface {
53
- id?: string;
54
- churchId?: string;
55
- groupId?: string;
56
- start?: Date;
57
- end?: Date;
58
- title?: string;
59
- description?: string;
60
- allDay?: boolean;
61
- visibility?: string;
62
- recurrenceRule?: string;
63
- exceptionDates?: Date[];
64
- }
65
- export interface EventExceptionInterface {
66
- id?: string;
67
- churchId?: string;
68
- eventId?: string;
69
- exceptionDate?: Date;
70
- }
71
- export interface CuratedCalendarInterface {
72
- id?: string;
73
- churchId?: string;
74
- name?: string;
75
- }
76
- export interface CuratedEventInterface {
77
- id?: string;
78
- churchId?: string;
79
- curratedCalendarId?: string;
80
- groupId?: string;
81
- eventId?: string;
82
- }
83
- export interface CuratedEventWithEventInterface extends EventInterface, CuratedEventInterface {}
84
- export type VisibilityOptions = "public" | "private" | "hidden";
@@ -1,142 +0,0 @@
1
- export interface ActionInterface {
2
- id?: string;
3
- automationId?: string;
4
- actionType?: string;
5
- actionData?: string;
6
- }
7
- export interface AutomationInterface {
8
- id?: string;
9
- title: string;
10
- recurs: string;
11
- active: boolean;
12
- }
13
- export interface ConditionInterface {
14
- id?: string;
15
- conjunctionId?: string;
16
- field?: string;
17
- fieldData?: string;
18
- operator?: string;
19
- value?: string;
20
- label?: string;
21
- }
22
- export interface ConjunctionInterface {
23
- id?: string;
24
- automationId?: string;
25
- parentId?: string;
26
- groupType?: string;
27
- conjunctions?: ConjunctionInterface[];
28
- conditions?: ConditionInterface[];
29
- }
30
- export interface TaskInterface {
31
- id?: string;
32
- taskNumber?: number;
33
- taskType?: string;
34
- dateCreated?: Date;
35
- dateClosed?: Date;
36
- associatedWithType?: string;
37
- associatedWithId?: string;
38
- associatedWithLabel?: string;
39
- createdByType?: string;
40
- createdById?: string;
41
- createdByLabel?: string;
42
- assignedToType?: string;
43
- assignedToId?: string;
44
- assignedToLabel?: string;
45
- title?: string;
46
- status?: string;
47
- automationId?: string;
48
- conversationId?: string;
49
- data?: string;
50
- }
51
-
52
- export interface PlanInterface {
53
- id?: string;
54
- churchId?: string;
55
- name?: string;
56
- ministryId?: string;
57
- serviceDate?: Date;
58
- notes?: string;
59
- contentType?: string;
60
- contentId?: string;
61
- // Content provider fields
62
- providerId?: string;
63
- providerPlanId?: string; // Path to the content in the provider
64
- providerPlanName?: string;
65
- }
66
- export interface PositionInterface {
67
- id?: string;
68
- churchId?: string;
69
- planId?: string;
70
- categoryName?: string;
71
- name?: string;
72
- count?: number;
73
- groupId?: string;
74
- }
75
- export interface AssignmentInterface {
76
- id?: string;
77
- churchId?: string;
78
- positionId?: string;
79
- personId?: string;
80
- status?: string;
81
- notified?: Date;
82
- }
83
- export interface TimeInterface {
84
- id?: string;
85
- churchId?: string;
86
- planId?: string;
87
- displayName?: string;
88
- startTime?: Date;
89
- endTime?: Date;
90
- teams?: string;
91
- teamList?: string[];
92
- }
93
- export interface BlockoutDateInterface {
94
- id?: string;
95
- churchId?: string;
96
- personId?: string;
97
- startDate?: Date;
98
- endDate?: Date;
99
- }
100
-
101
- export interface ExternalVenueRefInterface {
102
- externalProviderId: string;
103
- programId: string;
104
- studyId: string;
105
- lessonId: string;
106
- venueId: string;
107
- }
108
-
109
- export interface ContentFileInterface {
110
- id?: string;
111
- name?: string;
112
- url?: string;
113
- fileType?: string; // "image", "video", "audio", "document"
114
- seconds?: number;
115
- }
116
-
117
- export interface PlanItemContentInterface {
118
- provider: string; // "lessons", "songs", "media", "church"
119
- embedUrl?: string; // URL for iframe embed
120
- html?: string; // Raw HTML content
121
- files?: ContentFileInterface[];
122
- metadata?: Record<string, any>; // Provider-specific data
123
- }
124
-
125
- export interface PlanItemInterface {
126
- id?: string;
127
- planId?: string;
128
- parentId?: string;
129
- sort?: number;
130
- itemType?: string; // "header", "song", "lessonAction", "lessonAddOn", "lessonSection", "item"
131
- relatedId?: string;
132
- label?: string;
133
- description?: string;
134
- seconds?: number;
135
- link?: string;
136
- children?: PlanItemInterface[];
137
- content?: PlanItemContentInterface; // Populated by PlanHelper
138
- providerId?: string; // Provider that owns this item's content
139
- providerPath?: string; // Path to fetch instructions from provider
140
- providerContentPath?: string; // Dot-notation path to specific content item (e.g. "0.2.1")
141
- thumbnailUrl?: string;
142
- }
@@ -1,193 +0,0 @@
1
- import { PersonInterface } from "./index.js";
2
-
3
- export type DonationStatus = "pending" | "complete" | "failed";
4
-
5
- export interface DonationBatchInterface {
6
- id?: string;
7
- name?: string;
8
- batchDate?: string; // YYYY-MM-DD format - date-only field
9
- donationCount?: number;
10
- totalAmount?: number;
11
- }
12
- export interface DonationInterface {
13
- id?: string;
14
- batchId?: string;
15
- personId?: string;
16
- donationDate?: string; // YYYY-MM-DD format - date-only field
17
- amount?: number;
18
- method?: string;
19
- methodDetails?: string;
20
- notes?: string;
21
- status?: DonationStatus;
22
- person?: PersonInterface;
23
- fund?: FundInterface;
24
- }
25
- export interface DonationSummaryInterface {
26
- week: number;
27
- donations?: DonationSummaryDonation[];
28
- }
29
- export interface DonationSummaryDonation {
30
- totalAmount: number;
31
- fund?: FundInterface;
32
- }
33
- export interface FundInterface {
34
- id: string;
35
- name: string;
36
- taxDeductible?: boolean;
37
- amount?: number;
38
- }
39
- export interface FundDonationInterface {
40
- id?: string;
41
- donationId?: string;
42
- fundId?: string;
43
- amount?: number;
44
- donation?: DonationInterface;
45
- }
46
- export interface PaymentMethodInterface {
47
- id?: string;
48
- churchId?: string;
49
- personId?: string;
50
- customerId?: string;
51
- email?: string;
52
- name?: string;
53
- provider?: "stripe" | "paypal";
54
- type?: "card" | "bank" | "paypal";
55
- last4?: string;
56
- gatewayId?: string;
57
- }
58
- export interface StripeCardUpdateInterface {
59
- paymentMethodId: string;
60
- cardData: StripeCardDataInterface;
61
- personId?: string;
62
- }
63
- export interface StripeCardDataInterface {
64
- card: StripeCardExpirationInterface;
65
- }
66
- export interface StripeCardExpirationInterface {
67
- exp_month: string;
68
- exp_year: string;
69
- }
70
- export interface StripeBankAccountInterface {
71
- account_holder_name: any;
72
- account_holder_type: any;
73
- country: string;
74
- currency: string;
75
- account_number: any;
76
- routing_number: any;
77
- }
78
- export interface StripeBankAccountUpdateInterface {
79
- paymentMethodId: string;
80
- customerId: string;
81
- personId?: string;
82
- bankData: StripeBankAccountHolderDataInterface;
83
- }
84
- export interface StripeBankAccountHolderDataInterface {
85
- account_holder_name: string;
86
- account_holder_type: string;
87
- }
88
- export interface StripeBankAccountVerifyInterface {
89
- customerId: string;
90
- paymentMethodId: string;
91
- amountData: { amounts: string[] };
92
- }
93
- export interface StripePersonDonationInterface {
94
- id: string;
95
- email: string;
96
- name: string;
97
- }
98
- export interface StripeFundDonationInterface {
99
- id: string;
100
- amount: number;
101
- name?: string;
102
- }
103
- export interface StripeDonationInterface {
104
- id?: string;
105
- type?: string;
106
- amount?: number;
107
- customerId?: string;
108
- billing_cycle_anchor?: number;
109
- proration_behavior?: string;
110
- interval?: StripeDonationIntervalInterface;
111
- person?: StripePersonDonationInterface;
112
- funds?: StripeFundDonationInterface[];
113
- notes?: string;
114
- churchId?: string;
115
- }
116
- export interface StripeDonationIntervalInterface {
117
- interval: string;
118
- interval_count: number;
119
- }
120
- export interface SubscriptionInterface {
121
- id: string;
122
- funds: [];
123
- billing_cycle_anchor: number;
124
- default_payment_method: string;
125
- default_source: string;
126
- plan: { amount: number; interval: string; interval_count: number };
127
- customer: string;
128
- gatewayId?: string;
129
- }
130
-
131
- export interface PayPalPaymentMethodInterface {
132
- id: string;
133
- type: "paypal";
134
- name: string;
135
- last4?: string;
136
- email?: string;
137
- }
138
-
139
- export interface PayPalDonationInterface {
140
- gatewayId?: string;
141
- }
142
-
143
- export interface PaymentGatewayInterface {
144
- id: string;
145
- provider: "stripe" | "paypal";
146
- publicKey: string;
147
- enabled: boolean;
148
- }
149
-
150
- export interface MultiGatewayDonationInterface {
151
- id: string;
152
- type: "card" | "bank" | "paypal";
153
- provider: "stripe" | "paypal";
154
- customerId?: string;
155
- person?: {
156
- id?: string;
157
- email?: string;
158
- name?: string;
159
- };
160
- amount: number;
161
- billing_cycle_anchor?: number;
162
- interval?: {
163
- interval_count: number;
164
- interval: string;
165
- };
166
- funds?: FundDonationInterface[];
167
- notes?: string;
168
- gatewayId?: string;
169
- }
170
-
171
- export class StripePaymentMethod {
172
- id: string;
173
- type: string;
174
- name: string;
175
- last4: string;
176
- exp_month?: string;
177
- exp_year?: string;
178
- status?: string;
179
- account_holder_name?: string;
180
- account_holder_type?: string;
181
-
182
- constructor(obj?: any) {
183
- this.id = obj?.id || null;
184
- this.type = obj?.type || (obj?.object && obj.object === "bank_account" ? "bank" : null);
185
- this.name = obj?.card?.brand || obj?.bank_name || null;
186
- this.last4 = obj?.last4 || obj?.card?.last4 || null;
187
- this.exp_month = obj?.exp_month || obj?.card?.exp_month || null;
188
- this.exp_year = obj?.exp_year || obj?.card?.exp_year || null;
189
- this.status = obj?.status || null;
190
- this.account_holder_name = obj?.account_holder_name || "";
191
- this.account_holder_type = obj?.account_holder_type || "individual";
192
- }
193
- }
@@ -1,17 +0,0 @@
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,61 +0,0 @@
1
- // Interfaces for Lessons API responses (tree structures)
2
-
3
- export interface LessonActionInterface {
4
- id: string;
5
- name: string;
6
- actionType: string;
7
- roleName?: string;
8
- seconds?: number;
9
- }
10
-
11
- export interface LessonSectionInterface {
12
- id: string;
13
- name: string;
14
- actions?: LessonActionInterface[];
15
- }
16
-
17
- export interface LessonVenueInterface {
18
- id: string;
19
- name: string;
20
- sections?: LessonSectionInterface[];
21
- }
22
-
23
- export interface LessonInfoInterface {
24
- id: string;
25
- name: string;
26
- venues?: LessonVenueInterface[];
27
- }
28
-
29
- export interface LessonStudyInterface {
30
- id: string;
31
- name: string;
32
- lessons?: LessonInfoInterface[];
33
- }
34
-
35
- export interface LessonProgramInterface {
36
- id: string;
37
- name: string;
38
- studies?: LessonStudyInterface[];
39
- }
40
-
41
- // Response from /lessons/public/tree
42
- export interface LessonTreeInterface {
43
- programs?: LessonProgramInterface[];
44
- }
45
-
46
- // Response from /lessons/public/actionTree (same structure as LessonTreeInterface)
47
- export interface LessonActionTreeInterface {
48
- programs?: LessonProgramInterface[];
49
- }
50
-
51
- // Response from /venues/public/actions/{id}
52
- export interface VenueActionResponseInterface {
53
- venueName?: string;
54
- sections?: LessonSectionInterface[];
55
- }
56
-
57
- // Response from /venues/public/planItems/{id}
58
- export interface VenuePlanItemsResponseInterface {
59
- venueName?: string;
60
- items?: import("./Doing.js").PlanItemInterface[];
61
- }