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

Upload endpoints #16

Merged
merged 8 commits into from
Dec 6, 2018
Merged

Upload endpoints #16

merged 8 commits into from
Dec 6, 2018

Conversation

mmcc
Copy link
Collaborator

@mmcc mmcc commented Dec 5, 2018

No description provided.

Copy link
Collaborator

@jsanford8 jsanford8 left a comment

Choose a reason for hiding this comment

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

some nits more than any functionality

src/data/data.js Outdated
@@ -32,19 +32,24 @@ class Data extends Base {
super(...params);

/** @type {Metrics} */
this.metrics = new Metrics(this);
this.Metrics = new Metrics(this);
this.metrics = this.Metrics;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you still need these? Just so this doesn't break backwards compatibility?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, just so there'd be one less big change to make if you were updating from 1.x (you already have to remove all the data.data accessors)

* @example
* const { Video } = new Mux(accessToken, secret);
*
* // Create an upload
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this be around line 38... or just removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's just an example for using the class module, but I was just being consistent with the other modules and don't feel too strongly about it.

* const { Video } = new Mux(accessToken, secret);
*
* // Delete an upload
* Video.Uploads.remove(uploadId);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we use remove elsewhere for delete things? Like... why not `delete?

Cool if we already use remove elsewhere, just asking

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, all the other modules used remove.

Copy link
Collaborator

Choose a reason for hiding this comment

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

delete is a reserved word in Javascript and i believe we were using deleteAsset or removeAsset before, but there was a request to keep it to one word for consistency.

const createdUploads = []; // These are uploads we'll clean up when it's all done.


before(async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you do this? You have a test specifically for this, and then create one directly in each test where you need to do things...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Except for the get call... why not just create it in the get test?

expect(TestData.Errors).to.be.an.instanceof(Errors);
expect(TestData.Exports).to.be.an.instanceof(Exports);
expect(TestData.VideoViews).to.be.an.instanceof(VideoViews);
expect(TestData.Filters).to.be.an.instanceof(Filters);
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we're keeping the lower-cased versions around for backwards compatibility, should we add tests to make sure those exist so we don't accidentally remove them for now?

expect(TestVideo.Assets).to.be.an.instanceof(Assets);
expect(TestVideo.LiveStreams).to.be.an.instanceof(LiveStreams);
expect(TestVideo.LiveStreams).to.be.an.instanceof(LiveStreams);
expect(TestVideo.Uploads).to.be.an.instanceof(Uploads);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here with the lower-cased ones...

@@ -22,7 +22,7 @@ yarn add @mux/mux-node
```

## Releases
The latest **stable** release is `1.1.1`
The latest **stable** release is `2.0.0`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ooh if this is a major version bump... let's just kill the lower-cased versions of things?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, that's fair, I was trying to make it one less messy thing, but this is already an annoying upgrade. 😢

Copy link
Collaborator

@jsanford8 jsanford8 left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Collaborator

@jsanford8 jsanford8 left a comment

Choose a reason for hiding this comment

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

for real this time

@@ -136,8 +132,7 @@ class Assets extends Base {
* @returns {Promise} - Returns a resolved Promise with a response from the Mux API
*
* @example
* const muxClient = new Mux(accessToken, secret);
* const { Video } = muxClient;
* const { Video }= new Mux(accessToken, secret);
Copy link
Collaborator

Choose a reason for hiding this comment

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

you're missing a space after { Video } and before the =

@mmcc mmcc merged commit c3fa6b9 into master Dec 6, 2018
@mmcc mmcc deleted the mmcc/upload branch December 6, 2018 14:40
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