panda_doc 0.7.0 → 0.8.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8849ee8f7c8311a7eb442ff4c1b059c94a6ec87fb039a23cc74b1dd06c0c6873
4
- data.tar.gz: 4563201e0b177abf440381dc8f06ccf876603f9c9c45d34a71d54786ae615144
3
+ metadata.gz: 40c4774251d60005e024d1ae28a5568fd3a1e8c438d83abe3e08f4824e3e67aa
4
+ data.tar.gz: dd09ac16cf4dc968537462e12fae7483c26d80d3623f388b52ba1c64cac2701b
5
5
  SHA512:
6
- metadata.gz: 74541a952ad1c7f327e220dd197ce0213fd2d9de697fb5e2743f46b72b5a2e1df94e7c801cf5b833406fac61751de1cbc4b2af643b7daa3b4c10f69e25cd34fa
7
- data.tar.gz: 04ff0e440faac7e29d5f8b6bfa9ffe9f8bf31f0399eeeab18f6cc9940be1b482d74c47915c21d2b40b396328fca5bce3c1c37f172dcb13adfb1f97a55aece404
6
+ metadata.gz: 7e8ec163353b05d1d73ffce4dd41114824b06f4ae4d233fa32fafa325e469bb01fca4710cf09aab027a1be9fef9e81ee68c7701a63293205891fee7dce0a452c
7
+ data.tar.gz: b80b8d50cbbd703dc8ccd4ff2004b5e49307fff5ac1bb43041bbb16ab5f851ab3dfc1577c1df60363ae9945ed5835b11755884488f6bc1346791485bfb82b049
@@ -13,15 +13,15 @@ jobs:
13
13
  fail-fast: false
14
14
  matrix:
15
15
  ruby:
16
+ - '3.3'
16
17
  - '3.2'
17
18
  - '3.1'
18
19
  - '3.0'
19
- - '2.7'
20
20
  include:
21
- - ruby: '3.2'
21
+ - ruby: '3.3'
22
22
  coverage: '1'
23
23
  steps:
24
- - uses: actions/checkout@v3
24
+ - uses: actions/checkout@v4
25
25
  with:
26
26
  submodules: true
27
27
  - name: Setup Ruby
@@ -31,7 +31,7 @@ jobs:
31
31
  - name: Update rubygems
32
32
  run: |
33
33
  gem update --system
34
- - uses: actions/cache@v3
34
+ - uses: actions/cache@v4
35
35
  with:
36
36
  path: vendor/bundle
37
37
  key: bundle-use-ruby-${{ matrix.ruby }}-${{ hashFiles('**/Gemfile.lock') }}
@@ -47,7 +47,7 @@ jobs:
47
47
  run: |
48
48
  bundle exec rake spec
49
49
  - name: Publish code coverage
50
- if: ${{ matrix.coverage == '1' && github.actor != 'dependabot[bot]' }}
51
- uses: paambaati/codeclimate-action@v3.1.1
50
+ if: ${{ matrix.coverage == '1' && github.actor != 'dependabot[bot]' && github.ref_name == 'main' }}
51
+ uses: paambaati/codeclimate-action@v8
52
52
  env:
53
53
  CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.2
1
+ 3.3.4
data/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.8.0][] (2024-07-12)
8
+
9
+ New:
10
+
11
+ - Optional `metadata` field which can be used to store arbitrary data (by @andrewvy)
12
+ - `Document.move_to_draft` -> POST /documents/{id}/draft/ (by @andrewvy)
13
+ - `Document.update` -> PATCH /documents/{id}/ (by @andrewvy)
14
+
7
15
  ## [0.7.0][] (2023-06-07)
8
16
 
9
17
  New:
@@ -204,7 +212,8 @@ Fixes:
204
212
 
205
213
  - Initial release
206
214
 
207
- [Unreleased]: https://github.com/opti/panda_doc/compare/v0.7.0...HEAD
215
+ [Unreleased]: https://github.com/opti/panda_doc/compare/v0.8.0...HEAD
216
+ [0.8.0]: https://github.com/opti/panda_doc/compare/v0.7.0...v0.8.0
208
217
  [0.7.0]: https://github.com/opti/panda_doc/compare/v0.6.0...v0.7.0
