-
Notifications
You must be signed in to change notification settings - Fork 0
Async import of the appStore packages #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: appstore-sync-refactor-base
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,63 +1,33 @@ | ||
| // import * as example from "./_example"; | ||
| import * as applecalendar from "./applecalendar"; | ||
| import * as caldavcalendar from "./caldavcalendar"; | ||
| import * as closecom from "./closecom"; | ||
| import * as dailyvideo from "./dailyvideo"; | ||
| import * as exchange2013calendar from "./exchange2013calendar"; | ||
| import * as exchange2016calendar from "./exchange2016calendar"; | ||
| import * as exchangecalendar from "./exchangecalendar"; | ||
| import * as facetime from "./facetime"; | ||
| import * as giphy from "./giphy"; | ||
| import * as googlecalendar from "./googlecalendar"; | ||
| import * as googlevideo from "./googlevideo"; | ||
| import * as hubspot from "./hubspot"; | ||
| import * as huddle01video from "./huddle01video"; | ||
| import * as jitsivideo from "./jitsivideo"; | ||
| import * as larkcalendar from "./larkcalendar"; | ||
| import * as office365calendar from "./office365calendar"; | ||
| import * as office365video from "./office365video"; | ||
| import * as plausible from "./plausible"; | ||
| import * as salesforce from "./salesforce"; | ||
| import * as sendgrid from "./sendgrid"; | ||
| import * as stripepayment from "./stripepayment"; | ||
| import * as sylapsvideo from "./sylapsvideo"; | ||
| import * as tandemvideo from "./tandemvideo"; | ||
| import * as vital from "./vital"; | ||
| import * as wipemycalother from "./wipemycalother"; | ||
| import * as zapier from "./zapier"; | ||
| import * as zohocrm from "./zohocrm"; | ||
| import * as zoomvideo from "./zoomvideo"; | ||
|
|
||
| const appStore = { | ||
| // example, | ||
| applecalendar, | ||
| caldavcalendar, | ||
| closecom, | ||
| dailyvideo, | ||
| googlecalendar, | ||
| googlevideo, | ||
| hubspot, | ||
| huddle01video, | ||
| jitsivideo, | ||
| sylapsvideo, | ||
| larkcalendar, | ||
| office365calendar, | ||
| office365video, | ||
| plausible, | ||
| salesforce, | ||
| zohocrm, | ||
| sendgrid, | ||
| stripepayment, | ||
| tandemvideo, | ||
| vital, | ||
| zoomvideo, | ||
| wipemycalother, | ||
| giphy, | ||
| zapier, | ||
| exchange2013calendar, | ||
| exchange2016calendar, | ||
| exchangecalendar, | ||
| facetime, | ||
| // example: import("./example"), | ||
| applecalendar: import("./applecalendar"), | ||
| caldavcalendar: import("./caldavcalendar"), | ||
| closecom: import("./closecom"), | ||
| dailyvideo: import("./dailyvideo"), | ||
| googlecalendar: import("./googlecalendar"), | ||
| googlevideo: import("./googlevideo"), | ||
| hubspot: import("./hubspot"), | ||
| huddle01video: import("./huddle01video"), | ||
| jitsivideo: import("./jitsivideo"), | ||
| larkcalendar: import("./larkcalendar"), | ||
| office365calendar: import("./office365calendar"), | ||
| office365video: import("./office365video"), | ||
| plausible: import("./plausible"), | ||
| salesforce: import("./salesforce"), | ||
| zohocrm: import("./zohocrm"), | ||
| sendgrid: import("./sendgrid"), | ||
| stripepayment: import("./stripepayment"), | ||
| tandemvideo: import("./tandemvideo"), | ||
| vital: import("./vital"), | ||
| zoomvideo: import("./zoomvideo"), | ||
| wipemycalother: import("./wipemycalother"), | ||
| giphy: import("./giphy"), | ||
| zapier: import("./zapier"), | ||
| exchange2013calendar: import("./exchange2013calendar"), | ||
| exchange2016calendar: import("./exchange2016calendar"), | ||
| exchangecalendar: import("./exchangecalendar"), | ||
| facetime: import("./facetime"), | ||
| sylapsvideo: import("./sylapsvideo"), | ||
| }; | ||
|
|
||
| export default appStore; |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -122,10 +122,10 @@ const Reschedule = async (bookingUid: string, cancellationReason: string) => { | |||||||||||||||||||||||||||||||||
| (ref) => !!credentialsMap.get(ref.type) | ||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||
| bookingRefsFiltered.forEach((bookingRef) => { | ||||||||||||||||||||||||||||||||||
| bookingRefsFiltered.forEach(async (bookingRef) => { | ||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||
| if (bookingRef.uid) { | ||||||||||||||||||||||||||||||||||
| if (bookingRef.type.endsWith("_calendar")) { | ||||||||||||||||||||||||||||||||||
| const calendar = getCalendar(credentialsMap.get(bookingRef.type)); | ||||||||||||||||||||||||||||||||||
| const calendar = await getCalendar(credentialsMap.get(bookingRef.type)); | ||||||||||||||||||||||||||||||||||
| return calendar?.deleteEvent(bookingRef.uid, builder.calendarEvent); | ||||||||||||||||||||||||||||||||||
| } else if (bookingRef.type.endsWith("_video")) { | ||||||||||||||||||||||||||||||||||
| return deleteMeeting(credentialsMap.get(bookingRef.type), bookingRef.uid); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,7 +13,7 @@ const deletePayment = async ( | |||||||||||||||||||
| } | null; | ||||||||||||||||||||
| } | ||||||||||||||||||||
| ): Promise<boolean> => { | ||||||||||||||||||||
| const paymentApp = appStore[paymentAppCredentials?.app?.dirName as keyof typeof appStore]; | ||||||||||||||||||||
| const paymentApp = await appStore[paymentAppCredentials?.app?.dirName as keyof typeof appStore]; | ||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
| if (!(paymentApp && "lib" in paymentApp && "PaymentService" in paymentApp.lib)) { | ||||||||||||||||||||
| console.warn(`payment App service of type ${paymentApp} is not implemented`); | ||||||||||||||||||||
| return false; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,7 +23,7 @@ const handlePayment = async ( | |||||||||||||||||||
| uid: string; | ||||||||||||||||||||
| } | ||||||||||||||||||||
| ) => { | ||||||||||||||||||||
| const paymentApp = appStore[paymentAppCredentials?.app?.dirName as keyof typeof appStore]; | ||||||||||||||||||||
| const paymentApp = await appStore[paymentAppCredentials?.app?.dirName as keyof typeof appStore]; | ||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
| if (!(paymentApp && "lib" in paymentApp && "PaymentService" in paymentApp.lib)) { | ||||||||||||||||||||
| console.warn(`payment App service of type ${paymentApp} is not implemented`); | ||||||||||||||||||||
| return null; | ||||||||||||||||||||
|
|
||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.