mp-js-api 0.0.1

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 (48) hide show
  1. package/dist/index.d.ts +120 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +341 -0
  4. package/dist/tables/addresses.d.ts +55 -0
  5. package/dist/tables/addresses.d.ts.map +1 -0
  6. package/dist/tables/addresses.js +60 -0
  7. package/dist/tables/contact-attributes.d.ts +19 -0
  8. package/dist/tables/contact-attributes.d.ts.map +1 -0
  9. package/dist/tables/contact-attributes.js +24 -0
  10. package/dist/tables/contacts.d.ts +105 -0
  11. package/dist/tables/contacts.d.ts.map +1 -0
  12. package/dist/tables/contacts.js +114 -0
  13. package/dist/tables/event-participants.d.ts +47 -0
  14. package/dist/tables/event-participants.d.ts.map +1 -0
  15. package/dist/tables/event-participants.js +52 -0
  16. package/dist/tables/events.d.ts +117 -0
  17. package/dist/tables/events.d.ts.map +1 -0
  18. package/dist/tables/events.js +122 -0
  19. package/dist/tables/group-participants.d.ts +61 -0
  20. package/dist/tables/group-participants.d.ts.map +1 -0
  21. package/dist/tables/group-participants.js +66 -0
  22. package/dist/tables/groups.d.ts +103 -0
  23. package/dist/tables/groups.d.ts.map +1 -0
  24. package/dist/tables/groups.js +108 -0
  25. package/dist/tables/households.d.ts +55 -0
  26. package/dist/tables/households.d.ts.map +1 -0
  27. package/dist/tables/households.js +60 -0
  28. package/dist/tables/participants.d.ts +63 -0
  29. package/dist/tables/participants.d.ts.map +1 -0
  30. package/dist/tables/participants.js +68 -0
  31. package/dist/utils/strings.d.ts +2 -0
  32. package/dist/utils/strings.d.ts.map +1 -0
  33. package/dist/utils/strings.js +30 -0
  34. package/package.json +26 -0
  35. package/src/index.ts +571 -0
  36. package/src/tables/addresses.ts +111 -0
  37. package/src/tables/contact-attributes.ts +40 -0
  38. package/src/tables/contacts.ts +223 -0
  39. package/src/tables/event-participants.ts +95 -0
  40. package/src/tables/events.ts +235 -0
  41. package/src/tables/group-participants.ts +123 -0
  42. package/src/tables/groups.ts +207 -0
  43. package/src/tables/households.ts +111 -0
  44. package/src/tables/participants.ts +127 -0
  45. package/src/utils/strings.ts +29 -0
  46. package/src/utils/types.d.ts +7 -0
  47. package/test/index.spec.ts +103 -0
  48. package/tsconfig.json +25 -0
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapGroupParticipantRecord = mapGroupParticipantRecord;
4
+ exports.mapGroupParticipantToGroupParticipantRecord = mapGroupParticipantToGroupParticipantRecord;
5
+ function mapGroupParticipantRecord(originalObject) {
6
+ return {
7
+ groupParticipantID: originalObject.Group_Participant_ID,
8
+ groupID: originalObject.Group_ID,
9
+ participantID: originalObject.Participant_ID,
10
+ groupRoleID: originalObject.Group_Role_ID,
11
+ startDate: originalObject.Start_Date,
12
+ endDate: originalObject.End_Date,
13
+ employeeRole: originalObject.Employee_Role,
14
+ hoursPerWeek: originalObject.Hours_Per_Week,
15
+ notes: originalObject.Notes,
16
+ needBook: originalObject.Need_Book,
17
+ emailOptOut: originalObject.Email_Opt_Out,
18
+ shareWithGroup: originalObject.Share_With_Group,
19
+ autoPromote: originalObject.Auto_Promote,
20
+ firstAttendance: originalObject._First_Attendance,
21
+ secondAttendance: originalObject._Second_Attendance,
22
+ thirdAttendance: originalObject._Third_Attendance,
23
+ lastAttendance: originalObject._Last_Attendance,
24
+ showEmail: originalObject.Show_Email,
25
+ showPhone: originalObject.Show_Phone,
26
+ showLastName: originalObject.Show_Last_Name,
27
+ showPhoto: originalObject.Show_Photo,
28
+ _showBirthday: originalObject._Show_Birthday,
29
+ _showEmail: originalObject._Show_Email,
30
+ _showHomePhone: originalObject._Show_Home_Phone,
31
+ _showMobilePhone: originalObject._Show_Mobile_Phone,
32
+ _showAddress: originalObject._Show_Address,
33
+ _showPhoto: originalObject._Show_Photo,
34
+ };
35
+ }
36
+ function mapGroupParticipantToGroupParticipantRecord(groupParticipant) {
37
+ return {
38
+ Group_Participant_ID: groupParticipant.groupParticipantID,
39
+ Group_ID: groupParticipant.groupID,
40
+ Participant_ID: groupParticipant.participantID,
41
+ Group_Role_ID: groupParticipant.groupRoleID,
42
+ Start_Date: groupParticipant.startDate,
43
+ End_Date: groupParticipant.endDate,
44
+ Employee_Role: groupParticipant.employeeRole,
45
+ Hours_Per_Week: groupParticipant.hoursPerWeek,
46
+ Notes: groupParticipant.notes,
47
+ Need_Book: groupParticipant.needBook,
48
+ Email_Opt_Out: groupParticipant.emailOptOut,
49
+ Share_With_Group: groupParticipant.shareWithGroup,
50
+ Auto_Promote: groupParticipant.autoPromote,
51
+ _First_Attendance: groupParticipant.firstAttendance,
52
+ _Second_Attendance: groupParticipant.secondAttendance,
53
+ _Third_Attendance: groupParticipant.thirdAttendance,
54
+ _Last_Attendance: groupParticipant.lastAttendance,
55
+ Show_Email: groupParticipant.showEmail,
56
+ Show_Phone: groupParticipant.showPhone,
57
+ Show_Last_Name: groupParticipant.showLastName,
58
+ Show_Photo: groupParticipant.showPhoto,
59
+ _Show_Birthday: groupParticipant._showBirthday,
60
+ _Show_Email: groupParticipant._showEmail,
61
+ _Show_Home_Phone: groupParticipant._showHomePhone,
62
+ _Show_Mobile_Phone: groupParticipant._showMobilePhone,
63
+ _Show_Address: groupParticipant._showAddress,
64
+ _Show_Photo: groupParticipant._showPhoto,
65
+ };
66
+ }
@@ -0,0 +1,103 @@
1
+ export interface GroupRecord {
2
+ Group_ID: number;
3
+ Group_Name: string;
4
+ Group_Type_ID: number;
5
+ Ministry_ID: number;
6
+ Congregation_ID: number;
7
+ Primary_Contact: number;
8
+ Description: null | string;
9
+ Start_Date: string;
10
+ End_Date: string;
11
+ Target_Size: null | number;
12
+ Parent_Group: null | number;
13
+ Priority_ID: null | number;
14
+ Small_Group_Information: null | string;
15
+ Offsite_Meeting_Address: null | string;
16
+ Group_Is_Full: boolean;
17
+ Available_Online: boolean;
18
+ Meets_Online: boolean;
19
+ Life_Stage_ID: null | number;
20
+ Group_Focus_ID: number;
21
+ Meeting_Time: null | string;
22
+ Meeting_Day_ID: null | number;
23
+ Meeting_Frequency_ID: null | number;
24
+ Meeting_Duration_ID: null | number;
25
+ Required_Book: null | string;
26
+ Descended_From: null | number;
27
+ Reason_Ended: null | string;
28
+ _Last_Attendance_Posted: null | string;
29
+ _Last_Group_Member_Changed: string;
30
+ Check_in_Information: null | string;
31
+ Secure_Check_in: boolean;
32
+ Suppress_Nametag: boolean;
33
+ Suppress_Care_Note: boolean;
34
+ On_Classroom_Manager: boolean;
35
+ Promotion_Information: null | string;
36
+ Promote_to_Group: null | string;
37
+ Age_in_Months_to_Promote: null | number;
38
+ Promote_Weekly: boolean;
39
+ Promotion_Date: null | string;
40
+ Promote_Participants_Only: boolean;
41
+ Notifications: null | string;
42
+ Send_Attendance_Notification: boolean;
43
+ Send_Service_Notification: boolean;
44
+ Enable_Discussion: boolean;
45
+ SMS_Number: null | string;
46
+ Default_Meeting_Room: null | string;
47
+ Create_Next_Meeting: boolean;
48
+ Next_Scheduled_Meeting: null | string;
49
+ Available_On_App: null | string;
50
+ }
51
+ export interface Group {
52
+ groupID: number;
53
+ groupName: string;
54
+ groupTypeID: number;
55
+ ministryID: number;
56
+ congregationID: number;
57
+ primaryContact: number;
58
+ description: null | string;
59
+ startDate: string;
60
+ endDate: string;
61
+ targetSize: null | number;
62
+ parentGroup: null | number;
63
+ priorityID: null | number;
64
+ smallGroupInformation: null | string;
65
+ offsiteMeetingAddress: null | string;
66
+ groupIsFull: boolean;
67
+ availableOnline: boolean;
68
+ meetsOnline: boolean;
69
+ lifeStageID: null | number;
70
+ groupFocusID: number;
71
+ meetingTime: null | string;
72
+ meetingDayID: null | number;
73
+ meetingFrequencyID: null | number;
74
+ meetingDurationID: null | number;
75
+ requiredBook: null | string;
76
+ descendedFrom: null | number;
77
+ reasonEnded: null | string;
78
+ lastAttendancePosted: null | string;
79
+ lastGroupMemberChanged: string;
80
+ checkInInformation: null | string;
81
+ secureCheckIn: boolean;
82
+ suppressNametag: boolean;
83
+ suppressCareNote: boolean;
84
+ onClassroomManager: boolean;
85
+ promotionInformation: null | string;
86
+ promoteToGroup: null | string;
87
+ ageInMonthsToPromote: null | number;
88
+ promoteWeekly: boolean;
89
+ promotionDate: null | string;
90
+ promoteParticipantsOnly: boolean;
91
+ notifications: null | string;
92
+ sendAttendanceNotification: boolean;
93
+ sendServiceNotification: boolean;
94
+ enableDiscussion: boolean;
95
+ smsNumber: null | string;
96
+ defaultMeetingRoom: null | string;
97
+ createNextMeeting: boolean;
98
+ nextScheduledMeeting: null | string;
99
+ availableOnApp: null | string;
100
+ }
101
+ export declare function mapGroupRecord(record: GroupRecord): Group;
102
+ export declare function mapGroupToGroupRecord(group: Group): GroupRecord;
103
+ //# sourceMappingURL=groups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../src/tables/groups.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3B,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC;IAC5B,WAAW,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3B,uBAAuB,EAAE,IAAI,GAAG,MAAM,CAAC;IACvC,uBAAuB,EAAE,IAAI,GAAG,MAAM,CAAC;IACvC,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa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AC5B,oBAAoB,EAAE,IAAI,GAAG,MAAM,CAAC;IACpC,cAAc,EAAE,IAAI,GAAG,MAAM,CAAC;IAC9B,oBAAoB,EAAE,IAAI,GAAG,MAAM,CAAC;IACpC,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,IAAI,GAAG,MAAM,CAAC;IAC7B,uBAAuB,EAAE,OAAO,CAAC;IACjC,aAAa,EAAE,IAAI,GAAG,MAAM,CAAC;IAC7B,0BAA0B,EAAE,OAAO,CAAC;IACpC,uBAAuB,EAAE,OAAO,CAAC;IACjC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;IACzB,kBAAkB,EAAE,IAAI,GAAG,MAAM,CAAC;IAClC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,oBAAoB,EAAE,IAAI,GAAG,MAAM,CAAC;IACpC,cAAc,EAAE,IAAI,GAAG,MAAM,CAAC;CACjC;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,KAAK,CAmDzD;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,GAAG,WAAW,CAmD/D"}
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapGroupRecord = mapGroupRecord;
4
+ exports.mapGroupToGroupRecord = mapGroupToGroupRecord;
5
+ function mapGroupRecord(record) {
6
+ return {
7
+ groupID: record.Group_ID,
8
+ groupName: record.Group_Name,
9
+ groupTypeID: record.Group_Type_ID,
10
+ ministryID: record.Ministry_ID,
11
+ congregationID: record.Congregation_ID,
12
+ primaryContact: record.Primary_Contact,
13
+ description: record.Description,
14
+ startDate: record.Start_Date,
15
+ endDate: record.End_Date,
16
+ targetSize: record.Target_Size,
17
+ parentGroup: record.Parent_Group,
18
+ priorityID: record.Priority_ID,
19
+ smallGroupInformation: record.Small_Group_Information,
20
+ offsiteMeetingAddress: record.Offsite_Meeting_Address,
21
+ groupIsFull: record.Group_Is_Full,
22
+ availableOnline: record.Available_Online,
23
+ meetsOnline: record.Meets_Online,
24
+ lifeStageID: record.Life_Stage_ID,
25
+ groupFocusID: record.Group_Focus_ID,
26
+ meetingTime: record.Meeting_Time,
27
+ meetingDayID: record.Meeting_Day_ID,
28
+ meetingFrequencyID: record.Meeting_Frequency_ID,
29
+ meetingDurationID: record.Meeting_Duration_ID,
30
+ requiredBook: record.Required_Book,
31
+ descendedFrom: record.Descended_From,
32
+ reasonEnded: record.Reason_Ended,
33
+ lastAttendancePosted: record._Last_Attendance_Posted,
34
+ lastGroupMemberChanged: record._Last_Group_Member_Changed,
35
+ checkInInformation: record.Check_in_Information,
36
+ secureCheckIn: record.Secure_Check_in,
37
+ suppressNametag: record.Suppress_Nametag,
38
+ suppressCareNote: record.Suppress_Care_Note,
39
+ onClassroomManager: record.On_Classroom_Manager,
40
+ promotionInformation: record.Promotion_Information,
41
+ promoteToGroup: record.Promote_to_Group,
42
+ ageInMonthsToPromote: record.Age_in_Months_to_Promote,
43
+ promoteWeekly: record.Promote_Weekly,
44
+ promotionDate: record.Promotion_Date,
45
+ promoteParticipantsOnly: record.Promote_Participants_Only,
46
+ notifications: record.Notifications,
47
+ sendAttendanceNotification: record.Send_Attendance_Notification,
48
+ sendServiceNotification: record.Send_Service_Notification,
49
+ enableDiscussion: record.Enable_Discussion,
50
+ smsNumber: record.SMS_Number,
51
+ defaultMeetingRoom: record.Default_Meeting_Room,
52
+ createNextMeeting: record.Create_Next_Meeting,
53
+ nextScheduledMeeting: record.Next_Scheduled_Meeting,
54
+ availableOnApp: record.Available_On_App,
55
+ };
56
+ }
57
+ function mapGroupToGroupRecord(group) {
58
+ return {
59
+ Group_ID: group.groupID,
60
+ Group_Name: group.groupName,
61
+ Group_Type_ID: group.groupTypeID,
62
+ Ministry_ID: group.ministryID,
63
+ Congregation_ID: group.congregationID,
64
+ Primary_Contact: group.primaryContact,
65
+ Description: group.description,
66
+ Start_Date: group.startDate,
67
+ End_Date: group.endDate,
68
+ Target_Size: group.targetSize,
69
+ Parent_Group: group.parentGroup,
70
+ Priority_ID: group.priorityID,
71
+ Small_Group_Information: group.smallGroupInformation,
72
+ Offsite_Meeting_Address: group.offsiteMeetingAddress,
73
+ Group_Is_Full: group.groupIsFull,
74
+ Available_Online: group.availableOnline,
75
+ Meets_Online: group.meetsOnline,
76
+ Life_Stage_ID: group.lifeStageID,
77
+ Group_Focus_ID: group.groupFocusID,
78
+ Meeting_Time: group.meetingTime,
79
+ Meeting_Day_ID: group.meetingDayID,
80
+ Meeting_Frequency_ID: group.meetingFrequencyID,
81
+ Meeting_Duration_ID: group.meetingDurationID,
82
+ Required_Book: group.requiredBook,
83
+ Descended_From: group.descendedFrom,
84
+ Reason_Ended: group.reasonEnded,
85
+ _Last_Attendance_Posted: group.lastAttendancePosted,
86
+ _Last_Group_Member_Changed: group.lastGroupMemberChanged,
87
+ Check_in_Information: group.checkInInformation,
88
+ Secure_Check_in: group.secureCheckIn,
89
+ Suppress_Nametag: group.suppressNametag,
90
+ Suppress_Care_Note: group.suppressCareNote,
91
+ On_Classroom_Manager: group.onClassroomManager,
92
+ Promotion_Information: group.promotionInformation,
93
+ Promote_to_Group: group.promoteToGroup,
94
+ Age_in_Months_to_Promote: group.ageInMonthsToPromote,
95
+ Promote_Weekly: group.promoteWeekly,
96
+ Promotion_Date: group.promotionDate,
97
+ Promote_Participants_Only: group.promoteParticipantsOnly,
98
+ Notifications: group.notifications,
99
+ Send_Attendance_Notification: group.sendAttendanceNotification,
100
+ Send_Service_Notification: group.sendServiceNotification,
101
+ Enable_Discussion: group.enableDiscussion,
102
+ SMS_Number: group.smsNumber,
103
+ Default_Meeting_Room: group.defaultMeetingRoom,
104
+ Create_Next_Meeting: group.createNextMeeting,
105
+ Next_Scheduled_Meeting: group.nextScheduledMeeting,
106
+ Available_On_App: group.availableOnApp,
107
+ };
108
+ }
@@ -0,0 +1,55 @@
1
+ export interface HouseholdRecord {
2
+ Household_ID: number;
3
+ Household_Name: string;
4
+ Address_ID: number;
5
+ Home_Phone: null | string;
6
+ Congregation_ID: number;
7
+ Care_Person: null | string;
8
+ Household_Source_ID: number;
9
+ Family_Call_Number: number;
10
+ Household_Preferences: null | string;
11
+ Home_Phone_Unlisted: boolean;
12
+ Home_Address_Unlisted: boolean;
13
+ Bulk_Mail_Opt_Out: boolean;
14
+ _First_Donation: null | string;
15
+ _Last_Donation: null | string;
16
+ _Last_Activity: string;
17
+ Seasonal_Alternate_Address_Settings: null | string;
18
+ Alternate_Mailing_Address: null | string;
19
+ Season_Start: null | string;
20
+ Season_End: null | string;
21
+ Repeats_Annually: boolean;
22
+ End_Seasonal_Alternate_Address_Settings: null | string;
23
+ Congregation_Drive_Time: null | string;
24
+ Driving_Distance: null | string;
25
+ Driving_Time: null | string;
26
+ }
27
+ export interface Household {
28
+ householdID: number;
29
+ householdName: string;
30
+ addressID: number;
31
+ homePhone: null | string;
32
+ congregationID: number;
33
+ carePerson: null | string;
34
+ householdSourceID: number;
35
+ familyCallNumber: number;
36
+ householdPreferences: null | string;
37
+ homePhoneUnlisted: boolean;
38
+ homeAddressUnlisted: boolean;
39
+ bulkMailOptOut: boolean;
40
+ firstDonation: null | string;
41
+ lastDonation: null | string;
42
+ lastActivity: string;
43
+ seasonalAlternateAddressSettings: null | string;
44
+ alternateMailingAddress: null | string;
45
+ seasonStart: null | string;
46
+ seasonEnd: null | string;
47
+ repeatsAnnually: boolean;
48
+ endSeasonalAlternateAddressSettings: null | string;
49
+ congregationDriveTime: null | string;
50
+ drivingDistance: null | string;
51
+ drivingTime: null | string;
52
+ }
53
+ export declare function mapHouseholdRecord(householdRecord: HouseholdRecord): Household;
54
+ export declare function mapHouseholdToHouseholdRecord(household: Household): HouseholdRecord;
55
+ //# sourceMappingURL=households.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"households.d.ts","sourceRoot":"","sources":["../../src/tables/households.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC5B,Y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AAE,IAAI,GAAG,MAAM,CAAC;IACpC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,IAAI,GAAG,MAAM,CAAC;IAC7B,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,gCAAgC,EAAE,IAAI,GAAG,MAAM,CAAC;IAChD,uBAAuB,EAAE,IAAI,GAAG,MAAM,CAAC;IACvC,WAAW,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3B,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,mCAAmC,EAAE,IAAI,GAAG,MAAM,CAAC;IACnD,qBAAqB,EAAE,IAAI,GAAG,MAAM,CAAC;IACrC,eAAe,EAAE,IAAI,GAAG,MAAM,CAAC;IAC/B,WAAW,EAAE,IAAI,GAAG,MAAM,CAAC;CAC9B;AAED,wBAAgB,kBAAkB,CAAC,eAAe,EAAE,eAAe,GAAG,SAAS,CA2B9E;AAED,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,SAAS,GAAG,eAAe,CA2BnF"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapHouseholdRecord = mapHouseholdRecord;
4
+ exports.mapHouseholdToHouseholdRecord = mapHouseholdToHouseholdRecord;
5
+ function mapHouseholdRecord(householdRecord) {
6
+ return {
7
+ householdID: householdRecord.Household_ID,
8
+ householdName: householdRecord.Household_Name,
9
+ addressID: householdRecord.Address_ID,
10
+ homePhone: householdRecord.Home_Phone,
11
+ congregationID: householdRecord.Congregation_ID,
12
+ carePerson: householdRecord.Care_Person,
13
+ householdSourceID: householdRecord.Household_Source_ID,
14
+ familyCallNumber: householdRecord.Family_Call_Number,
15
+ householdPreferences: householdRecord.Household_Preferences,
16
+ homePhoneUnlisted: householdRecord.Home_Phone_Unlisted,
17
+ homeAddressUnlisted: householdRecord.Home_Address_Unlisted,
18
+ bulkMailOptOut: householdRecord.Bulk_Mail_Opt_Out,
19
+ firstDonation: householdRecord._First_Donation,
20
+ lastDonation: householdRecord._Last_Donation,
21
+ lastActivity: householdRecord._Last_Activity,
22
+ seasonalAlternateAddressSettings: householdRecord.Seasonal_Alternate_Address_Settings,
23
+ alternateMailingAddress: householdRecord.Alternate_Mailing_Address,
24
+ seasonStart: householdRecord.Season_Start,
25
+ seasonEnd: householdRecord.Season_End,
26
+ repeatsAnnually: householdRecord.Repeats_Annually,
27
+ endSeasonalAlternateAddressSettings: householdRecord.End_Seasonal_Alternate_Address_Settings,
28
+ congregationDriveTime: householdRecord.Congregation_Drive_Time,
29
+ drivingDistance: householdRecord.Driving_Distance,
30
+ drivingTime: householdRecord.Driving_Time,
31
+ };
32
+ }
33
+ function mapHouseholdToHouseholdRecord(household) {
34
+ return {
35
+ Household_ID: household.householdID,
36
+ Household_Name: household.householdName,
37
+ Address_ID: household.addressID,
38
+ Home_Phone: household.homePhone,
39
+ Congregation_ID: household.congregationID,
40
+ Care_Person: household.carePerson,
41
+ Household_Source_ID: household.householdSourceID,
42
+ Family_Call_Number: household.familyCallNumber,
43
+ Household_Preferences: household.householdPreferences,
44
+ Home_Phone_Unlisted: household.homePhoneUnlisted,
45
+ Home_Address_Unlisted: household.homeAddressUnlisted,
46
+ Bulk_Mail_Opt_Out: household.bulkMailOptOut,
47
+ _First_Donation: household.firstDonation,
48
+ _Last_Donation: household.lastDonation,
49
+ _Last_Activity: household.lastActivity,
50
+ Seasonal_Alternate_Address_Settings: household.seasonalAlternateAddressSettings,
51
+ Alternate_Mailing_Address: household.alternateMailingAddress,
52
+ Season_Start: household.seasonStart,
53
+ Season_End: household.seasonEnd,
54
+ Repeats_Annually: household.repeatsAnnually,
55
+ End_Seasonal_Alternate_Address_Settings: household.endSeasonalAlternateAddressSettings,
56
+ Congregation_Drive_Time: household.congregationDriveTime,
57
+ Driving_Distance: household.drivingDistance,
58
+ Driving_Time: household.drivingTime,
59
+ };
60
+ }
@@ -0,0 +1,63 @@
1
+ export interface ParticipantRecord {
2
+ Participant_ID: number;
3
+ Red_Flag_Notes: null | string;
4
+ Contact_ID: number;
5
+ Participant_Type_ID: number;
6
+ Member_Status_ID: null | number;
7
+ Participant_Engagement_ID: number;
8
+ Participant_Start_Date: string;
9
+ Participant_End_Date: null | string;
10
+ Notes: string;
11
+ _First_Attendance_Ever: null | string;
12
+ _Second_Attendance_Ever: null | string;
13
+ _Third_Attendance_Ever: null | string;
14
+ _Last_Attendance_Ever: null | string;
15
+ SubStatus_Name: null | string;
16
+ Status_Date: null | string;
17
+ Former_Denomination: null | string;
18
+ Former_Church: null | string;
19
+ _Background_Check_Information: null | string;
20
+ _Background_Check_Type: null | string;
21
+ _Background_Check_Status: null | string;
22
+ _Background_Check_Date: null | string;
23
+ Sacrament_Information: null | string;
24
+ Church_of_Record: null | string;
25
+ Baptism_Parish_Name: null | string;
26
+ Baptism_Parish_Address: null | string;
27
+ Birth_Certificate_Address: null | string;
28
+ Birth_Certificate_City: null | string;
29
+ Birth_Certificate_State: null | string;
30
+ }
31
+ export interface Participant {
32
+ participantID: number;
33
+ redFlagNotes: null | string;
34
+ contactID: number;
35
+ participantTypeID: number;
36
+ memberStatusID: null | number;
37
+ participantEngagementID: number;
38
+ participantStartDate: string;
39
+ participantEndDate: null | string;
40
+ notes: string;
41
+ firstAttendanceEver: null | string;
42
+ secondAttendanceEver: null | string;
43
+ thirdAttendanceEver: null | string;
44
+ lastAttendanceEver: null | string;
45
+ subStatusName: null | string;
46
+ statusDate: null | string;
47
+ formerDenomination: null | string;
48
+ formerChurch: null | string;
49
+ backgroundCheckInformation: null | string;
50
+ backgroundCheckType: null | string;
51
+ backgroundCheckStatus: null | string;
52
+ backgroundCheckDate: null | string;
53
+ sacramentInformation: null | string;
54
+ churchOfRecord: null | string;
55
+ baptismParishName: null | string;
56
+ baptismParishAddress: null | string;
57
+ birthCertificateAddress: null | string;
58
+ birthCertificateCity: null | string;
59
+ birthCertificateState: null | string;
60
+ }
61
+ export declare function mapParticipantRecord(record: ParticipantRecord): Participant;
62
+ export declare function mapParticipantToParticipantRecord(participant: Participant): ParticipantRecord;
63
+ //# sourceMappingURL=participants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"participants.d.ts","sourceRoot":"","sources":["../../src/tables/participants.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,IAAI,GAAG,MAAM,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,IAAI,GAAG,MAAM,CAAC;IAChC,yBAAyB,EAAE,MAAM,CAAC;IAClC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,oBAAoB,EAAE,IAAI,GAAG,MAAM,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB,EAAE,IAAI,GAAG,MAAM,CAAC;IACtC,uBAAuB,EAAE,IAAI,GAAG,MAAM,CAAC;IACvC,sBAAsB,EAAE,IAAI,GAAG,MAAM,CAAC;IACtC,qBAAqB,EAAE,IAAI,GAAG,MAAM,CAAC;IACrC,cAAc,EAAE,IAAI,GAAG,MAAM,CAAC;IAC9B,WAAW,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3B,mBAAmB,EAAE,IAAI,GAAG,MAAM,CAAC;IACnC,aAAa,EAAE,IAAI,GAAG,MAAM,CAAC;IAC7B,6BAA6B,EAAE,IAAI,GAAG,MAAM,CAAC;IAC7C,sBAAsB,EAAE,IAAI,GAAG,MAAM,CAAC;IACtC,wBAAwB,EAAE,IAAI,GAAG,MAAM,CAAC;IACxC,sBAAsB,EAAE,IAAI,GAAG,MAAM,CAAC;IACtC,qBAAqB,EAAE,IAAI,GAAG,MAAM,CAAC;IACrC,gBAAgB,EAAE,IAAI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IAAI,GAAG,MAAM,CAAC;IACjC,oBAAoB,EAAE,IAAI,GAAG,MAAM,CAAC;IACpC,uBAAuB,EAAE,IAAI,GAAG,MAAM,CAAC;IACvC,oBAAoB,EAAE,IAAI,GAAG,MAAM,CAAC;IACpC,qBAAqB,EAAE,IAAI,GAAG,MAAM,CAAC;CACxC;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,WAAW,CA+B3E;AAED,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,WAAW,GAAG,iBAAiB,CA+B7F"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapParticipantRecord = mapParticipantRecord;
4
+ exports.mapParticipantToParticipantRecord = mapParticipantToParticipantRecord;
5
+ function mapParticipantRecord(record) {
6
+ return {
7
+ participantID: record.Participant_ID,
8
+ redFlagNotes: record.Red_Flag_Notes,
9
+ contactID: record.Contact_ID,
10
+ participantTypeID: record.Participant_Type_ID,
11
+ memberStatusID: record.Member_Status_ID,
12
+ participantEngagementID: record.Participant_Engagement_ID,
13
+ participantStartDate: record.Participant_Start_Date,
14
+ participantEndDate: record.Participant_End_Date,
15
+ notes: record.Notes,
16
+ firstAttendanceEver: record._First_Attendance_Ever,
17
+ secondAttendanceEver: record._Second_Attendance_Ever,
18
+ thirdAttendanceEver: record._Third_Attendance_Ever,
19
+ lastAttendanceEver: record._Last_Attendance_Ever,
20
+ subStatusName: record.SubStatus_Name,
21
+ statusDate: record.Status_Date,
22
+ formerDenomination: record.Former_Denomination,
23
+ formerChurch: record.Former_Church,
24
+ backgroundCheckInformation: record._Background_Check_Information,
25
+ backgroundCheckType: record._Background_Check_Type,
26
+ backgroundCheckStatus: record._Background_Check_Status,
27
+ backgroundCheckDate: record._Background_Check_Date,
28
+ sacramentInformation: record.Sacrament_Information,
29
+ churchOfRecord: record.Church_of_Record,
30
+ baptismParishName: record.Baptism_Parish_Name,
31
+ baptismParishAddress: record.Baptism_Parish_Address,
32
+ birthCertificateAddress: record.Birth_Certificate_Address,
33
+ birthCertificateCity: record.Birth_Certificate_City,
34
+ birthCertificateState: record.Birth_Certificate_State,
35
+ };
36
+ }
37
+ function mapParticipantToParticipantRecord(participant) {
38
+ return {
39
+ Participant_ID: participant.participantID,
40
+ Red_Flag_Notes: participant.redFlagNotes,
41
+ Contact_ID: participant.contactID,
42
+ Participant_Type_ID: participant.participantTypeID,
43
+ Member_Status_ID: participant.memberStatusID,
44
+ Participant_Engagement_ID: participant.participantEngagementID,
45
+ Participant_Start_Date: participant.participantStartDate,
46
+ Participant_End_Date: participant.participantEndDate,
47
+ Notes: participant.notes,
48
+ _First_Attendance_Ever: participant.firstAttendanceEver,
49
+ _Second_Attendance_Ever: participant.secondAttendanceEver,
50
+ _Third_Attendance_Ever: participant.thirdAttendanceEver,
51
+ _Last_Attendance_Ever: participant.lastAttendanceEver,
52
+ SubStatus_Name: participant.subStatusName,
53
+ Status_Date: participant.statusDate,
54
+ Former_Denomination: participant.formerDenomination,
55
+ Former_Church: participant.formerChurch,
56
+ _Background_Check_Information: participant.backgroundCheckInformation,
57
+ _Background_Check_Type: participant.backgroundCheckType,
58
+ _Background_Check_Status: participant.backgroundCheckStatus,
59
+ _Background_Check_Date: participant.backgroundCheckDate,
60
+ Sacrament_Information: participant.sacramentInformation,
61
+ Church_of_Record: participant.churchOfRecord,
62
+ Baptism_Parish_Name: participant.baptismParishName,
63
+ Baptism_Parish_Address: participant.baptismParishAddress,
64
+ Birth_Certificate_Address: participant.birthCertificateAddress,
65
+ Birth_Certificate_City: participant.birthCertificateCity,
66
+ Birth_Certificate_State: participant.birthCertificateState,
67
+ };
68
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=strings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src/utils/strings.ts"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ String.prototype.escapeSql = function () {
4
+ return this.replace(/%|(?<=\w)'(?=\w)/g, function (char) {
5
+ switch (char) {
6
+ case "\0":
7
+ return "\\0";
8
+ case "\x08":
9
+ return "\\b";
10
+ case "\x09":
11
+ return "\\t";
12
+ case "\x1a":
13
+ return "\\z";
14
+ case "\n":
15
+ return "\\n";
16
+ case "\r":
17
+ return "\\r";
18
+ case "%":
19
+ return "%25";
20
+ case "'":
21
+ return "''";
22
+ case "\"":
23
+ case "\\":
24
+ return "\\" + char; // prepends a backslash to backslash, percent,
25
+ // and double/single quotes
26
+ default:
27
+ return char;
28
+ }
29
+ });
30
+ };
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "mp-js-api",
3
+ "version": "0.0.1",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "scripts": {
7
+ "test": "mocha --require ts-node/register test/*",
8
+ "postinstall": "tsc"
9
+ },
10
+ "keywords": [],
11
+ "author": "",
12
+ "license": "ISC",
13
+ "dependencies": {
14
+ "axios": "^1.6.5"
15
+ },
16
+ "devDependencies": {
17
+ "@types/mocha": "^10.0.6",
18
+ "@types/node": "^20.10.6",
19
+ "@types/uuid": "^9.0.7",
20
+ "dotenv": "^16.3.1",
21
+ "mocha": "^10.2.0",
22
+ "ts-node": "^9.1.1",
23
+ "typescript": "^5.3.3",
24
+ "uuid": "^9.0.1"
25
+ }
26
+ }