panda_doc 0.6.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15388d36657b02a29ab9ab4113517330173b50363488d5570075acfc97fd2644
4
- data.tar.gz: cd93797418157b2922fb6bda62452548f03714b4296f92bb50c453e9836ecd86
3
+ metadata.gz: 40c4774251d60005e024d1ae28a5568fd3a1e8c438d83abe3e08f4824e3e67aa
4
+ data.tar.gz: dd09ac16cf4dc968537462e12fae7483c26d80d3623f388b52ba1c64cac2701b
5
5
  SHA512:
6
- metadata.gz: 3edd1e118866f67d64c4d9ba9b46518f3ec786253166e34f3e93c1e975597ab43b90543dc9da6d804bcf6c3b13542e819ac112233b4568c4f77be677c3a273b6
7
- data.tar.gz: c8e74fe1e14ef159991fd514f5ac906b51d54a183bbc55996a6dcc6d4dc5b0c330c3545843f231adec953e4f16af107d34406c6318ac88ae5a36fbc2046b0e17
6
+ metadata.gz: 7e8ec163353b05d1d73ffce4dd41114824b06f4ae4d233fa32fafa325e469bb01fca4710cf09aab027a1be9fef9e81ee68c7701a63293205891fee7dce0a452c
7
+ data.tar.gz: b80b8d50cbbd703dc8ccd4ff2004b5e49307fff5ac1bb43041bbb16ab5f851ab3dfc1577c1df60363ae9945ed5835b11755884488f6bc1346791485bfb82b049
@@ -0,0 +1,11 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "bundler"
9
+ directory: "/"
10
+ schedule:
11
+ interval: "daily"
@@ -13,15 +13,15 @@ jobs:
13
13
  fail-fast: false
14
14
  matrix:
15
15
  ruby:
16
+ - '3.3'
17
+ - '3.2'
16
18
  - '3.1'
17
19
  - '3.0'
18
- - '2.7'
19
- - '2.6'
20
20
  include:
21
- - ruby: '3.1'
21
+ - ruby: '3.3'
22
22
  coverage: '1'
23
23
  steps:
24
- - uses: actions/checkout@v2
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@v2
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' }}
51
- uses: paambaati/codeclimate-action@v3.0.0
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 }}
@@ -0,0 +1,72 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ push:
16
+ branches: [ main ]
17
+ pull_request:
18
+ # The branches below must be a subset of the branches above
19
+ branches: [ main ]
20
+ schedule:
21
+ - cron: '17 0 * * 5'
22
+
23
+ jobs:
24
+ analyze:
25
+ name: Analyze
26
+ runs-on: ubuntu-latest
27
+ permissions:
28
+ actions: read
29
+ contents: read
30
+ security-events: write
31
+
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ language: [ 'ruby' ]
36
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37
+ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38
+
39
+ steps:
40
+ - name: Checkout repository
41
+ uses: actions/checkout@v3
42
+
43
+ # Initializes the CodeQL tools for scanning.
44
+ - name: Initialize CodeQL
45
+ uses: github/codeql-action/init@v2
46
+ with:
47
+ languages: ${{ matrix.language }}
48
+ # If you wish to specify custom queries, you can do so here or in a config file.
49
+ # By default, queries listed here will override any specified in a config file.
50
+ # Prefix the list here with "+" to use these queries and those in the config file.
51
+
52
+ # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53
+ # queries: security-extended,security-and-quality
54
+
55
+
56
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57
+ # If this step fails, then you should remove it and run the build manually (see below)
58
+ - name: Autobuild
59
+ uses: github/codeql-action/autobuild@v2
60
+
61
+ # ℹ️ Command-line programs to run using the OS shell.
62
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63
+
64
+ # If the Autobuild fails above, remove it and uncomment the following three lines.
65
+ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66
+
67
+ # - run: |
68
+ # echo "Run, Build Application using script"
69
+ # ./location_of_script_within_repo/buildscript.sh
70
+
71
+ - name: Perform CodeQL Analysis
72
+ uses: github/codeql-action/analyze@v2
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.2
1
+ 3.3.4
data/CHANGELOG.md CHANGED
@@ -4,6 +4,21 @@ 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
+
15
+ ## [0.7.0][] (2023-06-07)
16
+
17
+ New:
18
+
19
+ - Drop ruby 2.6
20
+ - Update to Faraday 2
21
+
7
22
  ## [0.6.0][] (2022-05-04)
