graphql 2.4.3 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/graphql/analysis/analyzer.rb +2 -1
- data/lib/graphql/analysis/visitor.rb +38 -41
- data/lib/graphql/analysis.rb +15 -12
- data/lib/graphql/autoload.rb +38 -0
- data/lib/graphql/backtrace/table.rb +118 -55
- data/lib/graphql/backtrace.rb +1 -19
- data/lib/graphql/current.rb +6 -1
- data/lib/graphql/dashboard/detailed_traces.rb +47 -0
- data/lib/graphql/dashboard/installable.rb +22 -0
- data/lib/graphql/dashboard/limiters.rb +93 -0
- data/lib/graphql/dashboard/operation_store.rb +199 -0
- data/lib/graphql/dashboard/statics/bootstrap-5.3.3.min.css +6 -0
- data/lib/graphql/dashboard/statics/bootstrap-5.3.3.min.js +7 -0
- data/lib/graphql/dashboard/statics/charts.min.css +1 -0
- data/lib/graphql/dashboard/statics/dashboard.css +30 -0
- data/lib/graphql/dashboard/statics/dashboard.js +143 -0
- data/lib/graphql/dashboard/statics/header-icon.png +0 -0
- data/lib/graphql/dashboard/statics/icon.png +0 -0
- data/lib/graphql/dashboard/subscriptions.rb +96 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/detailed_traces/traces/index.html.erb +45 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/landings/show.html.erb +18 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/limiters/limiters/show.html.erb +62 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/not_installed.html.erb +18 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/_form.html.erb +23 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/edit.html.erb +21 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/index.html.erb +69 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/new.html.erb +7 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/index_entries/index.html.erb +39 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/index_entries/show.html.erb +32 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/operations/index.html.erb +81 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/operations/show.html.erb +71 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/subscriptions/subscriptions/show.html.erb +41 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/subscriptions/topics/index.html.erb +55 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/subscriptions/topics/show.html.erb +40 -0
- data/lib/graphql/dashboard/views/layouts/graphql/dashboard/application.html.erb +108 -0
- data/lib/graphql/dashboard.rb +158 -0
- data/lib/graphql/dataloader/active_record_association_source.rb +64 -0
- data/lib/graphql/dataloader/active_record_source.rb +26 -0
- data/lib/graphql/dataloader/async_dataloader.rb +21 -9
- data/lib/graphql/dataloader/null_dataloader.rb +1 -1
- data/lib/graphql/dataloader/source.rb +3 -3
- data/lib/graphql/dataloader.rb +43 -14
- data/lib/graphql/execution/interpreter/resolve.rb +3 -3
- data/lib/graphql/execution/interpreter/runtime/graphql_result.rb +34 -4
- data/lib/graphql/execution/interpreter/runtime.rb +94 -51
- data/lib/graphql/execution/interpreter.rb +16 -7
- data/lib/graphql/execution/multiplex.rb +1 -5
- data/lib/graphql/introspection/directive_location_enum.rb +1 -1
- data/lib/graphql/invalid_name_error.rb +1 -1
- data/lib/graphql/invalid_null_error.rb +5 -15
- data/lib/graphql/language/cache.rb +13 -0
- data/lib/graphql/language/document_from_schema_definition.rb +8 -7
- data/lib/graphql/language/lexer.rb +11 -4
- data/lib/graphql/language/nodes.rb +3 -0
- data/lib/graphql/language/parser.rb +15 -8
- data/lib/graphql/language/printer.rb +8 -8
- data/lib/graphql/language/static_visitor.rb +37 -33
- data/lib/graphql/language/visitor.rb +59 -55
- data/lib/graphql/pagination/connection.rb +1 -1
- data/lib/graphql/query/context/scoped_context.rb +1 -1
- data/lib/graphql/query/context.rb +6 -5
- data/lib/graphql/query/variable_validation_error.rb +1 -1
- data/lib/graphql/query.rb +19 -23
- data/lib/graphql/railtie.rb +7 -0
- data/lib/graphql/schema/addition.rb +1 -1
- data/lib/graphql/schema/argument.rb +7 -8
- data/lib/graphql/schema/build_from_definition.rb +99 -53
- data/lib/graphql/schema/directive/flagged.rb +3 -1
- data/lib/graphql/schema/directive.rb +2 -2
- data/lib/graphql/schema/enum.rb +36 -1
- data/lib/graphql/schema/enum_value.rb +1 -1
- data/lib/graphql/schema/field/scope_extension.rb +1 -1
- data/lib/graphql/schema/field.rb +27 -13
- data/lib/graphql/schema/field_extension.rb +1 -1
- data/lib/graphql/schema/has_single_input_argument.rb +3 -1
- data/lib/graphql/schema/input_object.rb +77 -40
- data/lib/graphql/schema/interface.rb +3 -2
- data/lib/graphql/schema/loader.rb +1 -1
- data/lib/graphql/schema/member/has_arguments.rb +25 -17
- data/lib/graphql/schema/member/has_dataloader.rb +60 -0
- data/lib/graphql/schema/member/has_deprecation_reason.rb +15 -0
- data/lib/graphql/schema/member/has_directives.rb +4 -4
- data/lib/graphql/schema/member/has_fields.rb +19 -1
- data/lib/graphql/schema/member/has_interfaces.rb +5 -5
- data/lib/graphql/schema/member/has_validators.rb +1 -1
- data/lib/graphql/schema/member/scoped.rb +1 -1
- data/lib/graphql/schema/member/type_system_helpers.rb +1 -1
- data/lib/graphql/schema/member.rb +1 -0
- data/lib/graphql/schema/object.rb +25 -8
- data/lib/graphql/schema/relay_classic_mutation.rb +0 -1
- data/lib/graphql/schema/resolver.rb +12 -10
- data/lib/graphql/schema/subscription.rb +52 -6
- data/lib/graphql/schema/union.rb +1 -1
- data/lib/graphql/schema/validator/required_validator.rb +23 -6
- data/lib/graphql/schema/validator.rb +1 -1
- data/lib/graphql/schema/visibility/migration.rb +1 -0
- data/lib/graphql/schema/visibility/profile.rb +95 -243
- data/lib/graphql/schema/visibility/visit.rb +190 -0
- data/lib/graphql/schema/visibility.rb +169 -28
- data/lib/graphql/schema/warden.rb +18 -5
- data/lib/graphql/schema.rb +93 -44
- data/lib/graphql/static_validation/all_rules.rb +1 -1
- data/lib/graphql/static_validation/rules/argument_names_are_unique.rb +1 -1
- data/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb +1 -1
- data/lib/graphql/static_validation/rules/fields_will_merge.rb +1 -1
- data/lib/graphql/static_validation/rules/no_definitions_are_present.rb +1 -1
- data/lib/graphql/static_validation/rules/not_single_subscription_error.rb +25 -0
- data/lib/graphql/static_validation/rules/required_arguments_are_present.rb +1 -1
- data/lib/graphql/static_validation/rules/subscription_root_exists_and_single_subscription_selection.rb +26 -0
- data/lib/graphql/static_validation/rules/unique_directives_per_location.rb +1 -1
- data/lib/graphql/static_validation/rules/variable_names_are_unique.rb +1 -1
- data/lib/graphql/static_validation/rules/variable_usages_are_allowed.rb +1 -1
- data/lib/graphql/static_validation/validation_context.rb +1 -0
- data/lib/graphql/static_validation/validator.rb +6 -1
- data/lib/graphql/subscriptions/action_cable_subscriptions.rb +1 -1
- data/lib/graphql/subscriptions/default_subscription_resolve_extension.rb +12 -10
- data/lib/graphql/subscriptions/event.rb +12 -1
- data/lib/graphql/subscriptions/serialize.rb +1 -1
- data/lib/graphql/subscriptions.rb +1 -1
- data/lib/graphql/testing/helpers.rb +7 -4
- data/lib/graphql/tracing/active_support_notifications_trace.rb +14 -3
- data/lib/graphql/tracing/active_support_notifications_tracing.rb +1 -1
- data/lib/graphql/tracing/appoptics_trace.rb +9 -1
- data/lib/graphql/tracing/appoptics_tracing.rb +7 -0
- data/lib/graphql/tracing/appsignal_trace.rb +32 -55
- data/lib/graphql/tracing/appsignal_tracing.rb +2 -0
- data/lib/graphql/tracing/call_legacy_tracers.rb +66 -0
- data/lib/graphql/tracing/data_dog_trace.rb +46 -158
- data/lib/graphql/tracing/data_dog_tracing.rb +2 -0
- data/lib/graphql/tracing/detailed_trace/memory_backend.rb +60 -0
- data/lib/graphql/tracing/detailed_trace/redis_backend.rb +72 -0
- data/lib/graphql/tracing/detailed_trace.rb +93 -0
- data/lib/graphql/tracing/legacy_hooks_trace.rb +1 -0
- data/lib/graphql/tracing/legacy_trace.rb +4 -61
- data/lib/graphql/tracing/monitor_trace.rb +283 -0
- data/lib/graphql/tracing/new_relic_trace.rb +47 -54
- data/lib/graphql/tracing/new_relic_tracing.rb +2 -0
- data/lib/graphql/tracing/notifications_trace.rb +182 -34
- data/lib/graphql/tracing/notifications_tracing.rb +2 -0
- data/lib/graphql/tracing/null_trace.rb +9 -0
- data/lib/graphql/tracing/perfetto_trace/trace.proto +141 -0
- data/lib/graphql/tracing/perfetto_trace/trace_pb.rb +33 -0
- data/lib/graphql/tracing/perfetto_trace.rb +734 -0
- data/lib/graphql/tracing/platform_trace.rb +5 -0
- data/lib/graphql/tracing/prometheus_trace/graphql_collector.rb +2 -0
- data/lib/graphql/tracing/prometheus_trace.rb +72 -68
- data/lib/graphql/tracing/prometheus_tracing.rb +2 -0
- data/lib/graphql/tracing/scout_trace.rb +32 -55
- data/lib/graphql/tracing/scout_tracing.rb +2 -0
- data/lib/graphql/tracing/sentry_trace.rb +62 -94
- data/lib/graphql/tracing/statsd_trace.rb +33 -41
- data/lib/graphql/tracing/statsd_tracing.rb +2 -0
- data/lib/graphql/tracing/trace.rb +111 -1
- data/lib/graphql/tracing.rb +31 -30
- data/lib/graphql/types/relay/connection_behaviors.rb +3 -3
- data/lib/graphql/types/relay/edge_behaviors.rb +2 -2
- data/lib/graphql/types.rb +18 -11
- data/lib/graphql/version.rb +1 -1
- data/lib/graphql.rb +55 -47
- metadata +146 -11
- data/lib/graphql/backtrace/inspect_result.rb +0 -38
- data/lib/graphql/backtrace/trace.rb +0 -93
- data/lib/graphql/backtrace/tracer.rb +0 -80
- data/lib/graphql/schema/null_mask.rb +0 -11
- data/lib/graphql/static_validation/rules/subscription_root_exists.rb +0 -17
@@ -0,0 +1,93 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require_relative "./installable"
|
3
|
+
module Graphql
|
4
|
+
class Dashboard < Rails::Engine
|
5
|
+
module Limiters
|
6
|
+
class LimitersController < Dashboard::ApplicationController
|
7
|
+
include Installable
|
8
|
+
FALLBACK_CSP_NONCE_GENERATOR = ->(_req) { SecureRandom.hex(32) }
|
9
|
+
|
10
|
+
def show
|
11
|
+
name = params[:name]
|
12
|
+
@title = case name
|
13
|
+
when "runtime"
|
14
|
+
"Runtime Limiter"
|
15
|
+
when "active_operations"
|
16
|
+
"Active Operation Limiter"
|
17
|
+
when "mutations"
|
18
|
+
"Mutation Limiter"
|
19
|
+
else
|
20
|
+
raise ArgumentError, "Unknown limiter name: #{name}"
|
21
|
+
end
|
22
|
+
|
23
|
+
limiter = limiter_for(name)
|
24
|
+
if limiter.nil?
|
25
|
+
@install_path = "http://graphql-ruby.org/limiters/#{name}"
|
26
|
+
else
|
27
|
+
@chart_mode = params[:chart] || "day"
|
28
|
+
@current_soft = limiter.soft_limit_enabled?
|
29
|
+
@histogram = limiter.dashboard_histogram(@chart_mode)
|
30
|
+
|
31
|
+
# These configs may have already been defined by the application; provide overrides here if not.
|
32
|
+
request.content_security_policy_nonce_generator ||= FALLBACK_CSP_NONCE_GENERATOR
|
33
|
+
nonce_dirs = request.content_security_policy_nonce_directives || []
|
34
|
+
if !nonce_dirs.include?("style-src")
|
35
|
+
nonce_dirs += ["style-src"]
|
36
|
+
request.content_security_policy_nonce_directives = nonce_dirs
|
37
|
+
end
|
38
|
+
@csp_nonce = request.content_security_policy_nonce
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def update
|
43
|
+
name = params[:name]
|
44
|
+
limiter = limiter_for(name)
|
45
|
+
if limiter
|
46
|
+
limiter.toggle_soft_limit
|
47
|
+
flash[:success] = if limiter.soft_limit_enabled?
|
48
|
+
"Enabled soft limiting -- over-limit traffic will be logged but not rejected."
|
49
|
+
else
|
50
|
+
"Disabled soft limiting -- over-limit traffic will be rejected."
|
51
|
+
end
|
52
|
+
else
|
53
|
+
flash[:warning] = "No limiter configured for #{name.inspect}"
|
54
|
+
end
|
55
|
+
|
56
|
+
redirect_to graphql_dashboard.limiters_limiter_path(name, chart: params[:chart])
|
57
|
+
end
|
58
|
+
|
59
|
+
private
|
60
|
+
|
61
|
+
def limiter_for(name)
|
62
|
+
case name
|
63
|
+
when "runtime"
|
64
|
+
schema_class.enterprise_runtime_limiter
|
65
|
+
when "active_operations"
|
66
|
+
schema_class.enterprise_active_operation_limiter
|
67
|
+
when "mutations"
|
68
|
+
schema_class.enterprise_mutation_limiter
|
69
|
+
else
|
70
|
+
raise ArgumentError, "Unknown limiter: #{name}"
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def feature_installed?
|
75
|
+
defined?(GraphQL::Enterprise::Limiter) &&
|
76
|
+
(
|
77
|
+
schema_class.enterprise_active_operation_limiter ||
|
78
|
+
schema_class.enterprise_runtime_limiter ||
|
79
|
+
(schema_class.respond_to?(:enterprise_mutation_limiter) && schema_class.enterprise_mutation_limiter)
|
80
|
+
)
|
81
|
+
end
|
82
|
+
|
83
|
+
|
84
|
+
INSTALLABLE_COMPONENT_HEADER_HTML = "Rate limiters aren't installed on this schema yet."
|
85
|
+
INSTALLABLE_COMPONENT_MESSAGE_HTML = <<-HTML.html_safe
|
86
|
+
Check out the docs to get started with GraphQL-Enterprise's
|
87
|
+
<a href="https://graphql-ruby.org/limiters/runtime.html">runtime limiter</a> or
|
88
|
+
<a href="https://graphql-ruby.org/limiters/active_operations.html">active operation limiter</a>.
|
89
|
+
HTML
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
@@ -0,0 +1,199 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require_relative "./installable"
|
3
|
+
module Graphql
|
4
|
+
class Dashboard < Rails::Engine
|
5
|
+
module OperationStore
|
6
|
+
class BaseController < Dashboard::ApplicationController
|
7
|
+
include Installable
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
def feature_installed?
|
12
|
+
schema_class.respond_to?(:operation_store) && schema_class.operation_store.is_a?(GraphQL::Pro::OperationStore)
|
13
|
+
end
|
14
|
+
|
15
|
+
INSTALLABLE_COMPONENT_HEADER_HTML = "<code>OperationStore</code> isn't installed for this schema yet.".html_safe
|
16
|
+
INSTALLABLE_COMPONENT_MESSAGE_HTML = <<-HTML.html_safe
|
17
|
+
Learn more about improving performance and security with stored operations
|
18
|
+
in the <a href="https://graphql-ruby.org/operation_store/overview.html"><code>OperationStore</code> docs</a>.
|
19
|
+
HTML
|
20
|
+
end
|
21
|
+
|
22
|
+
class ClientsController < BaseController
|
23
|
+
def index
|
24
|
+
@order_by = params[:order_by] || "name"
|
25
|
+
@order_dir = params[:order_dir].presence || "asc"
|
26
|
+
clients_page = schema_class.operation_store.all_clients(
|
27
|
+
page: params[:page]&.to_i || 1,
|
28
|
+
per_page: params[:per_page]&.to_i || 25,
|
29
|
+
order_by: @order_by,
|
30
|
+
order_dir: @order_dir,
|
31
|
+
)
|
32
|
+
|
33
|
+
@clients_page = clients_page
|
34
|
+
end
|
35
|
+
|
36
|
+
def new
|
37
|
+
@client = init_client(secret: SecureRandom.hex(32))
|
38
|
+
end
|
39
|
+
|
40
|
+
def create
|
41
|
+
client_params = params.require(:client).permit(:name, :secret)
|
42
|
+
schema_class.operation_store.upsert_client(client_params[:name], client_params[:secret])
|
43
|
+
flash[:success] = "Created #{client_params[:name].inspect}"
|
44
|
+
redirect_to graphql_dashboard.operation_store_clients_path
|
45
|
+
end
|
46
|
+
|
47
|
+
def edit
|
48
|
+
@client = schema_class.operation_store.get_client(params[:name])
|
49
|
+
end
|
50
|
+
|
51
|
+
def update
|
52
|
+
client_name = params[:name]
|
53
|
+
client_secret = params.require(:client).permit(:secret)[:secret]
|
54
|
+
schema_class.operation_store.upsert_client(client_name, client_secret)
|
55
|
+
flash[:success] = "Updated #{client_name.inspect}"
|
56
|
+
redirect_to graphql_dashboard.operation_store_clients_path
|
57
|
+
end
|
58
|
+
|
59
|
+
def destroy
|
60
|
+
client_name = params[:name]
|
61
|
+
schema_class.operation_store.delete_client(client_name)
|
62
|
+
flash[:success] = "Deleted #{client_name.inspect}"
|
63
|
+
redirect_to graphql_dashboard.operation_store_clients_path
|
64
|
+
end
|
65
|
+
|
66
|
+
private
|
67
|
+
|
68
|
+
def init_client(name: nil, secret: nil)
|
69
|
+
GraphQL::Pro::OperationStore::ClientRecord.new(
|
70
|
+
name: name,
|
71
|
+
secret: secret,
|
72
|
+
created_at: nil,
|
73
|
+
operations_count: 0,
|
74
|
+
archived_operations_count: 0,
|
75
|
+
last_synced_at: nil,
|
76
|
+
last_used_at: nil,
|
77
|
+
)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
class OperationsController < BaseController
|
82
|
+
def index
|
83
|
+
@client_operations = client_name = params[:client_name]
|
84
|
+
per_page = params[:per_page]&.to_i || 25
|
85
|
+
page = params[:page]&.to_i || 1
|
86
|
+
@is_archived = params[:archived_status] == :archived
|
87
|
+
order_by = params[:order_by] || "name"
|
88
|
+
order_dir = params[:order_dir]&.to_sym || :asc
|
89
|
+
if @client_operations
|
90
|
+
@operations_page = schema_class.operation_store.get_client_operations_by_client(
|
91
|
+
client_name,
|
92
|
+
page: page,
|
93
|
+
per_page: per_page,
|
94
|
+
is_archived: @is_archived,
|
95
|
+
order_by: order_by,
|
96
|
+
order_dir: order_dir,
|
97
|
+
)
|
98
|
+
opposite_archive_mode_count = schema_class.operation_store.get_client_operations_by_client(
|
99
|
+
client_name,
|
100
|
+
page: 1,
|
101
|
+
per_page: 1,
|
102
|
+
is_archived: !@is_archived,
|
103
|
+
order_by: order_by,
|
104
|
+
order_dir: order_dir,
|
105
|
+
).total_count
|
106
|
+
else
|
107
|
+
@operations_page = schema_class.operation_store.all_operations(
|
108
|
+
page: page,
|
109
|
+
per_page: per_page,
|
110
|
+
is_archived: @is_archived,
|
111
|
+
order_by: order_by,
|
112
|
+
order_dir: order_dir,
|
113
|
+
)
|
114
|
+
opposite_archive_mode_count = schema_class.operation_store.all_operations(
|
115
|
+
page: 1,
|
116
|
+
per_page: 1,
|
117
|
+
is_archived: !@is_archived,
|
118
|
+
order_by: order_by,
|
119
|
+
order_dir: order_dir,
|
120
|
+
).total_count
|
121
|
+
end
|
122
|
+
|
123
|
+
if @is_archived
|
124
|
+
@archived_operations_count = @operations_page.total_count
|
125
|
+
@unarchived_operations_count = opposite_archive_mode_count
|
126
|
+
else
|
127
|
+
@archived_operations_count = opposite_archive_mode_count
|
128
|
+
@unarchived_operations_count = @operations_page.total_count
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
def show
|
133
|
+
digest = params[:digest]
|
134
|
+
@operation = schema_class.operation_store.get_operation_by_digest(digest)
|
135
|
+
if @operation
|
136
|
+
# Parse & re-format the query
|
137
|
+
document = GraphQL.parse(@operation.body)
|
138
|
+
@graphql_source = document.to_query_string
|
139
|
+
|
140
|
+
@client_operations = schema_class.operation_store.get_client_operations_by_digest(digest)
|
141
|
+
@entries = schema_class.operation_store.get_index_entries_by_digest(digest)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
def update
|
146
|
+
is_archived = case params[:modification]
|
147
|
+
when :archive
|
148
|
+
true
|
149
|
+
when :unarchive
|
150
|
+
false
|
151
|
+
else
|
152
|
+
raise ArgumentError, "Unexpected modification: #{params[:modification].inspect}"
|
153
|
+
end
|
154
|
+
|
155
|
+
if (client_name = params[:client_name])
|
156
|
+
operation_aliases = params[:operation_aliases]
|
157
|
+
schema_class.operation_store.archive_client_operations(
|
158
|
+
client_name: client_name,
|
159
|
+
operation_aliases: operation_aliases,
|
160
|
+
is_archived: is_archived
|
161
|
+
)
|
162
|
+
flash[:success] = "#{is_archived ? "Archived" : "Activated"} #{operation_aliases.size} #{"operation".pluralize(operation_aliases.size)}"
|
163
|
+
else
|
164
|
+
digests = params[:digests]
|
165
|
+
schema_class.operation_store.archive_operations(
|
166
|
+
digests: digests,
|
167
|
+
is_archived: is_archived
|
168
|
+
)
|
169
|
+
flash[:success] = "#{is_archived ? "Archived" : "Activated"} #{digests.size} #{"operation".pluralize(digests.size)}"
|
170
|
+
end
|
171
|
+
head :no_content
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
class IndexEntriesController < BaseController
|
176
|
+
def index
|
177
|
+
@search_term = if request.params["q"] && request.params["q"].length > 0
|
178
|
+
request.params["q"]
|
179
|
+
else
|
180
|
+
nil
|
181
|
+
end
|
182
|
+
|
183
|
+
@index_entries_page = schema_class.operation_store.all_index_entries(
|
184
|
+
search_term: @search_term,
|
185
|
+
page: params[:page]&.to_i || 1,
|
186
|
+
per_page: params[:per_page]&.to_i || 25,
|
187
|
+
)
|
188
|
+
end
|
189
|
+
|
190
|
+
def show
|
191
|
+
name = params[:name]
|
192
|
+
@entry = schema_class.operation_store.index.get_entry(name)
|
193
|
+
@chain = schema_class.operation_store.index.index_entry_chain(name)
|
194
|
+
@operations = schema_class.operation_store.get_operations_by_index_entry(name)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|