Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

class ShopifyCli::PartnersAPI

Tim Anema edited this page Apr 22, 2020 · 11 revisions

Constants

  • ENV_VAR
  • AUTH_PROD_URI
  • AUTH_DEV_URI
  • PROD_URI
  • DEV_URI
  • PROD_ID
  • DEV_ID
  • PROD_CLI_ID
  • DEV_CLI_ID

Class Methods

id

id()

see source

# File lib/shopify-cli/partners_api.rb, line 16
def id
  ENV[ENV_VAR].nil? ? PROD_ID : DEV_ID
end
---

cli_id

cli_id()

see source

# File lib/shopify-cli/partners_api.rb, line 20
def cli_id
  ENV[ENV_VAR].nil? ? PROD_CLI_ID : DEV_CLI_ID
end
---

auth_endpoint

auth_endpoint()

see source

# File lib/shopify-cli/partners_api.rb, line 24
def auth_endpoint
  ENV[ENV_VAR].nil? ? AUTH_PROD_URI : AUTH_DEV_URI
end
---

endpoint

endpoint()

see source

# File lib/shopify-cli/partners_api.rb, line 28
def endpoint
  ENV[ENV_VAR].nil? ? PROD_URI : DEV_URI
end
---

query

query(ctx, body, **variables)

see source

# File lib/shopify-cli/partners_api.rb, line 32
def query(ctx, body, **variables)
  authenticated_req(ctx) do
    api_client(ctx).query(body, variables: variables)
  end
end
---

Instance Methods

auth_headers

auth_headers(token)

see source

# File lib/shopify-cli/partners_api.rb, line 58
def auth_headers(token)
  { Authorization: "Bearer #{token}" }
end
---
Clone this wiki locally