Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,15 @@ gem "ruby-prof", "~> 2.0", require: false
gem "stackprof", "~> 0.2.25", require: false

group :development, :test do
gem "derailed_benchmarks", require: false
gem "factory_bot_rails", "~> 6.5.0"
gem "faker", "~> 3.6"
gem "rspec", "~> 3.13.2"
gem "rspec-rails", "~> 8.0"
gem "yard", "~> 0.9.34"
gem "yard-activerecord", "~> 0.0.16"
gem "yard-activesupport-concern", "~> 0.0.1"
gem "vernier", require: false
gem "yard", "~> 0.9.34", require: false
gem "yard-activerecord", "~> 0.0.16", require: false
gem "yard-activesupport-concern", "~> 0.0.1", require: false
end

group :development do
Expand Down
55 changes: 43 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ GEM
anyway_config (2.8.0)
ruby-next-core (~> 1.0)
ast (2.4.3)
async (2.36.0)
async (2.38.0)
console (~> 1.29)
fiber-annotation
io-event (~> 1.11)
Expand All @@ -126,7 +126,7 @@ GEM
attr_required (1.0.2)
autotuner (1.1.0)
aws-eventstream (1.4.0)
aws-partitions (1.1222.0)
aws-partitions (1.1223.0)
aws-sdk-core (3.243.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
Expand All @@ -147,6 +147,7 @@ GEM
base64 (0.3.0)
bcrypt (3.1.21)
benchmark (0.5.0)
benchmark-ips (2.14.0)
bibtex-ruby (6.2.0)
latex-decode (~> 0.0)
logger (~> 1.7)
Expand Down Expand Up @@ -182,6 +183,24 @@ GEM
database_cleaner-core (~> 2.0.0)
redis
date (3.5.1)
derailed_benchmarks (2.2.1)
base64
benchmark-ips (~> 2)
bigdecimal
drb
get_process_mem
heapy (~> 0)
logger
memory_profiler (>= 0, < 2)
mini_histogram (>= 0.3.0)
mutex_m
ostruct
rack (>= 1)
rack-test
rake (> 10, < 14)
ruby-statistics (>= 4.0.1)
ruby2_keywords
thor (>= 0.19, < 2)
device_detector (1.1.3)
diff-lcs (1.6.2)
docile (1.4.1)
Expand Down Expand Up @@ -310,6 +329,9 @@ GEM
geocoder (1.8.6)
base64 (>= 0.1.0)
csv (>= 3.0.0)
get_process_mem (1.0.0)
bigdecimal (>= 2.0)
ffi (~> 1.0)
globalid (1.3.0)
activesupport (>= 6.1)
good_job (4.13.3)
Expand Down Expand Up @@ -343,7 +365,7 @@ GEM
google-protobuf (4.34.0-x86_64-linux-musl)
bigdecimal
rake (~> 13.3)
graphql (2.5.20)
graphql (2.5.21)
base64
fiber-storage
logger
Expand All @@ -360,6 +382,8 @@ GEM
hana (1.3.7)
hashdiff (1.2.1)
hashids (1.0.6)
heapy (0.2.0)
thor
htmlbeautifier (1.4.3)
http (5.3.1)
addressable (~> 2.8)
Expand All @@ -377,7 +401,7 @@ GEM
mini_magick (>= 4.9.5, < 6)
ruby-vips (>= 2.0.17, < 3)
io-console (0.8.2)
io-event (1.14.3)
io-event (1.14.4)
irb (1.17.0)
pp (>= 0.6.0)
prism (>= 1.3.0)
Expand All @@ -391,7 +415,7 @@ GEM
jmespath (1.6.2)
job-iteration (1.12.0)
activejob (>= 6.1)
json (2.18.1)
json (2.19.1)
json-jwt (1.17.0)
activesupport (>= 4.2)
aes_key_wrap
Expand Down Expand Up @@ -457,12 +481,14 @@ GEM
marcel (1.1.0)
maxminddb (0.1.22)
mediainfo (1.5.0)
memory_profiler (1.1.0)
method_source (1.1.0)
metrics (0.15.0)
mime-types (3.7.0)
logger
mime-types-data (~> 3.2025, >= 3.2025.0507)
mime-types-data (3.2026.0303)
mini_histogram (0.3.1)
mini_magick (5.3.1)
logger
mini_mime (1.1.5)
Expand All @@ -481,6 +507,7 @@ GEM
multi_json (1.19.1)
mustermann (3.0.4)
ruby2_keywords (~> 0.0.1)
mutex_m (0.3.0)
namae (1.2.0)
racc (~> 1.7)
naught (1.1.0)
Expand Down Expand Up @@ -652,7 +679,7 @@ GEM
redcarpet (3.6.1)
redis (5.4.1)
redis-client (>= 0.22.0)
redis-client (0.26.4)
redis-client (0.27.0)
connection_pool
redis-objects (2.0.0)
redis (~> 5.0)
Expand Down Expand Up @@ -685,14 +712,14 @@ GEM
rspec-mocks (3.13.8)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-rails (8.0.3)
rspec-rails (8.0.4)
actionpack (>= 7.2)
activesupport (>= 7.2)
railties (>= 7.2)
rspec-core (~> 3.13)
rspec-expectations (~> 3.13)
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-core (>= 3.13.0, < 5.0.0)
rspec-expectations (>= 3.13.0, < 5.0.0)
rspec-mocks (>= 3.13.0, < 5.0.0)
rspec-support (>= 3.13.0, < 5.0.0)
rspec-support (3.13.7)
rubocop (1.79.2)
json (~> 2.3)
Expand Down Expand Up @@ -730,6 +757,7 @@ GEM
base64
ostruct
ruby-progressbar (1.13.0)
ruby-statistics (4.1.0)
ruby-vips (2.3.0)
ffi (~> 1.12)
logger
Expand Down Expand Up @@ -802,7 +830,7 @@ GEM
thor (1.5.0)
tilt (2.7.0)
timecop (0.9.10)
timeout (0.6.0)
timeout (0.6.1)
tomlib (0.7.3)
bigdecimal
traces (0.18.2)
Expand All @@ -820,6 +848,7 @@ GEM
validate_url (1.0.15)
activemodel (>= 3.0.0)
public_suffix
vernier (1.10.0)
wapiti (2.1.0)
builder (~> 3.2)
rexml (~> 3.0)
Expand Down Expand Up @@ -886,6 +915,7 @@ DEPENDENCIES
csv (~> 3.3.5)
database_cleaner-active_record (~> 2.2.2)
database_cleaner-redis (~> 2.0.0)
derailed_benchmarks
down (~> 5.4.2)
dry-auto_inject (~> 1.1)
dry-core (~> 1.2)
Expand Down Expand Up @@ -998,6 +1028,7 @@ DEPENDENCIES
tomlib (~> 0.7.2)
tus-server (~> 2.3.0)
validate_url (~> 1.0.15)
vernier
webmock (= 3.26.1)
with_advisory_lock (~> 7.0.2)
yard (~> 0.9.34)
Expand Down
1 change: 1 addition & 0 deletions app/controllers/graphql_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def execute
auth_context:,
current_user:,
request_state:,
visibility_profile: :public,
}

