Sha256: 37e644805a86dfb60699cc9dc7c5957922ff7c0c4ee239c88796790eec4e3be5
Contents?: true
Size: 805 Bytes
Versions: 17
Compression:
Stored size: 805 Bytes
Contents
require 'shopify_cli' module ShopifyCli module Tasks class CreateApiClient < ShopifyCli::Task VALID_APP_TYPES = %w(public custom) DEFAULT_APP_URL = 'https://shopify.github.io/shopify-app-cli/help/start-app/' def call(ctx, org_id:, title:, type:) resp = ShopifyCli::PartnersAPI.query( ctx, 'create_app', org: org_id.to_i, title: title, type: type, app_url: DEFAULT_APP_URL, redir: [OAuth::REDIRECT_HOST] ) user_errors = resp["data"]["appCreate"]["userErrors"] if !user_errors.nil? && user_errors.any? ctx.abort(user_errors.map { |err| "#{err['field']} #{err['message']}" }.join(", ")) end resp["data"]["appCreate"]["app"] end end end end
Version data entries
17 entries across 17 versions & 1 rubygems