-
Notifications
You must be signed in to change notification settings - Fork 12
Async import of the appStore packages #2
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
Open
everettbu
wants to merge
1
commit into
appstore-sync-refactor-base
Choose a base branch
from
appstore-async-improvements
base: appstore-sync-refactor-base
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,13 +6,13 @@ import appStore from ".."; | |
|
|
||
| const log = logger.getChildLogger({ prefix: ["CalendarManager"] }); | ||
|
|
||
| export const getCalendar = (credential: CredentialPayload | null): Calendar | null => { | ||
| export const getCalendar = async (credential: CredentialPayload | null): Promise<Calendar | null> => { | ||
| if (!credential || !credential.key) return null; | ||
| let { type: calendarType } = credential; | ||
| if (calendarType?.endsWith("_other_calendar")) { | ||
| calendarType = calendarType.split("_other_calendar")[0]; | ||
| } | ||
| const calendarApp = appStore[calendarType.split("_").join("") as keyof typeof appStore]; | ||
| const calendarApp = await appStore[calendarType.split("_").join("") 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. style: Consider adding try-catch around the await to handle import failures gracefully |
||
| if (!(calendarApp && "lib" in calendarApp && "CalendarService" in calendarApp.lib)) { | ||
| log.warn(`calendar of type ${calendarType} is not implemented`); | ||
| return null; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
style: Consider adding try-catch around the await to handle import failures gracefully