json = request_state.wrap do
Expand Down
9 changes: 9 additions & 0 deletions app/graphql/api_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class APISchema < GraphQL::Schema
trace_with(GraphQL::Tracing::ActiveSupportNotificationsTrace)
trace_with(GraphQL::Tracing::NewRelicTrace)

introspection ::Support::GraphQLAPI::Introspection

validate_timeout nil

use GraphQL::FragmentCache
Expand Down Expand Up @@ -94,6 +96,7 @@ class APISchema < GraphQL::Schema
Types::OrganizationContributorType,
Types::PersonContributorType,
Types::SearchResultType,
Types::SchemaPropertyFunctionType,
Types::SchemaPropertyTypeType,
Types::SchemaInstanceType,
Types::TemplateContributionType
Expand Down Expand Up @@ -180,4 +183,10 @@ def resolve_type(abstract_type, object, context)
end
end
end

# @note This has to be at the end of the file so that extra and orphan types
# are properly registered.
use GraphQL::Schema::Visibility, dynamic: false, preload: true, profiles: {
public: { public: true },
}
end
20 changes: 20 additions & 0 deletions app/graphql/mutations/depositor_agreement_accept.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

module Mutations
# @see Mutations::Operations::DepositorAgreementAccept
class DepositorAgreementAccept < Mutations::BaseMutation
description <<~TEXT
Accept the depositor agreement for the given submission target.
TEXT

