@bigcommerce/stencil-cli 7.5.0 → 7.5.1

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.
@@ -212,19 +212,28 @@ async function getStoreChannels({ accessToken, apiHost, storeHash }) {
212
212
  url: `${apiHost}/stores/${storeHash}/v3/sites`,
213
213
  accessToken,
214
214
  });
215
- const channelsResponse = await networkUtils.sendApiRequest({
216
- url: `${apiHost}/stores/${storeHash}/v3/channels`,
217
- accessToken,
218
- });
215
+ const channelsResponse = await networkUtils
216
+ .sendApiRequest({
217
+ url: `${apiHost}/stores/${storeHash}/v3/channels?type:in=storefront`,
218
+ accessToken,
219
+ })
220
+ .catch((error) => {
221
+ if (error.response.status === 403) {
222
+ console.log(
223
+ 'WARNING: Version 7.4.2+ of stencil-cli added a request to the Channels resource which requires a permission missing on your current stencil cli auth token. Please generate a new auth token at your convenience which includes the "read-only channels" permission to clear up this warning. You can read more about correcting this issue here: https://github.com/bigcommerce/stencil-cli/issues/1185',
224
+ );
225
+ }
226
+ });
219
227
 
220
- const storefrontChannels = channelsResponse.data.data.filter(
221
- (channel) => channel.type === 'storefront',
222
- );
228
+ if (channelsResponse) {
229
+ return sitesResponse.data.data.filter(
230
+ (site) =>
231
+ channelsResponse.data.data.filter((channel) => channel.id === site.channel_id)
232
+ .length > 0,
233
+ );
234
+ }
223
235
 
224
- return sitesResponse.data.data.filter(
225
- (site) =>
226
- storefrontChannels.filter((channel) => channel.id === site.channel_id).length > 0,
227
- );
236
+ return sitesResponse.data.data;
228
237
  } catch (err) {
229
238
  throw new Error(`Could not fetch a list of the store channels: ${err.message}`);
230
239
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigcommerce/stencil-cli",
3
- "version": "7.5.0",
3
+ "version": "7.5.1",
4
4
  "description": "CLI tool to run BigCommerce Stores locally for theme development.",
5
5
  "main": "index.js",
6
6
  "engines": {