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.36.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.35.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.34.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.33.1 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.33.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.32.1 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.32.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.31.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.30.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.29.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.28.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.27.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.26.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.25.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.24.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.23.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.22.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.21.0 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.20.1 lib/project_types/extension/tasks/converters/app_converter.rb
shopify-cli-2.20.0 lib/project_types/extension/tasks/converters/app_converter.rb