webext-buildtools-chrome-webstore-builder
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -104,3 +104,5 @@ import { PublishStatus, PublishTarget } from 'typed-chrome-webstore-api'; | ||
extensionId: string; | ||
accessToken?: string; | ||
/** | ||
@@ -111,4 +113,2 @@ * Required for uploadExt and publishExt outputs | ||
/** | ||
@@ -115,0 +115,0 @@ * For uploadExt output, optional |
@@ -77,10 +77,18 @@ "use strict"; | ||
let newExtensionResource; | ||
if ((this._uploadedExtRequired || this._publishedExtRequired) && this._options.apiAccess) { | ||
if (this._uploadedExtRequired || this._publishedExtRequired) { | ||
let apiFacade; | ||
try { | ||
apiFacade = await chromeWebstoreApiFacade_1.ChromeWebstoreApiFacade.authorize(this._options.apiAccess.clientId, this._options.apiAccess.clientSecret, this._options.apiAccess.refreshToken, this._options.extensionId); | ||
if (this._options.accessToken) { | ||
apiFacade = new chromeWebstoreApiFacade_1.ChromeWebstoreApiFacade(this._options.accessToken, this._options.extensionId); | ||
} | ||
catch (error) { | ||
throw new Error(error.message + ': ' + JSON.stringify(error.response.data)); | ||
else if (this._options.apiAccess) { | ||
try { | ||
apiFacade = await chromeWebstoreApiFacade_1.ChromeWebstoreApiFacade.authorize(this._options.apiAccess.clientId, this._options.apiAccess.clientSecret, this._options.apiAccess.refreshToken, this._options.extensionId); | ||
} | ||
catch (error) { | ||
throw new Error(error.message + ': ' + JSON.stringify(error.response.data)); | ||
} | ||
} | ||
else { | ||
throw new Error('Neither accessToken or apiAccess options are set'); | ||
} | ||
apiFacade.setLogMethod(this._logWrapper.logMethod); | ||
@@ -87,0 +95,0 @@ if (this._uploadedExtRequired) { |
@@ -32,4 +32,4 @@ "use strict"; | ||
if (this._uploadedExtRequired || this._publishedExtRequired) { | ||
if (!options.apiAccess) { | ||
r.missedFields.push('apiAccess'); | ||
if (options.accessToken && !options.apiAccess) { | ||
r.missedFields.push('apiAccess or accessToken'); | ||
} | ||
@@ -36,0 +36,0 @@ else { |
@@ -12,3 +12,3 @@ /// <reference types="node" /> | ||
protected readonly _logWrapper: LoggerWrapper; | ||
protected constructor(token: string, extensionId: string); | ||
constructor(token: string, extensionId: string); | ||
setLogMethod(logMethod?: ILogMethod): void; | ||
@@ -15,0 +15,0 @@ getCurrentlyUploadedResource(): Promise<webstoreApi.WebstoreResource>; |
{ | ||
"name": "webext-buildtools-chrome-webstore-builder", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "webext-buildtools builder for deploying to Chrome Webstore. Based on chrome-webstore-upload", | ||
@@ -5,0 +5,0 @@ "main": "dist", |
@@ -18,3 +18,3 @@ [![Build Status](https://travis-ci.com/cardinalby/webext-buildtools-chrome-webstore-builder.svg?branch=master)](https://travis-ci.com/cardinalby/webext-buildtools-chrome-webstore-builder) | ||
Builder doesn't allow publish new extension, only update existing (specified by `extensionId` in options) | ||
Builder doesn't allow publish a new extension, only update the existing one (specified by `extensionId` in options) | ||
with new version. | ||
@@ -53,2 +53,4 @@ | ||
Alternatively, you can directly set valid `options.accessToken` (be sure it's not expired). | ||
### Inputs | ||
@@ -66,3 +68,3 @@ 1. **`setInputManifest(...)`**. Optional. Object with parsed extension's `package.json`. Will be extracted from zip if not specified. | ||
*Required options:* `extensionId`, `apiAccess` <br> | ||
*Required options:* `extensionId`, `apiAccess` or `accessToken` <br> | ||
*Require methods:* `requireUploadedExt()` <br> | ||
@@ -78,3 +80,3 @@ *Assets:* <br> | ||
*Required options:* `extensionId`, `apiAccess` <br> | ||
*Required options:* `extensionId`, `apiAccess` or `accessToken`<br> | ||
*Require methods:* `requirePublishedExt()` <br> | ||
@@ -81,0 +83,0 @@ *Assets:* <br> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43267
768
102