chrome-webstore-upload-keys 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +3 -7
- package/dist/index.js +3 -7
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -55,8 +55,8 @@ async function getRefreshToken() {
|
|
|
55
55
|
const request = await fetch('https://accounts.google.com/o/oauth2/token', {
|
|
56
56
|
method: 'POST',
|
|
57
57
|
body: new URLSearchParams([
|
|
58
|
-
['client_id', group.clientId],
|
|
59
|
-
['client_secret', group.clientSecret],
|
|
58
|
+
['client_id', group.clientId.trim()],
|
|
59
|
+
['client_secret', group.clientSecret.trim()],
|
|
60
60
|
['code', code],
|
|
61
61
|
['grant_type', 'authorization_code'],
|
|
62
62
|
['redirect_uri', serverUrl], // Unused but required
|
|
@@ -83,7 +83,7 @@ function getLoginUrl(clientId) {
|
|
|
83
83
|
const url = new URL('https://accounts.google.com/o/oauth2/auth');
|
|
84
84
|
url.searchParams.set('response_type', 'code');
|
|
85
85
|
url.searchParams.set('access_type', 'offline');
|
|
86
|
-
url.searchParams.set('client_id', clientId);
|
|
86
|
+
url.searchParams.set('client_id', clientId.trim());
|
|
87
87
|
url.searchParams.set('scope', 'https://www.googleapis.com/auth/chromewebstore');
|
|
88
88
|
url.searchParams.set('redirect_uri', serverUrl);
|
|
89
89
|
return url.href;
|
|
@@ -92,10 +92,6 @@ function getLoginUrl(clientId) {
|
|
|
92
92
|
p.intro('Follow the steps at this URL to generate the API keys, then enter them below to generate the refresh token.\n https://github.com/fregante/chrome-webstore-upload-keys');
|
|
93
93
|
const group = await p.group(
|
|
94
94
|
{
|
|
95
|
-
// ExtensionId: () => p.text({
|
|
96
|
-
// message: 'Extension ID:',
|
|
97
|
-
// placeholder: 'e.g. bdeobgpddfaegbjfinhldnkfeieakdaf, it’s in the Chrome Web Store URL',
|
|
98
|
-
// }),
|
|
99
95
|
clientId: () => p.text({
|
|
100
96
|
message: 'Client ID:',
|
|
101
97
|
placeholder: 'e.g. 960453266371-2qcq5fppm3d5e.apps.googleusercontent.com',
|
package/dist/index.js
CHANGED
|
@@ -301,8 +301,8 @@ async function getRefreshToken() {
|
|
|
301
301
|
const request = await fetch('https://accounts.google.com/o/oauth2/token', {
|
|
302
302
|
method: 'POST',
|
|
303
303
|
body: new URLSearchParams([
|
|
304
|
-
['client_id', group.clientId],
|
|
305
|
-
['client_secret', group.clientSecret],
|
|
304
|
+
['client_id', group.clientId.trim()],
|
|
305
|
+
['client_secret', group.clientSecret.trim()],
|
|
306
306
|
['code', code],
|
|
307
307
|
['grant_type', 'authorization_code'],
|
|
308
308
|
['redirect_uri', serverUrl], // Unused but required
|
|
@@ -329,7 +329,7 @@ function getLoginUrl(clientId) {
|
|
|
329
329
|
const url = new URL('https://accounts.google.com/o/oauth2/auth');
|
|
330
330
|
url.searchParams.set('response_type', 'code');
|
|
331
331
|
url.searchParams.set('access_type', 'offline');
|
|
332
|
-
url.searchParams.set('client_id', clientId);
|
|
332
|
+
url.searchParams.set('client_id', clientId.trim());
|
|
333
333
|
url.searchParams.set('scope', 'https://www.googleapis.com/auth/chromewebstore');
|
|
334
334
|
url.searchParams.set('redirect_uri', serverUrl);
|
|
335
335
|
return url.href;
|
|
@@ -338,10 +338,6 @@ function getLoginUrl(clientId) {
|
|
|
338
338
|
_clack_prompts__WEBPACK_IMPORTED_MODULE_2__/* .intro */ .mf('Follow the steps at this URL to generate the API keys, then enter them below to generate the refresh token.\n https://github.com/fregante/chrome-webstore-upload-keys');
|
|
339
339
|
const group = await _clack_prompts__WEBPACK_IMPORTED_MODULE_2__/* .group */ .ru(
|
|
340
340
|
{
|
|
341
|
-
// ExtensionId: () => p.text({
|
|
342
|
-
// message: 'Extension ID:',
|
|
343
|
-
// placeholder: 'e.g. bdeobgpddfaegbjfinhldnkfeieakdaf, it’s in the Chrome Web Store URL',
|
|
344
|
-
// }),
|
|
345
341
|
clientId: () => _clack_prompts__WEBPACK_IMPORTED_MODULE_2__/* .text */ .fL({
|
|
346
342
|
message: 'Client ID:',
|
|
347
343
|
placeholder: 'e.g. 960453266371-2qcq5fppm3d5e.apps.googleusercontent.com',
|