209
218
  [0.6.0]: https://github.com/opti/panda_doc/compare/v0.5.3...v0.6.0
210
219
  [0.5.3]: https://github.com/opti/panda_doc/compare/v0.5.2...v0.5.3
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ gemspec
5
5
 
6
6
  gem "bundler"
7
7
  gem "rake", ">= 10.0"
8
- gem "rspec", "~> 3.12"
8
+ gem "rspec", "~> 3.13"
9
9
  gem "byebug"
10
10
 
11
11
  group :test do
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- panda_doc (0.7.0)
4
+ panda_doc (0.8.0)
5
5
  dry-configurable
6
6
  dry-struct
7
7
  faraday (>= 2.0.1, < 3.0)
@@ -10,17 +10,18 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
+ bigdecimal (3.1.8)
13
14
  byebug (11.1.3)
14
- concurrent-ruby (1.2.2)
15
- diff-lcs (1.5.0)
15
+ concurrent-ruby (1.3.3)
16
+ diff-lcs (1.5.1)
16
17
  docile (1.4.0)
17
- dry-configurable (1.0.1)
18
+ dry-configurable (1.2.0)
18
19
  dry-core (~> 1.0, < 2)
19
20
  zeitwerk (~> 2.6)
20
- dry-core (1.0.0)
21
+ dry-core (1.0.1)
21
22
  concurrent-ruby (~> 1.0)
22
23
  zeitwerk (~> 2.6)
23
- dry-inflector (1.0.0)
24
+ dry-inflector (1.1.0)
24
25
  dry-logic (1.5.0)
25
26
  concurrent-ruby (~> 1.0)
26
27
  dry-core (~> 1.0, < 2)
@@ -30,42 +31,47 @@ GEM
30
31
  dry-types (>= 1.7, < 2)
31
32
  ice_nine (~> 0.11)
32
33
  zeitwerk (~> 2.6)
33
- dry-types (1.7.1)
34
+ dry-types (1.7.2)
35
+ bigdecimal (~> 3.0)
34
36
  concurrent-ruby (~> 1.0)
35
37
  dry-core (~> 1.0)
36
38
  dry-inflector (~> 1.0)
37
39
  dry-logic (~> 1.4)
38
40
  zeitwerk (~> 2.6)
39
- faraday (2.7.6)
40
- faraday-net_http (>= 2.0, < 3.1)
41
- ruby2_keywords (>= 0.0.4)
41
+ faraday (2.10.0)
42
+ faraday-net_http (>= 2.0, < 3.2)
43
+ logger
42
44
  faraday-multipart (1.0.4)
43
45
  multipart-post (~> 2)
44
- faraday-net_http (3.0.2)
46
+ faraday-net_http (3.1.0)
47
+ net-http
45
48
  ice_nine (0.11.2)
46
- multipart-post (2.3.0)
47
- rake (13.0.6)
48
- rspec (3.12.0)
49
- rspec-core (~> 3.12.0)
50
- rspec-expectations (~> 3.12.0)
51
- rspec-mocks (~> 3.12.0)
52
- rspec-core (3.12.2)
53
- rspec-support (~> 3.12.0)
54
- rspec-expectations (3.12.3)
49
+ logger (1.6.0)
50
+ multipart-post (2.4.1)
51
+ net-http (0.4.1)
52
+ uri
53
+ rake (13.2.1)
54
+ rspec (3.13.0)
55
+ rspec-core (~> 3.13.0)
56
+ rspec-expectations (~> 3.13.0)
57
+ rspec-mocks (~> 3.13.0)
58
+ rspec-core (3.13.0)
59
+ rspec-support (~> 3.13.0)
60
+ rspec-expectations (3.13.1)
55
61
  diff-lcs (>= 1.2.0, < 2.0)
56
- rspec-support (~> 3.12.0)
57
- rspec-mocks (3.12.5)
62
+ rspec-support (~> 3.13.0)
63
+ rspec-mocks (3.13.1)
58
64
  diff-lcs (>= 1.2.0, < 2.0)
59
- rspec-support (~> 3.12.0)
60
- rspec-support (3.12.0)
61
- ruby2_keywords (0.0.5)
65
+ rspec-support (~> 3.13.0)
66
+ rspec-support (3.13.1)
62
67
  simplecov (0.22.0)
