Sha256: 342782f9ead8e90d0815d553b9e4d0cc78c2f15809a53dfd82114114d8f9567b

Contents?: true

Size: 714 Bytes

Versions: 77

Compression:

Stored size: 714 Bytes

Contents

# frozen_string_literal: true
require "shopify_cli"

module Extension
  module Tasks
    module Converters
      module AppConverter
        API_KEY_FIELD = "apiKey"
        API_SECRET_KEYS_FIELD = "apiSecretKeys"
        API_SECRET_FIELD = "secret"
        TITLE_FIELD = "title"
        ORGANIZATION_NAME_FIELD = "businessName"

        def self.from_hash(hash, organization = {})
          return nil if hash.nil?

          Models::App.new(
            api_key: hash[API_KEY_FIELD],
            secret: hash[API_SECRET_KEYS_FIELD].first[API_SECRET_FIELD],
            title: hash[TITLE_FIELD],
            business_name: organization[ORGANIZATION_NAME_FIELD]
          )
        end
      end
    end
  end
end

Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
shopify-cli-2.19.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.18.1 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.18.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.17.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.16.1 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.16.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.15.6 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.15.5 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.15.4 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.15.3 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.15.2 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.15.1 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.15.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.14.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.13.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.12.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.11.2 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.11.1 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.11.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.10.2 lib/project_types/extension/tasks/converters/app_converter.rb