Sha256: de30a0b0dd45de1ac8db1ad4d7ae071872df84e2a05de3a01e00d1f1c96577cf

Contents?: true

Size: 1.2 KB

Versions: 13

Compression:

Stored size: 1.2 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).libraries.all.map do |library|
            next nil if library.beta? && !ShopifyCLI::Feature.enabled?(:scripts_beta_languages)
            library.language
          end.compact
        end

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
shopify-cli-2.8.0 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.7.4 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.7.3 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.7.2 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.7.1 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.7.0 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.6.6 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.6.5 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.6.4 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.6.3 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.6.2 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.6.1 lib/project_types/script/layers/application/extension_points.rb
shopify-cli-2.6.0 lib/project_types/script/layers/application/extension_points.rb