8
23
 
9
24
  New:
@@ -197,7 +212,9 @@ Fixes:
197
212
 
198
213
  - Initial release
199
214
 
200
- [Unreleased]: https://github.com/opti/panda_doc/compare/v0.6.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
217
+ [0.7.0]: https://github.com/opti/panda_doc/compare/v0.6.0...v0.7.0
201
218
  [0.6.0]: https://github.com/opti/panda_doc/compare/v0.5.3...v0.6.0
202
219
  [0.5.3]: https://github.com/opti/panda_doc/compare/v0.5.2...v0.5.3
203
220
  [0.5.2]: https://github.com/opti/panda_doc/compare/v0.5.1...v0.5.2
data/Gemfile CHANGED
@@ -5,9 +5,9 @@ gemspec
5
5
 
6
6
  gem "bundler"
7
7
  gem "rake", ">= 10.0"
8
- gem "rspec", "~> 3.4"
8
+ gem "rspec", "~> 3.13"
9
9
  gem "byebug"
10
10
 
11
11
  group :test do
12
- gem "simplecov", "~> 0.17.1", require: false
12
+ gem "simplecov", "~> 0.22.0", require: false
13
13
  end
data/Gemfile.lock CHANGED
@@ -1,85 +1,77 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- panda_doc (0.6.0)
4
+ panda_doc (0.8.0)
5
5
  dry-configurable
6
6
  dry-struct
7
- faraday (>= 0.9.2, < 2.0)
8
- faraday_middleware (>= 0.10.0, < 2.0)
7
+ faraday (>= 2.0.1, < 3.0)
8
+ faraday-multipart (>= 1.0.0, < 2.0)
9
9
 
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.1.9)
15
- diff-lcs (1.4.4)
15
+ concurrent-ruby (1.3.3)
16
+ diff-lcs (1.5.1)
16
17
  docile (1.4.0)
17
- dry-configurable (0.13.0)
18
+ dry-configurable (1.2.0)
19
+ dry-core (~> 1.0, < 2)
20
+ zeitwerk (~> 2.6)
21
+ dry-core (1.0.1)
18
22
  concurrent-ruby (~> 1.0)
19
- dry-core (~> 0.6)
20
- dry-container (0.9.0)
23
+ zeitwerk (~> 2.6)
24
+ dry-inflector (1.1.0)
25
+ dry-logic (1.5.0)
21
26
  concurrent-ruby (~> 1.0)
22
- dry-configurable (~> 0.13, >= 0.13.0)
23
- dry-core (0.7.1)
24
- concurrent-ruby (~> 1.0)
25
- dry-inflector (0.2.1)
26
- dry-logic (1.2.0)
27
- concurrent-ruby (~> 1.0)
28
- dry-core (~> 0.5, >= 0.5)
29
- dry-struct (1.4.0)
30
- dry-core (~> 0.5, >= 0.5)
31
- dry-types (~> 1.5)
27
+ dry-core (~> 1.0, < 2)
28
+ zeitwerk (~> 2.6)
29
+ dry-struct (1.6.0)
30
+ dry-core (~> 1.0, < 2)
31
+ dry-types (>= 1.7, < 2)
32
32
  ice_nine (~> 0.11)
33
- dry-types (1.5.1)
33
+ zeitwerk (~> 2.6)
34
+ dry-types (1.7.2)
35
+ bigdecimal (~> 3.0)
34
36
  concurrent-ruby (~> 1.0)
