From bd14a06b40c6f33af3037f0b85ca91a9f4f5318c Mon Sep 17 00:00:00 2001 From: Daniel Lew <51924260+DanielSLew@users.noreply.github.com> Date: Tue, 22 Jun 2021 10:59:00 -0400 Subject: [PATCH] removed apikey references/usage from shopify plugin (#32024) (cherry picked from commit 47cf6755fd6a44343b4cc5b77dab21530494751d) --- packages/gatsby-source-shopify/README.md | 6 ------ .../__tests__/make-source-from-operation.ts | 8 -------- packages/gatsby-source-shopify/__tests__/node-builder.ts | 2 -- packages/gatsby-source-shopify/src/gatsby-node.ts | 1 - packages/gatsby-source-shopify/types/interface.d.ts | 1 - 5 files changed, 18 deletions(-) diff --git a/packages/gatsby-source-shopify/README.md b/packages/gatsby-source-shopify/README.md index a1b13b1d6ddef..f3e502ed96508 100644 --- a/packages/gatsby-source-shopify/README.md +++ b/packages/gatsby-source-shopify/README.md @@ -76,7 +76,6 @@ module.exports = { { resolve: "gatsby-source-shopify", options: { - apiKey: process.env.SHOPIFY_ADMIN_API_KEY, password: process.env.SHOPIFY_ADMIN_PASSWORD, storeUrl: process.env.SHOPIFY_STORE_URL, }, @@ -131,10 +130,6 @@ Now follow the second link to explore your Shopify data! ## Plugin options -`apiKey: string` - -The admin API key for the Shopify store + app you're using - `password: string` The admin password for the Shopify store + app you're using @@ -250,7 +245,6 @@ module.exports = { { resolve: "gatsby-source-shopify", options: { - apiKey: process.env.SHOPIFY_ADMIN_API_KEY, password: process.env.SHOPIFY_ADMIN_PASSWORD, storeUrl: process.env.SHOPIFY_STORE_URL, downloadImages: true, diff --git a/packages/gatsby-source-shopify/__tests__/make-source-from-operation.ts b/packages/gatsby-source-shopify/__tests__/make-source-from-operation.ts index 6078d34fbead8..e402085a5c334 100644 --- a/packages/gatsby-source-shopify/__tests__/make-source-from-operation.ts +++ b/packages/gatsby-source-shopify/__tests__/make-source-from-operation.ts @@ -133,7 +133,6 @@ describe(`The collections operation`, () => { const gatsbyApi = gatsbyApiMock as jest.Mock const options = { - apiKey: ``, password: ``, storeUrl: `my-shop.shopify.com`, downloadImages: true, @@ -248,7 +247,6 @@ describe(`When polling an operation`, () => { const gatsbyApi = gatsbyApiMock as jest.Mock const options = { - apiKey: ``, password: ``, storeUrl: `my-shop.shopify.com`, downloadImages: true, @@ -339,7 +337,6 @@ describe(`When downloading images`, () => { const gatsbyApi = gatsbyApiMock as jest.Mock const options = { - apiKey: ``, password: ``, storeUrl: `my-shop.shopify.com`, downloadImages: true, @@ -446,7 +443,6 @@ describe(`A production build`, () => { const gatsbyApi = gatsbyApiMock as jest.Mock const options = { - apiKey: ``, password: ``, storeUrl: `my-shop.shopify.com`, } @@ -513,7 +509,6 @@ describe(`A production build`, () => { const gatsbyApi = gatsbyApiMock as jest.Mock const options = { - apiKey: ``, password: ``, storeUrl: `my-shop.shopify.com`, } @@ -604,7 +599,6 @@ describe(`When an operation gets canceled`, () => { const gatsbyApi = gatsbyApiMock as jest.Mock const options = { - apiKey: ``, password: ``, storeUrl: `my-shop.shopify.com`, } @@ -677,7 +671,6 @@ describe(`When an operation fails with bad credentials`, () => { const gatsbyApi = gatsbyApiMock as jest.Mock const options = { - apiKey: ``, password: ``, storeUrl: `my-shop.shopify.com`, } @@ -827,7 +820,6 @@ describe(`The incremental products processor`, () => { const gatsbyApi = gatsbyApiMock as jest.Mock const options = { - apiKey: ``, password: ``, storeUrl: `my-shop.shopify.com`, downloadImages: true, diff --git a/packages/gatsby-source-shopify/__tests__/node-builder.ts b/packages/gatsby-source-shopify/__tests__/node-builder.ts index 8f29b12013f82..c42fedeab949d 100644 --- a/packages/gatsby-source-shopify/__tests__/node-builder.ts +++ b/packages/gatsby-source-shopify/__tests__/node-builder.ts @@ -56,7 +56,6 @@ describe(`When a variant has an image set`, () => { describe(`and options are set, not to download images`, () => { const options = { - apiKey: ``, password: ``, storeUrl: `my-shop.shopify.com`, } @@ -70,7 +69,6 @@ describe(`When a variant has an image set`, () => { describe(`and options are set to download images`, () => { const options = { - apiKey: ``, password: ``, storeUrl: `my-shop.shopify.com`, downloadImages: true, diff --git a/packages/gatsby-source-shopify/src/gatsby-node.ts b/packages/gatsby-source-shopify/src/gatsby-node.ts index 686ce695d5676..789c22001dae6 100644 --- a/packages/gatsby-source-shopify/src/gatsby-node.ts +++ b/packages/gatsby-source-shopify/src/gatsby-node.ts @@ -25,7 +25,6 @@ export function pluginOptionsSchema({ // Vague type error that we're not able to figure out related to isJoi missing // Probably related to Joi being outdated return Joi.object({ - apiKey: Joi.string().required(), password: Joi.string().required(), storeUrl: Joi.string() .pattern(/^[a-z0-9-]+\.myshopify\.com$/) diff --git a/packages/gatsby-source-shopify/types/interface.d.ts b/packages/gatsby-source-shopify/types/interface.d.ts index a527447da8883..2c38288b9d98b 100644 --- a/packages/gatsby-source-shopify/types/interface.d.ts +++ b/packages/gatsby-source-shopify/types/interface.d.ts @@ -1,5 +1,4 @@ interface ShopifyPluginOptions { - apiKey: string; password: string; storeUrl: string; downloadImages?: boolean;