shopify-cli 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/CODEOWNERS +1 -0
- data/.github/CODE_OF_CONDUCT.md +73 -0
- data/.github/CONTRIBUTING.md +51 -0
- data/.github/DESIGN.md +153 -0
- data/.github/ISSUE_TEMPLATE.md +38 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +22 -0
- data/.github/probots.yml +3 -0
- data/.gitignore +19 -0
- data/.rubocop.yml +47 -0
- data/.ruby-version +1 -0
- data/.travis.yml +12 -0
- data/Gemfile +22 -0
- data/Gemfile.lock +77 -0
- data/LICENSE.md +7 -0
- data/README.md +13 -0
- data/Rakefile +101 -0
- data/SECURITY.md +59 -0
- data/Vagrantfile +17 -0
- data/bin/load_shopify.rb +20 -0
- data/bin/shopify +32 -0
- data/dev.yml +17 -0
- data/docs/Gemfile +5 -0
- data/docs/Gemfile.lock +248 -0
- data/docs/_config.yml +16 -0
- data/docs/_data/nav.yml +26 -0
- data/docs/_includes/footer.html +15 -0
- data/docs/_includes/head.html +19 -0
- data/docs/_includes/sidebar_nav.html +22 -0
- data/docs/_includes/toc.html +112 -0
- data/docs/_layouts/default.html +79 -0
- data/docs/app/node/commands/index.md +82 -0
- data/docs/app/node/index.md +35 -0
- data/docs/app/rails/commands/index.md +80 -0
- data/docs/app/rails/index.md +36 -0
- data/docs/core/index.md +70 -0
- data/docs/css/docs.css +157 -0
- data/docs/getting-started/index.md +61 -0
- data/docs/help/start-app/index.md +6 -0
- data/docs/images/header.png +0 -0
- data/docs/index.md +27 -0
- data/docs/installing-ruby.md +28 -0
- data/ext/shopify-cli/extconf.rb +27 -0
- data/install.sh +7 -0
- data/lib/docgen/class_template.md.erb +81 -0
- data/lib/docgen/index_template.md.erb +5 -0
- data/lib/docgen/markdown.rb +101 -0
- data/lib/graphql/admin_introspection.graphql +87 -0
- data/lib/graphql/all_organizations.graphql +19 -0
- data/lib/graphql/all_orgs_with_apps.graphql +30 -0
- data/lib/graphql/api_versions.graphql +6 -0
- data/lib/graphql/convert_dev_to_test_store.graphql +10 -0
- data/lib/graphql/create_app.graphql +20 -0
- data/lib/graphql/create_customer.graphql +9 -0
- data/lib/graphql/create_draft_order.graphql +8 -0
- data/lib/graphql/create_product.graphql +9 -0
- data/lib/graphql/extension_create.graphql +21 -0
- data/lib/graphql/extension_update_draft.graphql +18 -0
- data/lib/graphql/find_organization.graphql +17 -0
- data/lib/graphql/get_app_urls.graphql +6 -0
- data/lib/graphql/update_dashboard_urls.graphql +8 -0
- data/lib/project_types/extension/cli.rb +71 -0
- data/lib/project_types/extension/commands/build.rb +29 -0
- data/lib/project_types/extension/commands/create.rb +49 -0
- data/lib/project_types/extension/commands/extension_command.rb +22 -0
- data/lib/project_types/extension/commands/push.rb +69 -0
- data/lib/project_types/extension/commands/register.rb +78 -0
- data/lib/project_types/extension/commands/serve.rb +24 -0
- data/lib/project_types/extension/commands/tunnel.rb +69 -0
- data/lib/project_types/extension/extension_project.rb +85 -0
- data/lib/project_types/extension/extension_project_keys.rb +10 -0
- data/lib/project_types/extension/features/argo.rb +48 -0
- data/lib/project_types/extension/features/argo_dependencies.rb +28 -0
- data/lib/project_types/extension/features/argo_setup.rb +54 -0
- data/lib/project_types/extension/features/argo_setup_step.rb +31 -0
- data/lib/project_types/extension/features/argo_setup_steps.rb +53 -0
- data/lib/project_types/extension/features/tunnel_url.rb +20 -0
- data/lib/project_types/extension/forms/create.rb +52 -0
- data/lib/project_types/extension/forms/register.rb +48 -0
- data/lib/project_types/extension/messages/message_loading.rb +37 -0
- data/lib/project_types/extension/messages/messages.rb +126 -0
- data/lib/project_types/extension/models/app.rb +14 -0
- data/lib/project_types/extension/models/registration.rb +19 -0
- data/lib/project_types/extension/models/type.rb +76 -0
- data/lib/project_types/extension/models/types/checkout_post_purchase.rb +20 -0
- data/lib/project_types/extension/models/types/subscription_management.rb +20 -0
- data/lib/project_types/extension/models/validation_error.rb +17 -0
- data/lib/project_types/extension/models/version.rb +15 -0
- data/lib/project_types/extension/tasks/converters/registration_converter.rb +26 -0
- data/lib/project_types/extension/tasks/converters/validation_error_converter.rb +25 -0
- data/lib/project_types/extension/tasks/converters/version_converter.rb +28 -0
- data/lib/project_types/extension/tasks/create_extension.rb +31 -0
- data/lib/project_types/extension/tasks/get_apps.rb +34 -0
- data/lib/project_types/extension/tasks/update_draft.rb +29 -0
- data/lib/project_types/extension/tasks/user_errors.rb +45 -0
- data/lib/project_types/node/cli.rb +37 -0
- data/lib/project_types/node/commands/create.rb +117 -0
- data/lib/project_types/node/commands/deploy.rb +22 -0
- data/lib/project_types/node/commands/deploy/heroku.rb +91 -0
- data/lib/project_types/node/commands/generate.rb +51 -0
- data/lib/project_types/node/commands/generate/billing.rb +37 -0
- data/lib/project_types/node/commands/generate/page.rb +55 -0
- data/lib/project_types/node/commands/generate/webhook.rb +33 -0
- data/lib/project_types/node/commands/open.rb +16 -0
- data/lib/project_types/node/commands/populate.rb +23 -0
- data/lib/project_types/node/commands/populate/customer.rb +31 -0
- data/lib/project_types/node/commands/populate/draft_order.rb +28 -0
- data/lib/project_types/node/commands/populate/product.rb +30 -0
- data/lib/project_types/node/commands/serve.rb +45 -0
- data/lib/project_types/node/commands/tunnel.rb +39 -0
- data/lib/project_types/node/forms/create.rb +87 -0
- data/lib/project_types/node/messages/messages.rb +260 -0
- data/lib/project_types/rails/cli.rb +41 -0
- data/lib/project_types/rails/commands/create.rb +126 -0
- data/lib/project_types/rails/commands/deploy.rb +22 -0
- data/lib/project_types/rails/commands/deploy/heroku.rb +113 -0
- data/lib/project_types/rails/commands/generate.rb +49 -0
- data/lib/project_types/rails/commands/generate/webhook.rb +39 -0
- data/lib/project_types/rails/commands/open.rb +16 -0
- data/lib/project_types/rails/commands/populate.rb +23 -0
- data/lib/project_types/rails/commands/populate/customer.rb +31 -0
- data/lib/project_types/rails/commands/populate/draft_order.rb +28 -0
- data/lib/project_types/rails/commands/populate/product.rb +30 -0
- data/lib/project_types/rails/commands/serve.rb +47 -0
- data/lib/project_types/rails/commands/tunnel.rb +39 -0
- data/lib/project_types/rails/forms/create.rb +116 -0
- data/lib/project_types/rails/gem.rb +56 -0
- data/lib/project_types/rails/messages/messages.rb +283 -0
- data/lib/project_types/rails/ruby.rb +17 -0
- data/lib/project_types/script/cli.rb +76 -0
- data/lib/project_types/script/commands/create.rb +45 -0
- data/lib/project_types/script/commands/disable.rb +36 -0
- data/lib/project_types/script/commands/enable.rb +46 -0
- data/lib/project_types/script/commands/push.rb +39 -0
- data/lib/project_types/script/config/extension_points.yml +18 -0
- data/lib/project_types/script/errors.rb +16 -0
- data/lib/project_types/script/forms/create.rb +29 -0
- data/lib/project_types/script/forms/enable.rb +24 -0
- data/lib/project_types/script/forms/push.rb +19 -0
- data/lib/project_types/script/forms/script_form.rb +66 -0
- data/lib/project_types/script/graphql/app_script_update_or_create.graphql +27 -0
- data/lib/project_types/script/graphql/script_service_proxy.graphql +8 -0
- data/lib/project_types/script/graphql/shop_script_delete.graphql +14 -0
- data/lib/project_types/script/graphql/shop_script_update_or_create.graphql +28 -0
- data/lib/project_types/script/layers/application/build_script.rb +43 -0
- data/lib/project_types/script/layers/application/create_script.rb +47 -0
- data/lib/project_types/script/layers/application/disable_script.rb +19 -0
- data/lib/project_types/script/layers/application/enable_script.rb +21 -0
- data/lib/project_types/script/layers/application/extension_points.rb +17 -0
- data/lib/project_types/script/layers/application/project_dependencies.rb +34 -0
- data/lib/project_types/script/layers/application/push_script.rb +30 -0
- data/lib/project_types/script/layers/domain/errors.rb +25 -0
- data/lib/project_types/script/layers/domain/extension_point.rb +29 -0
- data/lib/project_types/script/layers/domain/push_package.rb +29 -0
- data/lib/project_types/script/layers/domain/script.rb +18 -0
- data/lib/project_types/script/layers/infrastructure/assemblyscript_dependency_manager.rb +73 -0
- data/lib/project_types/script/layers/infrastructure/assemblyscript_tsconfig.rb +38 -0
- data/lib/project_types/script/layers/infrastructure/assemblyscript_wasm_builder.rb +39 -0
- data/lib/project_types/script/layers/infrastructure/dependency_manager.rb +36 -0
- data/lib/project_types/script/layers/infrastructure/errors.rb +38 -0
- data/lib/project_types/script/layers/infrastructure/extension_point_repository.rb +31 -0
- data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +47 -0
- data/lib/project_types/script/layers/infrastructure/script_builder.rb +34 -0
- data/lib/project_types/script/layers/infrastructure/script_repository.rb +89 -0
- data/lib/project_types/script/layers/infrastructure/script_service.rb +165 -0
- data/lib/project_types/script/layers/infrastructure/test_suite_repository.rb +59 -0
- data/lib/project_types/script/messages/messages.rb +204 -0
- data/lib/project_types/script/script_project.rb +37 -0
- data/lib/project_types/script/templates/ts/as-pect.config.js +21 -0
- data/lib/project_types/script/ui/error_handler.rb +136 -0
- data/lib/project_types/script/ui/strict_spinner.rb +22 -0
- data/lib/rubygems_plugin.rb +18 -0
- data/lib/shopify-cli/admin_api.rb +99 -0
- data/lib/shopify-cli/admin_api/populate_resource_command.rb +165 -0
- data/lib/shopify-cli/admin_api/schema.rb +32 -0
- data/lib/shopify-cli/api.rb +104 -0
- data/lib/shopify-cli/command.rb +67 -0
- data/lib/shopify-cli/commands.rb +28 -0
- data/lib/shopify-cli/commands/connect.rb +108 -0
- data/lib/shopify-cli/commands/create.rb +50 -0
- data/lib/shopify-cli/commands/help.rb +79 -0
- data/lib/shopify-cli/commands/logout.rb +23 -0
- data/lib/shopify-cli/commands/system.rb +135 -0
- data/lib/shopify-cli/commands/version.rb +15 -0
- data/lib/shopify-cli/context.rb +372 -0
- data/lib/shopify-cli/core.rb +9 -0
- data/lib/shopify-cli/core/entry_point.rb +40 -0
- data/lib/shopify-cli/core/executor.rb +21 -0
- data/lib/shopify-cli/core/help_resolver.rb +20 -0
- data/lib/shopify-cli/core/monorail.rb +118 -0
- data/lib/shopify-cli/db.rb +114 -0
- data/lib/shopify-cli/form.rb +40 -0
- data/lib/shopify-cli/git.rb +141 -0
- data/lib/shopify-cli/helpers.rb +5 -0
- data/lib/shopify-cli/helpers/haikunator.rb +92 -0
- data/lib/shopify-cli/heroku.rb +97 -0
- data/lib/shopify-cli/js_deps.rb +110 -0
- data/lib/shopify-cli/js_system.rb +98 -0
- data/lib/shopify-cli/messages/messages.rb +287 -0
- data/lib/shopify-cli/oauth.rb +192 -0
- data/lib/shopify-cli/oauth/servlet.rb +61 -0
- data/lib/shopify-cli/options.rb +40 -0
- data/lib/shopify-cli/packager.rb +116 -0
- data/lib/shopify-cli/partners_api.rb +114 -0
- data/lib/shopify-cli/partners_api/organizations.rb +32 -0
- data/lib/shopify-cli/process_supervision.rb +187 -0
- data/lib/shopify-cli/project.rb +191 -0
- data/lib/shopify-cli/project_type.rb +83 -0
- data/lib/shopify-cli/resources.rb +5 -0
- data/lib/shopify-cli/resources/env_file.rb +96 -0
- data/lib/shopify-cli/sub_command.rb +15 -0
- data/lib/shopify-cli/task.rb +10 -0
- data/lib/shopify-cli/tasks.rb +32 -0
- data/lib/shopify-cli/tasks/create_api_client.rb +29 -0
- data/lib/shopify-cli/tasks/ensure_dev_store.rb +41 -0
- data/lib/shopify-cli/tasks/ensure_env.rb +31 -0
- data/lib/shopify-cli/tasks/ensure_loopback_url.rb +20 -0
- data/lib/shopify-cli/tasks/update_dashboard_urls.rb +44 -0
- data/lib/shopify-cli/tunnel.rb +154 -0
- data/lib/shopify-cli/version.rb +3 -0
- data/lib/shopify_cli.rb +132 -0
- data/shopify-cli.gemspec +40 -0
- data/shopify.fish +12 -0
- data/shopify.sh +11 -0
- data/vendor/deps/cli-kit/REVISION +1 -0
- data/vendor/deps/cli-kit/lib/cli/kit.rb +60 -0
- data/vendor/deps/cli-kit/lib/cli/kit/autocall.rb +21 -0
- data/vendor/deps/cli-kit/lib/cli/kit/base_command.rb +49 -0
- data/vendor/deps/cli-kit/lib/cli/kit/command_registry.rb +94 -0
- data/vendor/deps/cli-kit/lib/cli/kit/config.rb +133 -0
- data/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb +115 -0
- data/vendor/deps/cli-kit/lib/cli/kit/executor.rb +81 -0
- data/vendor/deps/cli-kit/lib/cli/kit/ini.rb +102 -0
- data/vendor/deps/cli-kit/lib/cli/kit/levenshtein.rb +82 -0
- data/vendor/deps/cli-kit/lib/cli/kit/logger.rb +76 -0
- data/vendor/deps/cli-kit/lib/cli/kit/resolver.rb +60 -0
- data/vendor/deps/cli-kit/lib/cli/kit/ruby_backports/enumerable.rb +6 -0
- data/vendor/deps/cli-kit/lib/cli/kit/support.rb +9 -0
- data/vendor/deps/cli-kit/lib/cli/kit/support/test_helper.rb +244 -0
- data/vendor/deps/cli-kit/lib/cli/kit/system.rb +207 -0
- data/vendor/deps/cli-kit/lib/cli/kit/util.rb +189 -0
- data/vendor/deps/cli-kit/lib/cli/kit/version.rb +5 -0
- data/vendor/deps/cli-ui/REVISION +1 -0
- data/vendor/deps/cli-ui/lib/cli/ui.rb +187 -0
- data/vendor/deps/cli-ui/lib/cli/ui/ansi.rb +153 -0
- data/vendor/deps/cli-ui/lib/cli/ui/box.rb +15 -0
- data/vendor/deps/cli-ui/lib/cli/ui/color.rb +79 -0
- data/vendor/deps/cli-ui/lib/cli/ui/formatter.rb +179 -0
- data/vendor/deps/cli-ui/lib/cli/ui/frame.rb +310 -0
- data/vendor/deps/cli-ui/lib/cli/ui/glyph.rb +78 -0
- data/vendor/deps/cli-ui/lib/cli/ui/progress.rb +88 -0
- data/vendor/deps/cli-ui/lib/cli/ui/prompt.rb +248 -0
- data/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb +472 -0
- data/vendor/deps/cli-ui/lib/cli/ui/prompt/options_handler.rb +24 -0
- data/vendor/deps/cli-ui/lib/cli/ui/spinner.rb +48 -0
- data/vendor/deps/cli-ui/lib/cli/ui/spinner/async.rb +40 -0
- data/vendor/deps/cli-ui/lib/cli/ui/spinner/spin_group.rb +241 -0
- data/vendor/deps/cli-ui/lib/cli/ui/stdout_router.rb +227 -0
- data/vendor/deps/cli-ui/lib/cli/ui/terminal.rb +36 -0
- data/vendor/deps/cli-ui/lib/cli/ui/truncater.rb +102 -0
- data/vendor/deps/cli-ui/lib/cli/ui/version.rb +5 -0
- data/vendor/deps/smart_properties/REVISION +1 -0
- data/vendor/deps/smart_properties/lib/smart_properties.rb +174 -0
- data/vendor/deps/smart_properties/lib/smart_properties/errors.rb +114 -0
- data/vendor/deps/smart_properties/lib/smart_properties/property.rb +162 -0
- data/vendor/deps/smart_properties/lib/smart_properties/property_collection.rb +83 -0
- data/vendor/deps/smart_properties/lib/smart_properties/validations.rb +8 -0
- data/vendor/deps/smart_properties/lib/smart_properties/validations/ancestor.rb +27 -0
- data/vendor/deps/smart_properties/lib/smart_properties/version.rb +3 -0
- data/vendor/lib/semantic/LICENSE +20 -0
- data/vendor/lib/semantic/semantic.rb +4 -0
- data/vendor/lib/semantic/version.rb +180 -0
- metadata +374 -0
@@ -0,0 +1,101 @@
|
|
1
|
+
require 'rdoc/rdoc'
|
2
|
+
require 'erb'
|
3
|
+
|
4
|
+
module RDoc
|
5
|
+
module Generator
|
6
|
+
class Markdown
|
7
|
+
::RDoc::RDoc.add_generator(self)
|
8
|
+
|
9
|
+
DocClass = Struct.new(
|
10
|
+
:title, :kind, :comment, :class_methods, :instance_methods, :attributes,
|
11
|
+
:constants, :extended, :included, :filename,
|
12
|
+
keyword_init: true,
|
13
|
+
)
|
14
|
+
ClassMember = Struct.new(:title, :comment, :signature, :source_code, keyword_init: true)
|
15
|
+
|
16
|
+
def initialize(store, options)
|
17
|
+
@options = options
|
18
|
+
@store = store
|
19
|
+
@converter = ::RDoc::Markup::ToMarkdown.new
|
20
|
+
end
|
21
|
+
|
22
|
+
def generate
|
23
|
+
render(build_classes)
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def render(data)
|
29
|
+
class_template_path = File.join(File.dirname(__FILE__), 'class_template.md.erb')
|
30
|
+
class_renderer = ERB.new(File.read(class_template_path), nil, '-')
|
31
|
+
data.each do |cls|
|
32
|
+
File.write("#{cls.filename}.md", class_renderer.result(cls.instance_eval { binding }))
|
33
|
+
end
|
34
|
+
index_template_path = File.join(File.dirname(__FILE__), 'index_template.md.erb')
|
35
|
+
index_renderer = ERB.new(File.read(index_template_path), nil, '-')
|
36
|
+
File.write("Core-APIs.md", index_renderer.result(OpenStruct.new(classes: data).instance_eval { binding }))
|
37
|
+
end
|
38
|
+
|
39
|
+
def build_classes
|
40
|
+
classes = @store.all_classes_and_modules.map do |klass|
|
41
|
+
is_class = @store.all_modules.find { |m| m.full_name == klass.full_name }.nil?
|
42
|
+
kind = is_class ? :class : :module
|
43
|
+
DocClass.new(
|
44
|
+
filename: "#{kind}-#{klass.full_name}",
|
45
|
+
title: klass.full_name,
|
46
|
+
kind: kind,
|
47
|
+
comment: @converter.convert(klass.comment.parse),
|
48
|
+
constants: build_members(klass.constants),
|
49
|
+
class_methods: build_members(klass.method_list.select { |m| m.type == 'class' }),
|
50
|
+
instance_methods: build_members(klass.method_list.select { |m| m.type == 'instance' }),
|
51
|
+
attributes: build_members(klass.attributes),
|
52
|
+
extended: build_members(klass.extends),
|
53
|
+
included: build_members(klass.includes),
|
54
|
+
)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Remove nondescript items
|
58
|
+
classes.reject do |klass|
|
59
|
+
klass.comment.empty? && klass.constants.empty? &&
|
60
|
+
klass.class_methods.empty? && klass.instance_methods.empty? &&
|
61
|
+
klass.attributes.empty? && klass.extended.empty? &&
|
62
|
+
klass.included.empty?
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def build_members(member_list)
|
67
|
+
member_list.map do |m|
|
68
|
+
ClassMember.new(
|
69
|
+
title: m.name,
|
70
|
+
comment: @converter.convert(m.comment.parse),
|
71
|
+
signature: m.respond_to?(:arglists) ? m.arglists : '',
|
72
|
+
source_code: source(m),
|
73
|
+
)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# Just extracts sourcecode from html formatting/highlighting into a text
|
78
|
+
# blob so that markdown can format it with a codeblock
|
79
|
+
def source(m)
|
80
|
+
return '' unless m.respond_to?(:token_stream)
|
81
|
+
# each line, get the text
|
82
|
+
src = (m.token_stream || []).map do |t|
|
83
|
+
next unless t
|
84
|
+
CGI.escapeHTML(t[:text])
|
85
|
+
end.join
|
86
|
+
# dedent the source
|
87
|
+
indent = src.length
|
88
|
+
lines = src.lines.to_a
|
89
|
+
lines.shift if src =~ /\A.*#\ *File/i # remove '# File' comment
|
90
|
+
lines.each do |line|
|
91
|
+
next unless line =~ /^ *(?=\S)/
|
92
|
+
n = $&.length
|
93
|
+
indent = n if n < indent
|
94
|
+
break if n == 0
|
95
|
+
end
|
96
|
+
src.gsub!(/^#{' ' * indent}/, '') if indent > 0
|
97
|
+
src
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
query IntrospectionQuery {
|
2
|
+
__schema {
|
3
|
+
queryType { name }
|
4
|
+
mutationType { name }
|
5
|
+
types {
|
6
|
+
...FullType
|
7
|
+
}
|
8
|
+
directives {
|
9
|
+
name
|
10
|
+
description
|
11
|
+
locations
|
12
|
+
args {
|
13
|
+
...InputValue
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
fragment FullType on __Type {
|
19
|
+
kind
|
20
|
+
name
|
21
|
+
description
|
22
|
+
fields(includeDeprecated: true) {
|
23
|
+
name
|
24
|
+
description
|
25
|
+
args {
|
26
|
+
...InputValue
|
27
|
+
}
|
28
|
+
type {
|
29
|
+
...TypeRef
|
30
|
+
}
|
31
|
+
isDeprecated
|
32
|
+
deprecationReason
|
33
|
+
}
|
34
|
+
inputFields {
|
35
|
+
...InputValue
|
36
|
+
}
|
37
|
+
interfaces {
|
38
|
+
...TypeRef
|
39
|
+
}
|
40
|
+
enumValues(includeDeprecated: true) {
|
41
|
+
name
|
42
|
+
description
|
43
|
+
isDeprecated
|
44
|
+
deprecationReason
|
45
|
+
}
|
46
|
+
possibleTypes {
|
47
|
+
...TypeRef
|
48
|
+
}
|
49
|
+
}
|
50
|
+
fragment InputValue on __InputValue {
|
51
|
+
name
|
52
|
+
description
|
53
|
+
type { ...TypeRef }
|
54
|
+
defaultValue
|
55
|
+
}
|
56
|
+
fragment TypeRef on __Type {
|
57
|
+
kind
|
58
|
+
name
|
59
|
+
ofType {
|
60
|
+
kind
|
61
|
+
name
|
62
|
+
ofType {
|
63
|
+
kind
|
64
|
+
name
|
65
|
+
ofType {
|
66
|
+
kind
|
67
|
+
name
|
68
|
+
ofType {
|
69
|
+
kind
|
70
|
+
name
|
71
|
+
ofType {
|
72
|
+
kind
|
73
|
+
name
|
74
|
+
ofType {
|
75
|
+
kind
|
76
|
+
name
|
77
|
+
ofType {
|
78
|
+
kind
|
79
|
+
name
|
80
|
+
}
|
81
|
+
}
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
query AllOrgs{
|
2
|
+
organizations {
|
3
|
+
nodes {
|
4
|
+
id
|
5
|
+
businessName
|
6
|
+
website
|
7
|
+
stores(first: 500) {
|
8
|
+
nodes {
|
9
|
+
shopId
|
10
|
+
link
|
11
|
+
shopDomain
|
12
|
+
shopName
|
13
|
+
transferDisabled
|
14
|
+
convertableToPartnerTest
|
15
|
+
}
|
16
|
+
}
|
17
|
+
apps(first: 500) {
|
18
|
+
nodes {
|
19
|
+
id
|
20
|
+
title
|
21
|
+
apiKey
|
22
|
+
apiSecretKeys{
|
23
|
+
secret
|
24
|
+
}
|
25
|
+
appType
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
mutation AppCreate($org: Int!, $title: String!, $app_url: Url!, $redir: [Url]!, $type: AppType) {
|
2
|
+
appCreate(input: {organizationID: $org, title: $title, applicationUrl: $app_url, redirectUrlWhitelist: $redir, appType: $type}) {
|
3
|
+
app {
|
4
|
+
id
|
5
|
+
apiKey
|
6
|
+
title
|
7
|
+
applicationUrl
|
8
|
+
redirectUrlWhitelist
|
9
|
+
apiSecretKeys {
|
10
|
+
secret
|
11
|
+
createdAt
|
12
|
+
}
|
13
|
+
appType
|
14
|
+
}
|
15
|
+
userErrors {
|
16
|
+
field
|
17
|
+
message
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
mutation ExtensionCreate($api_key: String!, $type: ExtensionType!, $title: String!, $config: JSON!, $extension_context: String) {
|
2
|
+
extensionCreate(input: {apiKey: $api_key, type: $type, title: $title, config: $config, context: $extension_context}) {
|
3
|
+
extensionRegistration {
|
4
|
+
id
|
5
|
+
type
|
6
|
+
title
|
7
|
+
draftVersion {
|
8
|
+
registrationId
|
9
|
+
lastUserInteractionAt
|
10
|
+
validationErrors {
|
11
|
+
field
|
12
|
+
message
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
16
|
+
userErrors {
|
17
|
+
field
|
18
|
+
message
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
mutation ExtensionUpdateDraft($api_key: String!, $registration_id: ID!, $config: JSON!, $context: String) {
|
2
|
+
extensionUpdateDraft(input: {apiKey: $api_key, registrationId: $registration_id, config: $config, context: $context}) {
|
3
|
+
extensionVersion {
|
4
|
+
registrationId
|
5
|
+
context
|
6
|
+
lastUserInteractionAt
|
7
|
+
location
|
8
|
+
validationErrors {
|
9
|
+
field
|
10
|
+
message
|
11
|
+
}
|
12
|
+
}
|
13
|
+
userErrors {
|
14
|
+
field
|
15
|
+
message
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Extension
|
4
|
+
class Project < ShopifyCli::ProjectType
|
5
|
+
hidden_project_type
|
6
|
+
creator 'App Extension', 'Extension::Commands::Create'
|
7
|
+
|
8
|
+
register_command('Extension::Commands::Build', "build")
|
9
|
+
register_command('Extension::Commands::Register', "register")
|
10
|
+
register_command('Extension::Commands::Push', "push")
|
11
|
+
register_command('Extension::Commands::Serve', "serve")
|
12
|
+
register_command('Extension::Commands::Tunnel', "tunnel")
|
13
|
+
|
14
|
+
require Project.project_filepath('messages/messages')
|
15
|
+
require Project.project_filepath('messages/message_loading')
|
16
|
+
require Project.project_filepath('extension_project_keys')
|
17
|
+
register_messages(Extension::Messages::MessageLoading.load)
|
18
|
+
end
|
19
|
+
|
20
|
+
module Commands
|
21
|
+
autoload :ExtensionCommand, Project.project_filepath('commands/extension_command')
|
22
|
+
autoload :Create, Project.project_filepath('commands/create')
|
23
|
+
autoload :Register, Project.project_filepath('commands/register')
|
24
|
+
autoload :Build, Project.project_filepath('commands/build')
|
25
|
+
autoload :Serve, Project.project_filepath('commands/serve')
|
26
|
+
autoload :Push, Project.project_filepath('commands/push')
|
27
|
+
autoload :Tunnel, Project.project_filepath('commands/tunnel')
|
28
|
+
end
|
29
|
+
|
30
|
+
module Tasks
|
31
|
+
autoload :UserErrors, Project.project_filepath('tasks/user_errors')
|
32
|
+
autoload :GetApps, Project.project_filepath('tasks/get_apps')
|
33
|
+
autoload :CreateExtension, Project.project_filepath('tasks/create_extension')
|
34
|
+
autoload :UpdateDraft, Project.project_filepath('tasks/update_draft')
|
35
|
+
|
36
|
+
module Converters
|
37
|
+
autoload :RegistrationConverter, Project.project_filepath('tasks/converters/registration_converter')
|
38
|
+
autoload :VersionConverter, Project.project_filepath('tasks/converters/version_converter')
|
39
|
+
autoload :ValidationErrorConverter, Project.project_filepath('tasks/converters/validation_error_converter')
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
module Forms
|
44
|
+
autoload :Create, Project.project_filepath('forms/create')
|
45
|
+
autoload :Register, Project.project_filepath('forms/register')
|
46
|
+
end
|
47
|
+
|
48
|
+
module Features
|
49
|
+
autoload :Argo, Project.project_filepath('features/argo')
|
50
|
+
autoload :ArgoSetup, Project.project_filepath('features/argo_setup')
|
51
|
+
autoload :ArgoSetupStep, Project.project_filepath('features/argo_setup_step')
|
52
|
+
autoload :ArgoSetupSteps, Project.project_filepath('features/argo_setup_steps')
|
53
|
+
autoload :ArgoDependencies, Project.project_filepath('features/argo_dependencies')
|
54
|
+
autoload :TunnelUrl, Project.project_filepath('features/tunnel_url')
|
55
|
+
end
|
56
|
+
|
57
|
+
module Models
|
58
|
+
autoload :App, Project.project_filepath('models/app')
|
59
|
+
autoload :Registration, Project.project_filepath('models/registration')
|
60
|
+
autoload :Version, Project.project_filepath('models/version')
|
61
|
+
autoload :Type, Project.project_filepath('models/type')
|
62
|
+
autoload :ValidationError, Project.project_filepath('models/validation_error')
|
63
|
+
|
64
|
+
class << self
|
65
|
+
Models::Type.load_all
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
autoload :ExtensionProjectKeys, Project.project_filepath('extension_project_keys')
|
70
|
+
autoload :ExtensionProject, Project.project_filepath('extension_project')
|
71
|
+
end
|