63
68
  docile (~> 1.1)
64
69
  simplecov-html (~> 0.11)
65
70
  simplecov_json_formatter (~> 0.1)
66
71
  simplecov-html (0.12.3)
67
72
  simplecov_json_formatter (0.1.4)
68
- zeitwerk (2.6.8)
73
+ uri (0.13.0)
74
+ zeitwerk (2.6.16)
69
75
 
70
76
  PLATFORMS
71
77
  ruby
@@ -75,8 +81,8 @@ DEPENDENCIES
75
81
  byebug
76
82
  panda_doc!
77
83
  rake (>= 10.0)
78
- rspec (~> 3.12)
84
+ rspec (~> 3.13)
79
85
  simplecov (~> 0.22.0)
80
86
 
81
87
  BUNDLED WITH
82
- 2.4.13
88
+ 2.5.15
@@ -51,6 +51,10 @@ module PandaDoc
51
51
  connection.get(normalized_path(path), **data)
52
52
  end
53
53
 
54
+ def patch(path, data = {})
55
+ connection.patch(normalized_path(path), **data)
56
+ end
57
+
54
58
  private
55
59
 
56
60
  def normalized_path(path)
@@ -8,6 +8,13 @@ module PandaDoc
8
8
  respond(ApiClient.request(:post, "/documents", **data))
9
9
  end
10
10
 
11
+ def update(uuid, **data)
12
+ respond(
13
+ ApiClient.request(:patch, "/documents/#{uuid}", **data),
14
+ type: :empty
15
+ )
16
+ end
17
+
11
18
  def send(uuid, **data)
12
19
  respond(ApiClient.request(:post, "/documents/#{uuid}/send", **data))
13
20
  end
@@ -20,6 +27,10 @@ module PandaDoc
20
27
  respond(ApiClient.request(:get, "/documents/#{uuid}/details"))
21
28
  end
22
29
 
30
+ def move_to_draft(uuid)
31
+ respond(ApiClient.request(:post, "/documents/#{uuid}/draft"))
32
+ end
33
+
23
34
  def session(uuid, **data)
24
35
  respond(
25
36
  ApiClient.request(:post, "/documents/#{uuid}/session", **data),
@@ -15,6 +15,7 @@ module PandaDoc
15
15
 
16
16
  attribute? :tokens, Types::Array.of(Objects::Token)
17
17
  attribute? :fields, Types::Array.of(Objects::Field)
18
+ attribute? :metadata, Types::Hash
18
19
 
19
20
  alias_method :created_at, :date_created
20
21
  alias_method :updated_at, :date_modified
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PandaDoc
4
+ module Objects
5
+ class Empty
6
+ def initialize(_response_body)
7
+ end
8
+ end
9
+ end
10
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PandaDoc
4
- VERSION = "0.7.0"
4
+ VERSION = "0.8.0"
5
5
  end
data/lib/panda_doc.rb CHANGED
@@ -21,6 +21,7 @@ require "panda_doc/objects/recipient"
21
21
  require "panda_doc/objects/token"
22
22
  require "panda_doc/objects/field"
23
23
  require "panda_doc/objects/document"
24
+ require "panda_doc/objects/empty"
24
25
  require "panda_doc/objects/error"
25
26
  require "panda_doc/objects/session"
26
27
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panda_doc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Pstyga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-08 00:00:00.000000000 Z
11
+ date: 2024-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -109,6 +109,7 @@ files:
109
109
  - lib/panda_doc/failure_result.rb
110
110
  - lib/panda_doc/objects/base.rb
111
111
  - lib/panda_doc/objects/document.rb
112
+ - lib/panda_doc/objects/empty.rb
112
113
  - lib/panda_doc/objects/error.rb
113
114
  - lib/panda_doc/objects/field.rb
114
115
  - lib/panda_doc/objects/recipient.rb
@@ -138,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
139
  - !ruby/object:Gem::Version
139
140
  version: '0'
140
141
  requirements: []
141
- rubygems_version: 3.4.13
142
+ rubygems_version: 3.5.15
142
143
  signing_key:
143
144
  specification_version: 4
144
145
  summary: Ruby wrapper for PandaDoc.com API