35
- dry-container (~> 0.3)
36
- dry-core (~> 0.5, >= 0.5)
37
- dry-inflector (~> 0.1, >= 0.1.2)
38
- dry-logic (~> 1.0, >= 1.0.2)
39
- faraday (1.8.0)
40
- faraday-em_http (~> 1.0)
41
- faraday-em_synchrony (~> 1.0)
42
- faraday-excon (~> 1.1)
43
- faraday-httpclient (~> 1.0.1)
44
- faraday-net_http (~> 1.0)
45
- faraday-net_http_persistent (~> 1.1)
46
- faraday-patron (~> 1.0)
47
- faraday-rack (~> 1.0)
48
- multipart-post (>= 1.2, < 3)
49
- ruby2_keywords (>= 0.0.4)
50
- faraday-em_http (1.0.0)
51
- faraday-em_synchrony (1.0.0)
52
- faraday-excon (1.1.0)
53
- faraday-httpclient (1.0.1)
54
- faraday-net_http (1.0.1)
55
- faraday-net_http_persistent (1.2.0)
56
- faraday-patron (1.0.0)
57
- faraday-rack (1.0.0)
58
- faraday_middleware (1.2.0)
59
- faraday (~> 1.0)
37
+ dry-core (~> 1.0)
38
+ dry-inflector (~> 1.0)
39
+ dry-logic (~> 1.4)
40
+ zeitwerk (~> 2.6)
41
+ faraday (2.10.0)
42
+ faraday-net_http (>= 2.0, < 3.2)
43
+ logger
44
+ faraday-multipart (1.0.4)
45
+ multipart-post (~> 2)
46
+ faraday-net_http (3.1.0)
47
+ net-http
60
48
  ice_nine (0.11.2)
61
- json (2.6.1)
62
- multipart-post (2.1.1)
63
- rake (13.0.6)
64
- rspec (3.10.0)
65
- rspec-core (~> 3.10.0)
66
- rspec-expectations (~> 3.10.0)
67
- rspec-mocks (~> 3.10.0)
68
- rspec-core (3.10.1)
69
- rspec-support (~> 3.10.0)
70
- rspec-expectations (3.10.1)
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)
71
61
  diff-lcs (>= 1.2.0, < 2.0)
72
- rspec-support (~> 3.10.0)
73
- rspec-mocks (3.10.2)
62
+ rspec-support (~> 3.13.0)
63
+ rspec-mocks (3.13.1)
74
64
  diff-lcs (>= 1.2.0, < 2.0)
75
- rspec-support (~> 3.10.0)
76
- rspec-support (3.10.3)
77
- ruby2_keywords (0.0.5)
78
- simplecov (0.17.1)
65
+ rspec-support (~> 3.13.0)
66
+ rspec-support (3.13.1)
67
+ simplecov (0.22.0)
79
68
  docile (~> 1.1)
80
- json (>= 1.8, < 3)
81
- simplecov-html (~> 0.10.0)
82
- simplecov-html (0.10.2)
69
+ simplecov-html (~> 0.11)
70
+ simplecov_json_formatter (~> 0.1)
71
+ simplecov-html (0.12.3)
72
+ simplecov_json_formatter (0.1.4)
73
+ uri (0.13.0)
74
+ zeitwerk (2.6.16)
83
75
 
84
76
  PLATFORMS
85
77
  ruby
@@ -89,8 +81,8 @@ DEPENDENCIES
89
81
  byebug
90
82
  panda_doc!
91
83
  rake (>= 10.0)
92
- rspec (~> 3.4)
93
- simplecov (~> 0.17.1)
84
+ rspec (~> 3.13)
85
+ simplecov (~> 0.22.0)
94
86
 
95
87
  BUNDLED WITH
