Skip to content
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

Fixing Request Type #399

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Conversation

whizzzkid
Copy link
Contributor

This is a continuation of #390 so it has commits from that too.

In this PR:

  • Merging the Request type into APIRequest simplifying the request interface.
  • Improving performance

@whizzzkid whizzzkid changed the title Fixing eslint Fixing Request Type Oct 28, 2021
// videoID already exists
const destMatch = dest.find(s => s.videoID === obj.videoID);
if (destMatch) {
if (videoID in dest) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

solving in O(1) instead of O(n^2)

categories: Category[];
userID: UserID | HashedUserID;
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

simplified interface for what the request actually looks like.

Copy link
Contributor

@mchangrh mchangrh Oct 30, 2021

Choose a reason for hiding this comment

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

adminID is always of type userID

** will comment on file itself

Copy link
Contributor

@mchangrh mchangrh left a comment

Choose a reason for hiding this comment

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

most types are available here https://github.com/mchangrh/sb-openapi-source/blob/main/openapi.yaml
or https://wiki.sponsor.ajay.app/index.php/API_Docs

if you have any questions about types, just @ me on the discord blabdude#9793

adminUserID: string;
enabled: string;
generate: "true" | "false";
service: "youtube" | "vimeo";
Copy link
Contributor

Choose a reason for hiding this comment

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

services are in src/types/segments.model.s

videoID: VideoID;
userID: UserID | HashedUserID;
adminUserID: string;
enabled: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

enabled is type integer

query: {
videoID: VideoID;
userID: UserID | HashedUserID;
adminUserID: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

adminUserID is of type UserID

channelID: string,
service: string,
categories: Category[];
userID: UserID | HashedUserID;
Copy link
Contributor

Choose a reason for hiding this comment

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

userID retuned should always be HashedUserID

@ajayyy ajayyy changed the base branch from master to chapters November 28, 2021 16:20
@ajayyy ajayyy changed the base branch from chapters to master November 28, 2021 16:20
@ajayyy
Copy link
Owner

ajayyy commented Jan 16, 2022

Extracted the performance fix to 8759f8d

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.

3 participants