Sha256: 081d889329829e1a86db5f396318b0e93a0e5d08aafe2aa615c12a770ea0771e

Contents?: true

Size: 1.19 KB

Versions: 17

Compression:

Stored size: 1.19 KB

Contents

# frozen_string_literal: true

module Script
  module Layers
    module Application
      class ExtensionPoints
        def self.get(type:)
          Infrastructure::ExtensionPointRepository.new.get_extension_point(type)
        end

        def self.types
          Infrastructure::ExtensionPointRepository.new.extension_point_types
        end

        def self.available_types
          Infrastructure::ExtensionPointRepository.new.extension_points.select do |ep|
            next false if ep.deprecated?
            !ep.beta? || ShopifyCli::Feature.enabled?(:scripts_beta_extension_points)
          end.map(&:type)
        end

        def self.deprecated_types
          Infrastructure::ExtensionPointRepository.new
            .extension_points
            .select(&:deprecated?)
            .map(&:type)
        end

        def self.languages(type:)
          get(type: type).sdks.all.map do |sdk|
            next nil if sdk.beta? && !ShopifyCli::Feature.enabled?(:scripts_beta_languages)
            sdk.class.language
          end.compact
        end

        def self.supported_language?(type:, language:)
          languages(type: type).include?(language.downcase)
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
shopify-cli-2.4.0 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.3.0 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.2.2 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.2.1 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.2.0 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.1.0 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.0.2 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.0.1 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.0.0 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-1.14.0 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-1.13.1 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-1.13.0 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-1.12.0 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-1.11.0 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-1.10.0 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-1.9.1 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-1.9.0 lib/project_types/script/layers/application/extension_points.rb