-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Support deploy for partial rollout #90
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 |
---|---|---|
|
@@ -6,8 +6,10 @@ | |
export const refreshTokenURI = 'https://www.googleapis.com/oauth2/v4/token'; | ||
const uploadExistingURI = id => | ||
`${rootURI}/upload/chromewebstore/v1.1/items/${id}`; | ||
const publishURI = (id, target) => | ||
`${rootURI}/chromewebstore/v1.1/items/${id}/publish?publishTarget=${target}`; | ||
const publishURI = (id, target, deployPercentage) => ( | ||
`${rootURI}/chromewebstore/v1.1/items/${id}/publish?publishTarget=${target}` | ||
+ (deployPercentage == undefined ? '' : `&deployPercentage=${deployPercentage}`) | ||
Check failure on line 11 in index.js
|
||
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. Could you alter this function to build the URL via |
||
); | ||
const getURI = (id, projection) => | ||
`${rootURI}/chromewebstore/v1.1/items/${id}?projection=${projection}`; | ||
|
||
|
@@ -61,10 +63,10 @@ | |
return response; | ||
} | ||
|
||
async publish(target = 'default', token = this.fetchToken()) { | ||
async publish(target = 'default', token = this.fetchToken(), deployPercentage = undefined) { | ||
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. Same goes here, this can be changed to a single object: I'll release a breaking version after this |
||
const { extensionId } = this; | ||
|
||
const request = await fetch(publishURI(extensionId, target), { | ||
const request = await fetch(publishURI(extensionId, target, deployPercentage), { | ||
method: 'POST', | ||
headers: this._headers(await token), | ||
}); | ||
|
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.
Functions shouldn't accept more than 1 optional parameter, can you turn this into an object?
{id, target, deployPercentage}