This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 203
class ShopifyCli::PartnersAPI
Tim Anema edited this page Apr 22, 2020
·
11 revisions
ENV_VAR
AUTH_PROD_URI
AUTH_DEV_URI
PROD_URI
DEV_URI
PROD_ID
DEV_ID
PROD_CLI_ID
DEV_CLI_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()
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()
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()
see source
# File lib/shopify-cli/partners_api.rb, line 28
def endpoint
ENV[ENV_VAR].nil? ? PROD_URI : DEV_URI
end
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
auth_headers(token)
see source
# File lib/shopify-cli/partners_api.rb, line 58
def auth_headers(token)
{ Authorization: "Bearer #{token}" }
end