@churchapps/helpers 1.2.23 → 1.2.25
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/dist/ApiHelper.js +4 -4
- package/dist/ApiHelper.js.map +1 -1
- package/dist/ArrayHelper.d.ts.map +1 -1
- package/dist/ArrayHelper.js.map +1 -1
- package/dist/CommonEnvironmentHelper.d.ts.map +1 -1
- package/dist/CommonEnvironmentHelper.js.map +1 -1
- package/dist/CurrencyHelper.js +3 -3
- package/dist/DateHelper.d.ts.map +1 -1
- package/dist/DateHelper.js +22 -22
- package/dist/DateHelper.js.map +1 -1
- package/dist/DonationHelper.d.ts.map +1 -1
- package/dist/DonationHelper.js +2 -2
- package/dist/DonationHelper.js.map +1 -1
- package/dist/ErrorHelper.d.ts.map +1 -1
- package/dist/ErrorHelper.js.map +1 -1
- package/dist/EventHelper.d.ts.map +1 -1
- package/dist/EventHelper.js +1 -1
- package/dist/EventHelper.js.map +1 -1
- package/dist/FileHelper.d.ts.map +1 -1
- package/dist/FileHelper.js +11 -9
- package/dist/FileHelper.js.map +1 -1
- package/dist/PersonHelper.d.ts.map +1 -1
- package/dist/PersonHelper.js +3 -3
- package/dist/PersonHelper.js.map +1 -1
- package/dist/PlanHelper.d.ts.map +1 -1
- package/dist/PlanHelper.js +1 -3
- package/dist/PlanHelper.js.map +1 -1
- package/dist/UniqueIdHelper.d.ts.map +1 -1
- package/dist/UniqueIdHelper.js +130 -7
- package/dist/UniqueIdHelper.js.map +1 -1
- package/dist/UserHelper.d.ts.map +1 -1
- package/dist/UserHelper.js.map +1 -1
- package/dist/contentProviders/LessonsContentProvider.d.ts.map +1 -1
- package/dist/contentProviders/LessonsContentProvider.js.map +1 -1
- package/dist/interfaces/Doing.d.ts +3 -0
- package/dist/interfaces/Doing.d.ts.map +1 -1
- package/dist/interfaces/Messaging.d.ts +21 -0
- package/dist/interfaces/Messaging.d.ts.map +1 -1
- package/dist/interfaces/Permissions.d.ts +9 -0
- package/dist/interfaces/Permissions.d.ts.map +1 -1
- package/dist/interfaces/Permissions.js +12 -21
- package/dist/interfaces/Permissions.js.map +1 -1
- package/package.json +13 -11
- package/.eslintrc.json +0 -29
- package/.github/FUNDING.yml +0 -1
- package/.prettierrc +0 -12
- package/.yarnrc.yml +0 -6
- package/scripts/build-cjs.js +0 -33
- package/src/ApiHelper.ts +0 -169
- package/src/AppearanceHelper.ts +0 -69
- package/src/ArrayHelper.ts +0 -157
- package/src/CommonEnvironmentHelper.ts +0 -104
- package/src/CurrencyHelper.ts +0 -66
- package/src/DateHelper.ts +0 -183
- package/src/DonationHelper.ts +0 -26
- package/src/ErrorHelper.ts +0 -39
- package/src/EventHelper.ts +0 -84
- package/src/FileHelper.ts +0 -55
- package/src/PersonHelper.ts +0 -82
- package/src/PlanHelper.ts +0 -137
- package/src/UniqueIdHelper.ts +0 -36
- package/src/UserHelper.ts +0 -62
- package/src/contentProviders/ContentProvider.ts +0 -15
- package/src/contentProviders/LessonsContentProvider.ts +0 -279
- package/src/contentProviders/index.ts +0 -2
- package/src/index.ts +0 -16
- package/src/interfaces/Access.ts +0 -138
- package/src/interfaces/Attendance.ts +0 -45
- package/src/interfaces/Content.ts +0 -84
- package/src/interfaces/Doing.ts +0 -139
- package/src/interfaces/Donation.ts +0 -193
- package/src/interfaces/Error.ts +0 -17
- package/src/interfaces/Lessons.ts +0 -61
- package/src/interfaces/Membership.ts +0 -184
- package/src/interfaces/Messaging.ts +0 -96
- package/src/interfaces/Permissions.ts +0 -92
- package/src/interfaces/Reporting.ts +0 -41
- package/src/interfaces/UserContextInterface.ts +0 -13
- package/src/interfaces/index.ts +0 -14
- package/tsconfig.json +0 -36
package/src/UserHelper.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { ApiHelper } from "./ApiHelper.js"
|
|
2
|
-
import { UserInterface, UserContextInterface, IApiPermission, PersonInterface, LoginUserChurchInterface } from "./interfaces/index.js";
|
|
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 config = ApiHelper.getConfig(api);
|
|
44
|
-
if (!config) return false;
|
|
45
|
-
const permissions = config.permissions;
|
|
46
|
-
|
|
47
|
-
let result = false;
|
|
48
|
-
if (permissions !== undefined) {
|
|
49
|
-
permissions.forEach(element => {
|
|
50
|
-
if (element.contentType === contentType && element.action === action) result = true;
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
return result;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
static createAppUrl(appUrl: string, returnUrl: string) {
|
|
57
|
-
const config = ApiHelper.getConfig("MembershipApi");
|
|
58
|
-
const jwt = config?.jwt || "";
|
|
59
|
-
|
|
60
|
-
return `${appUrl}/login/?jwt=${jwt}&returnUrl=${returnUrl}`;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { PlanInterface, PlanItemInterface, PlanItemContentInterface } from "../interfaces/index.js";
|
|
2
|
-
|
|
3
|
-
export interface ContentProviderInterface {
|
|
4
|
-
// Unique identifier for this provider
|
|
5
|
-
readonly providerId: string;
|
|
6
|
-
|
|
7
|
-
// Check if this provider handles the given plan/planItem
|
|
8
|
-
canHandle(plan: PlanInterface, planItem: PlanItemInterface): boolean;
|
|
9
|
-
|
|
10
|
-
// Fetch content for multiple planItems (batch for efficiency)
|
|
11
|
-
fetchContent(
|
|
12
|
-
plan: PlanInterface,
|
|
13
|
-
planItems: PlanItemInterface[]
|
|
14
|
-
): Promise<Map<string, PlanItemContentInterface>>;
|
|
15
|
-
}
|
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
import { ApiHelper } from "../ApiHelper.js";
|
|
2
|
-
import type { PlanInterface, PlanItemInterface, PlanItemContentInterface, ExternalVenueRefInterface } from "../interfaces/index.js";
|
|
3
|
-
import type { VenuePlanItemsResponseInterface, VenueActionResponseInterface, LessonTreeInterface, LessonActionTreeInterface } from "../interfaces/Lessons.js";
|
|
4
|
-
import type { ContentProviderInterface } from "./ContentProvider.js";
|
|
5
|
-
|
|
6
|
-
export class LessonsContentProvider implements ContentProviderInterface {
|
|
7
|
-
readonly providerId = "lessons";
|
|
8
|
-
|
|
9
|
-
private lessonsUrl: string;
|
|
10
|
-
|
|
11
|
-
constructor(lessonsUrl: string = "https://lessons.church") {
|
|
12
|
-
this.lessonsUrl = lessonsUrl;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
canHandle(plan: PlanInterface, planItem: PlanItemInterface): boolean {
|
|
16
|
-
// Handles: lessonAction, lessonAddOn, lessonSection, and items with relatedId when plan has lesson
|
|
17
|
-
const lessonTypes = ["lessonAction", "lessonAddOn", "lessonSection"];
|
|
18
|
-
const hasLessonPlan = plan?.contentType === "venue" || plan?.contentType === "externalVenue";
|
|
19
|
-
|
|
20
|
-
if (lessonTypes.includes(planItem.itemType) && planItem.relatedId) return true;
|
|
21
|
-
if (planItem.itemType === "item" && planItem.relatedId && hasLessonPlan) return true;
|
|
22
|
-
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
async fetchContent(
|
|
27
|
-
plan: PlanInterface,
|
|
28
|
-
planItems: PlanItemInterface[]
|
|
29
|
-
): Promise<Map<string, PlanItemContentInterface>> {
|
|
30
|
-
const result = new Map<string, PlanItemContentInterface>();
|
|
31
|
-
|
|
32
|
-
// Group by type for efficient batching
|
|
33
|
-
const actions = planItems.filter(p => p.itemType === "lessonAction" && p.relatedId);
|
|
34
|
-
const addOns = planItems.filter(p => p.itemType === "lessonAddOn" && p.relatedId);
|
|
35
|
-
const sections = planItems.filter(p =>
|
|
36
|
-
(p.itemType === "lessonSection" || p.itemType === "item") && p.relatedId
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
const externalRef = this.getExternalRef(plan);
|
|
40
|
-
|
|
41
|
-
// Build embed URLs for each item
|
|
42
|
-
for (const item of actions) {
|
|
43
|
-
result.set(item.id, {
|
|
44
|
-
provider: this.providerId,
|
|
45
|
-
embedUrl: externalRef
|
|
46
|
-
? `${this.lessonsUrl}/embed/external/${externalRef.externalProviderId}/action/${item.relatedId}`
|
|
47
|
-
: `${this.lessonsUrl}/embed/action/${item.relatedId}`
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
for (const item of addOns) {
|
|
52
|
-
result.set(item.id, {
|
|
53
|
-
provider: this.providerId,
|
|
54
|
-
embedUrl: externalRef
|
|
55
|
-
? `${this.lessonsUrl}/embed/external/${externalRef.externalProviderId}/addon/${item.relatedId}`
|
|
56
|
-
: `${this.lessonsUrl}/embed/addon/${item.relatedId}`
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
for (const item of sections) {
|
|
61
|
-
result.set(item.id, {
|
|
62
|
-
provider: this.providerId,
|
|
63
|
-
embedUrl: externalRef
|
|
64
|
-
? `${this.lessonsUrl}/embed/external/${externalRef.externalProviderId}/section/${item.relatedId}`
|
|
65
|
-
: `${this.lessonsUrl}/embed/section/${item.relatedId}`
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return result;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// ============================================
|
|
73
|
-
// Plan/Lesson Association Methods
|
|
74
|
-
// ============================================
|
|
75
|
-
|
|
76
|
-
hasAssociatedLesson(plan: PlanInterface): boolean {
|
|
77
|
-
return (plan?.contentType === "venue" || plan?.contentType === "externalVenue") && !!plan?.contentId;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
isExternalVenue(plan: PlanInterface): boolean {
|
|
81
|
-
return plan?.contentType === "externalVenue";
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
getExternalRef(plan: PlanInterface): ExternalVenueRefInterface | null {
|
|
85
|
-
if (!this.isExternalVenue(plan) || !plan?.contentId) return null;
|
|
86
|
-
try {
|
|
87
|
-
return JSON.parse(plan.contentId);
|
|
88
|
-
} catch {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
getVenueId(plan: PlanInterface): string | null {
|
|
94
|
-
if (!this.hasAssociatedLesson(plan)) return null;
|
|
95
|
-
if (this.isExternalVenue(plan)) {
|
|
96
|
-
return this.getExternalRef(plan)?.venueId || null;
|
|
97
|
-
}
|
|
98
|
-
return plan.contentId || null;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// ============================================
|
|
102
|
-
// API Fetch Methods
|
|
103
|
-
// ============================================
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Fetch venue plan items - the basic hierarchical structure
|
|
107
|
-
* Returns: headers with children (sections), but sections don't have their actions
|
|
108
|
-
* Use this for preview mode display
|
|
109
|
-
*/
|
|
110
|
-
async fetchVenuePlanItems(plan: PlanInterface): Promise<VenuePlanItemsResponseInterface> {
|
|
111
|
-
if (!this.hasAssociatedLesson(plan)) return { items: [] };
|
|
112
|
-
const externalRef = this.getExternalRef(plan);
|
|
113
|
-
if (externalRef) {
|
|
114
|
-
return await ApiHelper.getAnonymous(
|
|
115
|
-
`/externalProviders/${externalRef.externalProviderId}/venue/${externalRef.venueId}/planItems`,
|
|
116
|
-
"LessonsApi"
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
return await ApiHelper.getAnonymous(`/venues/public/planItems/${plan.contentId}`, "LessonsApi");
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Fetch venue actions - sections with their full action lists
|
|
124
|
-
* Use this for action selection dialogs and full expansion
|
|
125
|
-
*/
|
|
126
|
-
async fetchVenueActions(plan: PlanInterface): Promise<VenueActionResponseInterface> {
|
|
127
|
-
if (!this.hasAssociatedLesson(plan)) return { sections: [] };
|
|
128
|
-
const externalRef = this.getExternalRef(plan);
|
|
129
|
-
if (externalRef) {
|
|
130
|
-
return await ApiHelper.getAnonymous(
|
|
131
|
-
`/externalProviders/${externalRef.externalProviderId}/venue/${externalRef.venueId}/actions`,
|
|
132
|
-
"LessonsApi"
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
return await ApiHelper.getAnonymous(`/venues/public/actions/${plan.contentId}`, "LessonsApi");
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Fetch the full lesson tree for browsing (programs -> studies -> lessons -> venues)
|
|
140
|
-
*/
|
|
141
|
-
async fetchLessonTree(): Promise<LessonTreeInterface> {
|
|
142
|
-
return await ApiHelper.getAnonymous("/lessons/public/tree", "LessonsApi");
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Fetch the action tree for action selection (includes actions in each venue section)
|
|
147
|
-
*/
|
|
148
|
-
async fetchActionTree(): Promise<LessonActionTreeInterface> {
|
|
149
|
-
return await ApiHelper.getAnonymous("/lessons/public/actionTree", "LessonsApi");
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// ============================================
|
|
153
|
-
// Display List Methods (for preview/display without full actions)
|
|
154
|
-
// ============================================
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Get the display list - hierarchical items suitable for preview
|
|
158
|
-
* Structure: headers -> sections (no actions expanded)
|
|
159
|
-
* This is the lightweight version for showing what a lesson contains
|
|
160
|
-
*/
|
|
161
|
-
async getDisplayList(plan: PlanInterface): Promise<PlanItemInterface[]> {
|
|
162
|
-
const response = await this.fetchVenuePlanItems(plan);
|
|
163
|
-
return response?.items || [];
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Get display list with sections only (strip actions from children)
|
|
168
|
-
* Use this when importing a lesson as editable plan items
|
|
169
|
-
*/
|
|
170
|
-
async getSectionsOnlyList(plan: PlanInterface): Promise<PlanItemInterface[]> {
|
|
171
|
-
const response = await this.fetchVenuePlanItems(plan);
|
|
172
|
-
if (!response?.items) return [];
|
|
173
|
-
|
|
174
|
-
return response.items.map(item => ({
|
|
175
|
-
...item,
|
|
176
|
-
children: item.children?.map(section => ({
|
|
177
|
-
...section,
|
|
178
|
-
children: undefined // Remove actions from sections
|
|
179
|
-
}))
|
|
180
|
-
}));
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// ============================================
|
|
184
|
-
// Expanded List Methods (with full actions)
|
|
185
|
-
// ============================================
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Get the fully expanded list - items with all actions populated in sections
|
|
189
|
-
* Merges fetchVenuePlanItems with fetchVenueActions to get complete data
|
|
190
|
-
*/
|
|
191
|
-
async getExpandedList(plan: PlanInterface): Promise<PlanItemInterface[]> {
|
|
192
|
-
const [planItemsResponse, actionsResponse] = await Promise.all([
|
|
193
|
-
this.fetchVenuePlanItems(plan),
|
|
194
|
-
this.fetchVenueActions(plan)
|
|
195
|
-
]);
|
|
196
|
-
|
|
197
|
-
if (!planItemsResponse?.items) return [];
|
|
198
|
-
|
|
199
|
-
// Create a map of section ID -> actions
|
|
200
|
-
const sectionActionsMap = new Map<string, PlanItemInterface[]>();
|
|
201
|
-
if (actionsResponse?.sections) {
|
|
202
|
-
for (const section of actionsResponse.sections) {
|
|
203
|
-
if (section.id && section.actions) {
|
|
204
|
-
sectionActionsMap.set(section.id, section.actions.map(action => ({
|
|
205
|
-
itemType: "lessonAction",
|
|
206
|
-
relatedId: action.id,
|
|
207
|
-
label: action.name,
|
|
208
|
-
description: action.actionType,
|
|
209
|
-
seconds: action.seconds
|
|
210
|
-
})));
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
// Recursively expand sections with their actions
|
|
216
|
-
const expandItem = (item: PlanItemInterface): PlanItemInterface => {
|
|
217
|
-
if (!item.children) return item;
|
|
218
|
-
|
|
219
|
-
return {
|
|
220
|
-
...item,
|
|
221
|
-
children: item.children.map(child => {
|
|
222
|
-
// If this is a section (has relatedId), try to get its actions
|
|
223
|
-
if (child.relatedId && sectionActionsMap.has(child.relatedId)) {
|
|
224
|
-
return {
|
|
225
|
-
...child,
|
|
226
|
-
children: sectionActionsMap.get(child.relatedId)
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
// Otherwise recursively process
|
|
230
|
-
return expandItem(child);
|
|
231
|
-
})
|
|
232
|
-
};
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
return planItemsResponse.items.map(expandItem);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
// ============================================
|
|
239
|
-
// Embed URL Helpers
|
|
240
|
-
// ============================================
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Get embed URL for an action
|
|
244
|
-
*/
|
|
245
|
-
getActionEmbedUrl(actionId: string, externalProviderId?: string): string {
|
|
246
|
-
if (externalProviderId) {
|
|
247
|
-
return `${this.lessonsUrl}/embed/external/${externalProviderId}/action/${actionId}`;
|
|
248
|
-
}
|
|
249
|
-
return `${this.lessonsUrl}/embed/action/${actionId}`;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Get embed URL for an add-on
|
|
254
|
-
*/
|
|
255
|
-
getAddOnEmbedUrl(addOnId: string, externalProviderId?: string): string {
|
|
256
|
-
if (externalProviderId) {
|
|
257
|
-
return `${this.lessonsUrl}/embed/external/${externalProviderId}/addon/${addOnId}`;
|
|
258
|
-
}
|
|
259
|
-
return `${this.lessonsUrl}/embed/addon/${addOnId}`;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Get embed URL for a section
|
|
264
|
-
*/
|
|
265
|
-
getSectionEmbedUrl(sectionId: string, externalProviderId?: string): string {
|
|
266
|
-
if (externalProviderId) {
|
|
267
|
-
return `${this.lessonsUrl}/embed/external/${externalProviderId}/section/${sectionId}`;
|
|
268
|
-
}
|
|
269
|
-
return `${this.lessonsUrl}/embed/section/${sectionId}`;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Get the external provider ID from a plan (if external)
|
|
274
|
-
*/
|
|
275
|
-
getExternalProviderId(plan: PlanInterface): string | null {
|
|
276
|
-
const externalRef = this.getExternalRef(plan);
|
|
277
|
-
return externalRef?.externalProviderId || null;
|
|
278
|
-
}
|
|
279
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export * from "./interfaces/index.js";
|
|
2
|
-
export { ApiHelper } from "./ApiHelper.js";
|
|
3
|
-
export { AppearanceHelper } from "./AppearanceHelper.js";
|
|
4
|
-
export { ArrayHelper } from "./ArrayHelper.js";
|
|
5
|
-
export { CommonEnvironmentHelper } from "./CommonEnvironmentHelper.js";
|
|
6
|
-
export { CurrencyHelper } from "./CurrencyHelper.js";
|
|
7
|
-
export { DateHelper } from "./DateHelper.js";
|
|
8
|
-
export { DonationHelper } from "./DonationHelper.js";
|
|
9
|
-
export { ErrorHelper } from "./ErrorHelper.js";
|
|
10
|
-
export { EventHelper } from "./EventHelper.js";
|
|
11
|
-
export { FileHelper } from "./FileHelper.js";
|
|
12
|
-
export { PersonHelper } from "./PersonHelper.js";
|
|
13
|
-
export { UserHelper } from "./UserHelper.js";
|
|
14
|
-
export { UniqueIdHelper } from "./UniqueIdHelper.js";
|
|
15
|
-
export { PlanHelper } from "./PlanHelper.js";
|
|
16
|
-
export * from "./contentProviders/index.js";
|
package/src/interfaces/Access.ts
DELETED
|
@@ -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";
|