96
- 2.3.13
88
+ 2.5.15
data/README.md CHANGED
@@ -4,8 +4,8 @@ PandaDoc gem is a simple wrapper for PandaDoc.com API. Please check the official
4
4
  API [documenation](https://developers.pandadoc.com) for more details.
5
5
 
6
6
  [![Build Status](https://github.com/opti/panda_doc/actions/workflows/ci.yml/badge.svg)](https://github.com/opti/panda_doc/actions/workflows/ci.yml)
7
- [![Code Climate](https://codeclimate.com/github/opti/panda_doc/badges/gpa.svg)](https://codeclimate.com/github/opti/panda_doc)
8
- [![Test Coverage](https://codeclimate.com/github/opti/panda_doc/badges/coverage.svg)](https://codeclimate.com/github/opti/panda_doc/coverage)
7
+ [![Maintainability](https://api.codeclimate.com/v1/badges/ab0b236ae2c499659214/maintainability)](https://codeclimate.com/github/opti/panda_doc/maintainability)
8
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/ab0b236ae2c499659214/test_coverage)](https://codeclimate.com/github/opti/panda_doc/test_coverage)
9
9
 
10
10
  ## Installation
11
11
 
@@ -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)
@@ -5,11 +5,18 @@ module PandaDoc
5
5
  extend self
6
6
 
7
7
  def create(data)
8
- respond(ApiClient.request(:post, "/documents", data))
8
+ respond(ApiClient.request(:post, "/documents", **data))
9
+ end
10
+
11
+ def update(uuid, **data)
12
+ respond(
13
+ ApiClient.request(:patch, "/documents/#{uuid}", **data),
14
+ type: :empty
15
+ )
9
16
  end
10
17
 
11
18
  def send(uuid, **data)
12
- respond(ApiClient.request(:post, "/documents/#{uuid}/send", data))
19
+ respond(ApiClient.request(:post, "/documents/#{uuid}/send", **data))
13
20
  end
14
21
 
15
22
  def find(uuid)
@@ -20,9 +27,13 @@ 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
- ApiClient.request(:post, "/documents/#{uuid}/session", data),
36
+ ApiClient.request(:post, "/documents/#{uuid}/session", **data),
26
37
  type: :session
27
38
  )
28
39
  end
@@ -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.6.0"
4
+ VERSION = "0.8.0"
5
5
  end
data/lib/panda_doc.rb CHANGED
@@ -4,7 +4,7 @@ require "forwardable"
4
4
  require "json"
5
5
 
6
6
  require "faraday"
7
- require "faraday_middleware"
7
+ require "faraday/multipart"
8
8
  require "dry-struct"
9
9
  require "dry-configurable"
10
10
 
@@ -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
 
data/panda_doc.gemspec CHANGED
@@ -19,9 +19,9 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = []
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.required_ruby_version = ">= 2.5"
23
- spec.add_dependency "faraday", ">= 0.9.2", "< 2.0"
24
- spec.add_dependency "faraday_middleware", ">= 0.10.0", "< 2.0"
22
+ spec.required_ruby_version = ">= 2.7"
23
+ spec.add_dependency "faraday", ">= 2.0.1", "< 3.0"
24
+ spec.add_dependency "faraday-multipart", ">= 1.0.0", "< 2.0"
25
25
  spec.add_dependency "dry-configurable"
26
26
  spec.add_dependency "dry-struct"
27
27
  end
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.6.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: 2022-05-05 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
@@ -16,27 +16,27 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.9.2
19
+ version: 2.0.1
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '2.0'
22
+ version: '3.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.9.2
29
+ version: 2.0.1
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '2.0'
32
+ version: '3.0'
33
33
  - !ruby/object:Gem::Dependency
34
- name: faraday_middleware
34
+ name: faraday-multipart
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 0.10.0
39
+ version: 1.0.0
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
42
  version: '2.0'
@@ -46,7 +46,7 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 0.10.0
49
+ version: 1.0.0
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '2.0'
@@ -85,7 +85,9 @@ executables: []
85
85
  extensions: []
86
86
  extra_rdoc_files: []
87
87
  files:
88
+ - ".github/dependabot.yml"
88
89
  - ".github/workflows/ci.yml"
90
+ - ".github/workflows/codeql-analysis.yml"
89
91
  - ".gitignore"
90
92
  - ".rspec"
91
93
  - ".ruby-version"
@@ -107,6 +109,7 @@ files:
107
109
  - lib/panda_doc/failure_result.rb
108
110
  - lib/panda_doc/objects/base.rb
109
111
  - lib/panda_doc/objects/document.rb
112
+ - lib/panda_doc/objects/empty.rb
110
113
  - lib/panda_doc/objects/error.rb
111
114
  - lib/panda_doc/objects/field.rb
112
115
  - lib/panda_doc/objects/recipient.rb
@@ -129,14 +132,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
132
  requirements:
130
133
  - - ">="
131
134
  - !ruby/object:Gem::Version
132
- version: '2.5'
135
+ version: '2.7'
133
136
  required_rubygems_version: !ruby/object:Gem::Requirement
134
137
  requirements:
135
138
  - - ">="
136
139
  - !ruby/object:Gem::Version
137
140
  version: '0'
138
141
  requirements: []
139
- rubygems_version: 3.3.13
142
+ rubygems_version: 3.5.15
140
143
  signing_key:
141
144
  specification_version: 4
142
145
  summary: Ruby wrapper for PandaDoc.com API