apollo_upload_server 2.1.5 → 2.1.7
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 +64 -35
- 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/middleware.rb +1 -6
- data/lib/apollo_upload_server/version.rb +1 -1
- metadata +6 -9
- 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: d46907daf44cc863d164ab81536766ec1327d10b7f700737f34c350e336e8e01
|
|
4
|
+
data.tar.gz: ce76f78b3f9e4b34656f6528d293b8ed1883cb45c7f96d7171ab8b0dfeeb880d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 478de411ffb5621c88d8a5cb89b70e8fdc78537b8093bf8ce7dde083335a9597589c20e6d1661ce181829ad32e2e929e9e51b618593a44c0af883fcad345f4ff
|
|
7
|
+
data.tar.gz: e652b5b5698a2a91f0c3147c1725d7f757b8f2f8a36307b7cfcca80e455a300482973790f9edebc5facd905053ec7ea9f32843f202ff359dc0a73b5c89208f43
|
|
@@ -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,56 +1,82 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
apollo_upload_server (2.1.
|
|
4
|
+
apollo_upload_server (2.1.7)
|
|
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 (
|
|
12
|
-
actionview (=
|
|
13
|
-
activesupport (=
|
|
14
|
-
|
|
11
|
+
actionpack (8.1.1)
|
|
12
|
+
actionview (= 8.1.1)
|
|
13
|
+
activesupport (= 8.1.1)
|
|
14
|
+
nokogiri (>= 1.8.5)
|
|
15
|
+
rack (>= 2.2.4)
|
|
16
|
+
rack-session (>= 1.0.1)
|
|
15
17
|
rack-test (>= 0.6.3)
|
|
16
|
-
rails-dom-testing (~> 2.
|
|
17
|
-
rails-html-sanitizer (~> 1.
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
rails-dom-testing (~> 2.2)
|
|
19
|
+
rails-html-sanitizer (~> 1.6)
|
|
20
|
+
useragent (~> 0.16)
|
|
21
|
+
actionview (8.1.1)
|
|
22
|
+
activesupport (= 8.1.1)
|
|
20
23
|
builder (~> 3.1)
|
|
21
|
-
erubi (~> 1.
|
|
22
|
-
rails-dom-testing (~> 2.
|
|
23
|
-
rails-html-sanitizer (~> 1.
|
|
24
|
-
activesupport (
|
|
25
|
-
|
|
24
|
+
erubi (~> 1.11)
|
|
25
|
+
rails-dom-testing (~> 2.2)
|
|
26
|
+
rails-html-sanitizer (~> 1.6)
|
|
27
|
+
activesupport (8.1.1)
|
|
28
|
+
base64
|
|
29
|
+
bigdecimal
|
|
30
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
31
|
+
connection_pool (>= 2.2.5)
|
|
32
|
+
drb
|
|
26
33
|
i18n (>= 1.6, < 2)
|
|
34
|
+
json
|
|
35
|
+
logger (>= 1.4.2)
|
|
27
36
|
minitest (>= 5.1)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
securerandom (>= 0.3)
|
|
38
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
39
|
+
uri (>= 0.13.1)
|
|
40
|
+
base64 (0.3.0)
|
|
41
|
+
bigdecimal (3.3.1)
|
|
42
|
+
builder (3.3.0)
|
|
43
|
+
concurrent-ruby (1.3.5)
|
|
44
|
+
connection_pool (2.5.4)
|
|
31
45
|
crass (1.0.6)
|
|
32
46
|
diff-lcs (1.5.0)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
47
|
+
drb (2.2.3)
|
|
48
|
+
erubi (1.13.1)
|
|
49
|
+
fiber-storage (1.0.1)
|
|
50
|
+
graphql (2.5.14)
|
|
51
|
+
base64
|
|
52
|
+
fiber-storage
|
|
53
|
+
logger
|
|
54
|
+
i18n (1.14.7)
|
|
36
55
|
concurrent-ruby (~> 1.0)
|
|
37
|
-
|
|
56
|
+
json (2.16.0)
|
|
57
|
+
logger (1.7.0)
|
|
58
|
+
loofah (2.24.1)
|
|
38
59
|
crass (~> 1.0.2)
|
|
39
|
-
nokogiri (>= 1.
|
|
40
|
-
mini_portile2 (2.8.
|
|
41
|
-
minitest (5.
|
|
42
|
-
nokogiri (1.
|
|
43
|
-
mini_portile2 (~> 2.8.
|
|
60
|
+
nokogiri (>= 1.12.0)
|
|
61
|
+
mini_portile2 (2.8.9)
|
|
62
|
+
minitest (5.26.1)
|
|
63
|
+
nokogiri (1.18.10)
|
|
64
|
+
mini_portile2 (~> 2.8.2)
|
|
44
65
|
racc (~> 1.4)
|
|
45
|
-
racc (1.
|
|
46
|
-
rack (
|
|
47
|
-
rack-
|
|
66
|
+
racc (1.8.1)
|
|
67
|
+
rack (3.2.4)
|
|
68
|
+
rack-session (2.1.1)
|
|
69
|
+
base64 (>= 0.1.0)
|
|
70
|
+
rack (>= 3.0.0)
|
|
71
|
+
rack-test (2.2.0)
|
|
48
72
|
rack (>= 1.3)
|
|
49
|
-
rails-dom-testing (2.0
|
|
50
|
-
activesupport (>=
|
|
73
|
+
rails-dom-testing (2.3.0)
|
|
74
|
+
activesupport (>= 5.0.0)
|
|
75
|
+
minitest
|
|
51
76
|
nokogiri (>= 1.6)
|
|
52
|
-
rails-html-sanitizer (1.
|
|
53
|
-
loofah (~> 2.
|
|
77
|
+
rails-html-sanitizer (1.6.2)
|
|
78
|
+
loofah (~> 2.21)
|
|
79
|
+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
|
54
80
|
rake (13.0.6)
|
|
55
81
|
rspec (3.11.0)
|
|
56
82
|
rspec-core (~> 3.11.0)
|
|
@@ -65,8 +91,11 @@ GEM
|
|
|
65
91
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
66
92
|
rspec-support (~> 3.11.0)
|
|
67
93
|
rspec-support (3.11.0)
|
|
68
|
-
|
|
94
|
+
securerandom (0.4.1)
|
|
95
|
+
tzinfo (2.0.6)
|
|
69
96
|
concurrent-ruby (~> 1.0)
|
|
97
|
+
uri (1.1.1)
|
|
98
|
+
useragent (0.16.11)
|
|
70
99
|
|
|
71
100
|
PLATFORMS
|
|
72
101
|
ruby
|
|
@@ -75,7 +104,7 @@ DEPENDENCIES
|
|
|
75
104
|
apollo_upload_server!
|
|
76
105
|
bundler (~> 2.1)
|
|
77
106
|
rake (~> 13.0)
|
|
78
|
-
rspec (~> 3.
|
|
107
|
+
rspec (~> 3.11)
|
|
79
108
|
|
|
80
109
|
BUNDLED WITH
|
|
81
110
|
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
|
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
require 'apollo_upload_server/graphql_data_builder'
|
|
2
|
-
require "active_support/configurable"
|
|
3
2
|
|
|
4
3
|
module ApolloUploadServer
|
|
5
4
|
class Middleware
|
|
6
|
-
include ActiveSupport::Configurable
|
|
7
|
-
|
|
8
5
|
# Strict mode requires that all mapped files are present in the mapping arrays.
|
|
9
|
-
|
|
10
|
-
false
|
|
11
|
-
end
|
|
6
|
+
class_attribute :strict_mode, default: false
|
|
12
7
|
|
|
13
8
|
def initialize(app)
|
|
14
9
|
@app = app
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
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.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- JetRuby
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: actionpack
|
|
@@ -72,14 +71,14 @@ dependencies:
|
|
|
72
71
|
requirements:
|
|
73
72
|
- - "~>"
|
|
74
73
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: '3.
|
|
74
|
+
version: '3.11'
|
|
76
75
|
type: :development
|
|
77
76
|
prerelease: false
|
|
78
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
78
|
requirements:
|
|
80
79
|
- - "~>"
|
|
81
80
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: '3.
|
|
81
|
+
version: '3.11'
|
|
83
82
|
description: apollo-upload-server implementation for Ruby on Rails as middleware.
|
|
84
83
|
email:
|
|
85
84
|
- engineering@jetruby.com
|
|
@@ -87,9 +86,9 @@ executables: []
|
|
|
87
86
|
extensions: []
|
|
88
87
|
extra_rdoc_files: []
|
|
89
88
|
files:
|
|
89
|
+
- ".github/workflows/specs.yml"
|
|
90
90
|
- ".gitignore"
|
|
91
91
|
- ".rspec"
|
|
92
|
-
- ".travis.yml"
|
|
93
92
|
- CODE_OF_CONDUCT.md
|
|
94
93
|
- Gemfile
|
|
95
94
|
- Gemfile.lock
|
|
@@ -110,7 +109,6 @@ homepage: https://github.com/jetruby/apollo_upload_server-ruby
|
|
|
110
109
|
licenses:
|
|
111
110
|
- MIT
|
|
112
111
|
metadata: {}
|
|
113
|
-
post_install_message:
|
|
114
112
|
rdoc_options: []
|
|
115
113
|
require_paths:
|
|
116
114
|
- lib
|
|
@@ -125,8 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
125
123
|
- !ruby/object:Gem::Version
|
|
126
124
|
version: '0'
|
|
127
125
|
requirements: []
|
|
128
|
-
rubygems_version: 3.
|
|
129
|
-
signing_key:
|
|
126
|
+
rubygems_version: 3.6.9
|
|
130
127
|
specification_version: 4
|
|
131
128
|
summary: Middleware which allows you to upload files using graphql and multipart/form-data.
|
|
132
129
|
test_files: []
|