Skip to content

chore: add CoderClient class #121

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

Closed
wants to merge 11 commits into from

Conversation

Parkreiner
Copy link
Member

Part 3 of the PRs for #107

Changes made

  • Added a general CoderClient class
  • Added separate errors file for custom error definitions
  • Updated Backstage mocks to help with Coder client tests
  • Added some temporary type definitions to help with some new request endpoints
  • Extracted out the mock server handler logic for checking the mock token into a middleware function, so that all handlers have the logic

@Parkreiner Parkreiner self-assigned this Apr 23, 2024
Comment on lines +159 to +164
this.sdkApi = {
getUserLoginType: this.getUserLoginType,
getWorkspaceBuildParameters: this.getWorkspaceBuildParameters,
getWorkspaces: this.getWorkspaces,
getWorkspacesByRepo: this.getWorkspacesByRepo,
};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was originally the actual Coder SDK until I started running into the issues with the TS file parsing
Hoping to get that swapped back in ASAP

Comment on lines +178 to +184
// Set up logic for syncing client snapshots to auth state changes
this.authApi.subscribe(newAuthSnapshot => {
const latestClientSnapshot = this.getStateSnapshot();
if (newAuthSnapshot.isTokenValid !== latestClientSnapshot.isAuthValid) {
this.notifySubscriptionsOfStateChange();
}
});
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main thing I was talking about in the StateSnapshotManager PR with how it's a little clunky to get two snapshots to be related to each other

@Parkreiner Parkreiner requested a review from code-asher April 23, 2024 19:06
@Parkreiner Parkreiner changed the title chore: add CoderClient class definition chore: add CoderClient class Apr 23, 2024
@Parkreiner
Copy link
Member Author

Closing this out in favor of a new series of PRs

@Parkreiner Parkreiner closed this Apr 26, 2024
@Parkreiner Parkreiner deleted the mes/api-factories-03 branch May 8, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant