apollo_upload_server 2.1.4 → 2.1.6
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/.github/workflows/specs.yml +16 -0
- data/.gitignore +1 -0
- data/Gemfile.lock +11 -11
- data/README.md +2 -0
- data/apollo_upload_server.gemspec +1 -1
- data/lib/apollo_upload_server/graphql_data_builder.rb +2 -8
- data/lib/apollo_upload_server/upload.rb +2 -6
- data/lib/apollo_upload_server/version.rb +1 -1
- metadata +6 -6
- data/.travis.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e739eca091fe90c153387cc5637f871ad3e5d93734cf1f77f250ad470816357c
|
4
|
+
data.tar.gz: 917a7590be5410efc83de4c824c8e2a0848d334d2e1fa0fcfc876979fe49d442
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8695e04ccabb84a9388bb74e3f8f73fc7346101edaf4468ff1eca79a36957657f1f963e7c0f9f8ef2d15cd1e7ae8311600427fc83758f84a0859a8901fed068f
|
7
|
+
data.tar.gz: 833777b4586c25cea707785588c66774b8271b894d17da5ef2e1ec244d80cd09eef3cf8d098903f6ec8b47c479825f360553772a2327595cd352a3f5bcb59bec
|
@@ -0,0 +1,16 @@
|
|
1
|
+
name: Rspec test suite
|
2
|
+
on: [push, pull_request]
|
3
|
+
jobs:
|
4
|
+
test:
|
5
|
+
strategy:
|
6
|
+
fail-fast: false
|
7
|
+
matrix:
|
8
|
+
ruby: ['2.7', '3.0', '3.1']
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v3
|
12
|
+
- uses: ruby/setup-ruby@v1
|
13
|
+
with:
|
14
|
+
ruby-version: ${{ matrix.ruby }}
|
15
|
+
bundler-cache: true
|
16
|
+
- run: bundle exec rspec
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
apollo_upload_server (2.1.
|
4
|
+
apollo_upload_server (2.1.5)
|
5
5
|
actionpack (>= 6.1.6)
|
6
6
|
graphql (>= 1.8)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actionpack (7.0.
|
12
|
-
actionview (= 7.0.
|
13
|
-
activesupport (= 7.0.
|
11
|
+
actionpack (7.0.4)
|
12
|
+
actionview (= 7.0.4)
|
13
|
+
activesupport (= 7.0.4)
|
14
14
|
rack (~> 2.0, >= 2.2.0)
|
15
15
|
rack-test (>= 0.6.3)
|
16
16
|
rails-dom-testing (~> 2.0)
|
17
17
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
18
|
-
actionview (7.0.
|
19
|
-
activesupport (= 7.0.
|
18
|
+
actionview (7.0.4)
|
19
|
+
activesupport (= 7.0.4)
|
20
20
|
builder (~> 3.1)
|
21
21
|
erubi (~> 1.4)
|
22
22
|
rails-dom-testing (~> 2.0)
|
23
23
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
24
|
-
activesupport (7.0.
|
24
|
+
activesupport (7.0.4)
|
25
25
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
26
26
|
i18n (>= 1.6, < 2)
|
27
27
|
minitest (>= 5.1)
|
@@ -31,15 +31,15 @@ GEM
|
|
31
31
|
crass (1.0.6)
|
32
32
|
diff-lcs (1.5.0)
|
33
33
|
erubi (1.11.0)
|
34
|
-
graphql (2.0.
|
34
|
+
graphql (2.0.15)
|
35
35
|
i18n (1.12.0)
|
36
36
|
concurrent-ruby (~> 1.0)
|
37
|
-
loofah (2.
|
37
|
+
loofah (2.19.0)
|
38
38
|
crass (~> 1.0.2)
|
39
39
|
nokogiri (>= 1.5.9)
|
40
40
|
mini_portile2 (2.8.0)
|
41
41
|
minitest (5.16.3)
|
42
|
-
nokogiri (1.13.
|
42
|
+
nokogiri (1.13.9)
|
43
43
|
mini_portile2 (~> 2.8.0)
|
44
44
|
racc (~> 1.4)
|
45
45
|
racc (1.6.0)
|
@@ -75,7 +75,7 @@ DEPENDENCIES
|
|
75
75
|
apollo_upload_server!
|
76
76
|
bundler (~> 2.1)
|
77
77
|
rake (~> 13.0)
|
78
|
-
rspec (~> 3.
|
78
|
+
rspec (~> 3.11)
|
79
79
|
|
80
80
|
BUNDLED WITH
|
81
81
|
2.3.17
|
data/README.md
CHANGED
@@ -68,6 +68,8 @@ In strict mode, passing empty destination arrays will always fail.
|
|
68
68
|
|
69
69
|
Bug reports and pull requests are welcome on GitHub at https://github.com/jetruby/apollo_upload_server-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
70
70
|
|
71
|
+
Tests can be run via `bundle exec rspec`.
|
72
|
+
|
71
73
|
## License
|
72
74
|
|
73
75
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -12,8 +12,8 @@ module ApolloUploadServer
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def call(params)
|
15
|
-
operations =
|
16
|
-
file_mapper =
|
15
|
+
operations = JSON.parse(params['operations'])
|
16
|
+
file_mapper = JSON.parse(params['map'])
|
17
17
|
|
18
18
|
return nil if operations.nil? || file_mapper.nil?
|
19
19
|
if operations.is_a?(Hash)
|
@@ -62,12 +62,6 @@ module ApolloUploadServer
|
|
62
62
|
raise OutOfBounds, "Path #{path.join('.')} maps to out-of-bounds index: #{index}"
|
63
63
|
end
|
64
64
|
|
65
|
-
def safe_json_parse(data)
|
66
|
-
JSON.parse(data)
|
67
|
-
rescue JSON::ParserError
|
68
|
-
nil
|
69
|
-
end
|
70
|
-
|
71
65
|
def get_parent_field(operations, splited_path)
|
72
66
|
# returns parent element of file field
|
73
67
|
|
@@ -7,13 +7,9 @@ module ApolloUploadServer
|
|
7
7
|
graphql_name "Upload"
|
8
8
|
|
9
9
|
def self.coerce_input(value, _ctx)
|
10
|
-
|
10
|
+
return super if value.nil? || value.is_a?(::ApolloUploadServer::Wrappers::UploadedFile)
|
11
11
|
|
12
|
-
value
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.coerce_result(value, _ctx)
|
16
|
-
value
|
12
|
+
raise GraphQL::CoercionError, "#{value.inspect} is not a valid upload"
|
17
13
|
end
|
18
14
|
end
|
19
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apollo_upload_server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JetRuby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '3.
|
75
|
+
version: '3.11'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '3.
|
82
|
+
version: '3.11'
|
83
83
|
description: apollo-upload-server implementation for Ruby on Rails as middleware.
|
84
84
|
email:
|
85
85
|
- engineering@jetruby.com
|
@@ -87,9 +87,9 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
+
- ".github/workflows/specs.yml"
|
90
91
|
- ".gitignore"
|
91
92
|
- ".rspec"
|
92
|
-
- ".travis.yml"
|
93
93
|
- CODE_OF_CONDUCT.md
|
94
94
|
- Gemfile
|
95
95
|
- Gemfile.lock
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
127
|
requirements: []
|
128
|
-
rubygems_version: 3.3.
|
128
|
+
rubygems_version: 3.3.25
|
129
129
|
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: Middleware which allows you to upload files using graphql and multipart/form-data.
|