field :depositor_agreement, Types::DepositorAgreementType, null: true do
description "The depositor agreement that was accepted."
end

argument :submission_target_id, ID, required: true, loads: Types::SubmissionTargetType do
description "The ID of the submission target that the agreement belongs to."
end

performs_operation! "mutations.operations.depositor_agreement_accept"
end
end
24 changes: 24 additions & 0 deletions app/graphql/mutations/depositor_agreement_reset.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# frozen_string_literal: true

module Mutations
# @see Mutations::Operations::DepositorAgreementReset
class DepositorAgreementReset < Mutations::BaseMutation
description <<~TEXT
Reset a specific depositor agreement, forcing the associated depositor to re-accept the agreement before making any more deposits to the associated submission target.
TEXT

field :depositor_agreement, Types::DepositorAgreementType, null: true do
description "The depositor agreement that was reset."
end

argument :submission_target_id, ID, required: true, loads: Types::SubmissionTargetType do
description "The ID of the submission target for which to reset a depositor agreement."
end

argument :user_id, ID, required: true, loads: Types::UserType do
description "The ID of the user for which to reset a depositor agreement."
end

performs_operation! "mutations.operations.depositor_agreement_reset"
end
end
20 changes: 20 additions & 0 deletions app/graphql/mutations/depositor_agreement_reset_all.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

module Mutations
# @see Mutations::Operations::DepositorAgreementResetAll
class DepositorAgreementResetAll < Mutations::BaseMutation
description <<~TEXT
Force all depositors to re-accept the depositor agreement for a given submission target.
TEXT

field :submission_target, Types::SubmissionTargetType, null: true do
description "The submission target for which depositor agreements were reset."
end

argument :submission_target_id, ID, required: true, loads: Types::SubmissionTargetType do
description "The ID of the submission target for which to reset depositor agreements."
end

performs_operation! "mutations.operations.depositor_agreement_reset_all"
end
end
30 changes: 30 additions & 0 deletions app/graphql/mutations/submission_batch_publish.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# frozen_string_literal: true

module Mutations
# @see Mutations::Operations::SubmissionBatchPublish
class SubmissionBatchPublish < Mutations::BaseMutation
description <<~TEXT
Publish multiple submissions within a single submission target.

This will enqueue the actual publications in the backend.
TEXT

field :submission_batch_publication, Types::SubmissionBatchPublicationType, null: true do
description "The submission batch publication that was created to track this process."
end

field :submission_target, Types::SubmissionTargetType, null: true do
description "The submission target that the submissions belong to."
end

argument :submission_target_id, ID, required: true, loads: Types::SubmissionTargetType do
description "The ID of the submission target that the submissions belong to."
end

argument :submission_ids, [ID], required: true, loads: Types::SubmissionType do
description "The IDs of the submissions to publish."
end

performs_operation! "mutations.operations.submission_batch_publish"
end
end
38 changes: 38 additions & 0 deletions app/graphql/mutations/submission_publish.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# frozen_string_literal: true

module Mutations
# @see Mutations::Operations::SubmissionPublish
class SubmissionPublish < Mutations::BaseMutation
description <<~TEXT
Publish a single submission.

To publish multiple submissions at once, use `submissionBatchPublish`.
TEXT

field :entity, Types::EntityType, null: true do
description <<~TEXT
The entity that the published submission belongs to, if successful.
TEXT
end

field :submission, Types::SubmissionType, null: true do
description <<~TEXT
The submission that was published, if successful.
TEXT
end

field :submission_publication, Types::SubmissionPublicationType, null: true do
description <<~TEXT
The actual record of the publication, if successful.
TEXT
end

argument :submission_id, ID, required: true, loads: ::Types::SubmissionType do
description <<~TEXT
The ID for the submission to publish.
TEXT
end

performs_operation! "mutations.operations.submission_publish"
end
end
1 change: 1 addition & 0 deletions app/graphql/types/asset_kind_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class AssetKindType < Types::BaseEnum
value "audio"
value "pdf"
value "document"
value "archive"
value "unknown"
end
end
Loading
Loading